diff --git a/CHANGELOG.md b/CHANGELOG.md index a49de417..5cf821f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,65 @@ +# 2023-02-26 + +## Traefik is the default reverse-proxy now + +**TLDR**: new installations will now default to Traefik as their reverse-proxy. Existing users need to explicitly choose their reverse-proxy type. [Switching to Traefik](#how-do-i-switch-my-existing-setup-to-traefik) is strongly encouraged. `matrix-nginx-proxy` may break over time and will ultimately be removed. + +As mentioned 2 weeks ago in [(Backward Compatibility) Reverse-proxy configuration changes and initial Traefik support](#backward-compatibility-reverse-proxy-configuration-changes-and-initial-traefik-support), the playbook is moving to Traefik as its default SSL-terminating reverse-proxy. + +Until now, we've been doing the migration gradually and keeping full backward compatibility. New installations were defaulting to `matrix-nginx-proxy` (just like before), while existing installations were allowed to remain on `matrix-nginx-proxy` as well. This makes things very difficult for us, because we need to maintain and think about lots of different setups: + +- Traefik managed by the playbook +- Traefik managed by the user in another way +- another reverse-proxy on the same host (`127.0.0.1` port exposure) +- another reverse-proxy on another host (`0.0.0.0` port exposure) +- `matrix-nginx-proxy` - an `nginx` container managed by the playbook +- `nginx` webserver operated by the user, running without a container on the same server + +Each change we do and each new feature that comes in needs to support all these different ways of reverse-proxying. Because `matrix-nginx-proxy` was the default and pretty much everyone was (and still is) using it, means that new PRs also come with `matrix-nginx-proxy` as their main focus and Traefik as an afterthought, which means we need to spend hours fixing up Traefik support. + +We can't spend all this time maintaining so many different configurations anymore. Traefik support has been an option for 2 weeks and lots of people have already migrated their server and have tested things out. Traefik is what we use and preferentially test for. + +It's time for the **next step in our migration process** to Traefik and elimination of `matrix-nginx-proxy`: + +- Traefik is now the default reverse-proxy for new installations +- All existing users need to explicitly choose their reverse-proxy type by defining the `matrix_playbook_reverse_proxy_type` variable in their `vars.yml` configuration file. We strongly encourage existing users to [switch the Traefik](#how-to-switch-an-existing-setup-to-traefik), as the nginx setup is bound to become more and more broken over time until it's ultimately removed + +### How do I switch my existing setup to Traefik? + +**For users who are on `matrix-nginx-proxy`** (the default reverse-proxy provided by the playbook), switching to Traefik can happen with a simple configuration change. Follow this section from 2 weeks ago: [How do I explicitly switch to Traefik right now?](#how-do-i-explicitly-switch-to-traefik-right-now). + +If you experience trouble: + +1. Follow [How do I remain on matrix-nginx-proxy?](#how-do-i-remain-on-matrix-nginx-proxy) to bring your server back online using the old reverse-proxy +2. Ask for help in our [support channels](README.md#support) +3. Try switching to Traefik again later + +**For users with a more special reverse-proxying setup** (another nginx server, Apache, Caddy, etc.), the migration may not be so smooth. Follow the [Using your own webserver](docs/configuring-playbook-own-webserver.md) guide. Ideally, your custom reverse-proxy will be configured in such a way that it **fronts the Traefik reverse-proxy** provided by the playbook. Other means of reverse-proxying are more fragile and may be deprecated in the future. + +### I already use my own Traefik server. How do I plug that in? + +See the [Traefik managed by the playbook](docs/configuring-playbook-own-webserver.md#traefik-managed-by-the-playbook) section. + +### Why is matrix-nginx-proxy used even after switching to Traefik? + +This playbook manages many different services. All these services were initially integrated with `matrix-nginx-proxy`. + +While we migrate all these components to have native Traefik support, some still go through nginx internally (Traefik -> local `matrix-nginx-proxy` -> component). +As time goes on, internal reliance on `matrix-nginx-proxy` will gradually decrease until it's completely removed. + +### How do I remain on matrix-nginx-proxy? + +Most new work and testing targets Traefik, so remaining on nginx is **not** "the good old stable" option, but rather the "still available, but largely untested and likely to be broken very soon" option. + +To proceed regardless of this warning, add `matrix_playbook_reverse_proxy_type: playbook-managed-nginx` to your configuration. + +At some point in the **near** future (days, or even weeks at most), we hope to completely get rid of `matrix-nginx-proxy` (or break it enough to make it unusable), so you **will soon be forced to migrate** anyway. Plan your migration accordingly. + +### How do I keep using my own other reverse-proxy? + +We recommend that you follow the guide for [Fronting the integraed reverse-proxy webserver with another reverse-proxy](docs/configuring-playbook-own-webserver.md#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy). + + # 2023-02-25 ## Rageshake support diff --git a/README.md b/README.md index f57db148..dd446725 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,9 @@ Services that run on the server to make the various parts of your installation w | ---- | -------- | ----------- | ------------- | | [PostgreSQL](https://www.postgresql.org/)| ✓ | Database for Synapse. [Using an external PostgreSQL server](docs/configuring-playbook-external-postgres.md) is also possible. | [Link](docs/configuring-playbook-external-postgres.md) | | [Coturn](https://github.com/coturn/coturn) | ✓ | STUN/TURN server for WebRTC audio/video calls | [Link](docs/configuring-playbook-turn.md) | -| [nginx](http://nginx.org/) | ✓ | Web server, listening on ports 80 and 443 - standing in front of all the other services. Using your own webserver [is possible](docs/configuring-playbook-own-webserver.md) | [Link](docs/configuring-playbook-nginx.md) | -| [Let's Encrypt](https://letsencrypt.org/) | ✓ | Free SSL certificate, which secures the connection to the Synapse server and the Element web UI | [Link](docs/configuring-playbook-ssl-certificates.md) | +| [Traefik](https://doc.traefik.io/traefik/) | ✓ | Web server, listening on ports 80, 443 and 8448 - standing in front of all the other services. Using your own webserver [is possible](docs/configuring-playbook-own-webserver.md) | [Link](docs/configuring-playbook-traefik.md) | +| [nginx](http://nginx.org/) | x | (Deprecated) Web server, listening on ports 80, 443 and 8448 - standing in front of all the other services. Deprecated in favor of Traefik | [Link](docs/configuring-playbook-nginx.md) | +| [Let's Encrypt](https://letsencrypt.org/) | ✓ | Free SSL certificate, which secures the connection to all components | [Link](docs/configuring-playbook-ssl-certificates.md) | | [ma1sd](https://github.com/ma1uta/ma1sd) | x | Matrix Identity Server | [Link](docs/configuring-playbook-ma1sd.md) | [Exim](https://www.exim.org/) | ✓ | Mail server, through which all Matrix services send outgoing email (can be configured to relay through another SMTP server) | [Link](docs/configuring-playbook-email.md) | | [Dimension](https://github.com/turt2live/matrix-dimension) | x | An open source integrations manager for matrix clients | [Link](docs/configuring-playbook-dimension.md) | diff --git a/docs/configuring-playbook-nginx.md b/docs/configuring-playbook-nginx.md index 96f854d0..43cff4a8 100644 --- a/docs/configuring-playbook-nginx.md +++ b/docs/configuring-playbook-nginx.md @@ -1,7 +1,6 @@ # Configure Nginx (optional, advanced) -By default, this playbook installs its own nginx webserver (in a Docker container) which listens on ports 80 and 443. -If that's alright, you can skip this. +**Note**: the playbook is [in the process of moving to Traefik](../CHANGELOG.md#reverse-proxy-configuration-changes-and-initial-traefik-support). Traefik is already the default reverse-proxy for new installations and existing users are also strongly encouraged to switch to Traefik. As such, this **nginx documentation below may be incomplete or misleading**. ## Using Nginx status diff --git a/docs/configuring-playbook-own-webserver.md b/docs/configuring-playbook-own-webserver.md index 22170f40..3b9d822d 100644 --- a/docs/configuring-playbook-own-webserver.md +++ b/docs/configuring-playbook-own-webserver.md @@ -1,4 +1,4 @@ -# Using your own webserver, instead of this playbook's nginx proxy (optional, advanced) +# Using your own webserver, instead of this playbook's Traefik reverse-proxy (optional, advanced) **Note**: the playbook is [in the process of moving to Traefik](../CHANGELOG.md#reverse-proxy-configuration-changes-and-initial-traefik-support). The **documentation below may be incomplete or misleading**. @@ -117,17 +117,36 @@ There are 2 ways to go about it: This method is about leaving the integrated reverse-proxy webserver be, but making it not get in the way (using up important ports, trying to retrieve SSL certificates, etc.). -If you wish to use another webserver, the integrated nginx reverse-proxy webserver usually gets in the way because it attempts to fetch SSL certificates and binds to ports 80, 443 and 8448 (if Matrix Federation is enabled). +If you wish to use another webserver, the integrated reverse-proxy webserver usually gets in the way because it attempts to fetch SSL certificates and binds to ports 80, 443 and 8448 (if Matrix Federation is enabled). You can disable such behavior and make the integrated reverse-proxy webserver only serve traffic locally (or over a local network). This is the recommended way for using another reverse-proxy, because the integrated one would act as a black box and wire all Matrix services correctly. You would only need to reverse-proxy a few individual domains and ports over to it. -**For `matrix-nginx-proxy`** fronted by another reverse-proxy, you would need some configuration like this: +**For Traefik** fronted by another reverse-proxy, you would need some configuration like this: ```yaml -# playbook-managed-proxy is the default right now, so we can keep this commented out. -# matrix_playbook_reverse_proxy_type: playbook-managed-nginx +matrix_playbook_reverse_proxy_type: playbook-managed-traefik + +# Ensure that public urls use https +matrix_playbook_ssl_enabled: true + +# Disable the web-secure (port 443) endpoint, which also disables SSL certificate retrieval +devture_traefik_config_entrypoint_web_secure_enabled: false + +devture_traefik_container_web_host_bind_port: '127.0.0.1:81' + +devture_traefik_additional_entrypoints_auto: + - name: matrix-federation + port: "{{ matrix_federation_public_port }}" + host_bind_port: "127.0.0.1:{{ matrix_federation_public_port }}" + config: {} +``` + +(Deprecated) **For `matrix-nginx-proxy`** fronted by another reverse-proxy, you would need some configuration like this: + +```yaml +matrix_playbook_reverse_proxy_type: playbook-managed-nginx # Ensure that public urls use https matrix_playbook_ssl_enabled: true @@ -150,28 +169,9 @@ matrix_nginx_proxy_container_http_host_bind_port: '127.0.0.1:81' matrix_nginx_proxy_container_federation_host_bind_port: '127.0.0.1:8449' ``` -**For Traefik** fronted by another reverse-proxy, you would need some configuration like this: - -```yaml -matrix_playbook_reverse_proxy_type: playbook-managed-traefik - -# Ensure that public urls use https -matrix_playbook_ssl_enabled: true - -# Disable the web-secure (port 443) endpoint, which also disables SSL certificate retrieval -devture_traefik_config_entrypoint_web_secure_enabled: false - -devture_traefik_container_web_host_bind_port: '127.0.0.1:81' - -devture_traefik_additional_entrypoints_auto: - - name: matrix-federation - port: "{{ matrix_federation_public_port }}" - host_bind_port: "127.0.0.1:{{ matrix_federation_public_port }}" - config: {} -``` - If you'll be fronting with a reverse-proxy that lives on another machine (not on the same one as Matrix), you need to replace `127.0.0.1` in the above configurations with `0.0.0.0` or another network interface. + ### Using no reverse-proxy on the Matrix side at all Instead of [Fronting the integrated reverse-proxy webserver with another reverse-proxy](#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy), you can also go another way -- completely disabling the playbook-managed reverse-proxy. You would then need to reverse-proxy from your own webserver directly to Matrix services. @@ -182,6 +182,8 @@ If your webserver is on the same machine, sure your web server user (something l #### Using your own nginx reverse-proxy running on the same machine +**WARNING**: this type of setup is not maintained and will be removed in the future. We recommend that you go for [Fronting the integrated reverse-proxy webserver with another reverse-proxy](#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy) instead. + If you'll be using `nginx` running on the same machine (not in a container), you can make the playbook help you generate configuration for `nginx` with this configuration: ```yaml @@ -202,6 +204,8 @@ You can most likely directly use the config files installed by this playbook at: #### Using your own reverse-proxy running on the same machine or elsewhere +**WARNING**: this is difficult to set up, likely not very well supported and will be removed in the future. We recommend that you go for [Fronting the integrated reverse-proxy webserver with another reverse-proxy](#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy) instead. + To reverse-proxy manually for each service, use configuration like this: ```yaml diff --git a/docs/configuring-playbook-ssl-certificates.md b/docs/configuring-playbook-ssl-certificates.md index 606160da..60d5b135 100644 --- a/docs/configuring-playbook-ssl-certificates.md +++ b/docs/configuring-playbook-ssl-certificates.md @@ -1,112 +1,34 @@ # Adjusting SSL certificate retrieval (optional, advanced) -By default, this playbook retrieves and auto-renews free SSL certificates from [Let's Encrypt](https://letsencrypt.org/) for the domains it needs (`matrix.` and possibly `element.`) +By default, this playbook retrieves and auto-renews free SSL certificates from [Let's Encrypt](https://letsencrypt.org/) for the domains it needs (e.g. `matrix.` and others) -Those certificates are used when configuring the nginx reverse proxy installed by this playbook. -They can also be used for configuring [your own webserver](configuring-playbook-own-webserver.md), in case you're not using the integrated nginx server provided by the playbook. +This guide is about using the integrated Traefik server and doesn't apply if you're using [your own webserver](configuring-playbook-own-webserver.md). -If you need to retrieve certificates for other domains (e.g. your base domain) or more control over certificate retrieval, read below. -Things discussed in this document: +## Using staging Let's Encrypt certificates instead of real ones -- [Using self-signed SSL certificates](#using-self-signed-ssl-certificates), if you can't use Let's Encrypt or just need a test setup +For testing purposes, you may wish to use staging certificates provide by Let's Encrypt. -- [Using your own SSL certificates](#using-your-own-ssl-certificates), if you don't want to or can't use Let's Encrypt certificates, but are still interested in using the integrated nginx reverse proxy server +You can do this with the following configuration: -- [Not bothering with SSL certificates](#not-bothering-with-ssl-certificates), if you're using [your own webserver](configuring-playbook-own-webserver.md) and would rather this playbook leaves SSL certificate management to you +```yaml +devture_traefik_config_certificatesResolvers_acme_use_staging: true +``` -- [Obtaining SSL certificates for additional domains](#obtaining-ssl-certificates-for-additional-domains), if you'd like to host additional domains on the Matrix server and would like the playbook to help you obtain and renew certificates for those domains automatically + +## Disabling SSL termination + +For testing or other purposes, you may wish to install services without SSL termination and have services exposed to `http://` instead of `https://`. + +You can do this with the following configuration: + +```yaml +devture_traefik_config_entrypoint_web_secure_enabled: false +``` ## Using self-signed SSL certificates -For private deployments (not publicly accessible from the internet), you may not be able to use Let's Encrypt certificates. +Using self-signed certificates with Traefik is a somewhat involved processes, where you need to manually mount the files into the container and adjust the "static" configuration to refer to them. -If self-signed certificates are alright with you, you can ask the playbook to generate such for you with the following configuration: - -```yaml -matrix_ssl_retrieval_method: self-signed -``` - -If you get a `Cannot reach homeserver` error in Element, you will have to visit `https://matrix.` in your browser and agree to the certificate exception before you can login. - - -## Using your own SSL certificates - -If you'd like to manage SSL certificates by yourself and have the playbook use your certificate files, you can use the following configuration: - -```yaml -matrix_ssl_retrieval_method: manually-managed -``` - -With such a configuration, the playbook would expect you to drop the SSL certificate files in the directory specified by `matrix_ssl_config_dir_path` (`/matrix/ssl/config` by default) obeying the following hierarchy: - -- `/live//fullchain.pem` -- `/live//privkey.pem` -- `/live//chain.pem` - -where `` refers to the domains that you need (usually `matrix.` and `element.`). - - -## Not bothering with SSL certificates - -If you're [using an external web server](configuring-playbook-own-webserver.md) which is not nginx, or you would otherwise want to manage its certificates without this playbook getting in the way, you can completely disable SSL certificate management with the following configuration: - -```yaml -matrix_ssl_retrieval_method: none -``` - -With such a configuration, no certificates will be retrieved at all. You're free to manage them however you want. - - -## Obtaining SSL certificates for additional domains - -The playbook tries to be smart about the certificates it will obtain for you. - -By default, it obtains certificates for: -- `matrix.` (`matrix_server_fqn_matrix`) -- possibly for `element.`, unless you have disabled the [Element client component](configuring-playbook-client-element.md) using `matrix_client_element_enabled: false` -- possibly for `riot.`, if you have explicitly enabled Riot to Element redirection (for background compatibility) using `matrix_nginx_proxy_proxy_riot_compat_redirect_enabled: true` -- possibly for `hydrogen.`, if you have explicitly [set up Hydrogen client](configuring-playbook-client-hydrogen.md). -- possibly for `cinny.`, if you have explicitly [set up Cinny client](configuring-playbook-client-cinny.md). -- possibly for `dimension.`, if you have explicitly [set up Dimension](configuring-playbook-dimension.md). -- possibly for `goneb.`, if you have explicitly [set up Go-NEB bot](configuring-playbook-bot-go-neb.md). -- possibly for `jitsi.`, if you have explicitly [set up Jitsi](configuring-playbook-jitsi.md). -- possibly for `stats.`, if you have explicitly [set up Grafana](configuring-playbook-prometheus-grafana.md). -- possibly for `sygnal.`, if you have explicitly [set up Sygnal](configuring-playbook-sygnal.md). -- possibly for `ntfy.`, if you have explicitly [set up ntfy](configuring-playbook-ntfy.md). -- possibly for your base domain (``), if you have explicitly configured [Serving the base domain](configuring-playbook-base-domain-serving.md) - -If you are hosting other domains on the Matrix machine, you can make the playbook obtain and renew certificates for those other domains too. -To do that, simply define your own custom configuration like this: - -```yaml -# In this example, we retrieve 2 extra certificates, -# one for the base domain (in the `matrix_domain` variable) and one for a hardcoded domain. -# Adding any other additional domains (hosted on the same machine) is possible. -matrix_ssl_additional_domains_to_obtain_certificates_for: - - '{{ matrix_domain }}' - - 'another.domain.example.com' -``` - -After redefining `matrix_ssl_domains_to_obtain_certificates_for`, to actually obtain certificates you should: - -- make sure the web server occupying port 80 is stopped. If you are using matrix-nginx-proxy server (which is the default for this playbook), you need to stop it temporarily by running `systemctl stop matrix-nginx-proxy` on the server. - -- re-run the SSL part of the playbook and restart all services: `ansible-playbook -i inventory/hosts setup.yml --tags=setup-ssl,start` - -The certificate files would be made available in `/matrix/ssl/config/live//...`. - -For automated certificate renewal to work, each port `80` vhost for each domain you are obtaining certificates for needs to forward requests for `/.well-known/acme-challenge` to the certbot container we use for renewal. - -See how this is configured for the `matrix.` subdomain in `/matrix/nginx-proxy/conf.d/matrix-domain.conf` -Don't be alarmed if the above configuration file says port `8080`, instead of port `80`. It's due to port mapping due to our use of containers. - - -## Specify the SSL private key algorithm - -If you'd like to [specify the private key type](https://eff-certbot.readthedocs.io/en/stable/using.html#using-ecdsa-keys) used with Let's Encrypt, define your own custom configuration like this: - -```yaml -matrix_ssl_lets_encrypt_key_type: ecdsa -``` +Feel free to research this approach on your own and improve this guide! diff --git a/docs/configuring-playbook-traefik.md b/docs/configuring-playbook-traefik.md new file mode 100644 index 00000000..4f6a7335 --- /dev/null +++ b/docs/configuring-playbook-traefik.md @@ -0,0 +1,48 @@ +# Configure Traefik (optional, advanced) + +By default, this playbook installs and manages a [Traefik](https://doc.traefik.io/traefik/) reverse-proxy server, powered by the [com.devture.ansible.role.traefik](https://github.com/devture/com.devture.ansible.role.traefik) Ansible role. + +This Ansible role support various configuration options. Feel free to consult its `default/main.yml` variables file. + + +## Adjusting SSL certificate retrieval + +See the dedicated [Adjusting SSL certificate retrieval](configuring-playbook-ssl-certificates.md) documentation page. + +## Increase logging verbosity + +```yaml +devture_traefik_config_log_level: DEBUG +``` + +## Disable access logs + +This will disable access logging. + +```yaml +devture_traefik_config_accessLog_enabled: false +``` + +## Enable Traefik Dashboard + +This will enable a Traefik [Dashboard](https://doc.traefik.io/traefik/operations/dashboard/) UI at `https://matrix.DOMAIN/dashboard/` (note the trailing `/`). + +```yaml +devture_traefik_dashboard_enabled: true +devture_traefik_dashboard_hostname: "{{ matrix_server_fqn_matrix }}" +devture_traefik_dashboard_basicauth_enabled: true +devture_traefik_dashboard_basicauth_user: YOUR_USERNAME_HERE +devture_traefik_dashboard_basicauth_password: YOUR_PASSWORD_HERE +``` + +## Additional configuration + +Use the `devture_traefik_configuration_extension_yaml` variable provided by the Traefik Ansible role to override or inject additional settings, even when no dedicated variable exists. + +```yaml +# This is a contrived example. +# You can enable and secure the Dashboard using dedicated variables. See above. +devture_traefik_configuration_extension_yaml: | + api: + dashboard: true +``` diff --git a/docs/configuring-playbook.md b/docs/configuring-playbook.md index c94977a2..b4bae786 100644 --- a/docs/configuring-playbook.md +++ b/docs/configuring-playbook.md @@ -59,9 +59,11 @@ When you're done with all the configuration you'd like to do, continue with [Ins - [Serving your base domain using this playbook's nginx server](configuring-playbook-base-domain-serving.md) (optional) -- [Configure Nginx](configuring-playbook-nginx.md) (optional, advanced) +- [Configure the Traefik reverse-proxy](configuring-playbook-traefik.md) (optional, advanced) -- [Using your own webserver, instead of this playbook's nginx proxy](configuring-playbook-own-webserver.md) (optional, advanced) +- (Deprecated) [Configure the Nginx reverse-proxy](configuring-playbook-nginx.md) (optional, advanced) + +- [Using your own webserver, instead of this playbook's default reverse-proxy](configuring-playbook-own-webserver.md) (optional, advanced) - [Adjusting TURN server configuration](configuring-playbook-turn.md) (optional, advanced) diff --git a/examples/vars.yml b/examples/vars.yml index 732d7eed..784bf061 100644 --- a/examples/vars.yml +++ b/examples/vars.yml @@ -21,6 +21,11 @@ matrix_homeserver_implementation: synapse # You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`). matrix_homeserver_generic_secret_key: '' +# By default, the playbook manages its own Traefik (https://doc.traefik.io/traefik/) reverse-proxy server. +# It will retrieve SSL certificates for you on-demand and forward requests to all other components. +# For alternatives, see `docs/configuring-playbook-own-webserver.md`. +matrix_playbook_reverse_proxy_type: playbook-managed-traefik + # This is something which is provided to Let's Encrypt when retrieving SSL certificates for domains. # # In case SSL renewal fails at some point, you'll also get an email notification there. @@ -29,7 +34,7 @@ matrix_homeserver_generic_secret_key: '' # you won't be required to define this variable (see `docs/configuring-playbook-ssl-certificates.md`). # # Example value: someone@example.com -matrix_ssl_lets_encrypt_support_email: '' +devture_traefik_config_certificatesResolvers_acme_email: '' # A Postgres password to use for the superuser Postgres user (called `matrix` by default). # diff --git a/roles/custom/matrix-base/defaults/main.yml b/roles/custom/matrix-base/defaults/main.yml index 0f2e3b48..403af983 100644 --- a/roles/custom/matrix-base/defaults/main.yml +++ b/roles/custom/matrix-base/defaults/main.yml @@ -319,7 +319,7 @@ matrix_homeserver_app_service_config_files_auto: [] # - no nginx configuration will be dumped in /matrix/nginx/conf.d # - no port exposure will be done for any of the container services # - it's up to you to expose the ports you want, etc. -matrix_playbook_reverse_proxy_type: playbook-managed-nginx +matrix_playbook_reverse_proxy_type: '' matrix_playbook_service_host_bind_interface_prefix: "{{ '' if matrix_playbook_reverse_proxy_type not in ['other-nginx-non-container', 'other-on-same-host', 'other-on-another-host'] else ('0.0.0.0:' if matrix_playbook_reverse_proxy_type == 'other-on-another-host' else '127.0.0.1:') }}" diff --git a/roles/custom/matrix-base/tasks/validate_config.yml b/roles/custom/matrix-base/tasks/validate_config.yml index ab06ffcd..c663ab2e 100644 --- a/roles/custom/matrix-base/tasks/validate_config.yml +++ b/roles/custom/matrix-base/tasks/validate_config.yml @@ -54,6 +54,14 @@ msg: "Detected that variable matrix_architecture {{ matrix_architecture }} appears to be set incorrectly. See docs/alternative-architectures.md. Server appears to be {{ ansible_architecture }}." when: matrix_architecture not in ['amd64', 'arm32', 'arm64'] +- name: Fail if matrix_playbook_reverse_proxy_type is set incorrectly + ansible.builtin.fail: + msg: | + You have not explicitly specified the type of reverse-proxy you'd like to use (with a `matrix_playbook_reverse_proxy_type` variable in your configuration). + The playbook used to default to nginx (matrix-nginx-proxy), but things are changing with Traefik being the new default reverse-proxy. + Learn more here: https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/CHANGELOG.md#traefik-is-the-default-reverse-proxy-now + when: matrix_playbook_reverse_proxy_type == '' + - name: Fail if matrix_playbook_reverse_proxy_type is set incorrectly ansible.builtin.fail: msg: "Detected that variable matrix_playbook_reverse_proxy_type (current value: `{{ matrix_playbook_reverse_proxy_type }}`) appears to be set incorrectly. See roles/custom/matrix-base/defaults/main.yml for valid choices."