Repository navigation
TGK Server 1.0.0
The first release of the server on its own release line. Until now it was built from source (it is part of the
repository since TGK 0.1.0) or taken from the client's nightly builds.
Added
-
Sync server for TGK: one self-contained executable with one SQLite file, for Linux x64 and ARM64
(tgk-server-linux-x64,tgk-server-linux-arm64; no .NET, no ICU needed). Accounts with sign-in by password plus an
authenticator app (TOTP), signed-in devices that users can sign out, password change, and sync of the end-to-end
encrypted vault (the server stores only ciphertext). Each account holds at most 50,000 items and 64 MB. -
Admin commands on the database, also while the server runs:
users,user create <name>(an invite code for
"Create an account", which also works with registration closed),user show|disable|enable|delete|reset-totp| revoke-sessions <name>,registration on|off|status,backup <file>(a consistent copy while the server runs)
and--version. -
--known-proxy <ip|cidr>(orTGK_KNOWN_PROXIES): trustsX-Forwarded-For/-Protofrom a reverse proxy on
another machine (e.g. HAProxy ending TLS for a subdomain), so client addresses and rate limits are right behind it. -
tgk-server-manage, which installs the server on any systemd Linux (a Proxmox LXC too) and looks after it: a new
install has self-registration off; every night it backs up the database and installs a newer server release of the
same MAJOR version (checked against SHA-256 sums; the database is snapshotted first, and a version that does not
answer withinTGK_HEALTH_TIMEOUTseconds, 120 by default, is rolled back and skipped).tgk-server-manage rollbackgoes back to the previous version with its snapshot;statusshows the last update's result. Install:
https://github.com/AlexandruMindra/TGK/releases/download/server/tgk-server-manage.sh(docs/SERVER.md). -
Sync protocol 2: edits from different devices are no longer lost. A pushed change carries the revision of the
item it was made on; when the item changed since, the server does not overwrite it but returns its current version
(conflictsin the push response), and the client merges both and pushes again.GET /api/vault/manifestlists
every item's revision, so clients notice a server restored from an older backup and give back what it lost. -
Version handshake:
/api/inforeportsminClientProtocol, and every other request must name the client's
protocol inX-TGK-Protocol; older clients (TGK 0.4 and earlier) get426 client_outdated("update TGK") instead of
overwriting other devices' edits.
Changed
- A new database starts with self-registration closed, also without the installer (
tgk-server registration on
opens it). Existing databases keep their setting. - A sign-in no longer tells whether the password was right: without a code the server asks for one first, and a
wrong password and a wrong or reused code get the sameinvalid_credentials. Accounts waiting for a new
authenticator (afteruser reset-totp) are locked for everyone after 5 failures from all networks together. - A warning in the log when requests carry
X-Forwarded-Forfrom a proxy that is not trusted (--known-proxy). tgk-server-manage:TGK_AUTO_UPDATE=0in server.env now stops the nightly update; the health check also works
when the server serves HTTPS itself;update --forceof the installed version keeps the way back forrollback.- Sign-in lockouts apply per username and client network: someone else's failed attempts can no longer lock a user
out. Failure counts expire after the 5-minute window, and a full lockout table drops only its oldest entries. - Per-client limits count an IPv6 client by its /64 and an IPv4-mapped address as IPv4.
- Expensive auth requests are limited across all clients: at most one prelogin/login/registration/password change
per CPU at a time, a few more wait briefly, the rest get503 server_busywithRetry-After. - Registering without an invite code gets the same answer for every username while registration is closed, so
pending invites cannot be discovered. - Sessions end 365 days after sign-in at the latest, even when used every day (and after 30 days without use, as
before). - Stricter connection limits (15 s for request headers, 75 s keep-alive, a minimum data rate) and generic messages
for malformed requests. - The server has its own version (
/api/infoandtgk-server --versionreport it in full, e.g.1.0.0) and its
own releases,server-vX.Y.Z; installed servers follow those instead of the client's releases.
Fixed
- Starting under systemd (or from
/) no longer watches the whole file system for settings files before listening,
which took minutes and hundreds of MB of memory. tgk-server-manage(compared with the nightly builds' copy): settings with spaces in/etc/tgk/server.env(e.g.
TGK_EXTRA_ARGS=--rate-limit 40) no longer break updates, backups and thetgk-serveradmin wrapper; an update
whose database snapshot cannot be written (disk full) is aborted with the old server still running, and the free
space is checked before the server is stopped; the server is started again if the update is interrupted; the
health check compares the full version; unit changes ship with updates; a plainupdateskips a failed version too;
installwaits for a running update; downloads are HTTPS only; one release fewer is kept, as intended (3).