<commit_before>
# Shinken Broker Install

    module.exports = header: 'Shinken Broker Install', handler: ->
      {shinken} = @config.ryba
      {broker} = @config.ryba.shinken

## IPTables

| Service           | Port  | Proto | Parameter       |
|-------------------|-------|-------|-----------------|
|  shinken-broker   | 7772  |  tcp  |   config.port   |

IPTables rules are only inserted if the parameter "iptables.action" is set to
"start" (default value).

      rules = [{ chain: 'INPUT', jump: 'ACCEPT', dport: broker.config.port, protocol: 'tcp', state: 'NEW', comment: "Shinken Broker" }]
      for name, mod of broker.modules
        if mod.config?.port?
          rules.push { chain: 'INPUT', jump: 'ACCEPT', dport: mod.config.port, protocol: 'tcp', state: 'NEW', comment: "Shinken Broker #{name}" }
      @tools.iptables
        rules: rules
        if: @config.iptables.action is 'start'

## Packages

      @call header: 'Packages', ->
        @service name: 'shinken-broker'
        @service name: 'python-requests'
        @service name: 'python-arrow'

## WebUI Dependencies

      @call header: 'Install WebUI Dependencies', if: 'webui2' in broker.config.modules, ->
        install_dep = (k, v) => 
          @call unless_exec: "pip list | grep #{k}", ->
            @file.download
              source: v.url
              target: "#{shinken.build_dir}/##{v.archive}.tar.gz"
              md5: v.md5
            @tools.extract
              source: "#{shinken.build_dir}/##{v.archive}.tar.gz"
            @system.execute
              cmd:"""
              cd #{shinken.build_dir}/#{v.archive}
              python setup.py build
              python setup.py install
              """
            @system.remove target: "#{shinken.build_dir}/#{k}-#{v.version}.tar.gz"
            @system.remove target: "#{shinken.build_dir}/#{k}-#{v.version}"
        for k, v of broker.modules['webui2'].pip_modules then install_dep k, v

## Additional Shinken Modules<commit_msg>shinken/broker: fix cache path (typo)<commit_after>
# Shinken Broker Install

    module.exports = header: 'Shinken Broker Install', handler: ->
      {shinken} = @config.ryba
      {broker} = @config.ryba.shinken

## IPTables

| Service           | Port  | Proto | Parameter       |
|-------------------|-------|-------|-----------------|
|  shinken-broker   | 7772  |  tcp  |   config.port   |

IPTables rules are only inserted if the parameter "iptables.action" is set to
"start" (default value).

      rules = [{ chain: 'INPUT', jump: 'ACCEPT', dport: broker.config.port, protocol: 'tcp', state: 'NEW', comment: "Shinken Broker" }]
      for name, mod of broker.modules
        if mod.config?.port?
          rules.push { chain: 'INPUT', jump: 'ACCEPT', dport: mod.config.port, protocol: 'tcp', state: 'NEW', comment: "Shinken Broker #{name}" }
      @tools.iptables
        rules: rules
        if: @config.iptables.action is 'start'

## Packages

      @call header: 'Packages', ->
        @service name: 'shinken-broker'
        @service name: 'python-requests'
        @service name: 'python-arrow'

## WebUI Dependencies

      @call header: 'Install WebUI Dependencies', if: 'webui2' in broker.config.modules, ->
        install_dep = (k, v) => 
          @call unless_exec: "pip list | grep #{k}", ->
            @file.download
              source: v.url
              target: "#{shinken.build_dir}/#{v.archive}.tar.gz"
              md5: v.md5
            @tools.extract
              source: "#{shinken.build_dir}/#{v.archive}.tar.gz"
            @system.execute
              cmd:"""
              cd #{shinken.build_dir}/#{v.archive}
              python setup.py build
              python setup.py install
              """
            @system.remove target: "#{shinken.build_dir}/#{k}-#{v.version}.tar.gz"
            @system.remove target: "#{shinken.build_dir}/#{k}-#{v.version}"
        for k, v of broker.modules['webui2'].pip_modules then install_dep k, v

## Additional Shinken Modules
{'fraction_non_alphanumeric': 0.168, 'fraction_numerical': 0.004, 'mean_word_length': 2.0682515337423313, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2248000', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1248, 'n_words': 307}