Store events and config in SQLite
Replace the JSON-file event and config stores with a SQLite database (modernc.org/sqlite, pure-Go so the static build keeps CGO_ENABLED=0). Last-write-wins now rides on the upsert's WHERE clause rather than a Go-side map compare; the sync protocol and HTTP handlers are unchanged. On first start the server auto-imports any legacy events.json/config.json sitting in the data dir, renaming them to *.imported. The -data flag now points at puppy.db; photos still live on the filesystem alongside it.
This commit is contained in:
+1
-1
@@ -53,7 +53,7 @@ in
|
||||
"${cfg.package}/bin/puppy-tracker-server"
|
||||
"-addr ${cfg.address}:${toString cfg.port}"
|
||||
"-static ${cfg.staticPackage}/share/puppy-tracker"
|
||||
"-data /var/lib/puppy-tracker/events.json"
|
||||
"-data /var/lib/puppy-tracker/puppy.db"
|
||||
];
|
||||
|
||||
DynamicUser = true;
|
||||
|
||||
Reference in New Issue
Block a user