Commit Graph
24 Commits
Author SHA1 Message Date
MrFastwind 5134a3b261 fix: create dev-deploy directories before copying stubs in make dev 2026-07-23 20:47:06 +02:00
MrFastwind 234116e6a1 test(backend): add tests for SERVER_BINARY, SERVER_PARAMS, STEAMCMD_PATH env vars
- TestStartWithServerBinaryEnv: custom binary name via env
- TestStartWithServerParamsEnv: overridden params via env
- TestServerParamsEnvOverridesSettings: env takes precedence over settings
- TestSteamCmdManager_SteampathEnv: custom steamcmd path via env
2026-07-23 20:39:24 +02:00
MrFastwind 03c3d7bae2 feat: add SERVER_BINARY, SERVER_PARAMS, STEAMCMD_PATH env vars
- ProcessManager.Start() reads SERVER_BINARY and SERVER_PARAMS from env
  with platform-based defaults as fallback
- SteamCmdManager.run() reads STEAMCMD_PATH from env, defaults to
  'steamcmd'
- Makefile: add SERVER_BINARY/SERVER_PARAMS/STEAMCMD_PATH variables,
  copy stubs to dev-deploy in 'make dev', pass env vars to backend
- .gitignore: add bin/
2026-07-23 20:31:38 +02:00
MrFastwind bc23ad7daa test(backend): add process manager and steamcmd tests with stub scripts
- server_process_test.go: 16 tests covering splitArgs, hasArgPrefix,
  buildAutoArgs (config/port/profiles), buildArgs, resolveModPath (name/
  ID/empty), buildModPath, WriteUserconfigFiles, Start/Stop lifecycle,
  percent-command substitution
- steamcmd_test.go: 9 tests covering CheckWorkshopMod (directory/file/
  empty), SteamCmdManager state machine, DownloadMods/UpdateGame
- testdata/: stub arma3server_x64 and steamcmd scripts for safe process
  testing without real binaries
2026-07-23 20:23:31 +02:00
MrFastwind 311cc01ce5 chore(backend): update go.mod after go mod tidy
- Promote golang.org/x/sys from indirect to direct (used by health.go)
2026-07-23 20:15:54 +02:00
MrFastwind 0e58b36bd2 chore: add make test, test-backend, test-frontend targets
- make test runs both backend and frontend tests
- make test-backend runs 'go test ./...'
- make test-frontend runs 'npm test'
2026-07-23 20:15:36 +02:00
MrFastwind d66f8bdd26 ci: add go test and npm test to CI pipeline, remove redundant npm ci
- ci.yml: add 'go test ./...' and 'npm test' steps
- release.yml: remove redundant 'cd frontend && npm ci' (GoReleaser handles it)
2026-07-23 20:15:31 +02:00
MrFastwind d54c46d2ad chore(frontend): remove unused zustand dependency and fix HTML title
- Remove zustand from package.json (was declared but never imported)
- Fix index.html title from 'arma3-frontend' to 'Arma 3 Server Manager'
2026-07-23 20:15:27 +02:00
MrFastwind f4d98830dc refactor(frontend): extract shared fmtSize, remove duplicate ModEntry, use shared ConfigEditor
- Extract fmtSize to src/utils/format.ts (was duplicated in Mods.tsx and Status.tsx)
- Remove duplicate ModEntry interface from ModlistEditor.tsx, import from types
- Refactor pages/ConfigEditor.tsx to use shared components/ConfigEditor.tsx
- Add enabled option to queries with undefined params to prevent premature fetches
2026-07-23 20:15:19 +02:00
MrFastwind 6e628a0bba fix(backend): replace mutex with atomic state machine in ProcessManager and SteamCmdManager
- ProcessManager: atomic.Int32 state enum (idle/starting/running/stopping)
  eliminates race between IsRunning check and Start/Stop
- SteamCmdManager: atomic.Bool with CompareAndSwap for same protection
- Restart() now propagates Stop() errors instead of swallowing them
2026-07-23 20:15:11 +02:00
MrFastwind 9f232b5225 fix(backend): add path validation to DeleteMod and improve GetLog security
- DeleteMod now validates path prefix against SERVERFILE_DIR and MODS_DIR
  before allowing deletion (prevents arbitrary directory deletion)
- GetLog uses strings.ContainsAny for cross-platform path traversal check
2026-07-23 20:15:06 +02:00
MrFastwind d55200886b docs: rewrite PLAN.md and update CODEBASE.md, README.md
- Full rewrite of PLAN.md to reflect current architecture (27 REST + 3 WS endpoints,
  embedded frontend, automation, scheduler, health check, GoReleaser CI)
- Added health.go, mods.go, scheduler.go, robfig/cron dep to CODEBASE.md
- Added Gitea Actions CI/CD section to CODEBASE.md
- Added conventional commits to code style section
- Added missing API routes and embed/ to README.md
2026-07-23 20:14:56 +02:00
MrFastwind 914e0fbe48 Make deployment-friendly defaults: no env vars needed to run
CI / build (push) Failing after 3s
- Go binary defaults DATA_DIR=./data, SERVERFILE_DIR=./serverfiles
  (relative to cwd) — just copy the binary and run
- MODS_DIR, CFG_DIR, PROFILES_DIR are derived from SERVERFILE_DIR
- Removed DEV_DEPLOY_DIR indirection (was only used for development)
- Makefile expands defaults to ../dev-deploy/... directly for dev
2026-07-09 15:42:54 +02:00
MrFastwind 9aa6fca50e Fix embedded frontend serving: use fs.ReadFile instead of Gin FileFromFS
- FileFromFS with http.FS(embedFS) returned 301 redirects due to
  Gin setting c.Request.URL.Path to a relative path for http.FileServer
- Replace with direct fs.ReadFile + Gin c.Data, determining content
  type via mime.TypeByExtension
- Supports all asset types (JS, CSS, SVG, HTML) and SPA fallback
2026-07-09 15:34:50 +02:00
MrFastwind bc0a252d7d Embed frontend dist into Go binary; remove frontend path from health
- New backend/embed package embeds frontend dist/ via //go:embed
- Go binary serves frontend from embedded FS (no external files needed)
- Dev mode uses placeholder dir (dev.txt) so Go compiles; Vite handles
  frontend in dev mode
- Makefile copies frontend/dist/ to backend/embed/dist/ during build
- Removed FRONTEND_DIR env var and filesystem serving fallback
- Removed frontend path from Health API response and Status page frontend
  section (only Served boolean remains)
- Removed frontendDir from Handler struct/constructor (unused)
2026-07-09 15:27:50 +02:00
MrFastwind 2d301b95b6 Add server health endpoint and status page
Backend:
- New /api/server/health endpoint returning server, paths, disk,
  mods, steamcmd, and frontend status
- Health endpoint checks directory existence/writability, disk usage,
  server binary, and frontend dist availability

Frontend:
- New Status page (route /status) with sections for Server, SteamCMD,
  Mods, Frontend, Directories (with exists/writable badges), and
  Disk Usage (with size formatting and used-percent coloring)
- Paths are clickable to copy and use start-truncation (ellipsis on
  the left) with native hover tooltip
- Health API client integration with 10s auto-refresh

Misc:
- Update .gitignore and Makefile, minor Layout nav addition
2026-07-09 15:22:43 +02:00
MrFastwind 6f782af913 refactor(modlist): replace html/template with text/template and clean up deps
CI / build (push) Failing after 3s
2026-07-09 14:13:09 +02:00
MrFastwind 6774397885 feat: add modlist export to Arma 3 Launcher HTML format
- RenderModlistHTML: generates compatible preset HTML from a modlist
- GET /api/modlists/:id/export: returns downloadable .html file
- Export button on ModlistEditor page
- Skips local mods (no workshop ID), includes only Steam workshop mods
2026-07-06 18:33:24 +02:00
MrFastwind d94593743f ci: add build and distribution pipeline with goreleaser and Gitea Actions
- .goreleaser.yaml: cross-compile linux/windows, Docker image, Gitea releases
- .gitea/workflows/ci.yml: verify build on every push/PR
- .gitea/workflows/release.yml: goreleaser + Docker on tag push
- Dockerfile: switch to debian:bookworm-slim, install steamcmd from Valve
- Dockerfile.goreleaser: minimal image used by goreleaser dockers
- docker-compose.yml: parameterize SERVERS_DIR via env var
2026-07-06 17:35:23 +02:00
MrFastwind cc7cb0bc56 feat(frontend): add Mods page with table view, delete, and cleanup 2026-07-06 16:10:32 +02:00
MrFastwind c06a9a7981 feat(backend): add mod management API endpoints 2026-07-06 16:10:30 +02:00
MrFastwind 26cc812e73 feat(backend): add mod manager service for scanning workshop/local mods 2026-07-06 16:10:24 +02:00
MrFastwind 149a60c6fb feat: add automation features (auto-update, auto-start, scheduled updates) 2026-07-06 16:10:17 +02:00
MrFastwind b853aead8c Initial commit 2026-07-06 14:14:58 +02:00