feat: Add slug for multiple domains of same user

This commit is contained in:
moanos [he/him] 2023-11-15 11:45:10 +01:00
parent 97634b58f6
commit ddc7f73a13
2 changed files with 11 additions and 6 deletions

View File

@ -18,11 +18,16 @@ static_sites:
- user: host_1
domain: host_1.example.org
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOREPUBLICKEYINFO host_1"
slug: host-1-staging
- user: host_2
domain: host_2.example.org
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMOREPUBLICKEYINFO host_2"
slug: host-1-prod
```
You can re-use a user and their key. You can also use different keys per user. Be aware that a shared user or keys will allow any such site to alter all sites that share the user/key.
Now deploy by running
```zsh

View File

@ -15,12 +15,12 @@ services:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.{{ site.user }}.rule=Host(`{{ site.domain }}`)"
- "traefik.http.routers.{{ site.user }}.service=present"
- "traefik.http.routers.{{ site.user }}.entrypoints=web-secure"
- "traefik.http.routers.{{ site.user }}.tls=true"
- "traefik.http.routers.{{ site.user }}.tls.certResolver=default"
- "traefik.http.services.{{ site.user }}.loadbalancer.server.port=8080"
- "traefik.http.routers.{{ site.slug }}.rule=Host(`{{ site.domain }}`)"
- "traefik.http.routers.{{ site.slug }}.service={{ site.slug }}-service"
- "traefik.http.routers.{{ site.slug }}.entrypoints=web-secure"
- "traefik.http.routers.{{ site.slug }}.tls=true"
- "traefik.http.routers.{{ site.slug }}.tls.certResolver=default"
- "traefik.http.services.{{ site.slug }}-service.loadbalancer.server.port=8080"
networks:
- traefik
{% endfor %}