<commit_before>---

## Global
brain_project_dir: /opt/irma/irma-brain
brain_install_dir: "{{ brain_project_dir }}/current"
brain_venv_dir: "{{ brain_install_dir }}/venv"

brain_user: "{{ default_user }}"
brain_group: "{{ default_group }}"


## Deployment
brain_deployment_repository: "https://github.com/quarkslab/irma-brain.git"
brain_deployment_configs:
  - section: broker_brain
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_brain
    option: vhost
    value: "{{irma_configurations.rabbitmq.brain.vhost}}"
  - section: broker_brain
    option: username
    value: "{{irma_configurations.rabbitmq.brain.user}}"
  - section: broker_brain
    option: password
    value: "{{irma_configurations.rabbitmq.brain.password}}"
  - section: broker_probe
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_probe
    option: vhost
    value: "{{irma_configurations.rabbitmq.probe.vhost}}"
  - section: broker_probe
    option: username
    value: "{{irma_configurations.rabbitmq.probe.user}}"
  - section: broker_probe
    option: password
    value: "{{irma_configurations.rabbitmq.probe.password}}"
  - section: broker_frontend
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_frontend
    option: vhost
    value: "{{irma_configurations.rabbitmq.frontend.vhost}}"
  - section: broker_frontend
    option: username
    value: "{{irma_configurations.rabbitmq.frontend.user}}"
  - section: broker_frontend
    option: password
    value: "{{irma_configurations.rabbitmq.frontend.password}}"
  - section: ftp_brain
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: ftp_brain
    option: username
    value: "{{irma_configurations.ftpd.probe.username}}"
  - section: ftp_brain
    option: password
    value: "{{irma_configurations.ftpd.probe.password}}"


## UFW Rules
brain_ufw_additional_rules:
  - port: 21
    rule: allow
    proto: tcp
  - port: 5672
    rule: allow
    proto: tcp
  #- port: "65435:65535"
  #  rule: allow
  #  proto: tcp


## RabbitMQ role
rabbitmq_os_package: "{{ default_use_debian_repo | bool }}"
rabbitmq_ssl: false
rabbitmq_conf_tcp_listeners_address: 0.0.0.0
rabbitmq_conf_tcp_listeners_port: 5672

rabbitmq_vhost_definitions:
  - name: "{{irma_configurations.rabbitmq.brain.vhost}}"
  - name: "{{irma_configurations.rabbitmq.frontend.vhost}}"
  - name: "{{irma_configurations.rabbitmq.probe.vhost}}"

rabbitmq_users_definitions:
  - vhost: "{{irma_configurations.rabbitmq.brain.vhost}}"
    user: "{{irma_configurations.rabbitmq.brain.user}}"
    password: "{{irma_configurations.rabbitmq.brain.password}}"
  - vhost: "{{irma_configurations.rabbitmq.frontend.vhost}}"
    user: "{{irma_configurations.rabbitmq.frontend.user}}"
    password: "{{<PASSWORD>}}"
  - vhost: "{{irma_configurations.rabbitmq.probe.vhost}}"
    user: "{{irma_configurations.rabbitmq.probe.user}}"
    password: "{{irma_configurations.rabbitmq.probe.password}}"


## Pure-FTPD role
#Standalone role
#pureftpd_options:
#  CreateHomeDir: "yes"
#  PAMAuthentication: "no"
#  TLS: "2"
#  PassivePortRange: "65435 65535"
#  # NOTE: vulnerable to POODLE but cannot find a workaround to make
#  # Python's 2.7.9 ftplib module work with Debian 8.1 pure-ftpd configured with
#  # TLSv1 only (-S:HIGH:MEDIUM:+TLSv1:!SSLv2:!SSLv3)
#  TLSCipherSuite: "-S:HIGH:MEDIUM:+TLSv1"

## SSHD SFTP server
sshd_sftp_server: internal-sftp
sshd_match:
  - Condition: "User {{irma_configurations.ftpd.frontend.username}}"
    X11Forwarding: no
    AllowTcpForwarding: no
    PermitTunnel: no
    ChrootDirectory: "{{ brain_sftpd_rootdir }}/{{irma_configurations.ftpd.frontend.username}}"
    ForceCommand: "{{ sshd_sftp_server }} -u 2"
  - Condition: "User {{irma_configurations.ftpd.probe.username}}"
    X11Forwarding: no
    AllowTcpForwarding: no
    PermitTunnel: no
    ChrootDirectory: "{{ brain_sftpd_rootdir }}"
    ForceCommand: "{{ sshd_sftp_server }} -u 2"

## Brain role PureFtpd
#brain_pureftpd_virtual_users:
#  - username: "{{irma_configurations.ftpd.frontend.username}}"
#    virtual_user: "ftpuser"
#    virtual_home: "/home/ftpuser/frontend"
#    password: "{{<PASSWORD>_configurations.ftpd.frontend.password}}"
#  - username: "{{irma_configurations.ftpd.probe.username}}"
#    virtual_user: "ftpuser"
#    virtual_home: "/home/ftpuser"
#    password: "{{irma_configurations.ftpd.probe.password}}"

#brain_pureftpd_openssl_subj: "/C=FR/ST=Paris/L=Paris/O=IRMA"

# Brain role
brain_sftpd_groupname: sftpusers
brain_sftpd_rootdir: /sftp
brain_sftpd_default_upload_dir : uploads

brain_sftpd_virtual_users:
  - username: "{{irma_configurations.ftpd.frontend.username}}"
    password: "{{<PASSWORD>_configurations.ftpd.frontend.password}}"
  - username: "{{irma_configurations.ftpd.probe.username}}"
    password: "{{irma_configurations.ftpd.probe.password}}"

brain_sftpd_virtual_writers:
  - user: "{{irma_configurations.ftpd.frontend.username}}"

## Supervisor role
# supervisor_extra_confs:
supervisor_programs_brain:
  - name: scan_app
    command: "{{ brain_venv_dir }}/bin/celery worker -A brain.tasks:scan_app --hostname=scan_app.%%h {{default_celery_options}} -Ofair"
    directory: "{{ brain_install_dir }}"
    user: "{{ irma_user }}"
    numprocs: 1
    stdout_logfile: /var/log/supervisor/scan_app.log
    stderr_logfile: /var/log/supervisor/scan_app.log
    autostart: true
    stopwaitsecs: 600
    killasgroup: true
  - name: result_app
    command: "{{ brain_venv_dir }}/bin/celery worker -A brain.tasks:results_app --hostname=result_app.%%h {{default_celery_options}}"
    directory: "{{ brain_install_dir }}"
    user: "{{ irma_user }}"
    numprocs: 1
    stdout_logfile: /var/log/supervisor/result_app.log
    stderr_logfile: /var/log/supervisor/result_app.log
    autostart: true
    stopwaitsecs: 600
    killasgroup: true

# vim: sw=2<commit_msg>Fix new brain tasks filenames<commit_after>---

## Global
brain_project_dir: /opt/irma/irma-brain
brain_install_dir: "{{ brain_project_dir }}/current"
brain_venv_dir: "{{ brain_install_dir }}/venv"

brain_user: "{{ default_user }}"
brain_group: "{{ default_group }}"


## Deployment
brain_deployment_repository: "https://github.com/quarkslab/irma-brain.git"
brain_deployment_configs:
  - section: broker_brain
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_brain
    option: vhost
    value: "{{irma_configurations.rabbitmq.brain.vhost}}"
  - section: broker_brain
    option: username
    value: "{{irma_configurations.rabbitmq.brain.user}}"
  - section: broker_brain
    option: password
    value: "{{irma_configurations.rabbitmq.brain.password}}"
  - section: broker_probe
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_probe
    option: vhost
    value: "{{irma_configurations.rabbitmq.probe.vhost}}"
  - section: broker_probe
    option: username
    value: "{{irma_configurations.rabbitmq.probe.user}}"
  - section: broker_probe
    option: password
    value: "{{irma_configurations.rabbitmq.probe.password}}"
  - section: broker_frontend
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: broker_frontend
    option: vhost
    value: "{{irma_configurations.rabbitmq.frontend.vhost}}"
  - section: broker_frontend
    option: username
    value: "{{irma_configurations.rabbitmq.frontend.user}}"
  - section: broker_frontend
    option: password
    value: "{{irma_configurations.rabbitmq.frontend.password}}"
  - section: ftp_brain
    option: host
    value: "{{irma_configurations.brain_addr}}"
  - section: ftp_brain
    option: username
    value: "{{irma_configurations.ftpd.probe.username}}"
  - section: ftp_brain
    option: password
    value: "{{irma_configurations.ftpd.probe.password}}"


## UFW Rules
brain_ufw_additional_rules:
  - port: 21
    rule: allow
    proto: tcp
  - port: 5672
    rule: allow
    proto: tcp
  #- port: "65435:65535"
  #  rule: allow
  #  proto: tcp


## RabbitMQ role
rabbitmq_os_package: "{{ default_use_debian_repo | bool }}"
rabbitmq_ssl: false
rabbitmq_conf_tcp_listeners_address: 0.0.0.0
rabbitmq_conf_tcp_listeners_port: 5672

rabbitmq_vhost_definitions:
  - name: "{{irma_configurations.rabbitmq.brain.vhost}}"
  - name: "{{irma_configurations.rabbitmq.frontend.vhost}}"
  - name: "{{irma_configurations.rabbitmq.probe.vhost}}"

rabbitmq_users_definitions:
  - vhost: "{{irma_configurations.rabbitmq.brain.vhost}}"
    user: "{{irma_configurations.rabbitmq.brain.user}}"
    password: "{{irma_configurations.rabbitmq.brain.password}}"
  - vhost: "{{irma_configurations.rabbitmq.frontend.vhost}}"
    user: "{{irma_configurations.rabbitmq.frontend.user}}"
    password: "{{irma_configurations.rabbitmq.frontend.password}}"
  - vhost: "{{irma_configurations.rabbitmq.probe.vhost}}"
    user: "{{irma_configurations.rabbitmq.probe.user}}"
    password: "{{irma_configurations.rabbitmq.probe.password}}"


## Pure-FTPD role
#Standalone role
#pureftpd_options:
#  CreateHomeDir: "yes"
#  PAMAuthentication: "no"
#  TLS: "2"
#  PassivePortRange: "65435 65535"
#  # NOTE: vulnerable to POODLE but cannot find a workaround to make
#  # Python's 2.7.9 ftplib module work with Debian 8.1 pure-ftpd configured with
#  # TLSv1 only (-S:HIGH:MEDIUM:+TLSv1:!SSLv2:!SSLv3)
#  TLSCipherSuite: "-S:HIGH:MEDIUM:+TLSv1"

## SSHD SFTP server
sshd_sftp_server: internal-sftp
sshd_match:
  - Condition: "User {{irma_configurations.ftpd.frontend.username}}"
    X11Forwarding: no
    AllowTcpForwarding: no
    PermitTunnel: no
    ChrootDirectory: "{{ brain_sftpd_rootdir }}/{{irma_configurations.ftpd.frontend.username}}"
    ForceCommand: "{{ sshd_sftp_server }} -u 2"
  - Condition: "User {{irma_configurations.ftpd.probe.username}}"
    X11Forwarding: no
    AllowTcpForwarding: no
    PermitTunnel: no
    ChrootDirectory: "{{ brain_sftpd_rootdir }}"
    ForceCommand: "{{ sshd_sftp_server }} -u 2"

## Brain role PureFtpd
#brain_pureftpd_virtual_users:
#  - username: "{{irma_configurations.ftpd.frontend.username}}"
#    virtual_user: "ftpuser"
#    virtual_home: "/home/ftpuser/frontend"
#    password: "{{irma_configurations.ftpd.frontend.password}}"
#  - username: "{{irma_configurations.ftpd.probe.username}}"
#    virtual_user: "ftpuser"
#    virtual_home: "/home/ftpuser"
#    password: "{{irma_configurations.ftpd.probe.password}}"

#brain_pureftpd_openssl_subj: "/C=FR/ST=Paris/L=Paris/O=IRMA"

# Brain role
brain_sftpd_groupname: sftpusers
brain_sftpd_rootdir: /sftp
brain_sftpd_default_upload_dir : uploads

brain_sftpd_virtual_users:
  - username: "{{irma_configurations.ftpd.frontend.username}}"
    password: "{{<PASSWORD>}}"
  - username: "{{irma_configurations.ftpd.probe.username}}"
    password: "{{<PASSWORD>configurations.ftpd.probe.password}}"

brain_sftpd_virtual_writers:
  - user: "{{irma_configurations.ftpd.frontend.username}}"

## Supervisor role
# supervisor_extra_confs:
supervisor_programs_brain:
  - name: scan_app
    command: "{{ brain_venv_dir }}/bin/celery worker -A brain.scan_tasks --hostname=scan_app.%%h {{default_celery_options}} -Ofair"
    directory: "{{ brain_install_dir }}"
    user: "{{ irma_user }}"
    numprocs: 1
    stdout_logfile: /var/log/supervisor/scan_app.log
    stderr_logfile: /var/log/supervisor/scan_app.log
    autostart: true
    stopwaitsecs: 600
    killasgroup: true
  - name: result_app
    command: "{{ brain_venv_dir }}/bin/celery worker -A brain.results_tasks --hostname=result_app.%%h {{default_celery_options}}"
    directory: "{{ brain_install_dir }}"
    user: "{{ irma_user }}"
    numprocs: 1
    stdout_logfile: /var/log/supervisor/result_app.log
    stderr_logfile: /var/log/supervisor/result_app.log
    autostart: true
    stopwaitsecs: 600
    killasgroup: true

# vim: sw=2
{'fraction_non_alphanumeric': 0.13484861334916462, 'fraction_numerical': 0.010177253837672802, 'mean_word_length': 4.623271340009538, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '902301', 'n_tokens_mistral': 4539, 'n_tokens_neox': 4263, 'n_words': 695}