1.5 KiB
1.5 KiB
tx-sync
Small utility that POSTs txAdmin playersDB.json to your FiveM dashboard on a timer. It does not parse the file; your server ingests the raw JSON.
Server contract (dashboard ingest)
| Item | Value |
|---|---|
| Method | POST |
| Header | X-API-Key: <secret> |
| Header | Content-Type: application/json |
| Body | Raw bytes of playersDB.json |
| URL | Whatever you configure (full URL) |
Usage
- Run the binary once from a console (TTY). If
config.jsonis missing, an interactive wizard creates it next to the executable, then exits. - Run again: it uploads immediately, then every
sync_interval(default5m).
tx-sync [-config path/to/config.json] [-setup]
-setup: run the wizard and exit (overwrites or createsconfig.json).
Configuration (config.json)
Lives beside the binary by default (see -config).
| Field | Description |
|---|---|
endpoint |
Full POST URL |
api_key |
Sent as X-API-Key |
players_db_path |
Path to playersDB.json on disk |
sync_interval |
Go duration string (e.g. 5m, 10m30s) |
Build
go build -trimpath -ldflags="-s -w" -o tx-sync .
Cross-compile (example):
GOOS=linux GOARCH=amd64 GOAMD64=v1 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o tx-sync-linux-amd64 .
GOOS=windows GOARCH=amd64 GOAMD64=v1 CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o tx-sync.exe .
CI builds Linux and Windows binaries via .gitea/workflows/build.yml.