Rename variables matrix_bot_postmoogle_* with matrix_postmoogle_*

Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
This commit is contained in:
Suguru Hirahara 2024-10-29 00:41:28 +09:00
parent 4dec2ff563
commit 829858a3f5
No known key found for this signature in database
GPG Key ID: E4F9743DAB4B7B75
11 changed files with 220 additions and 200 deletions

View File

@ -1,3 +1,9 @@
# 2024-10-28
## (BC Break) Postmoogle's variable names need adjustments
Due to the recategorization of [Postmoogle](./docs/configuring-playbook-bridge-postmoogle.md) from the bot to the bridge, its variables were renamed (`matrix_bot_postmoogle_` -> `matrix_postmoogle_`). You need to adjust your `vars.yml` configuration accordingly.
# 2024-10-19
## Support for Matrix Authentication Service

View File

@ -17,7 +17,7 @@ Open the following ports on your server to be able to receive incoming emails:
If you don't open these ports, you will still be able to send emails, but not receive any.
These port numbers are configurable via the `matrix_bot_postmoogle_smtp_host_bind_port` and `matrix_bot_postmoogle_submission_host_bind_port` variables, but other email servers will try to deliver on these default (standard) ports, so changing them is of little use.
These port numbers are configurable via the `matrix_postmoogle_smtp_host_bind_port` and `matrix_postmoogle_submission_host_bind_port` variables, but other email servers will try to deliver on these default (standard) ports, so changing them is of little use.
## Adjusting the playbook configuration
@ -25,17 +25,17 @@ These port numbers are configurable via the `matrix_bot_postmoogle_smtp_host_bin
Add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file:
```yaml
matrix_bot_postmoogle_enabled: true
matrix_postmoogle_enabled: true
# Uncomment and adjust this part if you'd like to use a username different than the default
# matrix_bot_postmoogle_login: postmoogle
# matrix_postmoogle_login: postmoogle
# Generate a strong password here. Consider generating it with `pwgen -s 64 1`
matrix_bot_postmoogle_password: PASSWORD_FOR_THE_BOT
matrix_postmoogle_password: PASSWORD_FOR_THE_BOT
# Uncomment to add one or more admins to this bridge:
#
# matrix_bot_postmoogle_admins:
# matrix_postmoogle_admins:
# - '@yourAdminAccount:{{ matrix_domain }}'
#
# .. unless you've made yourself an admin of all bots/bridges like this:
@ -59,7 +59,7 @@ ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-use
- the `ensure-matrix-users-created` playbook tag makes the playbook automatically create a user account of the bridge's bot
- if you change the bridge's bot password (`matrix_bot_postmoogle_password` in your `vars.yml` file) subsequently, the bot user's credentials on the homeserver won't be updated automatically. If you'd like to change the bot user's password, use a tool like [synapse-admin](configuring-playbook-synapse-admin.md) to change it, and then update `matrix_bot_postmoogle_password` to let the bot know its new password
- if you change the bridge's bot password (`matrix_postmoogle_password` in your `vars.yml` file) subsequently, the bot user's credentials on the homeserver won't be updated automatically. If you'd like to change the bot user's password, use a tool like [synapse-admin](configuring-playbook-synapse-admin.md) to change it, and then update `matrix_postmoogle_password` to let the bot know its new password
## Usage
@ -79,5 +79,5 @@ As with all other services, you can find their logs in [systemd-journald](https:
The default logging level for this bridge is `INFO`, but you can increase it to `DEBUG` with the following additional configuration:
```yaml
matrix_bot_postmoogle_loglevel: 'DEBUG'
matrix_postmoogle_loglevel: 'DEBUG'
```

View File

@ -293,7 +293,7 @@ devture_systemd_service_manager_services_list_auto: |
+
([{'name': 'matrix-bot-draupnir.service', 'priority': 4000, 'groups': ['matrix', 'bots', 'draupnir', 'bot-draupnir']}] if matrix_bot_draupnir_enabled else [])
+
([{'name': 'matrix-bot-postmoogle.service', 'priority': 2200, 'groups': ['matrix', 'bots', 'postmoogle', 'bot-postmoogle']}] if matrix_bot_postmoogle_enabled else [])
([{'name': 'matrix-bot-postmoogle.service', 'priority': 2200, 'groups': ['matrix', 'bots', 'postmoogle', 'bot-postmoogle']}] if matrix_postmoogle_enabled else [])
+
([{'name': 'matrix-bot-chatgpt.service', 'priority': 2200, 'groups': ['matrix', 'bots', 'chatgpt', 'bot-chatgpt']}] if matrix_bot_chatgpt_enabled else [])
+
@ -2863,11 +2863,11 @@ matrix_bot_baibot_container_additional_networks_auto: |-
######################################################################
# We don't enable bots by default.
matrix_bot_postmoogle_enabled: false
matrix_postmoogle_enabled: false
matrix_bot_postmoogle_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}"
matrix_postmoogle_container_image_self_build: "{{ matrix_architecture not in ['amd64', 'arm64'] }}"
matrix_bot_postmoogle_ssl_path: |-
matrix_postmoogle_ssl_path: |-
{{
{
'playbook-managed-traefik': (traefik_certs_dumper_dumped_certificates_dir_path if traefik_certs_dumper_enabled else ''),
@ -2876,10 +2876,10 @@ matrix_bot_postmoogle_ssl_path: |-
}[matrix_playbook_reverse_proxy_type]
}}
matrix_playbook_bot_postmoogle_traefik_tls_cert: "{% for domain in matrix_bot_postmoogle_domains %}/ssl/{{ domain }}/certificate.crt {% endfor %}"
matrix_playbook_bot_postmoogle_traefik_key: "{% for domain in matrix_bot_postmoogle_domains %}/ssl/{{ domain }}/privatekey.key {% endfor %}"
matrix_playbook_bot_postmoogle_traefik_tls_cert: "{% for domain in matrix_postmoogle_domains %}/ssl/{{ domain }}/certificate.crt {% endfor %}"
matrix_playbook_bot_postmoogle_traefik_key: "{% for domain in matrix_postmoogle_domains %}/ssl/{{ domain }}/privatekey.key {% endfor %}"
matrix_bot_postmoogle_tls_cert: |-
matrix_postmoogle_tls_cert: |-
{{
{
'playbook-managed-traefik': (matrix_playbook_bot_postmoogle_traefik_tls_cert if traefik_certs_dumper_enabled else ''),
@ -2888,7 +2888,7 @@ matrix_bot_postmoogle_tls_cert: |-
}[matrix_playbook_reverse_proxy_type]
}}
matrix_bot_postmoogle_tls_key: |-
matrix_postmoogle_tls_key: |-
{{
{
'playbook-managed-traefik': (matrix_playbook_bot_postmoogle_traefik_key if traefik_certs_dumper_enabled else ''),
@ -2897,27 +2897,27 @@ matrix_bot_postmoogle_tls_key: |-
}[matrix_playbook_reverse_proxy_type]
}}
matrix_playbook_bot_postmoogle_traefik_certs_dumper_waiter_services: "{% for domain in matrix_bot_postmoogle_domains %}{{ traefik_certs_dumper_identifier }}-wait-for-domain@{{ domain }}.service {% endfor %}"
matrix_playbook_bot_postmoogle_traefik_certs_dumper_waiter_services: "{% for domain in matrix_postmoogle_domains %}{{ traefik_certs_dumper_identifier }}-wait-for-domain@{{ domain }}.service {% endfor %}"
matrix_bot_postmoogle_systemd_required_services_list_auto: |
matrix_postmoogle_systemd_required_services_list_auto: |
{{
matrix_addons_homeserver_systemd_services_list
+
([postgres_identifier ~ '.service'] if postgres_enabled and matrix_bot_postmoogle_database_hostname == matrix_bot_postmoogle_database_hostname else [])
([postgres_identifier ~ '.service'] if postgres_enabled and matrix_postmoogle_database_hostname == matrix_postmoogle_database_hostname else [])
+
(matrix_playbook_bot_postmoogle_traefik_certs_dumper_waiter_services | trim | split(' ') if matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] and traefik_certs_dumper_enabled else [])
}}
# Postgres is the default, except if not using internal Postgres server
matrix_bot_postmoogle_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
matrix_bot_postmoogle_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
matrix_bot_postmoogle_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'postmoogle.db', rounds=655555) | to_uuid }}"
matrix_postmoogle_database_engine: "{{ 'postgres' if postgres_enabled else 'sqlite' }}"
matrix_postmoogle_database_hostname: "{{ postgres_connection_hostname if postgres_enabled else '' }}"
matrix_postmoogle_database_password: "{{ '%s' | format(matrix_homeserver_generic_secret_key) | password_hash('sha512', 'postmoogle.db', rounds=655555) | to_uuid }}"
matrix_bot_postmoogle_homeserver: "{{ matrix_addons_homeserver_client_api_url }}"
matrix_postmoogle_homeserver: "{{ matrix_addons_homeserver_client_api_url }}"
matrix_bot_postmoogle_container_network: "{{ matrix_addons_container_network }}"
matrix_postmoogle_container_network: "{{ matrix_addons_container_network }}"
matrix_bot_postmoogle_container_additional_networks_auto: |-
matrix_postmoogle_container_additional_networks_auto: |-
{{
(
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
@ -4054,10 +4054,10 @@ postgres_managed_databases_auto: |
}] if (matrix_bot_honoroit_enabled and matrix_bot_honoroit_database_engine == 'postgres' and matrix_bot_honoroit_database_hostname == postgres_connection_hostname) else [])
+
([{
'name': matrix_bot_postmoogle_database_name,
'username': matrix_bot_postmoogle_database_username,
'password': matrix_bot_postmoogle_database_password,
}] if (matrix_bot_postmoogle_enabled and matrix_bot_postmoogle_database_engine == 'postgres' and matrix_bot_postmoogle_database_hostname == postgres_connection_hostname) else [])
'name': matrix_postmoogle_database_name,
'username': matrix_postmoogle_database_username,
'password': matrix_postmoogle_database_password,
}] if (matrix_postmoogle_enabled and matrix_postmoogle_database_engine == 'postgres' and matrix_postmoogle_database_hostname == postgres_connection_hostname) else [])
+
([{
'name': matrix_bot_maubot_database_name,
@ -4950,8 +4950,8 @@ matrix_synapse_admin_config_asManagedUsers_auto: |
] if matrix_bot_maubot_enabled else [])
+
([
'^@'+(matrix_bot_postmoogle_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$',
] if matrix_bot_postmoogle_enabled else [])
'^@'+(matrix_postmoogle_login | default('') | regex_escape) +':'+(matrix_domain | regex_escape)+'$',
] if matrix_postmoogle_enabled else [])
+
([
'^@_discord_[a-zA-Z0-9]+:'+(matrix_domain | regex_escape)+'$',
@ -5775,10 +5775,10 @@ matrix_user_creator_users_auto: |
}] if matrix_bot_honoroit_enabled else [])
+
([{
'username': matrix_bot_postmoogle_login,
'initial_password': matrix_bot_postmoogle_password,
'username': matrix_postmoogle_login,
'initial_password': matrix_postmoogle_password,
'initial_type': 'bot',
}] if matrix_bot_postmoogle_enabled else [])
}] if matrix_postmoogle_enabled else [])
+
([{
'username': matrix_bot_buscarron_login,

View File

@ -2,178 +2,178 @@
# postmoogle is an email to Matrix bridge using its bot user
# Project source code URL: https://github.com/etkecc/postmoogle
matrix_bot_postmoogle_enabled: true
matrix_postmoogle_enabled: true
matrix_bot_postmoogle_container_image_self_build: false
matrix_bot_postmoogle_docker_repo: "https://github.com/etkecc/postmoogle.git"
matrix_bot_postmoogle_docker_repo_version: "{{ 'main' if matrix_bot_postmoogle_version == 'latest' else matrix_bot_postmoogle_version }}"
matrix_bot_postmoogle_docker_src_files_path: "{{ matrix_base_data_path }}/postmoogle/docker-src"
matrix_postmoogle_container_image_self_build: false
matrix_postmoogle_docker_repo: "https://github.com/etkecc/postmoogle.git"
matrix_postmoogle_docker_repo_version: "{{ 'main' if matrix_postmoogle_version == 'latest' else matrix_postmoogle_version }}"
matrix_postmoogle_docker_src_files_path: "{{ matrix_base_data_path }}/postmoogle/docker-src"
# renovate: datasource=docker depName=ghcr.io/etkecc/postmoogle
matrix_bot_postmoogle_version: v0.9.22
matrix_bot_postmoogle_docker_image: "{{ matrix_bot_postmoogle_docker_image_name_prefix }}etkecc/postmoogle:{{ matrix_bot_postmoogle_version }}"
matrix_bot_postmoogle_docker_image_name_prefix: "{{ 'localhost/' if matrix_bot_postmoogle_container_image_self_build else 'ghcr.io/' }}"
matrix_bot_postmoogle_docker_image_force_pull: "{{ matrix_bot_postmoogle_docker_image.endswith(':latest') }}"
matrix_postmoogle_version: v0.9.22
matrix_postmoogle_docker_image: "{{ matrix_postmoogle_docker_image_name_prefix }}etkecc/postmoogle:{{ matrix_postmoogle_version }}"
matrix_postmoogle_docker_image_name_prefix: "{{ 'localhost/' if matrix_postmoogle_container_image_self_build else 'ghcr.io/' }}"
matrix_postmoogle_docker_image_force_pull: "{{ matrix_postmoogle_docker_image.endswith(':latest') }}"
matrix_bot_postmoogle_base_path: "{{ matrix_base_data_path }}/postmoogle"
matrix_bot_postmoogle_config_path: "{{ matrix_bot_postmoogle_base_path }}/config"
matrix_bot_postmoogle_data_path: "{{ matrix_bot_postmoogle_base_path }}/data"
matrix_postmoogle_base_path: "{{ matrix_base_data_path }}/postmoogle"
matrix_postmoogle_config_path: "{{ matrix_postmoogle_base_path }}/config"
matrix_postmoogle_data_path: "{{ matrix_postmoogle_base_path }}/data"
matrix_bot_postmoogle_container_network: ""
matrix_postmoogle_container_network: ""
matrix_bot_postmoogle_container_additional_networks: "{{ matrix_bot_postmoogle_container_additional_networks_auto + matrix_bot_postmoogle_container_additional_networks_custom }}"
matrix_bot_postmoogle_container_additional_networks_auto: []
matrix_bot_postmoogle_container_additional_networks_custom: []
matrix_postmoogle_container_additional_networks: "{{ matrix_postmoogle_container_additional_networks_auto + matrix_postmoogle_container_additional_networks_custom }}"
matrix_postmoogle_container_additional_networks_auto: []
matrix_postmoogle_container_additional_networks_custom: []
# A list of extra arguments to pass to the container
matrix_bot_postmoogle_container_extra_arguments: []
matrix_postmoogle_container_extra_arguments: []
# List of systemd services that matrix-bot-postmoogle.service depends on
matrix_bot_postmoogle_systemd_required_services_list: "{{ matrix_bot_postmoogle_systemd_required_services_list_default + matrix_bot_postmoogle_systemd_required_services_list_auto + matrix_bot_postmoogle_systemd_required_services_list_custom }}"
matrix_bot_postmoogle_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
matrix_bot_postmoogle_systemd_required_services_list_auto: []
matrix_bot_postmoogle_systemd_required_services_list_custom: []
matrix_postmoogle_systemd_required_services_list: "{{ matrix_postmoogle_systemd_required_services_list_default + matrix_postmoogle_systemd_required_services_list_auto + matrix_postmoogle_systemd_required_services_list_custom }}"
matrix_postmoogle_systemd_required_services_list_default: "{{ [devture_systemd_docker_base_docker_service_name] if devture_systemd_docker_base_docker_service_name else [] }}"
matrix_postmoogle_systemd_required_services_list_auto: []
matrix_postmoogle_systemd_required_services_list_custom: []
# List of systemd services that matrix-bot-postmoogle.service wants
matrix_bot_postmoogle_systemd_wanted_services_list: []
matrix_postmoogle_systemd_wanted_services_list: []
# Database-related configuration fields.
#
# To use SQLite, stick to these defaults.
#
# To use Postgres:
# - change the engine (`matrix_bot_postmoogle_database_engine: 'postgres'`)
# - adjust your database credentials via the `matrix_bot_postmoogle_database_*` variables
matrix_bot_postmoogle_database_engine: 'sqlite'
# - change the engine (`matrix_postmoogle_database_engine: 'postgres'`)
# - adjust your database credentials via the `matrix_postmoogle_database_*` variables
matrix_postmoogle_database_engine: 'sqlite'
matrix_bot_postmoogle_sqlite_database_path_local: "{{ matrix_bot_postmoogle_data_path }}/bot.db"
matrix_bot_postmoogle_sqlite_database_path_in_container: "/data/bot.db"
matrix_postmoogle_sqlite_database_path_local: "{{ matrix_postmoogle_data_path }}/bot.db"
matrix_postmoogle_sqlite_database_path_in_container: "/data/bot.db"
matrix_bot_postmoogle_database_username: 'postmoogle'
matrix_bot_postmoogle_database_password: 'some-password'
matrix_bot_postmoogle_database_hostname: ''
matrix_bot_postmoogle_database_port: 5432
matrix_bot_postmoogle_database_name: 'postmoogle'
matrix_bot_postmoogle_database_sslmode: disable
matrix_postmoogle_database_username: 'postmoogle'
matrix_postmoogle_database_password: 'some-password'
matrix_postmoogle_database_hostname: ''
matrix_postmoogle_database_port: 5432
matrix_postmoogle_database_name: 'postmoogle'
matrix_postmoogle_database_sslmode: disable
matrix_bot_postmoogle_database_connection_string: 'postgres://{{ matrix_bot_postmoogle_database_username }}:{{ matrix_bot_postmoogle_database_password }}@{{ matrix_bot_postmoogle_database_hostname }}:{{ matrix_bot_postmoogle_database_port }}/{{ matrix_bot_postmoogle_database_name }}?sslmode={{ matrix_bot_postmoogle_database_sslmode }}'
matrix_postmoogle_database_connection_string: 'postgres://{{ matrix_postmoogle_database_username }}:{{ matrix_postmoogle_database_password }}@{{ matrix_postmoogle_database_hostname }}:{{ matrix_postmoogle_database_port }}/{{ matrix_postmoogle_database_name }}?sslmode={{ matrix_postmoogle_database_sslmode }}'
matrix_bot_postmoogle_storage_database: "{{
matrix_postmoogle_storage_database: "{{
{
'sqlite': matrix_bot_postmoogle_sqlite_database_path_in_container,
'postgres': matrix_bot_postmoogle_database_connection_string,
}[matrix_bot_postmoogle_database_engine]
'sqlite': matrix_postmoogle_sqlite_database_path_in_container,
'postgres': matrix_postmoogle_database_connection_string,
}[matrix_postmoogle_database_engine]
}}"
matrix_bot_postmoogle_database_dialect: "{{
matrix_postmoogle_database_dialect: "{{
{
'sqlite': 'sqlite3',
'postgres': 'postgres',
}[matrix_bot_postmoogle_database_engine]
}[matrix_postmoogle_database_engine]
}}"
# The bot's username. This user needs to be created manually beforehand.
# Also see `matrix_bot_postmoogle_password` or `matrix_bot_postmoogle_sharedsecret`
matrix_bot_postmoogle_login: "postmoogle"
# Also see `matrix_postmoogle_password` or `matrix_postmoogle_sharedsecret`
matrix_postmoogle_login: "postmoogle"
# The password that the bot uses to authenticate.
matrix_bot_postmoogle_password: ''
matrix_postmoogle_password: ''
# Alternative to password - shared secret requires matrix_bot_postmoogle_login to be MXID
matrix_bot_postmoogle_sharedsecret: ''
# Alternative to password - shared secret requires matrix_postmoogle_login to be MXID
matrix_postmoogle_sharedsecret: ''
matrix_bot_postmoogle_homeserver: ""
matrix_postmoogle_homeserver: ""
# Command prefix
matrix_bot_postmoogle_prefix: '!pm'
matrix_postmoogle_prefix: '!pm'
# Max email size in megabytes, including attachments
matrix_bot_postmoogle_maxsize: '1024'
matrix_postmoogle_maxsize: '1024'
# Optional SMTP relay mode
matrix_bot_postmoogle_relay_host: ''
matrix_bot_postmoogle_relay_port: ''
matrix_bot_postmoogle_relay_username: ''
matrix_bot_postmoogle_relay_password: ''
matrix_postmoogle_relay_host: ''
matrix_postmoogle_relay_port: ''
matrix_postmoogle_relay_username: ''
matrix_postmoogle_relay_password: ''
# A list of admins
# Example set of rules:
# matrix_bot_postmoogle_admins:
# matrix_postmoogle_admins:
# - '@someone:example.com'
# - '@another:example.com'
# - '@bot.*:example.com'
# - '@*:example.net'
matrix_bot_postmoogle_admins: "{{ [matrix_admin] if matrix_admin else [] }}"
matrix_postmoogle_admins: "{{ [matrix_admin] if matrix_admin else [] }}"
# Sentry DSN. Deprecated, use matrix_bot_postmoogle_monitoring_sentry_dsn
matrix_bot_postmoogle_sentry: ''
# Sentry DSN. Deprecated, use matrix_postmoogle_monitoring_sentry_dsn
matrix_postmoogle_sentry: ''
# Sentry integration
matrix_bot_postmoogle_monitoring_sentry_dsn: "{{ matrix_bot_postmoogle_sentry }}"
matrix_bot_postmoogle_monitoring_sentry_rate: 20
matrix_postmoogle_monitoring_sentry_dsn: "{{ matrix_postmoogle_sentry }}"
matrix_postmoogle_monitoring_sentry_rate: 20
# healthchecks.io integration
matrix_bot_postmoogle_monitoring_healthchecks_uuid: ''
matrix_bot_postmoogle_monitoring_healthchecks_duration: 60
matrix_postmoogle_monitoring_healthchecks_uuid: ''
matrix_postmoogle_monitoring_healthchecks_duration: 60
# Log level
matrix_bot_postmoogle_loglevel: 'INFO'
matrix_postmoogle_loglevel: 'INFO'
# deprecated, use matrix_bot_postmoogle_domains
matrix_bot_postmoogle_domain: "{{ matrix_server_fqn_matrix }}"
# deprecated, use matrix_postmoogle_domains
matrix_postmoogle_domain: "{{ matrix_server_fqn_matrix }}"
matrix_bot_postmoogle_domains:
- "{{ matrix_bot_postmoogle_domain }}" # backward compatibility
matrix_postmoogle_domains:
- "{{ matrix_postmoogle_domain }}" # backward compatibility
# Password (passphrase) to encrypt account data
matrix_bot_postmoogle_data_secret: ""
matrix_postmoogle_data_secret: ""
# in-container ports
matrix_bot_postmoogle_port: '2525'
matrix_bot_postmoogle_tls_port: '25587'
matrix_postmoogle_port: '2525'
matrix_postmoogle_tls_port: '25587'
# on-host ports
matrix_bot_postmoogle_smtp_host_bind_port: '25'
matrix_bot_postmoogle_submission_host_bind_port: '587'
matrix_postmoogle_smtp_host_bind_port: '25'
matrix_postmoogle_submission_host_bind_port: '587'
### SSL
## on-host SSL dir
matrix_bot_postmoogle_ssl_path: ""
matrix_postmoogle_ssl_path: ""
## in-container SSL paths
# matrix_bot_postmoogle_tls_cert is the SSL certificates' certificates.
# matrix_postmoogle_tls_cert is the SSL certificates' certificates.
# This var is likely set via group_vars/matrix_servers, so you don't need to set certs manually.
# If you do need to set it manually, note that this is an in-container path.
# To mount a certificates volumes into the container, use matrix_bot_postmoogle_ssl_path
# Example value: /ssl/live/{{ matrix_bot_postmoogle_domain }}/fullchain.pem
matrix_bot_postmoogle_tls_cert: ""
# To mount a certificates volumes into the container, use matrix_postmoogle_ssl_path
# Example value: /ssl/live/{{ matrix_postmoogle_domain }}/fullchain.pem
matrix_postmoogle_tls_cert: ""
# matrix_bot_postmoogle_tls_key is the SSL certificates' keys.
# matrix_postmoogle_tls_key is the SSL certificates' keys.
# This var is likely set via group_vars/matrix_servers, so you don't need to set keys manually.
# If you do need to set it manually, note that this is an in-container path.
# To mount a certificates volumes into the container, use matrix_bot_postmoogle_ssl_path
# Example value: /ssl/live/{{ matrix_bot_postmoogle_domain }}/privkey.pem
matrix_bot_postmoogle_tls_key: ""
# To mount a certificates volumes into the container, use matrix_postmoogle_ssl_path
# Example value: /ssl/live/{{ matrix_postmoogle_domain }}/privkey.pem
matrix_postmoogle_tls_key: ""
# Mandatory TLS, even on plain SMTP port
matrix_bot_postmoogle_tls_required: false
matrix_postmoogle_tls_required: false
# trusted proxies
matrix_bot_postmoogle_proxies: []
matrix_postmoogle_proxies: []
# known forwarders
matrix_bot_postmoogle_mailboxes_forwarded: []
matrix_postmoogle_mailboxes_forwarded: []
# reserved mailboxes
matrix_bot_postmoogle_mailboxes_reserved: []
matrix_postmoogle_mailboxes_reserved: []
# mailbox activation flow
matrix_bot_postmoogle_mailboxes_activation: none
matrix_postmoogle_mailboxes_activation: none
# Additional environment variables to pass to the postmoogle container
#
# Example:
# matrix_bot_postmoogle_environment_variables_extension: |
# matrix_postmoogle_environment_variables_extension: |
# postmoogle_TEXT_DONE=Done
matrix_bot_postmoogle_environment_variables_extension: ''
matrix_postmoogle_environment_variables_extension: ''

View File

@ -6,15 +6,15 @@
- install-all
- install-bot-postmoogle
block:
- when: matrix_bot_postmoogle_enabled | bool
- when: matrix_postmoogle_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
- when: matrix_bot_postmoogle_enabled | bool
- when: matrix_postmoogle_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_install.yml"
- tags:
- setup-all
- setup-bot-postmoogle
block:
- when: not matrix_bot_postmoogle_enabled | bool
- when: not matrix_postmoogle_enabled | bool
ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml"

View File

@ -1,27 +1,27 @@
---
- when: "matrix_bot_postmoogle_database_engine == 'postgres'"
- when: "matrix_postmoogle_database_engine == 'postgres'"
block:
- name: Check if an SQLite database already exists
ansible.builtin.stat:
path: "{{ matrix_bot_postmoogle_sqlite_database_path_local }}"
register: matrix_bot_postmoogle_sqlite_database_path_local_stat_result
path: "{{ matrix_postmoogle_sqlite_database_path_local }}"
register: matrix_postmoogle_sqlite_database_path_local_stat_result
- when: "matrix_bot_postmoogle_sqlite_database_path_local_stat_result.stat.exists | bool"
- when: "matrix_postmoogle_sqlite_database_path_local_stat_result.stat.exists | bool"
block:
- ansible.builtin.include_role:
name: galaxy/postgres
tasks_from: migrate_db_to_postgres
vars:
postgres_db_migration_request:
src: "{{ matrix_bot_postmoogle_sqlite_database_path_local }}"
dst: "{{ matrix_bot_postmoogle_database_connection_string }}"
src: "{{ matrix_postmoogle_sqlite_database_path_local }}"
dst: "{{ matrix_postmoogle_database_connection_string }}"
caller: "{{ role_path | basename }}"
engine_variable_name: 'matrix_bot_postmoogle_database_engine'
engine_variable_name: 'matrix_postmoogle_database_engine'
engine_old: 'sqlite'
systemd_services_to_stop: ['matrix-bot-postmoogle.service']
- ansible.builtin.set_fact:
matrix_bot_postmoogle_requires_restart: true
matrix_postmoogle_requires_restart: true
- name: Ensure postmoogle paths exist
ansible.builtin.file:
@ -31,26 +31,26 @@
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
with_items:
- {path: "{{ matrix_bot_postmoogle_config_path }}", when: true}
- {path: "{{ matrix_bot_postmoogle_data_path }}", when: true}
- {path: "{{ matrix_bot_postmoogle_docker_src_files_path }}", when: matrix_bot_postmoogle_container_image_self_build}
- {path: "{{ matrix_postmoogle_config_path }}", when: true}
- {path: "{{ matrix_postmoogle_data_path }}", when: true}
- {path: "{{ matrix_postmoogle_docker_src_files_path }}", when: matrix_postmoogle_container_image_self_build}
when: "item.when | bool"
- name: Ensure postmoogle environment variables file created
ansible.builtin.template:
src: "{{ role_path }}/templates/env.j2"
dest: "{{ matrix_bot_postmoogle_config_path }}/env"
dest: "{{ matrix_postmoogle_config_path }}/env"
owner: "{{ matrix_user_username }}"
group: "{{ matrix_user_groupname }}"
mode: 0640
- name: Ensure postmoogle image is pulled
community.docker.docker_image:
name: "{{ matrix_bot_postmoogle_docker_image }}"
name: "{{ matrix_postmoogle_docker_image }}"
source: "{{ 'pull' if ansible_version.major > 2 or ansible_version.minor > 7 else omit }}"
force_source: "{{ matrix_bot_postmoogle_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_postmoogle_docker_image_force_pull }}"
when: "not matrix_bot_postmoogle_container_image_self_build | bool"
force_source: "{{ matrix_postmoogle_docker_image_force_pull if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_postmoogle_docker_image_force_pull }}"
when: "not matrix_postmoogle_container_image_self_build | bool"
register: result
retries: "{{ devture_playbook_help_container_retries_count }}"
delay: "{{ devture_playbook_help_container_retries_delay }}"
@ -58,31 +58,31 @@
- name: Ensure postmoogle repository is present on self-build
ansible.builtin.git:
repo: "{{ matrix_bot_postmoogle_docker_repo }}"
version: "{{ matrix_bot_postmoogle_docker_repo_version }}"
dest: "{{ matrix_bot_postmoogle_docker_src_files_path }}"
repo: "{{ matrix_postmoogle_docker_repo }}"
version: "{{ matrix_postmoogle_docker_repo_version }}"
dest: "{{ matrix_postmoogle_docker_src_files_path }}"
force: "yes"
become: true
become_user: "{{ matrix_user_username }}"
register: matrix_bot_postmoogle_git_pull_results
when: "matrix_bot_postmoogle_container_image_self_build | bool"
register: matrix_postmoogle_git_pull_results
when: "matrix_postmoogle_container_image_self_build | bool"
- name: Ensure postmoogle image is built
community.docker.docker_image:
name: "{{ matrix_bot_postmoogle_docker_image }}"
name: "{{ matrix_postmoogle_docker_image }}"
source: build
force_source: "{{ matrix_bot_postmoogle_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_bot_postmoogle_git_pull_results.changed }}"
force_source: "{{ matrix_postmoogle_git_pull_results.changed if ansible_version.major > 2 or ansible_version.minor >= 8 else omit }}"
force: "{{ omit if ansible_version.major > 2 or ansible_version.minor >= 8 else matrix_postmoogle_git_pull_results.changed }}"
build:
dockerfile: Dockerfile
path: "{{ matrix_bot_postmoogle_docker_src_files_path }}"
path: "{{ matrix_postmoogle_docker_src_files_path }}"
pull: true
when: "matrix_bot_postmoogle_container_image_self_build | bool"
when: "matrix_postmoogle_container_image_self_build | bool"
- name: Ensure postmoogle container network is created
community.general.docker_network:
enable_ipv6: "{{ devture_systemd_docker_base_ipv6_enabled }}"
name: "{{ matrix_bot_postmoogle_container_network }}"
name: "{{ matrix_postmoogle_container_network }}"
driver: bridge
driver_options: "{{ devture_systemd_docker_base_container_networks_driver_options }}"
@ -91,4 +91,4 @@
src: "{{ role_path }}/templates/systemd/matrix-bot-postmoogle.service.j2"
dest: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
mode: 0644
register: matrix_bot_postmoogle_systemd_service_result
register: matrix_postmoogle_systemd_service_result

View File

@ -3,9 +3,9 @@
- name: Check existence of matrix-postmoogle service
ansible.builtin.stat:
path: "{{ devture_systemd_docker_base_systemd_path }}/matrix-bot-postmoogle.service"
register: matrix_bot_postmoogle_service_stat
register: matrix_postmoogle_service_stat
- when: matrix_bot_postmoogle_service_stat.stat.exists | bool
- when: matrix_postmoogle_service_stat.stat.exists | bool
block:
- name: Ensure matrix-postmoogle is stopped
ansible.builtin.service:
@ -21,5 +21,5 @@
- name: Ensure Matrix postmoogle paths don't exist
ansible.builtin.file:
path: "{{ matrix_bot_postmoogle_base_path }}"
path: "{{ matrix_postmoogle_base_path }}"
state: absent

View File

@ -6,7 +6,7 @@
You need to define a required configuration setting (`{{ item.name }}`).
when: "item.when | bool and vars[item.name] == ''"
with_items:
- {'name': 'matrix_bot_postmoogle_password', when: true}
- {'name': 'matrix_bot_postmoogle_container_network', when: true}
- {'name': 'matrix_bot_postmoogle_homeserver', when: true}
- {'name': 'matrix_bot_postmoogle_database_hostname', when: "{{ matrix_bot_postmoogle_database_engine == 'postgres' }}"}
- {'name': 'matrix_postmoogle_password', when: true}
- {'name': 'matrix_postmoogle_container_network', when: true}
- {'name': 'matrix_postmoogle_homeserver', when: true}
- {'name': 'matrix_postmoogle_database_hostname', when: "{{ matrix_postmoogle_database_engine == 'postgres' }}"}

View File

@ -1,31 +1,31 @@
POSTMOOGLE_LOGIN={{ matrix_bot_postmoogle_login }}
POSTMOOGLE_PASSWORD={{ matrix_bot_postmoogle_password }}
POSTMOOGLE_SHAREDSECRET={{ matrix_bot_postmoogle_sharedsecret }}
POSTMOOGLE_HOMESERVER={{ matrix_bot_postmoogle_homeserver }}
POSTMOOGLE_DOMAINS={{ matrix_bot_postmoogle_domains | join(' ') }}
POSTMOOGLE_PORT={{ matrix_bot_postmoogle_port }}
POSTMOOGLE_DB_DSN={{ matrix_bot_postmoogle_database_connection_string }}
POSTMOOGLE_DB_DIALECT={{ matrix_bot_postmoogle_database_dialect }}
POSTMOOGLE_PREFIX={{ matrix_bot_postmoogle_prefix }}
POSTMOOGLE_MAXSIZE={{ matrix_bot_postmoogle_maxsize }}
POSTMOOGLE_LOGLEVEL={{ matrix_bot_postmoogle_loglevel }}
POSTMOOGLE_ADMINS={{ matrix_bot_postmoogle_admins | join(' ') }}
POSTMOOGLE_TLS_PORT={{ matrix_bot_postmoogle_tls_port }}
POSTMOOGLE_TLS_CERT={{ matrix_bot_postmoogle_tls_cert }}
POSTMOOGLE_TLS_KEY={{ matrix_bot_postmoogle_tls_key }}
POSTMOOGLE_TLS_REQUIRED={{ matrix_bot_postmoogle_tls_required }}
POSTMOOGLE_DATA_SECRET={{ matrix_bot_postmoogle_data_secret }}
POSTMOOGLE_PROXIES={{ matrix_bot_postmoogle_proxies | join(' ') }}
POSTMOOGLE_RELAY_HOST={{ matrix_bot_postmoogle_relay_host }}
POSTMOOGLE_RELAY_PORT={{ matrix_bot_postmoogle_relay_port }}
POSTMOOGLE_RELAY_USERNAME={{ matrix_bot_postmoogle_relay_username }}
POSTMOOGLE_RELAY_PASSWORD={{ matrix_bot_postmoogle_relay_password }}
POSTMOOGLE_MONITORING_SENTRY_DSN={{ matrix_bot_postmoogle_monitoring_sentry_dsn }}
POSTMOOGLE_MONITORING_SENTRY_RATE={{ matrix_bot_postmoogle_monitoring_sentry_rate }}
POSTMOOGLE_MONITORING_HEALTHCHECKS_UUID={{ matrix_bot_postmoogle_monitoring_healthchecks_uuid }}
POSTMOOGLE_MONITORING_HEALTHCHECKS_DURATION={{ matrix_bot_postmoogle_monitoring_healthchecks_duration }}
POSTMOOGLE_MAILBOXES_FORWARDED={{ matrix_bot_postmoogle_mailboxes_forwarded | join(' ') }}
POSTMOOGLE_MAILBOXES_RESERVED={{ matrix_bot_postmoogle_mailboxes_reserved | join(' ') }}
POSTMOOGLE_MAILBOXES_ACTIVATION={{ matrix_bot_postmoogle_mailboxes_activation }}
POSTMOOGLE_LOGIN={{ matrix_postmoogle_login }}
POSTMOOGLE_PASSWORD={{ matrix_postmoogle_password }}
POSTMOOGLE_SHAREDSECRET={{ matrix_postmoogle_sharedsecret }}
POSTMOOGLE_HOMESERVER={{ matrix_postmoogle_homeserver }}
POSTMOOGLE_DOMAINS={{ matrix_postmoogle_domains | join(' ') }}
POSTMOOGLE_PORT={{ matrix_postmoogle_port }}
POSTMOOGLE_DB_DSN={{ matrix_postmoogle_database_connection_string }}
POSTMOOGLE_DB_DIALECT={{ matrix_postmoogle_database_dialect }}
POSTMOOGLE_PREFIX={{ matrix_postmoogle_prefix }}
POSTMOOGLE_MAXSIZE={{ matrix_postmoogle_maxsize }}
POSTMOOGLE_LOGLEVEL={{ matrix_postmoogle_loglevel }}
POSTMOOGLE_ADMINS={{ matrix_postmoogle_admins | join(' ') }}
POSTMOOGLE_TLS_PORT={{ matrix_postmoogle_tls_port }}
POSTMOOGLE_TLS_CERT={{ matrix_postmoogle_tls_cert }}
POSTMOOGLE_TLS_KEY={{ matrix_postmoogle_tls_key }}
POSTMOOGLE_TLS_REQUIRED={{ matrix_postmoogle_tls_required }}
POSTMOOGLE_DATA_SECRET={{ matrix_postmoogle_data_secret }}
POSTMOOGLE_PROXIES={{ matrix_postmoogle_proxies | join(' ') }}
POSTMOOGLE_RELAY_HOST={{ matrix_postmoogle_relay_host }}
POSTMOOGLE_RELAY_PORT={{ matrix_postmoogle_relay_port }}
POSTMOOGLE_RELAY_USERNAME={{ matrix_postmoogle_relay_username }}
POSTMOOGLE_RELAY_PASSWORD={{ matrix_postmoogle_relay_password }}
POSTMOOGLE_MONITORING_SENTRY_DSN={{ matrix_postmoogle_monitoring_sentry_dsn }}
POSTMOOGLE_MONITORING_SENTRY_RATE={{ matrix_postmoogle_monitoring_sentry_rate }}
POSTMOOGLE_MONITORING_HEALTHCHECKS_UUID={{ matrix_postmoogle_monitoring_healthchecks_uuid }}
POSTMOOGLE_MONITORING_HEALTHCHECKS_DURATION={{ matrix_postmoogle_monitoring_healthchecks_duration }}
POSTMOOGLE_MAILBOXES_FORWARDED={{ matrix_postmoogle_mailboxes_forwarded | join(' ') }}
POSTMOOGLE_MAILBOXES_RESERVED={{ matrix_postmoogle_mailboxes_reserved | join(' ') }}
POSTMOOGLE_MAILBOXES_ACTIVATION={{ matrix_postmoogle_mailboxes_activation }}
{{ matrix_bot_postmoogle_environment_variables_extension }}
{{ matrix_postmoogle_environment_variables_extension }}

View File

@ -1,11 +1,11 @@
#jinja2: lstrip_blocks: "True"
[Unit]
Description=Matrix Postmoogle bot
{% for service in matrix_bot_postmoogle_systemd_required_services_list %}
{% for service in matrix_postmoogle_systemd_required_services_list %}
Requires={{ service }}
After={{ service }}
{% endfor %}
{% for service in matrix_bot_postmoogle_systemd_wanted_services_list %}
{% for service in matrix_postmoogle_systemd_wanted_services_list %}
Wants={{ service }}
{% endfor %}
DefaultDependencies=no
@ -23,22 +23,22 @@ ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--read-only \
--network={{ matrix_bot_postmoogle_container_network }} \
--env-file={{ matrix_bot_postmoogle_config_path }}/env \
-p {{ matrix_bot_postmoogle_smtp_host_bind_port }}:{{ matrix_bot_postmoogle_port }} \
{% if matrix_bot_postmoogle_ssl_path %}
-p {{ matrix_bot_postmoogle_submission_host_bind_port }}:{{ matrix_bot_postmoogle_tls_port }} \
--network={{ matrix_postmoogle_container_network }} \
--env-file={{ matrix_postmoogle_config_path }}/env \
-p {{ matrix_postmoogle_smtp_host_bind_port }}:{{ matrix_postmoogle_port }} \
{% if matrix_postmoogle_ssl_path %}
-p {{ matrix_postmoogle_submission_host_bind_port }}:{{ matrix_postmoogle_tls_port }} \
{% endif %}
--mount type=bind,src={{ matrix_bot_postmoogle_data_path }},dst=/data \
{% if matrix_bot_postmoogle_ssl_path %}
--mount type=bind,src={{ matrix_bot_postmoogle_ssl_path }},dst=/ssl \
--mount type=bind,src={{ matrix_postmoogle_data_path }},dst=/data \
{% if matrix_postmoogle_ssl_path %}
--mount type=bind,src={{ matrix_postmoogle_ssl_path }},dst=/ssl \
{% endif %}
{% for arg in matrix_bot_postmoogle_container_extra_arguments %}
{% for arg in matrix_postmoogle_container_extra_arguments %}
{{ arg }} \
{% endfor %}
{{ matrix_bot_postmoogle_docker_image }}
{{ matrix_postmoogle_docker_image }}
{% for network in matrix_bot_postmoogle_container_additional_networks %}
{% for network in matrix_postmoogle_container_additional_networks %}
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-postmoogle
{% endfor %}

View File

@ -223,6 +223,20 @@
We found usage of the following variables: {{ matrix_playbook_migration_jitsi_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_jitsi_migration_vars | length > 0"
- when: matrix_playbook_migration_matrix_jitsi_migration_validation_enabled | bool
block:
- ansible.builtin.set_fact:
matrix_playbook_migration_postmoogle_migration_vars: |-
{{ vars | dict2items | selectattr('key', 'match', 'matrix_postmoogle_.*') | list | items2dict }}
- name: (Deprecation) Catch and report matrix_bot_postmoogle variables
ansible.builtin.fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration (vars.yml) to rename all variables (`matrix_bot_postmoogle_` -> `matrix_postmoogle_`).
We found usage of the following variables: {{ matrix_playbook_migration_postmoogle_migration_vars.keys() | join(', ') }}
when: "matrix_playbook_migration_postmoogle_migration_vars | length > 0"
- when: matrix_playbook_migration_matrix_nginx_proxy_elimination_variable_transition_checks_enabled | bool
block:
- name: (Deprecation) Catch and report transitioned playbook settings during the matrix-nginx-proxy elimination