diff --git a/ansible/mcaptcha.yml b/ansible/mcaptcha.yml index 314f3d5..c96999f 100644 --- a/ansible/mcaptcha.yml +++ b/ansible/mcaptcha.yml @@ -10,7 +10,6 @@ become: yes vars_files: - vars/mcaptcha/vars.yml - - vars/mcaptcha/db-common.yml - vars/mcaptcha/postgresql.yml tasks: - ansible.builtin.include_role: @@ -23,7 +22,6 @@ become: yes vars_files: - vars/mcaptcha/vars.yml - - vars/mcaptcha/db-common.yml - vars/mcaptcha/mariadb.yml.yml tasks: - ansible.builtin.include_role: @@ -47,8 +45,6 @@ remote_user: atm vars_files: - vars/mcaptcha/vars.yml - - vars/mcaptcha/db-common.yml - - vars/mcaptcha/mcaptcha.yml roles: - mcaptcha tasks: diff --git a/ansible/vars/mcaptcha/db-common.yml b/ansible/vars/mcaptcha/db-common.yml deleted file mode 100644 index 8146b87..0000000 --- a/ansible/vars/mcaptcha/db-common.yml +++ /dev/null @@ -1,3 +0,0 @@ -database_owner: "mcaptcha" -database_name: "mcaptcha" -database_password: "{{ lookup('ansible.builtin.password', 'credentials/database_password', chars=['ascii_leters', 'digits'], length=32) }}" diff --git a/ansible/vars/mcaptcha/mcaptcha.yml b/ansible/vars/mcaptcha/mcaptcha.yml deleted file mode 100644 index 5740ab0..0000000 --- a/ansible/vars/mcaptcha/mcaptcha.yml +++ /dev/null @@ -1,61 +0,0 @@ -mcaptcha_debug: false -# mcaptcha_source_code: 'https://github.com/mCaptcha/mCaptcha' -mcaptcha_commercial: false -mcaptcha_allow_demo: false -mcaptcha_allow_registration: false - -# Please set a unique value, your mCaptcha instance's security depends on this being -# unique -mcaptcha_server_cookie_secret: "{{ lookup('ansible.builtin.password', 'credentials/mcaptcha_server_cookie_secret', chars=['ascii_leters', 'digits'], length=32) }}" -mcaptcha_server_port: 7000 -mcaptcha_server_bind: "127.0.0.1" -mcaptcha_server_hostname: "mcaptcha.local" -# Set true if you have setup TLS with a reverse proxy like Nginx. -# Does HTTPS redirect and sends additional headers that can only be used if -# HTTPS available to improve security -#mcaptcha_proxy_has_tls: false - -# Please set a unique value, your mCaptcha instance's security depends on this being -# unique -mcaptcha_captcha_salt: "{{ lookup('ansible.builtin.password', 'credentials/mcaptcha_captha_salt', chars=['ascii_leters', 'digits'], length=32) }}" -# garbage collection period to manage mCaptcha system -# leave untouched if you don't know what you are doing -# mcaptcha_captcha_gc: 30 -# mcaptcha_captcha_runners: 4 -# mcaptcha_captcha_queue_length: 2000 -mcaptcha_captcha_enable_stats: true - -#mcaptcha_captcha_default_difficulty_strategy_avg_traffic_difficulty: 50000 # almost instant solution -#mcaptcha_captcha_default_difficulty_strategy_peak_sustainable_traffic_difficulty: 3000000 # roughly 1.5s -#mcaptcha_captcha_default_difficulty_strategy_broke_my_site_traffic_difficulty: 5000000 # greater than 3.5s -# cooldown period in seconds -mcaptcha_captcha_default_difficulty_strategy_avg_duration: 30 - - #{% if database_type == 'postgres' %} - # {% set mcaptcha_database_url = "postgres://{{ database_owner }}:{{ database_password }}@localhost:5432/{{ database_name }}" %} - #{% else %} - # {% set mcaptcha_database_url = "mysql://{{ database_owner }}:{{ database_password }}@localhost/{{ database_name }}" %} - #{% endif %} -#mcaptcha_database_url: "mysql://{{ database_owner }}:{{ database_password }}@localhost/{{ database_name }}" - #mcaptcha_database_url: "postgres://{{ database_owner }}:{{ database_password }}@localhost:5432/{{ database_name }}" -# mysql://mcaptcha:password@localhost/mcaptcha" -mcaptcha_database_pool: 4 - #mcaptcha_database_url: "{{ mcaptcha_database_url }}" - -mcaptcha_redis_url: "redis://127.0.0.1" -mcaptcha_redis_pool: 4 - -mcaptcha_redis_url: "redis://127.0.0.1" -mcaptcha_redis_pool: 4 - - -mcaptcha_smtp_from: "admin@localhost" -mcaptcha_smtp_reply: "admin@localhost" -mcaptcha_smtp_url: "127.0.0.1" -mcaptcha_smtp_port: 10025 -mcaptcha_smtp_username: "admin" -mcaptcha_smtp_password: "password" -#[survey] -#nodes = ["http://localhost:7001"] -#rate_limit = 10 # upload every hour -#instance_root_url = "http://localhost:7000" diff --git a/ansible/vars/mcaptcha/vars.yml b/ansible/vars/mcaptcha/vars.yml index 2bc8542..2d1666a 100644 --- a/ansible/vars/mcaptcha/vars.yml +++ b/ansible/vars/mcaptcha/vars.yml @@ -1,2 +1,68 @@ database_type: "postgres" # options: "mariadb", "postgres" cache_type: "redis" # options: "embedded", "redis" + +database_owner: "mcaptcha" +database_name: "mcaptcha" +database_password: "{{ lookup('ansible.builtin.password', 'credentials/database_password', chars=['ascii_leters', 'digits'], length=32) }}" + +mcaptcha_debug: false +# mcaptcha_source_code: 'https://github.com/mCaptcha/mCaptcha' +mcaptcha_commercial: false +mcaptcha_allow_demo: false +mcaptcha_allow_registration: false + +# Please set a unique value, your mCaptcha instance's security depends on this being +# unique +mcaptcha_server_cookie_secret: "{{ lookup('ansible.builtin.password', 'credentials/mcaptcha_server_cookie_secret', chars=['ascii_leters', 'digits'], length=32) }}" +mcaptcha_server_port: 7000 +mcaptcha_server_bind: "127.0.0.1" +mcaptcha_server_hostname: "mcaptcha.local" +# Set true if you have setup TLS with a reverse proxy like Nginx. +# Does HTTPS redirect and sends additional headers that can only be used if +# HTTPS available to improve security +#mcaptcha_proxy_has_tls: false + +# Please set a unique value, your mCaptcha instance's security depends on this being +# unique +mcaptcha_captcha_salt: "{{ lookup('ansible.builtin.password', 'credentials/mcaptcha_captha_salt', chars=['ascii_leters', 'digits'], length=32) }}" +# garbage collection period to manage mCaptcha system +# leave untouched if you don't know what you are doing +# mcaptcha_captcha_gc: 30 +# mcaptcha_captcha_runners: 4 +# mcaptcha_captcha_queue_length: 2000 +mcaptcha_captcha_enable_stats: true + +#mcaptcha_captcha_default_difficulty_strategy_avg_traffic_difficulty: 50000 # almost instant solution +#mcaptcha_captcha_default_difficulty_strategy_peak_sustainable_traffic_difficulty: 3000000 # roughly 1.5s +#mcaptcha_captcha_default_difficulty_strategy_broke_my_site_traffic_difficulty: 5000000 # greater than 3.5s +# cooldown period in seconds +mcaptcha_captcha_default_difficulty_strategy_avg_duration: 30 + + #{% if database_type == 'postgres' %} + # {% set mcaptcha_database_url = "postgres://{{ database_owner }}:{{ database_password }}@localhost:5432/{{ database_name }}" %} + #{% else %} + # {% set mcaptcha_database_url = "mysql://{{ database_owner }}:{{ database_password }}@localhost/{{ database_name }}" %} + #{% endif %} +#mcaptcha_database_url: "mysql://{{ database_owner }}:{{ database_password }}@localhost/{{ database_name }}" + #mcaptcha_database_url: "postgres://{{ database_owner }}:{{ database_password }}@localhost:5432/{{ database_name }}" +# mysql://mcaptcha:password@localhost/mcaptcha" +mcaptcha_database_pool: 4 + #mcaptcha_database_url: "{{ mcaptcha_database_url }}" + +mcaptcha_redis_url: "redis://127.0.0.1" +mcaptcha_redis_pool: 4 + +mcaptcha_redis_url: "redis://127.0.0.1" +mcaptcha_redis_pool: 4 + + +mcaptcha_smtp_from: "admin@localhost" +mcaptcha_smtp_reply: "admin@localhost" +mcaptcha_smtp_url: "127.0.0.1" +mcaptcha_smtp_port: 10025 +mcaptcha_smtp_username: "admin" +mcaptcha_smtp_password: "password" +#[survey] +#nodes = ["http://localhost:7001"] +#rate_limit = 10 # upload every hour +#instance_root_url = "http://localhost:7000"