From 43a7239fbf8f105aeac59e175e7028840e1c271a Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 13 Apr 2023 11:06:12 -0500 Subject: [PATCH 1/2] Move ssl.conf include to default.conf --- README.md | 1 + readme-vars.yml | 1 + root/defaults/nginx/site-confs/default.conf.sample | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28b753f..02431c8 100644 --- a/README.md +++ b/README.md @@ -336,6 +336,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **13.04.23:** - [Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf and site-confs/default.conf - Move ssl.conf include to default.conf. * **25.03.23:** - Fix renewal post hook. * **10.03.23:** - Cleanup unused csr and keys folders. See [certbot 2.3.0 release notes](https://github.com/certbot/certbot/releases/tag/v2.3.0). * **09.03.23:** - Add Google Domains DNS support, `google-domains`. diff --git a/readme-vars.yml b/readme-vars.yml index ef33164..c074ec4 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -154,6 +154,7 @@ app_setup_block: | # changelog changelogs: + - { date: "13.04.23:", desc: "[Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf and site-confs/default.conf - Move ssl.conf include to default.conf." } - { date: "25.03.23:", desc: "Fix renewal post hook." } - { date: "10.03.23:", desc: "Cleanup unused csr and keys folders. See [certbot 2.3.0 release notes](https://github.com/certbot/certbot/releases/tag/v2.3.0)." } - { date: "09.03.23:", desc: "Add Google Domains DNS support, `google-domains`." } diff --git a/root/defaults/nginx/site-confs/default.conf.sample b/root/defaults/nginx/site-confs/default.conf.sample index 10756f8..6bd2438 100644 --- a/root/defaults/nginx/site-confs/default.conf.sample +++ b/root/defaults/nginx/site-confs/default.conf.sample @@ -1,4 +1,4 @@ -## Version 2023/02/09 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/site-confs/default.conf.sample +## Version 2023/04/13 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/site-confs/default.conf.sample # redirect all traffic to https server { @@ -17,6 +17,8 @@ server { server_name _; + include /config/nginx/ssl.conf; + root /config/www; index index.html index.htm index.php; From 7a831681c5ca57e16a746653bf7b8fc30fb3dfcb Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Thu, 13 Apr 2023 11:26:13 -0500 Subject: [PATCH 2/2] Remove Authorization headers in authelia Sort proxy_set_header in authelia and authentik --- README.md | 2 +- readme-vars.yml | 2 +- root/defaults/nginx/authelia-location.conf.sample | 14 +++++--------- root/defaults/nginx/authentik-location.conf.sample | 10 +++++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 02431c8..290cdc0 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **13.04.23:** - [Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf and site-confs/default.conf - Move ssl.conf include to default.conf. +* **13.04.23:** - [Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf, authelia-location.conf, authentik-location.conf, and site-confs/default.conf - Move ssl.conf include to default.conf. Remove Authorization headers in authelia. Sort proxy_set_header in authelia and authentik. * **25.03.23:** - Fix renewal post hook. * **10.03.23:** - Cleanup unused csr and keys folders. See [certbot 2.3.0 release notes](https://github.com/certbot/certbot/releases/tag/v2.3.0). * **09.03.23:** - Add Google Domains DNS support, `google-domains`. diff --git a/readme-vars.yml b/readme-vars.yml index c074ec4..cf36fab 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -154,7 +154,7 @@ app_setup_block: | # changelog changelogs: - - { date: "13.04.23:", desc: "[Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf and site-confs/default.conf - Move ssl.conf include to default.conf." } + - { date: "13.04.23:", desc: "[Existing users should update:](https://github.com/linuxserver/docker-swag/blob/master/README.md#updating-configs) nginx.conf, authelia-location.conf, authentik-location.conf, and site-confs/default.conf - Move ssl.conf include to default.conf. Remove Authorization headers in authelia. Sort proxy_set_header in authelia and authentik." } - { date: "25.03.23:", desc: "Fix renewal post hook." } - { date: "10.03.23:", desc: "Cleanup unused csr and keys folders. See [certbot 2.3.0 release notes](https://github.com/certbot/certbot/releases/tag/v2.3.0)." } - { date: "09.03.23:", desc: "Add Google Domains DNS support, `google-domains`." } diff --git a/root/defaults/nginx/authelia-location.conf.sample b/root/defaults/nginx/authelia-location.conf.sample index 430b2f7..ae4d630 100644 --- a/root/defaults/nginx/authelia-location.conf.sample +++ b/root/defaults/nginx/authelia-location.conf.sample @@ -1,4 +1,4 @@ -## Version 2023/02/09 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authelia-location.conf.sample +## Version 2023/04/13 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authelia-location.conf.sample # Make sure that your authelia container is in the same user defined bridge network and is named authelia # Rename /config/nginx/proxy-confs/authelia.subdomain.conf.sample to /config/nginx/proxy-confs/authelia.subdomain.conf # Make sure that the authelia configuration.yml has 'path: "authelia"' defined @@ -9,20 +9,16 @@ auth_request /authelia/api/verify; error_page 401 = @authelia_proxy_signin; ## Translate response headers from Authelia into variables -auth_request_set $user $upstream_http_remote_user; +auth_request_set $email $upstream_http_remote_email; auth_request_set $groups $upstream_http_remote_groups; auth_request_set $name $upstream_http_remote_name; -auth_request_set $email $upstream_http_remote_email; -auth_request_set $authorization $upstream_http_authorization; -auth_request_set $proxy_authorization $upstream_http_proxy_authorization; +auth_request_set $user $upstream_http_remote_user; ## Inject the response header variables into the request made to the actual upstream -proxy_set_header Remote-User $user; +proxy_set_header Remote-Email $email; proxy_set_header Remote-Groups $groups; proxy_set_header Remote-Name $name; -proxy_set_header Remote-Email $email; -proxy_set_header Authorization $authorization; -proxy_set_header Proxy-Authorization $proxy_authorization; +proxy_set_header Remote-User $user; ## Include the Set-Cookie header if present. auth_request_set $set_cookie $upstream_http_set_cookie; diff --git a/root/defaults/nginx/authentik-location.conf.sample b/root/defaults/nginx/authentik-location.conf.sample index 38001fe..39668c6 100644 --- a/root/defaults/nginx/authentik-location.conf.sample +++ b/root/defaults/nginx/authentik-location.conf.sample @@ -1,4 +1,4 @@ -## Version 2023/02/09 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authentik-location.conf.sample +## Version 2023/04/13 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/authentik-location.conf.sample # Make sure that your authentik container is in the same user defined bridge network and is named authentik-server # Rename /config/nginx/proxy-confs/authentik.subdomain.conf.sample to /config/nginx/proxy-confs/authentik.subdomain.conf @@ -8,18 +8,18 @@ auth_request /outpost.goauthentik.io/auth/nginx; error_page 401 = @goauthentik_proxy_signin; ## Translate response headers from Authentik into variables -auth_request_set $authentik_username $upstream_http_x_authentik_username; -auth_request_set $authentik_groups $upstream_http_x_authentik_groups; auth_request_set $authentik_email $upstream_http_x_authentik_email; +auth_request_set $authentik_groups $upstream_http_x_authentik_groups; auth_request_set $authentik_name $upstream_http_x_authentik_name; auth_request_set $authentik_uid $upstream_http_x_authentik_uid; +auth_request_set $authentik_username $upstream_http_x_authentik_username; ## Inject the response header variables into the request made to the actual upstream -proxy_set_header X-authentik-username $authentik_username; -proxy_set_header X-authentik-groups $authentik_groups; proxy_set_header X-authentik-email $authentik_email; +proxy_set_header X-authentik-groups $authentik_groups; proxy_set_header X-authentik-name $authentik_name; proxy_set_header X-authentik-uid $authentik_uid; +proxy_set_header X-authentik-username $authentik_username; ## Include the Set-Cookie header if present. auth_request_set $set_cookie $upstream_http_set_cookie;