supabase-postgres.git / summary / log / commit / refs
commit ff0574294c85bbc3140f2f2db97114e99492765b
Author: Chris Stockton <180184+cstockton@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Date: Tue Mar 25 18:15:47 2025 +0000
feat: enable runtime configuration reloads for auth (#1229)
This is a small diff doing three things:
- Create the `/etc/auth.d` directory.
- Copies the `gotrue-optimizations.service.j2` to also copy the
`gotrue.generated.env` file to the `/etc/auth.d` directory.
- Change the `gotrue.service.j2` to use the `--config-dir` flag
set to the newly created `/etc/auth.d` directory.
Co-authored-by: Chris Stockton <chris.stockton@supabase.io>
ansible/files/gotrue-optimizations.service.j2 | 1 +
ansible/files/gotrue.service.j2 | 2 +-
ansible/tasks/setup-gotrue.yml | 7 +++++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ansible/files/gotrue-optimizations.service.j2 b/ansible/files/gotrue-optimizations.service.j2
index d9c2f018..fe5b26cd 100644
--- a/ansible/files/gotrue-optimizations.service.j2
+++ b/ansible/files/gotrue-optimizations.service.j2
@@ -5,6 +5,7 @@ Description=GoTrue (Auth) optimizations
Type=oneshot
# we don't want failures from this command to cause PG startup to fail
ExecStart=/bin/bash -c "/opt/supabase-admin-api optimize auth --destination-config-file-path /etc/gotrue/gotrue.generated.env ; exit 0"
+ExecStartPost=/bin/bash -c "cp -a /etc/gotrue/gotrue.generated.env /etc/auth.d/20_generated.env ; exit 0"
User=postgrest
[Install]
diff --git a/ansible/files/gotrue.service.j2 b/ansible/files/gotrue.service.j2
index c1f7f584..272e5b87 100644
--- a/ansible/files/gotrue.service.j2
+++ b/ansible/files/gotrue.service.j2
@@ -4,7 +4,7 @@ Description=Gotrue
[Service]
Type=simple
WorkingDirectory=/opt/gotrue
-ExecStart=/opt/gotrue/gotrue
+ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d
User=gotrue
Restart=always
RestartSec=3
diff --git a/ansible/tasks/setup-gotrue.yml b/ansible/tasks/setup-gotrue.yml
index 0998468b..d2c76385 100644
--- a/ansible/tasks/setup-gotrue.yml
+++ b/ansible/tasks/setup-gotrue.yml
@@ -30,6 +30,13 @@
owner: gotrue
mode: 0775
+- name: gotrue - create /etc/auth.d
+ file:
+ path: /etc/auth.d
+ state: directory
+ owner: gotrue
+ mode: 0755
+
- name: gotrue - unpack archive in /opt/gotrue
unarchive:
remote_src: yes
[parent: 6ae63d39a36c]