Skip to content

Commit 387bf34

Browse files
author
Chris Stockton
committed
feat: enable notify support and cleanup for v3 support.
1 parent f11bb0d commit 387bf34

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

ansible/files/gotrue.service.j2

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ StartLimitBurst=5
5151
[Service]
5252
Type=exec
5353
WorkingDirectory=/opt/gotrue
54-
{% if qemu_mode is defined and qemu_mode %}
55-
ExecStart=/opt/gotrue/gotrue
56-
{% else %}
54+
55+
# Both v2 & v3 need a config-dir for reloading support.
5756
ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d
58-
{% endif %}
57+
ExecReload=/bin/kill -10 $MAINPID
5958

6059
User=gotrue
6160
Restart=always
@@ -64,10 +63,29 @@ RestartSec=3
6463
MemoryAccounting=true
6564
MemoryMax=50%
6665

66+
# These are the historical location of env files. The /etc/auth.d dir will
67+
# override them when present.
6768
EnvironmentFile=-/etc/gotrue.generated.env
6869
EnvironmentFile=/etc/gotrue.env
6970
EnvironmentFile=-/etc/gotrue.overrides.env
7071

72+
# Both v2 & v3 support reloading via signals, on linux this is SIGUSR1.
73+
Environment=GOTRUE_RELOADING_SIGNAL_ENABLED=true
74+
Environment=GOTRUE_RELOADING_SIGNAL_NUMBER=10
75+
76+
# Both v2 & v3 disable the poller. While gotrue sets it to off by default we
77+
# defensively set it to false here.
78+
Environment=GOTRUE_RELOADING_POLLER_ENABLED=false
79+
80+
# Determines how much idle time must pass before triggering a reload. This
81+
# ensures only 1 reload operation occurs during a burst of config updates.
82+
Environment=GOTRUE_RELOADING_GRACE_PERIOD_INTERVAL=2s
83+
84+
# v3 does not use filesystem notifications for config reloads.
85+
{% if qemu_mode is defined and qemu_mode %}
86+
Environment=GOTRUE_RELOADING_NOTIFY_ENABLED=false
87+
{% endif %}
88+
7189
Slice=services.slice
7290

7391
[Install]

0 commit comments

Comments
 (0)