From a74931aeba741778dbdb2d79056cb3409ed7228a Mon Sep 17 00:00:00 2001 From: Kirill Kovalchuk Date: Sun, 15 Sep 2024 20:34:49 +1000 Subject: [PATCH] Make dashboards available on main domain (not subdomain) --- roles/dashy/tasks/main.yml | 2 +- roles/heimdall/tasks/main.yml | 2 +- roles/homepage/tasks/main.yml | 2 +- roles/organizr/tasks/main.yml | 2 +- website/docs/applications/dashboards/dashy.md | 4 ++++ website/docs/applications/dashboards/heimdall.md | 2 ++ website/docs/applications/dashboards/homepage.md | 2 +- website/docs/applications/dashboards/organizr.md | 4 ++++ 8 files changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/dashy/tasks/main.yml b/roles/dashy/tasks/main.yml index 1cd44f2905..b7d8932290 100644 --- a/roles/dashy/tasks/main.yml +++ b/roles/dashy/tasks/main.yml @@ -27,7 +27,7 @@ - "{{ dashy_data_directory }}/conf.yml:/app/public/conf.yml:rw" labels: traefik.enable: "{{ dashy_available_externally | string }}" - traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.dashy.rule: "Host(`{{ homepage_hostname }}{% if homepage_hostname != '' %}.{% endif %}{{ ansible_nas_domain }}`)" traefik.http.routers.dashy.tls.certresolver: "letsencrypt" traefik.http.routers.dashy.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.dashy.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/roles/heimdall/tasks/main.yml b/roles/heimdall/tasks/main.yml index 7b9364f172..04577cf94d 100644 --- a/roles/heimdall/tasks/main.yml +++ b/roles/heimdall/tasks/main.yml @@ -25,7 +25,7 @@ memory: "{{ heimdall_memory }}" labels: traefik.enable: "{{ heimdall_available_externally | string }}" - traefik.http.routers.heimdall.rule: "Host(`{{ heimdall_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.heimdall.rule: "Host(`{{ heimdall_hostname }}{% if heimdall_hostname != '' %}.{% endif %}{{ ansible_nas_domain }}`)" traefik.http.routers.heimdall.tls.certresolver: "letsencrypt" traefik.http.routers.heimdall.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.heimdall.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/roles/homepage/tasks/main.yml b/roles/homepage/tasks/main.yml index 2bc24d2521..16e5ce8a7b 100644 --- a/roles/homepage/tasks/main.yml +++ b/roles/homepage/tasks/main.yml @@ -37,7 +37,7 @@ memory: "{{ homepage_memory }}" labels: traefik.enable: "{{ homepage_available_externally | string }}" - traefik.http.routers.homepage.rule: "Host(`{{ homepage_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.homepage.rule: "Host(`{{ homepage_hostname }}{% if homepage_hostname != '' %}.{% endif %}{{ ansible_nas_domain }}`)" traefik.http.routers.homepage.tls.certresolver: "letsencrypt" traefik.http.routers.homepage.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.homepage.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/roles/organizr/tasks/main.yml b/roles/organizr/tasks/main.yml index f49ff1e896..1cacbafd6e 100644 --- a/roles/organizr/tasks/main.yml +++ b/roles/organizr/tasks/main.yml @@ -26,7 +26,7 @@ memory: "{{ organizr_memory }}" labels: traefik.enable: "{{ organizr_available_externally | string }}" - traefik.http.routers.organizr.rule: "Host(`{{ organizr_hostname }}.{{ ansible_nas_domain }}`)" + traefik.http.routers.organizr.rule: "Host(`{{ organizr_hostname }}{% if organizr_hostname != '' %}.{% endif %}{{ ansible_nas_domain }}`)" traefik.http.routers.organizr.tls.certresolver: "letsencrypt" traefik.http.routers.organizr.tls.domains[0].main: "{{ ansible_nas_domain }}" traefik.http.routers.organizr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}" diff --git a/website/docs/applications/dashboards/dashy.md b/website/docs/applications/dashboards/dashy.md index 4c137a3ba9..c6ca343a8a 100644 --- a/website/docs/applications/dashboards/dashy.md +++ b/website/docs/applications/dashboards/dashy.md @@ -13,3 +13,7 @@ All the code is free and open source, and everything is thoroughly documented, y Set `dashy_enabled: true` in your `inventories//group_vars/nas.yml` file. The Dashy web interface can be found at [http://ansible_nas_host_or_ip:8082](http://ansible_nas_host_or_ip:8082). + +## Specific Configuration + +If you are using domain name (suppose, all your apps are using `.example.com`), but for your main dashboard you want it to be just `example.com` (without subdomain), you can achieve this by setting `dashy_hostname` to an empty, i.e. `dashy_hostname: ''` diff --git a/website/docs/applications/dashboards/heimdall.md b/website/docs/applications/dashboards/heimdall.md index 5807af358a..984824a669 100644 --- a/website/docs/applications/dashboards/heimdall.md +++ b/website/docs/applications/dashboards/heimdall.md @@ -15,3 +15,5 @@ The Heimdall web interface can be found at [http://ansible_nas_host_or_ip:10080] ## Specific Configuration Heimdall defaults to port 10080 - some browsers block this port. Override `heimdall_port_http` to move it somewhere else. + +If you are using domain name (suppose, all your apps are using `.example.com`), but for your main dashboard you want it to be just `example.com` (without subdomain), you can achieve this by setting `heimdall_hostname` to an empty, i.e. `heimdall_hostname: ''` diff --git a/website/docs/applications/dashboards/homepage.md b/website/docs/applications/dashboards/homepage.md index 81297d5f7c..7d3c856913 100644 --- a/website/docs/applications/dashboards/homepage.md +++ b/website/docs/applications/dashboards/homepage.md @@ -16,4 +16,4 @@ The Homepage web interface can be found at [http://ansible_nas_host_or_ip:11111] ## Specific Configuration -Heimdall defaults to port 10080 - some browsers block this port. Override `heimdall_port_http` to move it somewhere else. +If you are using domain name (suppose, all your apps are using `.example.com`), but for your main dashboard you want it to be just `example.com` (without subdomain), you can achieve this by setting `homepage_hostname` to an empty, i.e. `homepage_hostname: ''` diff --git a/website/docs/applications/dashboards/organizr.md b/website/docs/applications/dashboards/organizr.md index 36a2b87ed6..614eee68e9 100644 --- a/website/docs/applications/dashboards/organizr.md +++ b/website/docs/applications/dashboards/organizr.md @@ -11,3 +11,7 @@ HTPC/Homelab services organizer written in PHP. Set `organizr_enabled: true` in your `inventories//group_vars/nas.yml` file. The Organizr web interface can be found at [http://ansible_nas_host_or_ip:10081](http://ansible_nas_host_or_ip:10081). + +## Specific Configuration + +If you are using domain name (suppose, all your apps are using `.example.com`), but for your main dashboard you want it to be just `example.com` (without subdomain), you can achieve this by setting `organizr_hostname` to an empty, i.e. `organizr_hostname: ''`