From 9cc8043bb4074287c53425e23af569bd6a85b255 Mon Sep 17 00:00:00 2001 From: moanos Date: Wed, 15 Nov 2023 11:46:02 +0100 Subject: [PATCH] feat: use subdirectories by domain for multi-domain suppport for one user --- roles/static-server/tasks/setup_site.yml | 2 +- roles/static-server/templates/docker-compose.yml.j2 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/static-server/tasks/setup_site.yml b/roles/static-server/tasks/setup_site.yml index ca48295..2f8600c 100644 --- a/roles/static-server/tasks/setup_site.yml +++ b/roles/static-server/tasks/setup_site.yml @@ -6,7 +6,7 @@ user: name="{{ site.user }}" shell=/bin/bash home="{{ static_site_server_base_path }}/{{ site.user }}" createhome=yes group="{{ site.user }}" groups= state=present - name: Ensure public path is present - ansible.builtin.file: path="{{ static_site_server_base_path }}/{{ site.user }}/public" owner="{{ site.user }}" group="{{ site.user }}" mode=0700 state=directory + ansible.builtin.file: path="{{ static_site_server_base_path }}/{{ site.user }}/{{ site.domain }}" owner="{{ site.user }}" group="{{ site.user }}" mode=0700 state=directory - name: Ensure .ssh path is present ansible.builtin.file: path="{{ static_site_server_base_path }}/{{ site.user }}/.ssh" owner="{{ site.user }}" group="{{ site.user }}" mode=0700 state=directory diff --git a/roles/static-server/templates/docker-compose.yml.j2 b/roles/static-server/templates/docker-compose.yml.j2 index 5bc1307..6b6865c 100644 --- a/roles/static-server/templates/docker-compose.yml.j2 +++ b/roles/static-server/templates/docker-compose.yml.j2 @@ -11,7 +11,7 @@ services: - SERVER_ROOT=/public - SERVER_LOG_LEVEL=info volumes: - - {{ static_site_server_base_path }}/{{ site.user }}/public:/public + - {{ static_site_server_base_path }}/{{ site.user }}/{{ site.domain }}:/public labels: - "traefik.enable=true" - "traefik.docker.network=traefik"