Skip to content

Commit ff05742

Browse files
cstocktonChris Stockton
and
Chris Stockton
authored
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 <[email protected]>
1 parent 6ae63d3 commit ff05742

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

ansible/files/gotrue-optimizations.service.j2

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Description=GoTrue (Auth) optimizations
55
Type=oneshot
66
# we don't want failures from this command to cause PG startup to fail
77
ExecStart=/bin/bash -c "/opt/supabase-admin-api optimize auth --destination-config-file-path /etc/gotrue/gotrue.generated.env ; exit 0"
8+
ExecStartPost=/bin/bash -c "cp -a /etc/gotrue/gotrue.generated.env /etc/auth.d/20_generated.env ; exit 0"
89
User=postgrest
910

1011
[Install]

ansible/files/gotrue.service.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Description=Gotrue
44
[Service]
55
Type=simple
66
WorkingDirectory=/opt/gotrue
7-
ExecStart=/opt/gotrue/gotrue
7+
ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d
88
User=gotrue
99
Restart=always
1010
RestartSec=3

ansible/tasks/setup-gotrue.yml

+7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
owner: gotrue
3131
mode: 0775
3232

33+
- name: gotrue - create /etc/auth.d
34+
file:
35+
path: /etc/auth.d
36+
state: directory
37+
owner: gotrue
38+
mode: 0755
39+
3340
- name: gotrue - unpack archive in /opt/gotrue
3441
unarchive:
3542
remote_src: yes

0 commit comments

Comments
 (0)