$ show pelican/wings
Pelican Wings is a production-grade game server management daemon (agent) built in Go. It serves as the control plane for the Pelican Panel, managing Docker containers that run game servers. The daemon exposes a comprehensive HTTP API for server lifecycle operations (start, stop, install, backup, transfer), real-time WebSocket streams for console output and server stats, and a built-in SFTP server for file management. It communicates with a remote Panel API to synchronize server configurations, validate user credentials, and report activity logs. The codebase demonstrates strong systems engineering with a focus on security (sandboxed filesystem using openat2 syscalls, token authentication, download IP filtering), performance (disk-space caching, atomic generics), and reliability (crash detection, state persistence, cron-based backups). It supports multiple backup backends (local disk, S3), parallel server bootstrapping, and self-update via GitHub releases. The architecture follows a modular pattern with clear separation between API routing, server management, filesystem operations, and integration adapters. While the code is a fork of Pterodactyl Wings with some incomplete rebranding, it remains actively developed and production-ready.
The LLM identified 4 files worth highlighting for reuse:
Provides a chroot-like filesystem abstraction using openat2/openat syscalls to prevent symlink escapes and path traversal. Implements safe versions of MkdirAll, RemoveAll, Walk, and file operations. The design is self-contained (only depends on Go standard library) and could be extracted for any project requiring secure file operations in a restricted directory. Demonstrates deep knowledge of Unix kernel interfaces and defensive programming.
A generic configuration parser that replaces values in game server config files across multiple formats (YAML, JSON, TOML, XML, INI, Properties, plain text). Uses format-specific libraries behind a unified interface. Isolated and parameterized, it can be reused for any config injection task where patterns need to be matched and replaced. Non-obvious because it handles format detection and edge cases (e.g., XML CDATA, JSON arrays) robustly.
Defines generic atomic types (Atomic[T], AtomicBool, AtomicString) with thread-safe get/set and JSON marshal/unmarshal support. A clean, reusable concurrency utility that could be extracted into any Go codebase needing atomic values. Demonstrates idiomatic use of Go generics and sync/atomic to build composable primitives.
Defines a BackupInterface with Generate/Remove/Restore methods and two concrete implementations: LocalBackup (stores archives on disk) and S3Backup (multipart upload via presigned URLs). The adapter pattern allows easy extension to other storage backends. The restore logic includes security validations (IP allowlist, download URL checks). Self-contained and well-abstracted, this pattern can be reused in any service requiring backup operations with multiple storage providers.