diff --git a/group_vars/all b/group_vars/all index 793cf561..4fc0855e 100644 --- a/group_vars/all +++ b/group_vars/all @@ -32,7 +32,44 @@ path_docker_volumes: "{{path_administrator_home}}volume path_docker_compose_instances: "{{path_administrator_home}}docker-compose/" # Runtime Variables -activate_all_timers: false # Activates all timers, independend if the handlers had been triggered -nginx_matomo_tracking: false # Activates matomo tracking on all html pages -nginx_www_redirect: true # Implements an redirect from all www. domains to the main domain -execute_updates: true # Executes updates \ No newline at end of file +activate_all_timers: false # Activates all timers, independend if the handlers had been triggered +nginx_matomo_tracking: false # Activates matomo tracking on all html pages +nginx_www_redirect: true # Implements an redirect from all www. domains to the main domain +execute_updates: true # Executes updates + +# Domain Names +domain_akaunting: "akaunting.{{top_domain}}" +domain_baserow: "baserow.{{top_domain}}" +domain_bigbluebutton: "meet.{{top_domain}}" +domain_elk: "elk.{{top_domain}}" +domain_discourse: "forum.{{top_domain}}" +domain_funkwhale: "music.{{top_domain}}" +domain_gitea: "git.{{top_domain}}" +domain_listmonk: "newsletter.{{top_domain}}" +domain_mailu: "mail.{{top_domain}}" +domain_mastodon: "microblog.{{top_domain}}" +domains_mastodon_alternates: [] +domain_matomo: "matomo.{{top_domain}}" +domain_mediawiki: "wiki.{{top_domain}}" +domain_nextcloud: "cloud.{{top_domain}}" +domain_pixelfed: "pictures.{{top_domain}}" +domains_pixelfed: [] +domain_peertube: "videos.{{top_domain}}" +domains_peertube: [] +domain_roulette: "roulette.{{top_domain}}" +domain_attendize: "tickets.{{top_domain}}" +domain_yourls: "s.{{top_domain}}" + + +# Routings +redirect_domain_mappings: +- { source: "nextcloud.{{top_domain}}", target: "cloud.{{top_domain}}" } +- { source: "gitea.{{top_domain}}", target: "git.{{top_domain}}" } +- { source: "listmonk.{{top_domain}}", target: "newsletter.{{top_domain}}" } +- { source: "discourse.{{top_domain}}", target: "forum.{{top_domain}}" } +- { source: "bbb.{{top_domain}}", target: "meet.{{top_domain}}" } +- { source: "short.{{top_domain}}", target: "s.{{top_domain}}" } +- { source: "mastodon.{{top_domain}}", target: "microblog.{{top_domain}}" } +- { source: "peertube.{{top_domain}}", target: "videos.{{top_domain}}" } +- { source: "funkwhale.{{top_domain}}", target: "music.{{top_domain}}" } +- { source: "pixelfed.{{top_domain}}", target: "pictures.{{top_domain}}" } diff --git a/playbook-servers.yml b/playbook-servers.yml index 68a04cf7..f5ccaa90 100644 --- a/playbook-servers.yml +++ b/playbook-servers.yml @@ -19,7 +19,7 @@ roles: - role: docker-nextcloud vars: - domain: cloud.{{top_domain}} + domain: "{{domain_nextcloud}}" http_port: 8001 - name: setup gitea hosts @@ -28,7 +28,7 @@ roles: - role: docker-gitea vars: - domain: git.{{top_domain}} + domain: "{{domain_gitea}}" http_port: 8002 ssh_port: 2201 run_mode: prod @@ -48,7 +48,7 @@ roles: - role: docker-mediawiki vars: - domain: wiki.{{top_domain}} + domain: "{{domain_mediawiki}}" http_port: 8004 - name: setup mybb hosts @@ -57,7 +57,7 @@ roles: - role: docker-mybb vars: - domains: "{{mybb_domains}}" + domains: "{{domains_mybb}}" http_port: 8005 - name: setup yourls hosts @@ -66,7 +66,7 @@ roles: - role: docker-yourls vars: - domain: s.{{top_domain}} + domain: "{{domain_yourls}}" http_port: 8006 - name: setup mailu hosts @@ -75,7 +75,7 @@ roles: - role: docker-mailu vars: - domain: "mail.{{top_domain}}" + domain: "{{domain_mailu}}" http_port: 8007 - name: setup elk hosts @@ -84,7 +84,7 @@ roles: - role: docker-elk vars: - domain: "elk.{{top_domain}}" + domain: "{{domain_elk}}" http_port: 8008 - name: setup mastodon hosts @@ -93,7 +93,8 @@ roles: - role: docker-mastodon vars: - domain: "mastodon.{{top_domain}}" + domain: "{{domain_mastodon}}" + domains: "{{ [domain] + domains_mastodon_alternates }}" http_port: 8009 stream_port: 4001 @@ -103,7 +104,8 @@ roles: - role: docker-pixelfed vars: - domain: pixelfed.{{top_domain}} + domain: "{{domain_pixelfed}}" + domains: "{{ [domain] + domains_pixelfed }}" http_port: 8010 - name: setup peertube hosts @@ -112,7 +114,8 @@ roles: - role: docker-peertube vars: - domain: peertube.{{top_domain}} + domain: "{{domain_peertube}}" + domains: "{{ [domain] + domains_peertube }}" http_port: 8011 - name: setup bigbluebutton hosts @@ -121,14 +124,15 @@ roles: - role: docker-bigbluebutton vars: - domain: bbb.{{top_domain}} + domain: "{{domain_bigbluebutton}}" + - name: setup funkwhale hosts hosts: funkwhale become: true roles: - role: docker-funkwhale vars: - domain: funkwhale.{{top_domain}} + domain: "{{domain_funkwhale}}" http_port: 8012 - name: setup roulette-wheel hosts @@ -137,7 +141,7 @@ roles: - role: docker-roulette-wheel vars: - domain: roulette.{{top_domain}} + domain: "{{domain_roulette}}" http_port: 8013 - name: setup joomla hosts @@ -155,7 +159,7 @@ roles: - role: docker-attendize vars: - domain: "tickets.{{top_domain}}" + domain: "{{domain_attendize}}" http_port: 8015 mail_interface_http_port: 8016 @@ -165,7 +169,7 @@ roles: - role: docker-baserow vars: - domain: baserow.{{top_domain}} + domain: "{{domain_baserow}}" http_port: 8017 - name: setup matomo hosts @@ -174,7 +178,7 @@ roles: - role: docker-matomo vars: - domain: matomo.{{top_domain}} + domain: "{{domain_matomo}}" http_port: 8018 - name: setup listmonk @@ -183,7 +187,7 @@ roles: - role: docker-listmonk vars: - domain: listmonk.{{top_domain}} + domain: "{{domain_newsletter}}" http_port: 8019 - name: setup discourse @@ -192,8 +196,8 @@ roles: - role: docker-discourse vars: - domain: forum.{{top_domain}} - domains: "{{discourse_domains}}" + domain: "{{domain_discourse}}" + domains: "{{domains_discourse}}" http_port: 8020 - name: setup akaunting hosts @@ -202,7 +206,7 @@ roles: - role: docker-akaunting vars: - domain: akaunting.{{top_domain}} + domain: "{{domain_akaunting}}" http_port: 8080 # Native Webserver Roles diff --git a/roles/docker-mastodon/tasks/create-domains.yml b/roles/docker-mastodon/tasks/create-domains.yml new file mode 100644 index 00000000..6e5aa07d --- /dev/null +++ b/roles/docker-mastodon/tasks/create-domains.yml @@ -0,0 +1,6 @@ +- name: "include task certbot-matomo.yml" + include_tasks: certbot-matomo.yml + +- name: configure {{domain}}.conf + template: src=templates/mastodon.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf + notify: restart nginx \ No newline at end of file diff --git a/roles/docker-mastodon/tasks/main.yml b/roles/docker-mastodon/tasks/main.yml index 7d01bd7d..60863736 100644 --- a/roles/docker-mastodon/tasks/main.yml +++ b/roles/docker-mastodon/tasks/main.yml @@ -1,10 +1,9 @@ --- -- name: "include task certbot-matomo.yml" - include_tasks: certbot-matomo.yml - -- name: configure {{domain}}.conf - template: src=templates/mastodon.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf - notify: restart nginx +- name: "include create-domains.yml" + include_tasks: create-domains.yml + loop: "{{ domains }}" + loop_control: + loop_var: domain - name: "create {{docker_compose_instance_directory}}" file: @@ -20,5 +19,4 @@ template: src: .env.production.j2 dest: "{{docker_compose_instance_directory}}.env.production" - force: no notify: recreate mastodon diff --git a/roles/docker-mastodon/templates/.env.production.j2 b/roles/docker-mastodon/templates/.env.production.j2 index 2a476880..5aa23c2c 100644 --- a/roles/docker-mastodon/templates/.env.production.j2 +++ b/roles/docker-mastodon/templates/.env.production.j2 @@ -1,4 +1,5 @@ LOCAL_DOMAIN={{domain}} +ALTERNATE_DOMAINS="{{ domains_mastodon_alternates | join(',') }}" SINGLE_USER_MODE={{mastodon_single_user_mode}} SECRET_KEY_BASE={{mastodon_secret_key_base}} OTP_SECRET={{mastodon_otp_secret}} diff --git a/roles/docker-peertube/tasks/create-domains.yml b/roles/docker-peertube/tasks/create-domains.yml new file mode 100644 index 00000000..2facfd97 --- /dev/null +++ b/roles/docker-peertube/tasks/create-domains.yml @@ -0,0 +1,6 @@ +- name: "include task certbot-matomo.yml" + include_tasks: certbot-matomo.yml + +- name: configure {{domain}}.conf + template: src=templates/peertube.conf.j2 dest=/etc/nginx/conf.d/{{domain}}.conf + notify: restart nginx \ No newline at end of file diff --git a/roles/docker-peertube/tasks/main.yml b/roles/docker-peertube/tasks/main.yml index a0838bdc..2d8cd050 100644 --- a/roles/docker-peertube/tasks/main.yml +++ b/roles/docker-peertube/tasks/main.yml @@ -1,7 +1,10 @@ --- -- name: "include task certbot-matomo.yml" - include_tasks: certbot-matomo.yml - +- name: "include create-domains.yml" + include_tasks: create-domains.yml + loop: "{{ domains }}" + loop_control: + loop_var: domain + - name: "create {{docker_compose_instance_directory}}" file: path: "{{docker_compose_instance_directory}}" diff --git a/roles/docker-peertube/templates/peertube.conf.j2 b/roles/docker-peertube/templates/peertube.conf.j2 index 0e4dd402..aa957761 100644 --- a/roles/docker-peertube/templates/peertube.conf.j2 +++ b/roles/docker-peertube/templates/peertube.conf.j2 @@ -1,8 +1,3 @@ - -upstream backend { - server 127.0.0.1:{{http_port}}; -} - server { server_name {{domain}}; @@ -71,7 +66,7 @@ server { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_pass http://backend; + proxy_pass http://127.0.0.1:{{http_port}}; } location /socket.io { diff --git a/roles/docker-pixelfed/tasks/main.yml b/roles/docker-pixelfed/tasks/main.yml index 8f397ce1..8f2a1932 100644 --- a/roles/docker-pixelfed/tasks/main.yml +++ b/roles/docker-pixelfed/tasks/main.yml @@ -1,6 +1,9 @@ --- - name: "include tasks nginx-docker-proxy-domain.yml" include_tasks: nginx-docker-proxy-domain.yml + loop: "{{ domains }}" + loop_control: + loop_var: domain - name: "create {{docker_compose_instance_directory}}" file: