feat: services bundle and collection documentation #8

Merged
Tobias-Wuest merged 14 commits from feat/services-bundle-and-docs into main 2026-06-04 09:17:43 +00:00
15 changed files with 49 additions and 13 deletions
Showing only changes of commit 2104e5fe7d - Show all commits

View file

@ -48,7 +48,7 @@ services:
labels:
- traefik.enable=true
- traefik.docker.network={{ authentik_traefik_network }}
- traefik.http.routers.{{ authentik_service_name }}.rule=Host({% for d in authentik_domains %}`{{ d }}`{% if not loop.last %}, {% endif %}{% endfor %})
- traefik.http.routers.{{ authentik_service_name }}.rule={% for d in authentik_domains %}Host(`{{ d }}`){% if not loop.last %} || {% endif %}{% endfor +%}
{% if authentik_use_ssl %}
- traefik.http.routers.{{ authentik_service_name }}.entrypoints=websecure
- traefik.http.routers.{{ authentik_service_name }}.tls=true

View file

@ -5,4 +5,4 @@
- name: restart collabora
community.docker.docker_compose_v2:
project_src: "{{ collabora_docker_compose_dir }}"
state: restarted
state: present

View file

@ -20,7 +20,7 @@ services:
labels:
- traefik.enable=true
- traefik.docker.network={{ collabora_traefik_network }}
- traefik.http.routers.{{ collabora_service_name }}.rule=Host({% for d in collabora_domains %}`{{ d }}`{% if not loop.last %}, {% endif %}{% endfor %})
- traefik.http.routers.{{ collabora_service_name }}.rule={% for d in collabora_domains %}Host(`{{ d }}`){% if not loop.last %} || {% endif %}{% endfor +%}
- traefik.http.services.{{ collabora_service_name }}.loadbalancer.server.port={{ collabora_port }}
{% if collabora_use_ssl %}
- traefik.http.routers.{{ collabora_service_name }}.entrypoints=websecure

View file

@ -5,4 +5,4 @@
- name: restart drawio
community.docker.docker_compose_v2:
project_src: "{{ drawio_docker_compose_dir }}"
state: restarted
state: present

View file

@ -14,7 +14,7 @@ services:
- traefik.enable=true
- traefik.docker.network={{ garage_traefik_network }}
# S3 API endpoint
- traefik.http.routers.{{ garage_service_name }}.rule=Host({% for d in garage_s3_domains %}`{{ d }}`{% if not loop.last %}, {% endif %}{% endfor %})
- traefik.http.routers.{{ garage_service_name }}.rule={% for d in garage_s3_domains %}Host(`{{ d }}`){% if not loop.last %} || {% endif %}{% endfor +%}
{% if garage_use_ssl %}
- traefik.http.routers.{{ garage_service_name }}.entrypoints=websecure
- traefik.http.routers.{{ garage_service_name }}.tls=true

View file

@ -5,4 +5,4 @@
- name: restart homarr
community.docker.docker_compose_v2:
project_src: "{{ homarr_docker_compose_dir }}"
state: restarted
state: present

View file

@ -65,6 +65,12 @@ nextcloud_trusted_proxies: "172.16.0.0/12"
# File locking and real-time push notifications
nextcloud_enable_notify_push: false
nextcloud_notify_push_image: "icewind1991/notify_push:1.3.1"
# Domain used when calling `occ notify_push:setup`. Defaults to the
# first nextcloud_domains entry (the canonical public name). Override
# with an internal FQDN to avoid hairpinning the setup check through
# the DMZ; the FQDN must also be in nextcloud_domains so the push
# router matches it.
# nextcloud_notify_push_domain: "cloud.int.example.com"
# Nextcloud Talk: register external HPB signaling + TURN + STUN
# Set to true to run tasks/talk.yml after Nextcloud is up.

View file

@ -5,4 +5,4 @@
- name: Configure notify_push base endpoint
community.docker.docker_container_exec:
container: "{{ nextcloud_docker_compose_dir | basename }}-nextcloud-1"
command: php /var/www/html/occ notify_push:setup https://{{ nextcloud_domains[0] }}/push
command: php /var/www/html/occ notify_push:setup https://{{ nextcloud_notify_push_domain | default(nextcloud_domains[0]) }}/push

View file

@ -35,7 +35,7 @@ services:
labels:
- traefik.enable=true
- traefik.docker.network={{ nextcloud_traefik_network }}
- traefik.http.routers.{{ nextcloud_service_name }}.rule=Host({% for d in nextcloud_domains %}`{{ d }}`{% if not loop.last %}, {% endif %}{% endfor %})
- traefik.http.routers.{{ nextcloud_service_name }}.rule={% for d in nextcloud_domains %}Host(`{{ d }}`){% if not loop.last %} || {% endif %}{% endfor +%}
{% if nextcloud_use_ssl %}
- traefik.http.routers.{{ nextcloud_service_name }}.entrypoints=websecure
- traefik.http.routers.{{ nextcloud_service_name }}.tls=true
@ -136,7 +136,7 @@ services:
environment:
PORT: "7867"
REDIS_URL: "redis://redis:6379"
DATABASE_URL: "postgres://{{ nextcloud_postgres_user | urlencode }}:{{ nextcloud_postgres_password | urlencode }}@db:5432/{{ nextcloud_postgres_db }}"
DATABASE_URL: "postgres://{{ nextcloud_postgres_user | urlencode | replace('/', '%2F') }}:{{ nextcloud_postgres_password | urlencode | replace('/', '%2F') }}@db:5432/{{ nextcloud_postgres_db }}"
DATABASE_PREFIX: "oc_"
NEXTCLOUD_URL: "http://nginx"
networks:
@ -145,7 +145,7 @@ services:
labels:
- traefik.enable=true
- traefik.docker.network={{ nextcloud_traefik_network }}
- traefik.http.routers.{{ nextcloud_service_name }}-push.rule=Host(`{{ nextcloud_domains[0] }}`) && PathPrefix(`/push`)
- traefik.http.routers.{{ nextcloud_service_name }}-push.rule=({% for d in nextcloud_domains %}Host(`{{ d }}`){% if not loop.last %} || {% endif %}{% endfor %}) && PathPrefix(`/push`)
- traefik.http.services.{{ nextcloud_service_name }}-push.loadbalancer.server.port=7867
{% if nextcloud_use_ssl %}
- traefik.http.routers.{{ nextcloud_service_name }}-push.entrypoints=websecure

View file

@ -5,4 +5,4 @@
- name: restart opencloud
community.docker.docker_compose_v2:
project_src: "{{ opencloud_docker_compose_dir }}"
state: restarted
state: present

View file

@ -33,6 +33,18 @@ traefik_acme_tsig_secret: "" # TSIG secret
traefik_acme_propagation_timeout: "120"
traefik_acme_polling_interval: "2"
traefik_acme_ttl: "60"
# Force lego's DNS lookups (SOA resolution, propagation checks) onto
# TCP instead of UDP. Useful when container egress can reach the
# nameserver on TCP/53 but UDP/53 is blocked or unreliable. Sets the
# upstream env var LEGO_EXPERIMENTAL_DNS_TCP_ONLY=true on the
# traefik container.
traefik_acme_tcp_only: false
# Disable lego's propagation check against the zone's authoritative
# nameservers. Use when the SOA-listed NS hostname resolves to an
# address that isn't reachable from this traefik host (e.g. a DMZ
# box that can only see the internal NS IP, not the public one).
# lego still polls via the configured `resolvers:` list.
traefik_acme_disable_ans_checks: false
# Self-signed certificate configuration (for vagrant/testing)
traefik_selfsigned_cert_dir: "{{ docker_volume_dir }}/certs"

View file

@ -5,4 +5,4 @@
- name: restart traefik
community.docker.docker_compose_v2:
project_src: "{{ docker_compose_dir }}"
state: restarted
state: present

View file

@ -9,7 +9,18 @@
- name: Build service registry from backend servers (DMZ mode)
set_fact:
proxied_services: "{{ proxied_services | default([]) + hostvars[item].traefik_dmz_exposed_services | default([]) | map('combine', {'backend_host': hostvars[item].ansible_host | default(item)}) | list }}"
# Two-step merge so a service entry's own `backend_host` wins:
# entries that set it pass through unchanged, entries that don't
# get the backend host's ansible_host as fallback. The override
# lets a route target an internal FQDN covered by the backend
# cert's SANs instead of the raw IP (which would fail backend
# TLS verification at the proxy hop).
proxied_services: >-
{{
proxied_services | default([])
+ (hostvars[item].traefik_dmz_exposed_services | default([]) | selectattr('backend_host', 'defined') | list)
+ (hostvars[item].traefik_dmz_exposed_services | default([]) | rejectattr('backend_host', 'defined') | map('combine', {'backend_host': hostvars[item].ansible_host | default(item)}) | list)
}}
loop: "{{ _backend_servers | default([]) }}"
when: traefik_mode == 'dmz'

View file

@ -12,6 +12,9 @@ services:
RFC2136_PROPAGATION_TIMEOUT: "{{ traefik_acme_propagation_timeout }}"
RFC2136_POLLING_INTERVAL: "{{ traefik_acme_polling_interval }}"
RFC2136_TTL: "{{ traefik_acme_ttl }}"
{% if traefik_acme_tcp_only | default(false) %}
LEGO_EXPERIMENTAL_DNS_TCP_ONLY: "true"
{% endif %}
{% endif %}
ports:
- "80:80"

View file

@ -48,6 +48,10 @@ certificatesResolvers:
provider: rfc2136
resolvers:
- "{{ traefik_acme_dns_nameserver }}"
{% if traefik_acme_disable_ans_checks | default(false) %}
propagation:
disableANSChecks: true
{% endif %}
{% endif %}
{% if traefik_use_ssl %}