aboutsummaryrefslogtreecommitdiff
path: root/admin/reload.md
blob: 5cfc5b9b92c8bbcdefe3fd3863af70b8a7967049 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

   

POST /reload

back to admin /// home

Hotreload server configuration. Rereads all config files, merges with DB settings, rebuilds the permission system. All without downtime hopefully maybe.

Requires power >= min_reload_power (configurable).

Request Body (optional)

{
  "restart": false,
  "forced": false
}
Field Type Default Notes
restart boolean false schedule a full server restart (reexec)
forced boolean false skip idle wait and restart immediately

If you send no body at all the server just does a config reload without restarting.

Why restart?

Some things might be unable to be hot reloaded because theyre baked in the oven at startup such as: - rate limiter settings - server port - database connection settings - scheduled queries

For these feel free to do a full restart. A compliant server should reexec itself (same binary, fresh process).

Restart modes

Graceful restart (restart: true, forced: false)

Schedules a restart that waits for a configurable idle period before actually restarting. If theres user activity the timer should reset so you dont pull the rug from under active users lol.

Response:

{
  "success": true,
  "message": "Configuration reloaded: server will restart after 30s of idle time...",
  "request_id": "abc123",
  "restarting": true,
  "restart_wait_seconds": 30,
  "note": "Server restart is scheduled to apply heavy config changes (rate limits)."
}

Forced restart (restart: true, forced: true)

Restarts immediately, server should flush cached sessions to the database if it supports persistant sessions first (with a reasonable timeout so a dead DB doesnt block the restart) then reexec.

Because the server dies before it can send a json derulo response back the client wont really get a response. Just fire and forget, then wait for jsonderulo to come back lol.

Should require higher power than a normal reload (configurable via min_manual_restart_power).

No restart (restart: false)

Just reloads config. Fast and safe.

{
  "success": true,
  "message": "Configuration reloaded successfully (TOML + DB merged, RBAC rebuilt)",
  "request_id": "abc123",
  "restarting": false,
  "note": "Rate limiter and scheduled query changes require a restart to take effect."
}

Error Responses

Code When
401 no token or invalid session
403 power level too low (for reload or for restart)
500 config reload failed (bad config syntax, DB error, etc)