Automated Rust game server management powered by Google Calendar schedules.
โ ๏ธ Note: This tool is designed for Linux servers only. Windows is not supported.
๐ก Tip: Pairs well with WipeCal - a Carbon plugin that uses the same calendar URL to notify players of approaching restarts/wipes and display upcoming events in-game.
Server owners can schedule restart and wipe events in Google Calendar. This tool:
- ๐ Monitors multiple Google Calendar iCal feeds (one per server)
- ๐ Detects upcoming events within a configurable time window (default: 24 hours)
- ๐ Auto-installs and updates Rust server files (
/opt/rust/{branch}) and Carbon mod (/opt/carbon/{branch}) - โก Executes restart/wipe operations at scheduled times via customizable shell scripts
- ๐ Aggregates events across multiple servers (e.g., restart 3 servers simultaneously)
- ๐ฃ Discord webhook notifications for events, updates, and errors
- ๐บ๏ธ Custom map generation workflows via
generate-maps.sh
This project consists of two main components:
wipe๐ฅ๏ธ - CLI tool for managing server configurationswiped๐ค - Long-running daemon that monitors calendars and schedules tasks
The two components communicate via a shared configuration file stored at ~/.config/wiped/config.yaml.
When a restart or wipe event occurs:
- ๐ Stop servers โ Calls
/opt/wiped/stop-servers.shwith server paths - ๐ฆ Update Rust & Carbon โ Syncs from
/opt/rust/{branch}and/opt/carbon/{branch}(parallel) - ๐งน Wipe data (wipes only) โ Deletes map, save, and blueprint files (see below)
- ๐ง Run hook โ Calls
/opt/wiped/pre-start-hook.shwith all server paths โถ๏ธ Start servers โ Calls/opt/wiped/start-servers.shwith server paths
All scripts receive server paths as arguments, allowing you to integrate with your existing infrastructure.
Files deleted during wipes (from server/{identity}/ directory):
*.map- Map files*.sav*- Save filesplayer.states.*.db*- Player state databasessv.files.*.db*- Server file databasesplayer.blueprints.*- Blueprints (only ifwipe_blueprints: true)
wipe-cli/
โโโ cmd/
โ โโโ wipe/ # CLI tool entry point
โ โโโ wiped/ # Daemon entry point
โโโ internal/
โ โโโ calendar/ # iCal parsing and event detection
โ โโโ carbon/ # Carbon mod installation and updates
โ โโโ config/ # Shared configuration management
โ โโโ daemon/ # Daemon logic
โ โโโ discord/ # Discord webhook notifications
โ โโโ executor/ # Event execution and script management
โ โโโ scheduler/ # Event scheduling and grouping
โ โโโ steamcmd/ # Rust server installation via SteamCMD
โโโ systemd/
โ โโโ wiped.service # systemd service file
โโโ go.mod
โโโ Makefile
โโโ README.md
make buildThis creates binaries in the build/ directory.
make installThis will:
- โ
Install
wipeandwipedbinaries to/usr/local/bin/ - โ Install the systemd service file
- โ Reload systemd
After installation, enable and start the service:
sudo systemctl enable wiped@$USER.service
sudo systemctl start wiped@$USER.serviceNote: The service uses wiped@{username}.service format - replace $USER with your actual username if needed. The daemon runs as your user and accesses your ~/.config/wiped/config.yaml.
The daemon automatically creates default management scripts in /opt/wiped/ on first run:
- ๐
stop-servers.sh- Called to stop servers before restart/wipe โถ๏ธ start-servers.sh- Called to start servers after restart/wipe- ๐ง
pre-start-hook.sh- Called after updating Rust & Carbon but before server start - ๐บ๏ธ
generate-maps.sh- Called by default 22 hours before wipes (ifgenerate_map: true)
Example customization:
# /opt/wiped/stop-servers.sh
#!/bin/bash
SERVER_PATHS="$@"
for SERVER_PATH in $SERVER_PATHS; do
IDENTITY=$(basename "$SERVER_PATH")
systemctl stop "rs-${IDENTITY}"
doneYou can regenerate all scripts to defaults with:
wipe reset-scriptsThis will delete and regenerate all 4 management scripts.
Add servers to monitor with their calendar URLs:
# Add a server (minimum required flags)
wipe add \
--path /var/www/servers/us-weekly \
--calendar https://calendar.google.com/calendar/ical/xxx/basic.ics
# Add a server with all options
wipe add \
--path /var/www/servers/us-weekly \
--calendar https://calendar.google.com/calendar/ical/xxx/basic.ics \
--branch main \
--wipe-blueprints \
--generate-map๐ฉ Flags:
- ๐
--path- Full path to Rust server directory (required). Server name is derived from the basename. - ๐
--calendar- Google Calendar .ics URL (required) - ๐ฟ
--branch- Rust branch: main, staging, etc. (default: main) - ๐งน
--wipe-blueprints- Delete blueprints on wipe events (default: false) - ๐บ๏ธ
--generate-map- Call generate-maps.sh before wipes (default: false)
๐ก Note: The server name is automatically set to the basename of the path. For example, /var/www/servers/us-weekly becomes us-weekly.
# List all configured servers
wipe list
# Update server settings (accepts server name or full path)
wipe update us-weekly \
--calendar https://new-url.com/cal.ics \
--branch staging \
--generate-map
# You can also use full path
wipe update /var/www/servers/us-weekly --branch main
# Remove a server (accepts server name or full path)
wipe remove us-weekly
# Or: wipe remove /var/www/servers/us-weekly# View current configuration
wipe config
# Set global options
wipe config set --check-interval 30 # How often to check calendars (seconds)
wipe config set --lookahead-hours 24 # How far ahead to schedule events (hours)
wipe config set --event-delay 5 # Delay after event time (seconds)
wipe config set --map-generation-hours 22 # When to generate maps before wipe (hours)
wipe config set --discord-webhook "https://..." # General notifications webhookConfigure user and role IDs to mention in Discord notifications:
# Add Discord users to mention (use Discord user IDs)
wipe mention add-user 123456789012345678
wipe mention add-user 987654321098765432
# Add Discord roles to mention (use Discord role IDs)
wipe mention add-role 111222333444555666
wipe mention add-role 777888999000111222
# Remove users or roles
wipe mention remove-user 123456789012345678
wipe mention remove-role 111222333444555666
# View configured mentions
wipe configHow to get Discord IDs:
- Enable Developer Mode in Discord (Settings โ App Settings โ Advanced โ Developer Mode)
- Right-click on a user or role and select "Copy ID"
Configured mentions will be included in batch event notifications (start, complete, errors) as cc <@&ROLE_ID> <@USER_ID>.
# Update Rust and Carbon on servers (without stopping/starting)
wipe sync us-weekly eu-monthly
wipe sync us-weekly --force # Skip confirmation prompt
# Manually call a management script for specific servers
wipe call-script us-weekly us-long --script stop-servers
wipe call-script us-weekly --script start-servers
wipe call-script us-weekly --script generate-maps
# Reset all management scripts to defaults (includes pre-start-hook.sh)
wipe reset-scripts
wipe reset-scripts --force # Skip confirmation prompt# Check service status
systemctl status wiped@$USER.service
# View logs
journalctl -u wiped@$USER.service -f
# Restart service
sudo systemctl restart wiped@$USER.service
# Run daemon with custom config path (for testing)
wiped -config /path/to/custom/config.yamlThe pre-start-hook.sh runs once after all servers are synced but before they start. Use it for:
- ๐งน Clearing caches
- ๐ Updating plugins
- ๐พ Running database migrations
- ๐ข Sending custom notifications
Example:
#!/bin/bash
SERVER_PATHS="$@"
for SERVER_PATH in $SERVER_PATHS; do
IDENTITY=$(basename "$SERVER_PATH")
# Update custom configs
/usr/local/bin/update-configs "$IDENTITY"
done
# Send notification
IDENTITIES=$(echo "$SERVER_PATHS" | xargs -n1 basename | paste -sd,)
curl -X POST "https://api.example.com/notify" -d "servers=$IDENTITIES"Customize stop-servers.sh and start-servers.sh to match your infrastructure:
#!/bin/bash
# stop-servers.sh example with systemd
SERVER_PATHS="$@"
for SERVER_PATH in $SERVER_PATHS; do
IDENTITY=$(basename "$SERVER_PATH")
systemctl stop "rs-${IDENTITY}"
doneThe generate-maps.sh script is called 22 hours before wipes (configurable) for servers with generate_map: true. Customize it to:
- ๐ฒ Pick random seeds/sizes
- ๐จ Generate custom maps using rustmaps-cli
- โ๏ธ Update server.cfg files
- ๐ Handle map pool logic
The script receives server paths and should exit 0 on success.
The wipe sync command allows you to manually update Rust and Carbon on specified servers from /opt/rust/{branch} and /opt/carbon/{branch}:
# Update one or more servers
wipe sync us-weekly
wipe sync us-weekly eu-monthly
# Skip confirmation prompt (for automation)
wipe sync us-weekly --force- โ This command does NOT stop or start servers
- โ This command does NOT delete any files (no wipe)
- โ This command does NOT run the pre-start hook
โ ๏ธ You should stop servers before updating to avoid issues- โ This is useful for manual updates outside of scheduled events
Configuration is stored at ~/.config/wiped/config.yaml:
# How far ahead to look for events (in hours)
lookahead_hours: 24
# How often to check calendars (in seconds)
check_interval: 30
# How long to wait after event time before executing (in seconds)
event_delay: 5
# How many hours before a wipe to call generate-maps.sh
map_generation_hours: 22
# Discord webhook URL for notifications
discord_webhook: "https://discord.com/api/webhooks/..."
# Discord user IDs to mention in notifications (optional)
discord_mention_users:
- "123456789012345678"
- "987654321098765432"
# Discord role IDs to mention in notifications (optional)
discord_mention_roles:
- "111222333444555666"
- "777888999000111222"
# Servers to monitor
servers:
- name: "us-weekly"
path: "/var/www/servers/us-weekly"
calendar_url: "https://calendar.google.com/calendar/ical/xxx/basic.ics"
branch: "main"
wipe_blueprints: false
generate_map: true
- name: "eu-staging"
path: "/var/www/servers/eu-staging"
calendar_url: "https://calendar.google.com/calendar/ical/yyy/basic.ics"
branch: "staging"
wipe_blueprints: true
generate_map: falseThe daemon looks for events with these summaries (case-insensitive, trimmed):
- ๐
"restart"- Server restart event - ๐งน
"wipe"- Server wipe event
If a server has both a restart and wipe at the same time, only the wipe is executed.
Events occurring at the same time are automatically grouped into one unified batch:
- โก All servers stop at once (prevents systemd from auto-restarting during updates)
- ๐ All servers update in parallel (Rust + Carbon synced simultaneously)
- ๐งน Wipe-specific cleanup only runs for servers with wipe events
- ๐ง Pre-start hook runs once for all servers in the batch
- โ All servers start together
Example: 2 servers restarting + 2 servers wiping at 11:00 โ One batch operation
This ensures:
- No race conditions with systemd auto-restart
- Minimal downtime
- Efficient parallel execution
The daemon checks for Rust and Carbon updates every 2 minutes:
- ๐ฎ Rust: Monitors each configured branch via SteamCMD
- ๐ Carbon: Checks GitHub releases for production/staging builds
- ๐ฆ Updates are automatically installed to
/opt/rust/{branch}and/opt/carbon/{branch} - ๐ก๏ธ Cascade protection prevents multiple simultaneous updates
The daemon sends webhook notifications for key events:
๐ฏ Event Operations:
Batch Event Starting- When servers begin restart/wipe operationsBatch Event Complete- After successful completionBatch Event Failed- If any step fails during execution
๐ Calendar Changes:
Calendar Events Added- New events detected in calendarsCalendar Events Removed- Events deleted from calendars
๐ Installation & Updates:
Rust Installation Complete- Initial Rust branch installationRust Update Complete- Rust branch updated to new buildRust Update Available- New Rust build detected (before install)Rust Installation Failed- Rust installation errorCarbon Installation Complete- Initial Carbon installationCarbon Update Available- New Carbon version detectedCarbon Installation Failed- Carbon installation error
โ๏ธ Service Management:
Wipe Service Started- Daemon startup notificationServer Added- Server added to configurationServer Removed- Server removed from configurationMap Generation Failed- generate-maps.sh script error
All notifications include the hostname for easy identification in multi-server environments.
Run the CLI locally:
make run-cliRun the daemon locally:
make run-daemonRun code quality checks:
make check # Runs fmt, vet, staticcheck, and deadcodemake uninstallThis will:
- ๐ Stop the service
- โ Remove binaries from
/usr/local/bin/ - โ Remove systemd service file
- โ
Config files in
~/.config/wiped/and scripts in/opt/wiped/are preserved
- ๐ cobra - CLI framework
- โ๏ธ viper - Configuration management
- ๐ golang-ical - iCalendar parsing
- ๐ rrule-go - Recurring event support
- โฐ gocron - Job scheduling and execution
See LICENSE file.
Made with โค๏ธ by mainloot
