1.7 KiB
1.7 KiB
ServerManager — AGENTS.md
Repo-specific guidance for OpenCode sessions. Verified against code.
Stack
- PHP 8.3+, custom MVC (not Laravel), MySQL/MariaDB, phpseclib 3.0, phpdotenv
- Autoload: PSR-4
ServerManager\→src/;src/Helpers/functions.phpauto-loaded
Entry point
public/index.php → App::boot() → App::run() → Router::dispatch()
Commands
composer install— install deps (no dev deps incomposer.json)php bin/generate-key.php— generate master key at/etc/servermanager/master.keyphp bin/monitor.php— collect server metrics (runs via cron every minute)sudo bash install.sh— full Ubuntu 22.04+/24.04+ install (needs sudo)mysql servermanager < database/migrations/001_initial_schema.sql— db setup
Non-obvious conventions
- Route params use
:idsyntax (/servers/:id), not{id} - Router supports method spoofing via
_methodPOST field - Session name is
SM_SESSION; sessions stored server-side insessionstable - View engine: custom PHP templates (
extract()+include), not Twig/Blade - SSH credentials encrypted with AES-256-CBC; master key at
/etc/servermanager/master.key .gitignoreline/ vendor/has a leading space → does NOT ignorevendor/(it's tracked)
Security
- Master encryption key required at runtime (
MASTER_ENCRYPTION_KEYenv or/etc/servermanager/master.key) - Every credential access logged at
warninglevel in audit trail - Passwords hashed with Argon2id
Testing / CI
- No tests, no CI, no linter, no formatter, no typechecker exist in this repo
Notable missing files
.env.exampledoes NOT exist (referenced incomposer.jsonpost-install-cmd but missing from repo)- No Makefile, Dockerfile, or CI workflows