| @@ -2144,7 +2144,7 @@ matrix_coturn_tls_v1_1_enabled: true | |||||
| Thanks to [foxcris](https://github.com/foxcris), the playbook can now make automated local Postgres backups on a fixed schedule using [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local). | Thanks to [foxcris](https://github.com/foxcris), the playbook can now make automated local Postgres backups on a fixed schedule using [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local). | ||||
| Additional details are available in [Setting up postgres backup](docs/configuring-playbook-postgres-backup.md). | |||||
| Additional details are available in [Setting up Postgres backup](docs/configuring-playbook-postgres-backup.md). | |||||
| # 2021-04-03 | # 2021-04-03 | ||||
| @@ -1,3 +1,15 @@ | |||||
| <!-- | |||||
| SPDX-FileCopyrightText: 2021 Béla Becker | |||||
| SPDX-FileCopyrightText: 2021 - 2024 Slavi Pantaleev | |||||
| SPDX-FileCopyrightText: 2021 pushytoxin | |||||
| SPDX-FileCopyrightText: 2022 Jim Myhrberg | |||||
| SPDX-FileCopyrightText: 2022 Nikita Chernyi | |||||
| SPDX-FileCopyrightText: 2022 felixx9 | |||||
| SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | |||||
| --> | |||||
| # Setting up Etherpad (optional) | # Setting up Etherpad (optional) | ||||
| The playbook can install and configure [Etherpad](https://etherpad.org) for you. | The playbook can install and configure [Etherpad](https://etherpad.org) for you. | ||||
| @@ -66,7 +66,7 @@ Take a look at: | |||||
| Here is a list of additional common configuration options: | Here is a list of additional common configuration options: | ||||
| ```yaml | ```yaml | ||||
| # The postgres database pooling options | |||||
| # The Postgres database pooling options | |||||
| # The maximum number of connects to hold open. More of these allow for more concurrent | # The maximum number of connects to hold open. More of these allow for more concurrent | ||||
| # processes to happen. | # processes to happen. | ||||
| @@ -6,45 +6,12 @@ SPDX-FileCopyrightText: 2024 - 2025 Suguru Hirahara | |||||
| SPDX-License-Identifier: AGPL-3.0-or-later | SPDX-License-Identifier: AGPL-3.0-or-later | ||||
| --> | --> | ||||
| # Setting up postgres backup (optional) | |||||
| # Setting up Postgres backup (optional) | |||||
| The playbook can install and configure [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local) for you via the [ansible-role-postgres-backup](https://github.com/mother-of-all-self-hosting/ansible-role-postgres-backup) Ansible role. | The playbook can install and configure [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local) for you via the [ansible-role-postgres-backup](https://github.com/mother-of-all-self-hosting/ansible-role-postgres-backup) Ansible role. | ||||
| For a more complete backup solution (one that includes not only Postgres, but also other configuration/data files), you may wish to look into [BorgBackup](configuring-playbook-backup-borg.md) instead. | |||||
| For details about configuring and installing it, you can check them via: | |||||
| - [the role's document on the MASH (mother-of-all-self-hosting) project](https://github.com/mother-of-all-self-hosting/ansible-role-postgres-backup/blob/main/docs/configuring-postgres-backup.md) | |||||
| - `roles/galaxy/postgres_backup/docs/configuring-postgres-backup.md` locally, if you have fetched the Ansible roles | |||||
| ## Adjusting the playbook configuration | |||||
| To enable Postgres backup, add the following configuration to your `inventory/host_vars/matrix.example.com/vars.yml` file: | |||||
| ```yaml | |||||
| postgres_backup_enabled: true | |||||
| ``` | |||||
| Refer to the table below for additional configuration variables and their default values. | |||||
| | Name | Default value | Description | | |||||
| | :-------------------------------- | :--------------------------- | :--------------------------------------------------------------- | | |||||
| |`postgres_backup_enabled`|`false`|Set to true to use [docker-postgres-backup-local](https://github.com/prodrigestivill/docker-postgres-backup-local) to create automatic database backups| | |||||
| |`postgres_backup_schedule`| `'@daily'` |Cron-schedule specifying the interval between postgres backups.| | |||||
| |`postgres_backup_keep_days`|`7`|Number of daily backups to keep| | |||||
| |`postgres_backup_keep_weeks`|`4`|Number of weekly backups to keep| | |||||
| |`postgres_backup_keep_months`|`12`|Number of monthly backups to keep| | |||||
| |`postgres_backup_base_path` | `"{{ matrix_base_data_path }}/postgres-backup"` | Base path for postgres-backup. Also see `postgres_backup_data_path` | | |||||
| |`postgres_backup_data_path` | `"{{ postgres_backup_base_path }}/data"` | Storage path for postgres-backup database backups | | |||||
| ## Installing | |||||
| After configuring the playbook, run it with [playbook tags](playbook-tags.md) as below: | |||||
| <!-- NOTE: let this conservative command run (instead of install-all) to make it clear that failure of the command means something is clearly broken. --> | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | |||||
| ``` | |||||
| The shortcut commands with the [`just` program](just.md) are also available: `just install-all` or `just setup-all` | |||||
| `just install-all` is useful for maintaining your setup quickly ([2x-5x faster](../CHANGELOG.md#2x-5x-performance-improvements-in-playbook-runtime) than `just setup-all`) when its components remain unchanged. If you adjust your `vars.yml` to remove other components, you'd need to run `just setup-all`, or these components will still remain installed. Note these shortcuts run the `ensure-matrix-users-created` tag too. | |||||
| ## Troubleshooting | |||||
| As with all other services, you can find the logs in [systemd-journald](https://www.freedesktop.org/software/systemd/man/systemd-journald.service.html) by logging in to the server with SSH and running `journalctl -fu matrix-postgres-backup`. | |||||
| **Note**: for a more complete backup solution (one that includes not only Postgres, but also other configuration/data files), you may wish to look into [BorgBackup](configuring-playbook-backup-borg.md) instead. | |||||
| @@ -206,7 +206,7 @@ Services that help you in administrating and monitoring your Matrix installation | |||||
| - Backups: | - Backups: | ||||
| - [Setting up BorgBackup](configuring-playbook-backup-borg.md) — a full Matrix server backup solution, including the Postgres database | - [Setting up BorgBackup](configuring-playbook-backup-borg.md) — a full Matrix server backup solution, including the Postgres database | ||||
| - [Setting up postgres backup](configuring-playbook-postgres-backup.md) — a Postgres-database backup solution (note: does not include other files) | |||||
| - [Setting up Postgres backup](configuring-playbook-postgres-backup.md) — a Postgres-database backup solution (note: does not include other files) | |||||
| ### Other specialized services | ### Other specialized services | ||||
| @@ -125,6 +125,7 @@ Services that help you in administrating and monitoring your Matrix installation | |||||
| | [Metrics and Graphs](configuring-playbook-prometheus-grafana.md) | [grafana/grafana](https://hub.docker.com/r/grafana/grafana/) | ❌ | Graphing tool that works well with the above two images. Our playbook also adds two dashboards for [Synapse](https://github.com/element-hq/synapse/tree/master/contrib/grafana) and [Node Exporter](https://github.com/rfrail3/grafana-dashboards) | | | [Metrics and Graphs](configuring-playbook-prometheus-grafana.md) | [grafana/grafana](https://hub.docker.com/r/grafana/grafana/) | ❌ | Graphing tool that works well with the above two images. Our playbook also adds two dashboards for [Synapse](https://github.com/element-hq/synapse/tree/master/contrib/grafana) and [Node Exporter](https://github.com/rfrail3/grafana-dashboards) | | ||||
| | [Metrics and Graphs](configuring-playbook-prometheus-grafana.md#enable-metrics-and-graphs-for-nginx-logs-optional) | [martin-helmich/prometheus-nginxlog-exporter/exporter](https://ghcr.io/martin-helmich/prometheus-nginxlog-exporter/exporter) | ❌ | Addon for Prometheus that gathers access logs from various nginx reverse-proxies | | | [Metrics and Graphs](configuring-playbook-prometheus-grafana.md#enable-metrics-and-graphs-for-nginx-logs-optional) | [martin-helmich/prometheus-nginxlog-exporter/exporter](https://ghcr.io/martin-helmich/prometheus-nginxlog-exporter/exporter) | ❌ | Addon for Prometheus that gathers access logs from various nginx reverse-proxies | | ||||
| | [Borg](configuring-playbook-backup-borg.md) | (N/A) | ❌ | Backups | | | [Borg](configuring-playbook-backup-borg.md) | (N/A) | ❌ | Backups | | ||||
| | [postgres-backup-local](configuring-playbook-postgres-backup.md) | [prodrigestivill/postgres-backup-local](https://hub.docker.com/r/prodrigestivill/postgres-backup-local) | ❌ | Create automatic database backups | | |||||
| | [rageshake](configuring-playbook-rageshake.md) | [matrix-org/rageshake](https://ghcr.io/matrix-org/rageshake) | ❌ | Bug report server | | | [rageshake](configuring-playbook-rageshake.md) | [matrix-org/rageshake](https://ghcr.io/matrix-org/rageshake) | ❌ | Bug report server | | ||||
| | [synapse-usage-exporter](configuring-playbook-synapse-usage-exporter.md) | Self-building | ❌ | Export the usage statistics of a Synapse homeserver to be scraped by Prometheus. | | | [synapse-usage-exporter](configuring-playbook-synapse-usage-exporter.md) | Self-building | ❌ | Export the usage statistics of a Synapse homeserver to be scraped by Prometheus. | | ||||
| @@ -47,7 +47,7 @@ Example playbook invocations: | |||||
| ## Backing up PostgreSQL | ## Backing up PostgreSQL | ||||
| To automatically make Postgres database backups on a fixed schedule, see [Setting up postgres backup](configuring-playbook-postgres-backup.md). | |||||
| To automatically make Postgres database backups on a fixed schedule, see [Setting up Postgres backup](configuring-playbook-postgres-backup.md). | |||||
| To make a one off back up of the current PostgreSQL database, make sure it's running and then execute a command like this on the server: | To make a one off back up of the current PostgreSQL database, make sure it's running and then execute a command like this on the server: | ||||
| @@ -22,7 +22,7 @@ You can manually generate the password hash by using the command-line after **SS | |||||
| docker exec -it matrix-synapse /usr/local/bin/hash_password -c /data/homeserver.yaml | docker exec -it matrix-synapse /usr/local/bin/hash_password -c /data/homeserver.yaml | ||||
| ``` | ``` | ||||
| and then connecting to the postgres server and executing: | |||||
| and then connecting to the Postgres server and executing: | |||||
| ```sql | ```sql | ||||
| UPDATE users SET password_hash = '<password-hash>' WHERE name = '@alice:example.com'; | UPDATE users SET password_hash = '<password-hash>' WHERE name = '@alice:example.com'; | ||||
| @@ -12,7 +12,7 @@ markdown-it-py==3.0.0 | |||||
| MarkupSafe==3.0.2 | MarkupSafe==3.0.2 | ||||
| mdit-py-plugins==0.4.2 | mdit-py-plugins==0.4.2 | ||||
| mdurl==0.1.2 | mdurl==0.1.2 | ||||
| myst-parser==4.0.0 | |||||
| myst-parser==4.0.1 | |||||
| packaging==24.2 | packaging==24.2 | ||||
| Pygments==2.19.1 | Pygments==2.19.1 | ||||
| PyYAML==6.0.2 | PyYAML==6.0.2 | ||||
| @@ -28,7 +28,7 @@ | |||||
| version: v10008-0 | version: v10008-0 | ||||
| name: jitsi | name: jitsi | ||||
| - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git | - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-ntfy.git | ||||
| version: v2.11.0-0 | |||||
| version: v2.11.0-1 | |||||
| name: ntfy | name: ntfy | ||||
| - src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git | - src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git | ||||
| version: 201c939eed363de269a83ba29784fc3244846048 | version: 201c939eed363de269a83ba29784fc3244846048 | ||||
| @@ -28,7 +28,7 @@ plugin_directories: | |||||
| # Configuration for storing plugin databases | # Configuration for storing plugin databases | ||||
| plugin_databases: | plugin_databases: | ||||
| # Some plugins still require sqlite, so configure a path here. | # Some plugins still require sqlite, so configure a path here. | ||||
| # postgres will be used if supported. | |||||
| # Postgres will be used if supported. | |||||
| sqlite: /data/dbs | sqlite: /data/dbs | ||||
| postgres: default | postgres: default | ||||
| @@ -108,7 +108,7 @@ matrix_mx_puppet_slack_login_shared_secret: '' | |||||
| matrix_mx_puppet_slack_presence_enabled: true | matrix_mx_puppet_slack_presence_enabled: true | ||||
| matrix_mx_puppet_slack_presence_interval: 5000 | matrix_mx_puppet_slack_presence_interval: 5000 | ||||
| # Database configuration, role uses 'sqlite' per default but playbook sets up postgres by default | |||||
| # Database configuration, role uses 'sqlite' per default but playbook sets up Postgres by default | |||||
| matrix_mx_puppet_slack_database_engine: sqlite | matrix_mx_puppet_slack_database_engine: sqlite | ||||
| matrix_mx_puppet_slack_sqlite_database_path_local: "{{ matrix_mx_puppet_slack_data_path }}/database.db" | matrix_mx_puppet_slack_sqlite_database_path_local: "{{ matrix_mx_puppet_slack_data_path }}/database.db" | ||||
| @@ -8,11 +8,11 @@ matrix_synapse_auto_compressor_enabled: true | |||||
| # renovate: datasource=docker depName=registry.gitlab.com/etke.cc/rust-synapse-compress-state | # renovate: datasource=docker depName=registry.gitlab.com/etke.cc/rust-synapse-compress-state | ||||
| matrix_synapse_auto_compressor_version: v0.1.4 | matrix_synapse_auto_compressor_version: v0.1.4 | ||||
| # note: UID/GID better to match the UID/GID of the postgres container, but it doesn't really matter, as volumes are not used here | |||||
| # note: UID/GID better to match the UID/GID of the Postgres container, but it doesn't really matter, as volumes are not used here | |||||
| matrix_synapse_auto_compressor_uid: '' | matrix_synapse_auto_compressor_uid: '' | ||||
| matrix_synapse_auto_compressor_gid: '' | matrix_synapse_auto_compressor_gid: '' | ||||
| # note: the postgres image version doesn't matter, as it is used for a SQL script that doesn't use any specific features | |||||
| # note: the Postgres image version doesn't matter, as it is used for a SQL script that doesn't use any specific features | |||||
| matrix_synapse_auto_compressor_postgres_image: "postgres" | matrix_synapse_auto_compressor_postgres_image: "postgres" | ||||
| matrix_synapse_auto_compressor_base_path: "{{ matrix_base_data_path }}/synapse-auto-compressor" | matrix_synapse_auto_compressor_base_path: "{{ matrix_base_data_path }}/synapse-auto-compressor" | ||||
| @@ -837,7 +837,7 @@ caches: | |||||
| # before reconnecting. Defaults to 0, which means no limit. | # before reconnecting. Defaults to 0, which means no limit. | ||||
| # | # | ||||
| # 'allow_unsafe_locale' is an option specific to Postgres. Under the default behavior, Synapse will refuse to | # 'allow_unsafe_locale' is an option specific to Postgres. Under the default behavior, Synapse will refuse to | ||||
| # start if the postgres db is set to a non-C locale. You can override this behavior (which is *not* recommended) | |||||
| # start if the Postgres db is set to a non-C locale. You can override this behavior (which is *not* recommended) | |||||
| # by setting 'allow_unsafe_locale' to true. Note that doing so may corrupt your database. You can find more information | # by setting 'allow_unsafe_locale' to true. Note that doing so may corrupt your database. You can find more information | ||||
| # here: https://matrix-org.github.io/synapse/latest/postgres.html#fixing-incorrect-collate-or-ctype and here: | # here: https://matrix-org.github.io/synapse/latest/postgres.html#fixing-incorrect-collate-or-ctype and here: | ||||
| # https://wiki.postgresql.org/wiki/Locale_data_changes | # https://wiki.postgresql.org/wiki/Locale_data_changes | ||||
| @@ -423,7 +423,7 @@ | |||||
| - name: (Deprecation) Catch and report devture_postgres variables | - name: (Deprecation) Catch and report devture_postgres variables | ||||
| ansible.builtin.fail: | ansible.builtin.fail: | ||||
| msg: |- | msg: |- | ||||
| The postgres role in the playbook now lives under the MASH organization (https://github.com/mother-of-all-self-hosting/ansible-role-postgres). | |||||
| The Postgres role in the playbook now lives under the MASH organization (https://github.com/mother-of-all-self-hosting/ansible-role-postgres). | |||||
| The new role is pretty much the same, but uses differently named variables. | The new role is pretty much the same, but uses differently named variables. | ||||
| Please change your configuration (vars.yml) to rename all `devture_postgres_`-prefixed variables (`devture_postgres_*` -> `postgres_*`). | Please change your configuration (vars.yml) to rename all `devture_postgres_`-prefixed variables (`devture_postgres_*` -> `postgres_*`). | ||||