3510764cc6
`backup [NAME]` zips the world and the settings into backups/; on a running server it turns saving off, flushes, zips and turns saving back on, so the game stays up. `restore BACKUP` puts a backup's world in place and keeps the current one in backups/replaced-<time>/; a running server restarts with it. `[backups] every = "6h"`, `keep = 12` in server.toml back up on a schedule and prune the automatic backups only. The control API gains GET/POST /api/v1/backups and POST /api/v1/restore. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.0 KiB
TOML
30 lines
1.0 KiB
TOML
[package]
|
|
name = "horizon-server"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version = "1.90"
|
|
description = "Host a Horizon server: server.toml, the CLI and the supervisor that runs the game headless (docs/server.md)"
|
|
|
|
[dependencies]
|
|
horizon-server-files = { path = "../horizon-server-files" }
|
|
# The game process's RAM and CPU (the same probes the benchmark reports use).
|
|
horizon-bench = { path = "../horizon-bench" }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "1.1"
|
|
# Edits server.toml in place, keeping the owner's comments and order.
|
|
toml_edit = "0.25"
|
|
# Backups: one zip anyone can open, Windows included.
|
|
zip = { version = "2", default-features = false, features = ["deflate"] }
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
# SIGINT/SIGTERM/SIGHUP: stop the game cleanly when the terminal or the service manager asks.
|
|
libc = "0.2"
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Console", "Win32_System_Threading"] }
|
|
|
|
[lints]
|
|
workspace = true
|