mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-21 23:22:34 +01:00
feat: add SQLite support, setup wizard enhancements, and live dashboard
Add zero-dependency SQLite mode so users can run Erupe without
PostgreSQL. A transparent db.DB wrapper auto-translates PostgreSQL
SQL ($N placeholders, now(), ::casts, ILIKE, public. prefix,
TRUNCATE) for SQLite at runtime — all 28 repo files use the wrapper
with no per-query changes needed.
Setup wizard gains two new steps: quest file detection with download
link, and gameplay presets (solo/small/community/rebalanced). The API
server gets a /dashboard endpoint with auto-refreshing stats.
CI release workflow now builds and pushes Docker images to GHCR
alongside binary artifacts on tag push.
Key changes:
- common/db: DB/Tx wrapper with 6 SQL translation rules
- server/migrations/sqlite: full SQLite schema (0001-0005)
- config: Database.Driver field ("postgres" or "sqlite")
- main.go: SQLite connection with WAL mode, single writer
- server/setup: quest check + preset selection steps
- server/api: /dashboard with live stats
- .github/workflows: Docker in release, deduplicate docker.yml
This commit is contained in:
@@ -45,6 +45,15 @@ func (ws *wizardServer) handleClientModes(w http.ResponseWriter, _ *http.Request
|
||||
writeJSON(w, http.StatusOK, map[string]interface{}{"modes": clientModes()})
|
||||
}
|
||||
|
||||
func (ws *wizardServer) handleCheckQuests(w http.ResponseWriter, _ *http.Request) {
|
||||
status := checkQuestFiles("")
|
||||
writeJSON(w, http.StatusOK, status)
|
||||
}
|
||||
|
||||
func (ws *wizardServer) handlePresets(w http.ResponseWriter, _ *http.Request) {
|
||||
writeJSON(w, http.StatusOK, map[string]interface{}{"presets": availablePresets()})
|
||||
}
|
||||
|
||||
// testDBRequest is the JSON body for POST /api/setup/test-db.
|
||||
type testDBRequest struct {
|
||||
Host string `json:"host"`
|
||||
|
||||
Reference in New Issue
Block a user