Implemented draft for top domain as matrix identifier name

This commit is contained in:
Kevin Veen-Birkenbach 2024-01-19 11:52:08 +01:00
parent 849ed61d38
commit 0aebca62f6
9 changed files with 48 additions and 22 deletions

View File

@ -108,6 +108,8 @@ nginx_configuration_directory: "/etc/nginx/conf.d/"
nginx_servers_directory: "{{nginx_configuration_directory}}servers/" # Contains server blogs nginx_servers_directory: "{{nginx_configuration_directory}}servers/" # Contains server blogs
nginx_maps_directory: "{{nginx_configuration_directory}}maps/" # Contains mappins nginx_maps_directory: "{{nginx_configuration_directory}}maps/" # Contains mappins
nginx_upstreams_directory: "{{nginx_configuration_directory}}upstreams/" # Contains upstream configurations nginx_upstreams_directory: "{{nginx_configuration_directory}}upstreams/" # Contains upstream configurations
nginx_well_known_root: "/usr/share/nginx/well-known/" # Path where well-known files are stored
nginx_homepage_root: "/usr/share/nginx/homepage/" # Path where the static homepage files are stored
## Docker Applications ## Docker Applications

View File

@ -8,7 +8,18 @@
domain: "{{synapse_domain}}" domain: "{{synapse_domain}}"
http_port: "{{synapse_http_port}}" http_port: "{{synapse_http_port}}"
- name: configure {{synapse_domain}}.conf - name: create {{well_known_directory}}
file:
path: "{{well_known_directory}}"
state: directory
mode: '0755'
- name: create {{well_known_directory}}server
template:
src: "well-known.j2"
dest: "{{well_known_directory}}server"
- name: create {{synapse_domain}}.conf
template: template:
src: "templates/nginx.conf.j2" src: "templates/nginx.conf.j2"
dest: "{{nginx_servers_directory}}{{synapse_domain}}.conf" dest: "{{nginx_servers_directory}}{{synapse_domain}}.conf"
@ -17,12 +28,6 @@
http_port: "{{synapse_http_port}}" http_port: "{{synapse_http_port}}"
notify: restart nginx notify: restart nginx
#- name: "include tasks nginx-docker-proxy-domain.yml"
# include_tasks: nginx-docker-proxy-domain.yml
# vars:
# domain: "{{synapse_domain}}"
# http_port: "{{synapse_http_port}}"
- name: "include tasks nginx-docker-proxy-domain.yml for element" - name: "include tasks nginx-docker-proxy-domain.yml for element"
include_tasks: nginx-docker-proxy-domain.yml include_tasks: nginx-docker-proxy-domain.yml
vars: vars:

View File

@ -1,4 +1,4 @@
server_name: "{{domain_matrix_synapse}}" server_name: "{{top_domain}}"
pid_file: /data/homeserver.pid pid_file: /data/homeserver.pid
listeners: listeners:
- port: 8008 - port: 8008

View File

@ -0,0 +1,3 @@
{
"m.server": "{{synapse_domain}}:443"
}

View File

@ -3,6 +3,7 @@ docker_compose_project_name: "matrix"
database_password: "{{matrix_database_password}}" database_password: "{{matrix_database_password}}"
database_type: "postgres" database_type: "postgres"
registration_file_folder: "/data/registration/" registration_file_folder: "/data/registration/"
well_known_directory: "{{nginx_well_known_root}}/matrix/"
bridges: bridges:
- database_password: "{{ mautrix_whatsapp_bridge_database_password }}" - database_password: "{{ mautrix_whatsapp_bridge_database_password }}"

View File

@ -1,13 +1,4 @@
--- ---
- name: "include task certbot-matomo.yml"
include_tasks: certbot-matomo.yml
- name: configure {{domain}}.conf
template:
src: "homepage.nginx.conf.j2"
dest: "{{nginx_servers_directory}}{{domain}}.conf"
notify: restart nginx
- name: "pull homepage from {{nginx_homepage_repository_address}}" - name: "pull homepage from {{nginx_homepage_repository_address}}"
git: git:
repo: "{{nginx_homepage_repository_address}}" repo: "{{nginx_homepage_repository_address}}"

View File

@ -1 +0,0 @@
nginx_homepage_root: /usr/share/nginx/homepage

View File

@ -23,7 +23,25 @@
when: run_once_nginx is not defined when: run_once_nginx is not defined
- name: create nginx config file - name: create nginx config file
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf template:
src: nginx.conf.j2
dest: /etc/nginx/nginx.conf
notify: restart nginx
when: run_once_nginx is not defined
- name: "include task certbot-matomo.yml"
include_tasks: certbot-matomo.yml
when: run_once_nginx is not defined
vars:
domain: "{{top_domain}}"
when: run_once_nginx is not defined
- name: configure {{top_domain}}.conf
template:
src: "homepage.nginx.conf.j2"
dest: "{{nginx_servers_directory}}{{top_domain}}.conf"
vars:
domain: "{{top_domain}}"
notify: restart nginx notify: restart nginx
when: run_once_nginx is not defined when: run_once_nginx is not defined

View File

@ -16,4 +16,11 @@ server
root {{nginx_homepage_root}}; root {{nginx_homepage_root}};
index index.html index.htm; index index.html index.htm;
} }
location /.well-known/ {
alias {{nginx_well_known_root}};
allow all;
default_type "text/plain";
autoindex on;
}
} }