@@ -51,11 +51,10 @@ StartLimitBurst=5
51
51
[Service]
52
52
Type=exec
53
53
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.
57
56
ExecStart=/opt/gotrue/gotrue --config-dir /etc/auth.d
58
- {% endif %}
57
+ ExecReload=/bin/kill -10 $MAINPID
59
58
60
59
User=gotrue
61
60
Restart=always
@@ -64,10 +63,29 @@ RestartSec=3
64
63
MemoryAccounting=true
65
64
MemoryMax=50%
66
65
66
+ # These are the historical location of env files. The /etc/auth.d dir will
67
+ # override them when present.
67
68
EnvironmentFile=-/etc/gotrue.generated.env
68
69
EnvironmentFile=/etc/gotrue.env
69
70
EnvironmentFile=-/etc/gotrue.overrides.env
70
71
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
+
71
89
Slice=services.slice
72
90
73
91
[Install]
0 commit comments