Skip to content

Commit b71e5fa

Browse files
authored
Merge pull request #590 from linuxserver/swag-auto-proxy-authentik
add support for authentik
2 parents 923768e + be29d4c commit b71e5fa

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

.github/workflows/BuildImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2.3.3
14+
- uses: actions/checkout@v3.1.0
1515

1616
- name: Build image
1717
run: |

.github/workflows/permissions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Permission check
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/run'
6+
- '**/finish'
7+
jobs:
8+
permission_check:
9+
uses: linuxserver/github-workflows/.github/workflows/init-svc-executable-permissions.yml@v1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
This mod gives SWAG the ability to auto-detect running containers via labels and automatically enable reverse proxy for them.
44

55
## Requirements:
6-
- This mod needs the `universal-docker` mod installed and set up with either mapping `docker.sock` or setting the environment variable `DOCKER_HOST=remoteaddress`.
6+
- This mod needs the [universal-docker mod](https://github.com/linuxserver/docker-mods/tree/universal-docker) installed and set up with either mapping `docker.sock` or setting the environment variable `DOCKER_HOST=remoteaddress`.
77
- Other containers to be auto-detected and reverse proxied should be in the same [user defined bridge network](https://docs.linuxserver.io/general/swag#docker-networking) as SWAG.
88
- Containers to be auto-detected and reverse proxied must have a label `swag=enable` at a minimum.
99
- To benefit from curated preset proxy confs we provide, the container name must match the container names that are suggested in our readme examples (ie. `radarr` and not `Radarr-4K`).
1010

1111
## Labels:
1212
- `swag=enable` - required for auto-detection
1313
- `swag_address=containername` - *optional* - overrides upstream app address. Can be set to an IP or a DNS hostname. Defaults to `container name`.
14-
- `swag_port=80` - *optional* - overrides *internal* exposed port
14+
- `swag_port=80` - *optional* - overrides *internal* exposed port (if no preset conf and this label not set, auto-proxy will default to first detected exposed port)
1515
- `swag_proto=http` - *optional* - overrides internal proto (defaults to http)
1616
- `swag_url=containername.domain.com` - *optional* - overrides *server_name* (defaults to `containername.*`)
17-
- `swag_auth=authelia` - *optional* - enables auth methods (options are `authelia`, `ldap` and `http` for basic http auth)
17+
- `swag_auth=authelia` - *optional* - enables auth methods (options are `authelia`, `authentik`, `ldap` and `http` for basic http auth)
1818
- `swag_auth_bypass=/api,/othersubfolder` - *optional* - bypasses auth for selected subfolders. Comma separated, no spaces.
1919

2020

root/app/auto-proxy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ for CONTAINER in ${AUTO_GEN}; do
7373
if [ "${swag_auth}" == "authelia" ]; then
7474
sed -i "s|#include /config/nginx/authelia|include /config/nginx/authelia|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
7575
echo "**** Enabling Authelia for ${CONTAINER} ****"
76+
elif [ "${swag_auth}" == "authentik" ]; then
77+
sed -i "s|#include /config/nginx/authentik|include /config/nginx/authentik|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
78+
echo "**** Enabling Authentik for ${CONTAINER} ****"
7679
elif [ "${swag_auth}" == "http" ]; then
7780
sed -i "s|#auth_basic|auth_basic|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
7881
echo "**** Enabling basic http auth for ${CONTAINER} ****"
@@ -135,6 +138,9 @@ DUDE
135138
if [ "${swag_auth}" == "authelia" ]; then
136139
sed -i "s|#include /config/nginx/authelia|include /config/nginx/authelia|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
137140
echo "**** Enabling Authelia for ${CONTAINER} ****"
141+
elif [ "${swag_auth}" == "authentik" ]; then
142+
sed -i "s|#include /config/nginx/authentik|include /config/nginx/authentik|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
143+
echo "**** Enabling Authentik for ${CONTAINER} ****"
138144
elif [ "${swag_auth}" == "http" ]; then
139145
sed -i "s|#auth_basic|auth_basic|g" "/etc/nginx/http.d/auto-proxy-${CONTAINER}.subdomain.conf"
140146
echo "**** Enabling basic http auth for ${CONTAINER} ****"

0 commit comments

Comments
 (0)