The strings "yml" were replaced with "yaml" as the latter is used more than the former. Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>pull/3832/head
| @@ -2800,7 +2800,7 @@ You can now customize the server name string that Riot-web displays in its login | |||||
| These playbook variables, with these default values, have been added: | These playbook variables, with these default values, have been added: | ||||
| ``` | |||||
| ```yaml | |||||
| matrix_riot_web_default_server_name: "{{ matrix_domain }}" | matrix_riot_web_default_server_name: "{{ matrix_domain }}" | ||||
| ``` | ``` | ||||
| @@ -2828,7 +2828,7 @@ Still, we might become affected in the future. In any case, it's imminent that S | |||||
| To avoid future problems, we recommend that you run the following command: | To avoid future problems, we recommend that you run the following command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=upgrade-postgres --extra-vars='{"postgres_force_upgrade": true}' | ansible-playbook -i inventory/hosts setup.yml --tags=upgrade-postgres --extra-vars='{"postgres_force_upgrade": true}' | ||||
| ``` | ``` | ||||
| @@ -3289,7 +3289,7 @@ The certificates from the Matrix domain will be used for the Coturn server. | |||||
| This feature is enabled by default for new installations. | This feature is enabled by default for new installations. | ||||
| To make use of TLS support for your existing Matrix server's Coturn, make sure to rebuild both Coturn and Synapse: | To make use of TLS support for your existing Matrix server's Coturn, make sure to rebuild both Coturn and Synapse: | ||||
| ```bash | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-coturn,setup-synapse,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-coturn,setup-synapse,start | ||||
| ``` | ``` | ||||
| @@ -3628,7 +3628,7 @@ The playbook now allows you to set the log levels used by Synapse. The default l | |||||
| You can now override following variables with any of the supported log levels listed here: https://docs.python.org/3/library/logging.html#logging-levels | You can now override following variables with any of the supported log levels listed here: https://docs.python.org/3/library/logging.html#logging-levels | ||||
| ``` | |||||
| ```yaml | |||||
| matrix_synapse_log_level: "INFO" | matrix_synapse_log_level: "INFO" | ||||
| matrix_synapse_storage_sql_log_level: "INFO" | matrix_synapse_storage_sql_log_level: "INFO" | ||||
| matrix_synapse_root_log_level: "INFO" | matrix_synapse_root_log_level: "INFO" | ||||
| @@ -3641,7 +3641,7 @@ matrix_synapse_root_log_level: "INFO" | |||||
| You can now customize some parts of Riot's `config.json`. These playbook variables, with these default values, have been added: | You can now customize some parts of Riot's `config.json`. These playbook variables, with these default values, have been added: | ||||
| ``` | |||||
| ```yaml | |||||
| matrix_riot_web_disable_custom_urls: true | matrix_riot_web_disable_custom_urls: true | ||||
| matrix_riot_web_disable_guests: true | matrix_riot_web_disable_guests: true | ||||
| matrix_riot_web_integrations_ui_url: "https://scalar.vector.im/" | matrix_riot_web_integrations_ui_url: "https://scalar.vector.im/" | ||||
| @@ -3652,7 +3652,7 @@ matrix_riot_web_integrations_jitsi_widget_url: "https://scalar.vector.im/api/wid | |||||
| This now allows you use a custom integration manager like [Dimension](https://dimension.t2bot.io). For example, if you wish to use the Dimension instance hosted at dimension.t2bot.io, you can set the following in your vars.yml file: | This now allows you use a custom integration manager like [Dimension](https://dimension.t2bot.io). For example, if you wish to use the Dimension instance hosted at dimension.t2bot.io, you can set the following in your vars.yml file: | ||||
| ``` | |||||
| ```yaml | |||||
| matrix_riot_web_integrations_ui_url: "https://dimension.t2bot.io/riot" | matrix_riot_web_integrations_ui_url: "https://dimension.t2bot.io/riot" | ||||
| matrix_riot_web_integrations_rest_url: "https://dimension.t2bot.io/api/v1/scalar" | matrix_riot_web_integrations_rest_url: "https://dimension.t2bot.io/api/v1/scalar" | ||||
| matrix_riot_web_integrations_widgets_urls: "https://dimension.t2bot.io/widgets" | matrix_riot_web_integrations_widgets_urls: "https://dimension.t2bot.io/widgets" | ||||
| @@ -55,7 +55,7 @@ Alternatively, you can leave your `inventory/hosts` as is and specify the connec | |||||
| Run this from the playbook's directory: | Run this from the playbook's directory: | ||||
| ```bash | |||||
| ```sh | |||||
| docker run -it --rm \ | docker run -it --rm \ | ||||
| --privileged \ | --privileged \ | ||||
| --pid=host \ | --pid=host \ | ||||
| @@ -76,7 +76,7 @@ Finally, you can execute `ansible-playbook ...` (or `ansible-playbook --connecti | |||||
| Run this from the playbook's directory: | Run this from the playbook's directory: | ||||
| ```bash | |||||
| ```sh | |||||
| docker run -it --rm \ | docker run -it --rm \ | ||||
| -w /work \ | -w /work \ | ||||
| -v `pwd`:/work \ | -v `pwd`:/work \ | ||||
| @@ -99,7 +99,7 @@ Finally, you execute `ansible-playbook ...` commands as per normal now. | |||||
| If you don't use SSH keys for authentication, simply remove that whole line (`-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro`). | If you don't use SSH keys for authentication, simply remove that whole line (`-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa:ro`). | ||||
| To authenticate at your server using a password, you need to add a package. So, when you are in the shell of the ansible docker container (the previously used `docker run -it ...` command), run: | To authenticate at your server using a password, you need to add a package. So, when you are in the shell of the ansible docker container (the previously used `docker run -it ...` command), run: | ||||
| ```bash | |||||
| ```sh | |||||
| apk add sshpass | apk add sshpass | ||||
| ``` | ``` | ||||
| Then, to be asked for the password whenever running an `ansible-playbook` command add `--ask-pass` to the arguments of the command. | Then, to be asked for the password whenever running an `ansible-playbook` command add `--ask-pass` to the arguments of the command. | ||||
| @@ -51,7 +51,7 @@ matrix_appservice_draupnir_for_all_master_control_room_alias: "ALIAS_FROM_STEP_2 | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -18,7 +18,7 @@ By default, if you're using the integrated Postgres database server (as opposed | |||||
| 2. Create a new SSH key: | 2. Create a new SSH key: | ||||
| ```bash | |||||
| ```sh | |||||
| ssh-keygen -t ed25519 -N '' -f matrix-borg-backup -C matrix | ssh-keygen -t ed25519 -N '' -f matrix-borg-backup -C matrix | ||||
| ``` | ``` | ||||
| @@ -28,7 +28,7 @@ By default, if you're using the integrated Postgres database server (as opposed | |||||
| If you plan to use a hosted solution, follow their instructions. If you have your own server, copy the key over: | If you plan to use a hosted solution, follow their instructions. If you have your own server, copy the key over: | ||||
| ```bash | |||||
| ```sh | |||||
| # example to append the new PUBKEY contents, where: | # example to append the new PUBKEY contents, where: | ||||
| # PUBKEY is path to the public key, | # PUBKEY is path to the public key, | ||||
| # USER is a ssh user on a provider / server | # USER is a ssh user on a provider / server | ||||
| @@ -73,7 +73,7 @@ Check the [backup_borg role](https://github.com/mother-of-all-self-hosting/ansib | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -16,7 +16,7 @@ Choose a strong password for the bot. You can generate a good password with a co | |||||
| You can use the playbook to [register a new user](registering-users.md): | You can use the playbook to [register a new user](registering-users.md): | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.chatgpt password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.chatgpt password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ||||
| ``` | ``` | ||||
| @@ -19,7 +19,7 @@ Choose a strong password for the bot. You can generate a good password with a co | |||||
| You can use the playbook to [register a new user](registering-users.md): | You can use the playbook to [register a new user](registering-users.md): | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.draupnir password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.draupnir password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ||||
| ``` | ``` | ||||
| @@ -117,7 +117,7 @@ That is all you need to do due to that Draupnir can complete migration on its ow | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -19,7 +19,7 @@ Choose a strong password for the bot. You can generate a good password with a co | |||||
| You can use the playbook to [register a new user](registering-users.md): | You can use the playbook to [register a new user](registering-users.md): | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.go-neb password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.go-neb password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ||||
| ``` | ``` | ||||
| @@ -221,7 +221,7 @@ If you've decided to reuse the `matrix.` domain, you won't need to do any extra | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -46,6 +46,6 @@ If you have any questions, or if you need help setting it up, read the [troublsh | |||||
| To clean the cache (session & encryption data) after you changed the bot's username, changed the login method from access_token to password etc... you can use: | To clean the cache (session & encryption data) after you changed the bot's username, changed the login method from access_token to password etc... you can use: | ||||
| ```bash | |||||
| ```sh | |||||
| just run-tags bot-matrix-registration-bot-clean-cache | just run-tags bot-matrix-registration-bot-clean-cache | ||||
| ``` | ``` | ||||
| @@ -15,7 +15,7 @@ Choose a strong password for the bot. You can generate a good password with a co | |||||
| You can use the playbook to [register a new user](registering-users.md): | You can use the playbook to [register a new user](registering-users.md): | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.mjolnir password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=bot.mjolnir password=PASSWORD_FOR_THE_BOT admin=no' --tags=register-user | ||||
| ``` | ``` | ||||
| @@ -119,7 +119,7 @@ matrix_synapse_ext_spam_checker_mjolnir_antispam_config_ban_lists: [] | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -21,7 +21,7 @@ You may optionally wish to add some [Additional configuration](#additional-confi | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -29,7 +29,7 @@ You may optionally wish to add some [Additional configuration](#additional-confi | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -97,7 +97,7 @@ The easiest way to do this may be to use [sshuttle](https://sshuttle.readthedocs | |||||
| Example command for proxying your traffic through the Matrix server: | Example command for proxying your traffic through the Matrix server: | ||||
| ``` | |||||
| ```sh | |||||
| sshuttle -r root@matrix.example.com:22 0/0 | sshuttle -r root@matrix.example.com:22 0/0 | ||||
| ``` | ``` | ||||
| @@ -32,7 +32,7 @@ You may optionally wish to add some [Additional configuration](#additional-confi | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -25,7 +25,7 @@ matrix_mx_puppet_slack_oauth_client_secret: "<SLACK_APP_CLIENT_SECRET>" | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -71,7 +71,7 @@ By default, you will need to create a CNAME record for `dimension`. See [Configu | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -57,7 +57,7 @@ Why? This change could be useful for people running small Synapse instances on s | |||||
| The following changes in the configuration file (`inventory/host_vars/matrix.example.com/vars.yml`) will allow this and make it possible to proxy the federation through a CDN such as CloudFlare or any other: | The following changes in the configuration file (`inventory/host_vars/matrix.example.com/vars.yml`) will allow this and make it possible to proxy the federation through a CDN such as CloudFlare or any other: | ||||
| ``` | |||||
| ```yaml | |||||
| matrix_synapse_http_listener_resource_names: ["client","federation"] | matrix_synapse_http_listener_resource_names: ["client","federation"] | ||||
| # Any port can be used but in this case we use 443 | # Any port can be used but in this case we use 443 | ||||
| matrix_federation_public_port: 443 | matrix_federation_public_port: 443 | ||||
| @@ -271,7 +271,7 @@ jitsi_disable_gravatar: false | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -54,7 +54,7 @@ If you've decided to use the default hostname, you won't need to do any extra DN | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -72,7 +72,7 @@ We make the most common APIs easy to use via the playbook (see below). | |||||
| To **create a new user registration token (link)**, use this command: | To **create a new user registration token (link)**, use this command: | ||||
| ```bash | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml \ | ansible-playbook -i inventory/hosts setup.yml \ | ||||
| --tags=generate-matrix-registration-token \ | --tags=generate-matrix-registration-token \ | ||||
| --extra-vars="one_time=yes ex_date=2021-12-31" | --extra-vars="one_time=yes ex_date=2021-12-31" | ||||
| @@ -87,7 +87,7 @@ Share the unique registration link (generated by the command above) with users t | |||||
| To **list the existing user registration tokens**, use this command: | To **list the existing user registration tokens**, use this command: | ||||
| ```bash | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml \ | ansible-playbook -i inventory/hosts setup.yml \ | ||||
| --tags=list-matrix-registration-tokens | --tags=list-matrix-registration-tokens | ||||
| ``` | ``` | ||||
| @@ -52,7 +52,7 @@ By default, you will need to create a CNAME record for `ntfy`. See [Configuring | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -31,6 +31,6 @@ Refer to the table below for additional configuration variables and their defaul | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -53,7 +53,7 @@ If you've decided to reuse the `matrix.` domain, you won't need to do any extra | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -79,7 +79,7 @@ If you've decided to reuse the `matrix.` domain, you won't need to do any extra | |||||
| After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | After configuring the playbook and potentially [adjusting your DNS records](#adjusting-dns-records), run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -20,7 +20,7 @@ matrix_synapse_auto_compressor_enabled: true | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -92,7 +92,7 @@ This will instruct UVS to verify the OpenID token against any domain given in a | |||||
| After these variables have been set, run the [installation](installing.md) command to restart UVS: | After these variables have been set, run the [installation](installing.md) command to restart UVS: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-matrix-user-verification-service,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-matrix-user-verification-service,start | ||||
| ``` | ``` | ||||
| @@ -267,7 +267,7 @@ matrix_server_fqn_etherpad: "etherpad.example.com" | |||||
| After configuring the playbook, run the [installation](installing.md) command: | After configuring the playbook, run the [installation](installing.md) command: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,start | ||||
| ``` | ``` | ||||
| @@ -19,7 +19,7 @@ We recommend using the [git](https://git-scm.com/) tool to get the playbook's so | |||||
| Once you've installed git on your computer, you can go to any directory of your choosing and run the following command to retrieve the playbook's source code: | Once you've installed git on your computer, you can go to any directory of your choosing and run the following command to retrieve the playbook's source code: | ||||
| ```bash | |||||
| ```sh | |||||
| git clone https://github.com/spantaleev/matrix-docker-ansible-deploy.git | git clone https://github.com/spantaleev/matrix-docker-ansible-deploy.git | ||||
| ``` | ``` | ||||
| @@ -94,7 +94,7 @@ Once the database is clear and the ownership of the tables has been fixed in the | |||||
| Check, if `--dbname` is set to `synapse` (not `matrix`) and replace paths (or even better, copy this line from your terminal) | Check, if `--dbname` is set to `synapse` (not `matrix`) and replace paths (or even better, copy this line from your terminal) | ||||
| ``` | |||||
| ```sh | |||||
| /usr/bin/env docker run --rm --name matrix-postgres-import --log-driver=none --user=998:1001 --cap-drop=ALL --network=matrix --env-file=/matrix/postgres/env-postgres-psql --mount type=bind,src=/migration/synapse_dump.sql,dst=/synapse_dump.sql,ro --entrypoint=/bin/sh docker.io/postgres:15.0-alpine -c "cat /synapse_dump.sql | grep -vE '^(CREATE|ALTER) ROLE (matrix)(;| WITH)' | grep -vE '^CREATE DATABASE (matrix)\s' | psql -v ON_ERROR_STOP=1 -h matrix-postgres --dbname=synapse" | /usr/bin/env docker run --rm --name matrix-postgres-import --log-driver=none --user=998:1001 --cap-drop=ALL --network=matrix --env-file=/matrix/postgres/env-postgres-psql --mount type=bind,src=/migration/synapse_dump.sql,dst=/synapse_dump.sql,ro --entrypoint=/bin/sh docker.io/postgres:15.0-alpine -c "cat /synapse_dump.sql | grep -vE '^(CREATE|ALTER) ROLE (matrix)(;| WITH)' | grep -vE '^CREATE DATABASE (matrix)\s' | psql -v ON_ERROR_STOP=1 -h matrix-postgres --dbname=synapse" | ||||
| ``` | ``` | ||||
| @@ -3,7 +3,7 @@ | |||||
| ## How to see the current status of your services | ## How to see the current status of your services | ||||
| You can check the status of your services by using `systemctl status`. Example: | You can check the status of your services by using `systemctl status`. Example: | ||||
| ``` | |||||
| ```sh | |||||
| sudo systemctl status matrix-synapse | sudo systemctl status matrix-synapse | ||||
| ● matrix-synapse.service - Synapse server | ● matrix-synapse.service - Synapse server | ||||
| @@ -41,7 +41,7 @@ Re-run the playbook after making these configuration changes. | |||||
| ## Remove unused Docker data | ## Remove unused Docker data | ||||
| You can free some disk space from Docker, see [docker system prune](https://docs.docker.com/engine/reference/commandline/system_prune/) for more information. | You can free some disk space from Docker, see [docker system prune](https://docs.docker.com/engine/reference/commandline/system_prune/) for more information. | ||||
| ```bash | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=run-docker-prune | ansible-playbook -i inventory/hosts setup.yml --tags=run-docker-prune | ||||
| ``` | ``` | ||||
| @@ -4,7 +4,7 @@ This playbook can perform a check to ensure that you've configured things correc | |||||
| To perform the check, run: | To perform the check, run: | ||||
| ```bash | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=self-check | ansible-playbook -i inventory/hosts setup.yml --tags=self-check | ||||
| ``` | ``` | ||||
| @@ -57,7 +57,7 @@ To automatically make Postgres database backups on a fixed schedule, see [Settin | |||||
| 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: | ||||
| ```bash | |||||
| ```sh | |||||
| /usr/bin/docker exec \ | /usr/bin/docker exec \ | ||||
| --env-file=/matrix/postgres/env-postgres-psql \ | --env-file=/matrix/postgres/env-postgres-psql \ | ||||
| matrix-postgres \ | matrix-postgres \ | ||||
| @@ -35,7 +35,7 @@ After deleting data, you may wish to run a [`FULL` Postgres `VACUUM`](./maintena | |||||
| To ask the playbook to run rust-synapse-compress-state, execute: | To ask the playbook to run rust-synapse-compress-state, execute: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --tags=rust-synapse-compress-state | ansible-playbook -i inventory/hosts setup.yml --tags=rust-synapse-compress-state | ||||
| ``` | ``` | ||||
| @@ -52,14 +52,14 @@ Editing the database manually is not recommended or supported by the Synapse dev | |||||
| First, set up an SSH tunnel to your Matrix server (skip if it is your local machine): | First, set up an SSH tunnel to your Matrix server (skip if it is your local machine): | ||||
| ``` | |||||
| ```sh | |||||
| # you may replace 1799 with an arbitrary port unbound on both machines | # you may replace 1799 with an arbitrary port unbound on both machines | ||||
| ssh -L 1799:localhost:1799 matrix.example.com | ssh -L 1799:localhost:1799 matrix.example.com | ||||
| ``` | ``` | ||||
| Then start up an ephemeral [adminer](https://www.adminer.org/) container on the Matrix server, connecting it to the `matrix` network and linking the postgresql container: | Then start up an ephemeral [adminer](https://www.adminer.org/) container on the Matrix server, connecting it to the `matrix` network and linking the postgresql container: | ||||
| ``` | |||||
| ```sh | |||||
| docker run --rm --publish 1799:8080 --link matrix-postgres --net matrix adminer | docker run --rm --publish 1799:8080 --link matrix-postgres --net matrix adminer | ||||
| ``` | ``` | ||||
| @@ -25,7 +25,7 @@ Below, we describe 2 ways to generate an access token for a user - using [Elemen | |||||
| You can use the following command to get an access token for your user directly from the [Matrix Client-Server API](https://www.matrix.org/docs/guides/client-server-api#login): | You can use the following command to get an access token for your user directly from the [Matrix Client-Server API](https://www.matrix.org/docs/guides/client-server-api#login): | ||||
| ``` | |||||
| ```sh | |||||
| curl -XPOST -d '{ | curl -XPOST -d '{ | ||||
| "identifier": { "type": "m.id.user", "user": "USERNAME" }, | "identifier": { "type": "m.id.user", "user": "USERNAME" }, | ||||
| "password": "PASSWORD", | "password": "PASSWORD", | ||||
| @@ -8,7 +8,7 @@ | |||||
| You can reset a user's password via the Ansible playbook: | You can reset a user's password via the Ansible playbook: | ||||
| ``` | |||||
| ```sh | |||||
| ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=USERNAME_HERE password=PASSWORD_HERE' --tags=update-user-password | ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=USERNAME_HERE password=PASSWORD_HERE' --tags=update-user-password | ||||
| ``` | ``` | ||||
| @@ -19,7 +19,7 @@ ansible-playbook -i inventory/hosts setup.yml --extra-vars='username=USERNAME_HE | |||||
| You can manually generate the password hash by using the command-line after **SSH**-ing to your server (requires that [all services have been started](installing.md#finalize-the-installation): | You can manually generate the password hash by using the command-line after **SSH**-ing to your server (requires that [all services have been started](installing.md#finalize-the-installation): | ||||
| ``` | |||||
| ```sh | |||||
| 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 | ||||
| ``` | ``` | ||||
| @@ -42,6 +42,6 @@ If you didn't make your account a server admin when you created it, you can lear | |||||
| ### Example: | ### Example: | ||||
| To set @user:example.com's password to `correct_horse_battery_staple` you could use this curl command: | To set @user:example.com's password to `correct_horse_battery_staple` you could use this curl command: | ||||
| ``` | |||||
| ```sh | |||||
| curl -XPOST -d '{ "new_password": "correct_horse_battery_staple" }' "https://matrix.example.com/_matrix/client/r0/admin/reset_password/@user:example.com?access_token=MDA...this_is_my_access_token | curl -XPOST -d '{ "new_password": "correct_horse_battery_staple" }' "https://matrix.example.com/_matrix/client/r0/admin/reset_password/@user:example.com?access_token=MDA...this_is_my_access_token | ||||
| ``` | ``` | ||||