Files
tx-sync/README.md
T
jamie 38dc37149c
tx-sync build / build (tx-sync-linux-amd64, amd64, linux) (push) Failing after 50s
tx-sync build / build (tx-sync-windows-amd64.exe, amd64, windows) (push) Failing after 6s
feat: initial commit
2026-03-21 01:02:52 +00:00

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

  1. Run the binary once from a console (TTY). If config.json is missing, an interactive wizard creates it next to the executable, then exits.
  2. Run again: it uploads immediately, then every sync_interval (default 5m).
tx-sync [-config path/to/config.json] [-setup]
  • -setup: run the wizard and exit (overwrites or creates config.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.