diff --git a/defaults/main.yml b/defaults/main.yml index 8f3b00a..9e0dfc5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -40,7 +40,8 @@ matrix_conf_dir: "{{ matrix_base_dir }}/config" matrix_data_dir: "{{ matrix_base_dir }}/data" matrix_log_dir: "{{ matrix_base_dir }}/logs" -matrix_base_url: http://localhost +matrix_server_url: example.com +matrix_client_url: https://matrix.example.com matrix_http_bind_ips: - '::' diff --git a/tasks/install.yml b/tasks/install.yml index 50533d1..1cba920 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -41,9 +41,9 @@ when: matrix_ldap_auth_enabled - name: Create signing key - shell: "{{ matrix_base_dir }}/env/bin/python -c \"from signedjson import key; file = open('{{ matrix_conf_dir }}/{{ matrix_base_url | urlsplit('hostname') }}.signing.key','w'); key.write_signing_keys(file, [key.generate_signing_key('first')]); file.close()\"" + shell: "{{ matrix_base_dir }}/env/bin/python -c \"from signedjson import key; file = open('{{ matrix_conf_dir }}/{{ matrix_server_url | urlsplit('hostname') }}.signing.key','w'); key.write_signing_keys(file, [key.generate_signing_key('first')]); file.close()\"" args: - creates: "{{ matrix_conf_dir }}/{{ matrix_base_url | urlsplit('hostname') }}.signing.key" + creates: "{{ matrix_conf_dir }}/{{ matrix_server_url | urlsplit('hostname') }}.signing.key" notify: __matrix_restart - name: Deploy global config files diff --git a/templates/nginx/vhost.j2 b/templates/nginx/vhost.j2 index 90d1d2e..23d14f3 100644 --- a/templates/nginx/vhost.j2 +++ b/templates/nginx/vhost.j2 @@ -6,7 +6,7 @@ upstream backend_matrix { server { listen 80; - server_name {{ matrix_base_url | urlsplit('hostname') }}; + server_name {{ matrix_server_url | urlsplit('hostname') }}; client_max_body_size 200M; @@ -23,7 +23,7 @@ server { {% if matrix_nginx_tls_enabled %} server { listen 443 ssl; - server_name {{ matrix_base_url | urlsplit('hostname') }}; + server_name {{ matrix_server_url | urlsplit('hostname') }}; client_max_body_size 200M; diff --git a/templates/opt/matrix/config/homeserver.yml.j2 b/templates/opt/matrix/config/homeserver.yml.j2 index e6e65a7..02e75ee 100644 --- a/templates/opt/matrix/config/homeserver.yml.j2 +++ b/templates/opt/matrix/config/homeserver.yml.j2 @@ -50,7 +50,7 @@ tls_fingerprints: [] # This is used by remote servers to connect to this server, # e.g. matrix.org, localhost:8080, etc. # This is also the last part of your UserID. -server_name: "{{ matrix_base_url | urlsplit('hostname') }}" +server_name: "{{ matrix_server_url }}" # When running as a daemon, the file to store the pid in pid_file: /var/run/homeserver.pid @@ -546,7 +546,7 @@ form_secret: "5l51Jk51RyULKH4RbeYdnI5P^ROOOktfj-nWgK0i8JT_sd-CC." ## Signing Keys ## # Path to the signing key to sign messages with -signing_key_path: "{{ matrix_conf_dir }}/{{ matrix_base_url | urlsplit('hostname') }}.signing.key" +signing_key_path: "{{ matrix_conf_dir }}/{{ matrix_server_url }}.signing.key" # The keys that the server used to sign messages with but won't use # to sign new messages. E.g. it has lost its private key