Skip to content

TGK Server 1.0.0

Choose a tag to compare

@github-actions github-actions released this 30 Nov 11:07
· 9 commits to main since this release

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> (or TGK_KNOWN_PROXIES): trusts X-Forwarded-For/-Proto from 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 within TGK_HEALTH_TIMEOUT seconds, 120 by default, is rolled back and skipped). tgk-server-manage rollback goes back to the previous version with its snapshot; status shows 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
    (conflicts in the push response), and the client merges both and pushes again. GET /api/vault/manifest lists
    every item's revision, so clients notice a server restored from an older backup and give back what it lost.

  • Version handshake: /api/info reports minClientProtocol, and every other request must name the client's
    protocol in X-TGK-Protocol; older clients (TGK 0.4 and earlier) get 426 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 same invalid_credentials. Accounts waiting for a new
    authenticator (after user reset-totp) are locked for everyone after 5 failures from all networks together.
  • A warning in the log when requests carry X-Forwarded-For from a proxy that is not trusted (--known-proxy).
  • tgk-server-manage: TGK_AUTO_UPDATE=0 in server.env now stops the nightly update; the health check also works
    when the server serves HTTPS itself; update --force of the installed version keeps the way back for rollback.
  • 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 get 503 server_busy with Retry-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/info and tgk-server --version report 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 the tgk-server admin 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 plain update skips a failed version too;
    install waits for a running update; downloads are HTTPS only; one release fewer is kept, as intended (3).