diff --git a/roles/authelia/defaults/main.yml b/roles/authelia/defaults/main.yml index f41ce93..2b65593 100644 --- a/roles/authelia/defaults/main.yml +++ b/roles/authelia/defaults/main.yml @@ -6,7 +6,7 @@ authelia_image: authelia/authelia:4.38 authelia_container_name: authelia authelia_network_name: authelia_net -authelia_domain: example.com +authelia_domain: frantecrt.duckdns.org authelia_port: 9091 authelia_log_level: info \ No newline at end of file diff --git a/roles/authelia/templates/Caddyfile.j2 b/roles/authelia/templates/Caddyfile.j2 index 35874c8..32f6b57 100644 --- a/roles/authelia/templates/Caddyfile.j2 +++ b/roles/authelia/templates/Caddyfile.j2 @@ -1,3 +1,19 @@ auth.{{ authelia_domain }} { reverse_proxy authelia:{{ authelia_port }} +} + +# Reusable snippet for Authelia Forward Auth +(authelia_auth) { + forward_auth http://authelia:9091 { # Replace with your Authelia IP/Port or container name + uri /api/verify?rd=https://frantecrt.duckdns.org # Replace with your public Authelia URL + copy_headers Remote-User Remote-Groups Remote-Email Remote-Name + } +} + +test.frantecrt.duckdns.org { + # Import the auth configuration block + import authelia_auth + + # Route the traffic to your backend application if authenticated + reverse_proxy frantecrt.duckdns.org:8080 } \ No newline at end of file diff --git a/roles/authelia/templates/configuration.yml.j2 b/roles/authelia/templates/configuration.yml.j2 index 9608689..bd248f2 100644 --- a/roles/authelia/templates/configuration.yml.j2 +++ b/roles/authelia/templates/configuration.yml.j2 @@ -35,8 +35,8 @@ regulation: ban_time: 5m storage: - encryption_key: "{{ authelia_storage_encryption_key }}" - local: + encryption_key: {{ authelia_storage_encryption_key }} + local: path: /config/db.sqlite3 notifier: @@ -45,4 +45,4 @@ notifier: identity_validation: reset_password: - jwt_secret: "{{ authelia_jwt_secret }}" \ No newline at end of file + jwt_secret: {{ authelia_jwt_secret }} \ No newline at end of file