|
28 | 28 | GOTRUE_JWT_EXP = "3600";
|
29 | 29 | GOTRUE_JWT_SECRET = "your-super-secret-jwt-token-with-at-least-32-characters-long";
|
30 | 30 | GOTRUE_MAILER_AUTOCONFIRM = "true";
|
| 31 | + |
| 32 | + # Both v2 & v3 support reloading via signals, on linux this is SIGUSR1. |
| 33 | + GOTRUE_RELOADING_SIGNAL_ENABLED = "true"; |
| 34 | + GOTRUE_RELOADING_SIGNAL_NUMBER = "10"; |
| 35 | + |
| 36 | + # Both v2 & v3 disable the poller. While gotrue sets it to off by default we |
| 37 | + # defensively set it to false here. |
| 38 | + GOTRUE_RELOADING_POLLER_ENABLED = "false"; |
| 39 | + |
| 40 | + # Determines how much idle time must pass before triggering a reload. This |
| 41 | + # ensures only 1 reload operation occurs during a burst of config updates. |
| 42 | + GOTRUE_RELOADING_GRACE_PERIOD_INTERVAL = "2s"; |
| 43 | + |
| 44 | + # v3 does not use filesystem notifications for config reloads. |
| 45 | + GOTRUE_RELOADING_NOTIFY_ENABLED = "false"; |
| 46 | + |
| 47 | + # TODO: remove duplicates? |
31 | 48 | GOTRUE_SITE_URL = "http://localhost:3000";
|
32 | 49 | GOTRUE_SMTP_ADMIN_EMAIL = "[email protected]";
|
33 | 50 | GOTRUE_SMTP_HOST = "localhost";
|
|
90 | 107 | description = "gotrue (auth)";
|
91 | 108 | wantedBy = [ "multi-user.target" ];
|
92 | 109 | serviceConfig = {
|
93 |
| - Type = "simple"; |
| 110 | + Type = "exec"; |
94 | 111 | WorkingDirectory = "/opt/gotrue";
|
95 | 112 | ExecStart = "${cfg.package}/bin/gotrue --config-dir /etc/auth.d";
|
| 113 | + ExecReload = "${pkgs.coreutils}/bin/kill -10 $MAINPID"; |
96 | 114 | User = "gotrue";
|
97 | 115 | Restart = "always";
|
98 | 116 | RestartSec = 3;
|
|
108 | 126 | # pg_isready -h ${config.auth.settings.DB_HOST} -p ${config.auth.settings.DB_PORT} -U ${config.auth.settings.DB_USER}; do sleep 1; done
|
109 | 127 | # '';
|
110 | 128 | };
|
| 129 | + unitConfig = { |
| 130 | + StartLimitIntervalSec = 10; |
| 131 | + StartLimitBurst = 5; |
| 132 | + }; |
111 | 133 | };
|
112 | 134 |
|
113 | 135 | systemd.tmpfiles.rules = [
|
|
0 commit comments