Commit graph

27 commits

Author SHA1 Message Date
amir-climy
b2054a6dca chore: sync installers from triton main (2026-05-21)
- fix: image name triton-manage-server → triton-manageserver (matches CI)
- feat: --license-pubkey flag on install.sh
- fix: uninstall/upgrade use detected runtime (podman/docker) not hardcoded
- fix: upgrade pg_dump reads POSTGRES_USER/DB from .env
- feat: force pull image from registry on install and upgrade
- feat: SCRIPT_VERSION printed as first line on every run
- fix: --yes flag on uninstall --purge-data for non-interactive (curl|bash) use

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 23:02:13 +08:00
github-actions[bot]
846cfc3973 chore: sync installers from triton v1.0.0-rc.3 2026-05-21 07:23:44 +00:00
amir-climy
5cb8ce2f63 feat(install): macOS + Windows support
install.sh / uninstall.sh (Linux + macOS):
- Detect OS with uname -s; root check is Linux-only (Docker/Podman Desktop
  on macOS runs rootless, no sudo needed).
- Arch detection adds arm64 case for Apple Silicon (uname -m returns "arm64"
  on macOS, "aarch64" on Linux).
- sed_inplace() wrapper handles BSD sed on macOS (requires empty -i suffix).
- Fix --image flag to append TRITON_MANAGE_IMAGE rather than sed-replace a
  line that is commented out in env.template.
- uninstall: re-apply --purge-data fixes (rm installer dir, drop interactive
  prompt, use $RUNTIME for raw cleanup instead of hardcoded podman).

install.ps1 / uninstall.ps1 (Windows):
- Equivalent logic for Docker Desktop / Podman Desktop on Windows.
- Arch via RuntimeInformation.OSArchitecture (X64 → amd64, Arm64 → arm64).
- Secrets via RandomNumberGenerator (no openssl dependency).
- Parameters: -GatewayHostname, -ManageHostIP, -Image, -NoTls / -PurgeData.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 15:07:13 +08:00
amir-climy
fe90753a37 feat(install): detect and display host architecture (amd64/arm64)
Uses uname -m to detect x86_64/aarch64 and maps to the OCI arch name.
Printed at startup so users can confirm the correct image variant will
be pulled. Fails early on unsupported architectures.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 14:59:39 +08:00
github-actions[bot]
c1158e9938 chore: sync installers from triton v1.0.0-rc.2 2026-05-21 06:58:26 +00:00
amir-climy
a8dcbe9b31 fix(uninstall): delete installer directory on --purge-data
--purge-data now removes /opt/triton-manage-server entirely (volumes,
.env, and installer files). Without --purge-data the directory is kept
so secrets in .env survive a reinstall.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:36:24 +08:00
amir-climy
9d0a608c19 fix(install): make compose.yaml the single source of truth for image name
Remove TRITON_MANAGE_IMAGE from env.template so the name only lives
in one place (compose.yaml default). The --image flag still works by
appending to .env, which overrides the compose default. This prevents
the hyphen/no-hyphen typo from recurring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:33:31 +08:00
amir-climy
f18f0eef48 fix(install): correct image name triton-manage-server → triton-manageserver in env.template
The published ghcr.io image is triton-manageserver (no hyphen).
The hyphenated name in env.template caused the installer to pull the
wrong image, overriding the correct fallback in compose.yaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:28:57 +08:00
amir-climy
1c559e483b fix(uninstall): remove interactive confirmation that breaks curl-pipe installs
--purge-data is already an explicit opt-in; the read prompt causes
'error: aborted' when stdin has no TTY (curl | sudo bash).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 09:15:58 +08:00
github-actions[bot]
4057cebb27 chore: sync installers from triton v1.0.0-rc.1 2026-05-20 15:01:09 +00:00
Amir Yahaya
1d635a9338 feat: remove --license-server-url flag — URL now baked into binary
The License Server URL (https://license.tritonscans.com) is compiled
into the manage-server binary at release time. No need to pass it
during installation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 07:59:56 +02:00
Amir Yahaya
bad2a6f130 fix: print machine ID hash and mount /etc/machine-id for offline .lic binding
install.sh now computes and displays the SHA-3-256 hash of /etc/machine-id
at the end of every run so the customer can share it with the vendor when
requesting an offline .lic bound to this host. The hash is stable — it
never changes after OS installation, so re-running install.sh or restarting
the container will always show the same value.

compose.yaml now mounts /etc/machine-id:ro into the manage-server container
so ReadMachineID() can verify the offline .lic binding at startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 07:32:54 +02:00
amir-climy
f869e9c308 feat(security): add host-bound licence support (/etc/machine-id binding)
- compose.yaml: mount /etc/machine-id read-only into the manage-server container
- install.sh: print SHA-3-256 of /etc/machine-id after install so customers
  can share it with their vendor when requesting a host-bound .lic file
- README.md: document "Host-bound licences" flow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 10:19:44 +08:00
amir-climy
d2a19d4df7 feat(install): drop pubkey file from bundle — single license.lic is enough
Pubkey is now baked into the image at build time. Bundle is just license.lic.
TRITON_MANAGE_LICENSE_SERVER_PUBKEY in .env is optional (compiled-in default
used when empty).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 00:08:17 +08:00
amir-climy
9780ee3601 feat(install): license bundle approach — --license-file replaces pubkey fetch
Remove auto-fetching pubkey from license server. Instead the vendor ships
a bundle (license.lic + pubkey) and the installer reads both files from
the same directory. Works for both online and air-gapped deployments.
--license-server-url is now optional (heartbeats only, not required to start).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 23:29:19 +08:00
amir-climy
bbdc8aa292 feat(install): fetch license pubkey automatically from license server URL
Remove --license-server-pubkey flag. When --license-server-url is given,
the installer fetches the pubkey from GET /api/v1/license/pubkey on the
license server and writes it to .env — the key is never visible to the
operator on the command line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 23:21:05 +08:00
amir-climy
e0e887f97a feat(install): add --license-server-pubkey and --license-server-url flags
These were documented but never implemented. Without TRITON_MANAGE_LICENSE_SERVER_PUBKEY
the server refuses to start. Also add both vars to env.template so users
know they exist and what they're for.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 23:10:06 +08:00
amir-climy
d67086ccd8 fix(uninstall): remove interactive confirmation for --purge-data
The read prompt reads EOF when invoked via curl pipe, causing an
immediate abort. The --purge-data flag is explicit enough to serve
as confirmation — no secondary prompt needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:54:40 +08:00
amir-climy
8ed781a6c1 fix(uninstall): remove cached container image on uninstall
Without image removal, reinstalling reuses the old cached image even if
a newer one is available. Read TRITON_MANAGE_IMAGE from .env (falling back
to :latest) and rmi it after stopping containers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:52:16 +08:00
amir-climy
373f393b03 fix(install): pull latest image before starting containers
Without an explicit pull, compose up reuses the locally cached image even
when a newer one is available on the registry. This caused the old image
(without --chmod=755) to be used on re-runs. Pull first to guarantee the
current released image is always used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:50:53 +08:00
amir-climy
504242308c feat(upgrade): add --port flag to change web UI host port on upgrade
Allows changing the host port at upgrade time:

  curl ... | sudo bash -s -- --upgrade --port 9090

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:45:37 +08:00
amir-climy
3b3de281f6 feat(install): add --port flag to set web UI host port at install time
Passes --port PORT through to TRITON_MANAGE_HOST_PORT in .env so users
can change the default 8082 at install time via the one-liner:

  curl ... | sudo bash -s -- --port 9090

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:45:00 +08:00
amir-climy
f1cec6ac33 fix(scripts): handle BASH_SOURCE[0] unbound when piped via curl
BASH_SOURCE[0] is unset when a script runs via `curl | bash` (no source
file on disk). With `set -u` this triggers "unbound variable" and exits.
Fall back to $0 with ${BASH_SOURCE[0]:-$0} so piped execution works.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:38:47 +08:00
amir-climy
bacccd9550 feat: add --upgrade one-liner and improve upgrade.sh
get.sh --upgrade:
- Re-downloads installer files (compose.yaml, upgrade.sh, etc.) so the
  on-disk scripts are always current before upgrading
- Then execs upgrade.sh with any passthrough flags (e.g. --image TAG)

upgrade.sh improvements:
- Platform-aware backup dir (Linux: /var/backups/triton,
  macOS: ~/Library/Application Support/triton/backups)
- Reads POSTGRES_USER/POSTGRES_DB from .env instead of hardcoding
- Uses detected runtime (podman/docker) for pg_dump exec
- Explicit messaging that DB migrations run automatically on startup
- Health check success confirms migrations applied
- Prints rollback command pointing at the backup file

Usage:
  curl -fsSL .../get.sh | sudo bash -s -- --upgrade
  curl -fsSL .../get.sh | sudo bash -s -- --upgrade --image ...:1.2.0

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 19:19:57 +08:00
github-actions[bot]
c2a7445b1e chore: sync installers from triton v1.0.0-rc.2 2026-05-17 08:33:44 +00:00
github-actions[bot]
f64b71613f chore: sync installers from triton v1.0.0-rc.2 2026-05-17 07:43:44 +00:00
Amir Yahaya
92b0eeec90 feat: initial installer scripts for manage server and license server 2026-05-17 08:57:58 +02:00