Deploy

Setup commands

Prepares, changes, restores and checks a deployment from flags. Global flags are in the CLI hub.

0.11.x

Prepares, changes, restores and checks a deployment from flags. Global flags are in the CLI hub.

gdsgate setup prepare --domain <name> --security-profile <profile>

Write the Authority and Proxy configurations for this server in one run. Values both roles use are asked once. The Proxy uses the generated Authority address. With a SQLite pair this defaults to loopback; PostgreSQL setup needs an individual Authority address.

Shell
gdsgate setup prepare --domain gate.example.com --security-profile pilot \
    --store-url postgres://gdsgate@127.0.0.1:5432/gdsgate \
    --authority-bind 192.0.2.10 \
    --tls-cert /etc/letsencrypt/live/gate.example.com/fullchain.pem \
    --tls-key /etc/letsencrypt/live/gate.example.com/privkey.pem \
    --dry-run
Flag Default Meaning
--domain <name> required The name clients dial.
--security-profile <p> required dev, pilot or production.
--role <pair\|authority\|proxy> pair Which roles this machine gets. pair writes both. authority and proxy put the control plane and the gateway on separate machines; see below.
--authority-host <host> unset Where Authority answers, for --role proxy. Required there. The ports come from the port block.
--authority-bind <addr> pair with SQLite: loopback; PostgreSQL or authority: locally owned IPv4 from --domain, otherwise required What Authority binds its control plane and registration listeners on. Automatic selection requires exactly one active local interface with that address. Set an explicit private bind for DNS, external LB/NAT addresses, IPv6 and saved bundles. Explicit values take priority. With pair, the Proxy dials Authority at this address; at a wildcard, on the loopback.
--enroll-cert <path>, --enroll-key <path> unset What Authority's registration listener presents. Off the loopback, production refuses to start without it. On a --role proxy run, naming the certificate writes https:// into [enroll].endpoint. The certificate is taken to be for --domain: where the Proxy dials another address, [enroll].transport_sni is set to the domain. Unset, a new PostgreSQL Authority issues it from the cluster CA. IP-address registration with a configured store can also use a cluster-issued certificate, see issued by the cluster CA.
--store-url <url> dev: SQLite in the Authority state directory; otherwise required Linux: sqlite:///var/lib/gdsgate/authority/store.db?mode=rwc. Windows: store.db under %ProgramData%\gdsgate\state\authority. The service and administrative commands open the same file. pilot and production require PostgreSQL.
--store-password-file <path> unset store_password_file, for a URL that carries a user and no password. The password does not appear in the URL, the plan or the log.
--oidc-issuer <url>, --oidc-client-id <id> unset The identity provider people sign in at, and gdsgate's client ID there. Written into prepared role files: Authority validates against it, and the Proxy advertises its effective profile to gdsgate connect. production refuses to start an Authority without it. A separate preparation does not read an existing Authority file; authorized Proxy join saves the public profile. For existing files and extended settings, follow profile distribution.
--control-keyring, --audit-keyring, --kms-key unset Keyrings already in place, and the external keys a wrapped reference names.
--authority-output, --proxy-output Linux: /etc/gdsgate/{authority,proxy}.toml; Windows: %ProgramData%\gdsgate\{authority,proxy}.toml Where each configuration goes.
--state-dir <dir> Linux: /var/lib/gdsgate/proxy; Windows: %ProgramData%\gdsgate\state\proxy Persistent Proxy transport identity in the directory the service may write. This flag belongs to the Proxy role; Authority state follows its configured paths.
--listen <addr>, --tls-cert, --tls-key see proxy init The Proxy's half. A connector registering on the client port checks --tls-cert for the name it dials.
--join-relay selected for an IP gateway without --tls-cert, unless --no-public-join Connectors register and renew at the join relay (50064) in place of the client port. Authority's registration certificate verifies the IP address there. See connector route.
--no-public-join off Connectors register at Authority's own listener and take the direct route. See connector route.
--save <dir>, --node <name> unset Write a bundle for another machine; nothing on this machine changes. A bundle written on Windows carries no service files: on the target, run gdsgate service install <role> for each role after setup apply.
--binary <path> this process, or /usr/local/bin/gdsgate for a bundle The program the systemd units name. Refused on Windows.
--unit-dir <dir> /etc/systemd/system Where the systemd units go: an image root, or a directory from which root installs them later. Refused on Windows.
--policy-output <path> beside the Authority configuration Where the seed policy goes.
--access-group <name> admins The identity-provider group the seed policy makes the cluster's owner. It replaces the baseline's placeholder admins in every rule: editPolicy, approvePolicyEdit, approveRequest, manageCatalog, revokeNode, disableUser, issueJoinToken, killSession, viewNodes, viewRecordings, and sessions on every lane. Rules the baseline keeps commented stay commented: forwarding, onward certificates, the client-key grant. rotateCA, enrollNode and viewAudit stay with the administrative certificate. That group grants everyone else access afterwards with authority policy edit.
--port-base <port> 50050 First port of the block: registration, control plane, client, tunnel, WebSocket, relay and paired HA peer listeners at fixed offsets. Range 1..=65520. Change it to run a second deployment on one machine.
--metrics-port <port> 9090 Where /healthz, /readyz and /metrics answer. Not part of the block. The pair's Proxy takes the next port, and so does --role proxy on a host whose authority.toml answers on this one.
--start off After writing, install and start the services: the control plane, an administrative identity, the Proxy's token, the Proxy. Needs root on Linux (systemctl start) or an elevated prompt on Windows (sc.exe start). The install step of setup --tui does the same. Not with --dry-run or --save.
--dry-run, --json, --approve-plan '<reviewed-digest>' off Show the plan; print it as JSON; refuse unless it is the plan that digest names.

Both configurations are one plan with one digest. --dry-run creates nothing, key material included.

Defaults apply to a new configuration. Repeating the original preparation with its saved receipt retains existing files; an existing installation without a matching receipt is refused. Use setup change to edit installed settings. See retry after a failure. Updating the binary keeps the store URL and identity paths already written in those files. A custom --state-dir or --store-url takes precedence over the platform defaults. Only a locally owned IPv4 supplied as --domain can determine the Authority bind automatically. DNS, LB and NAT addresses do not determine a private bind; see Authority addresses.

Start-up checks. The Authority configuration goes through the checks its first start applies. Without --dry-run, a configuration they reject produces no plan, and the refusal names the rule: [oidc].issuer unset under production, [authority].enroll_cert_file naming no certificate under pilot or production, a store_url that is not a postgres:// URL.

With --dry-run, the plan is printed after a to prepare section. Each line is a profile matrix row the written files do not satisfy, the flag that supplies it (or the key to set in the written file), and what the first start does without it. The Proxy is judged as enrolled. Under pilot and production, a Proxy without --tls-cert/--tls-key is listed as not refused: it presents its enrolled identity, which clients trust through gdsgate connect. The dry run exits 1 when a listed item is refused at start. --json carries the list as to_prepare: what, how, at_start.

text
== to prepare for `pilot` ==
x: `store_url` names PostgreSQL (unset or `sqlite://` is SQLite): --store-url (refused at start)
x: Registration listener TLS: `[authority].enroll_cert_file` and `enroll_key_file`: --enroll-cert, --enroll-key (refused at start)
! `[audit].export_path`: in /etc/gdsgate/authority.toml, `[audit].export_path = "/var/lib/gdsgate/authority/audit.jsonl"` (Windows: `%ProgramData%\gdsgate\state\authority\audit.jsonl`), shipped by a log collector (warning at start)
x: `[enroll].endpoint` scheme is `http://`: --enroll-cert (refused at start)
! `[proxy].public_cert_file`, a certificate clients already trust: --tls-cert, --tls-key (not refused at start)

What is written.

Platform Changes, in order
Linux Two keyrings, two configurations, two systemd units. The units carry the hardening of packaging/systemd with the binary and configuration paths filled in. Installing a unit needs root: without it the run stops after the four files and exits 5.
Windows Two keyrings, two configurations. The services are registered by --start, or by gdsgate service install <role> from an elevated prompt; the plan lists them as unchecked.

Seed policy. A cluster with no stored policy runs the deny-all bootstrap, and policy push cannot reach it. The first policy is a file named by [policy].path; Authority stores it as version 1 on its first start. The file is the shipped baseline with admins replaced by --access-group. It grants connect and sshProgram on SSH hosts. Forwarding, onward certificates and sshUseClientKey stay ungranted. The break-glass permit is unchanged.

The --domain flag remains required when preparing a Proxy beside an existing Authority. It names the public gateway entry; --role proxy prepares only the Proxy and reuses the supplied Authority trust. A new PostgreSQL Authority starts with HA and keyring sync enabled. Its paired Proxy derives an individual peer address. Additional roles use join; current Authority membership refreshes automatically.

The first PostgreSQL Authority has a permanent ha.owner and seeds its own HTTPS control endpoint in ha.authority_peers. It initializes the canonical material once. A later host needs an owner-bound bootstrap permission; reusing the database URL cannot initialize a second cluster over existing material. SQLite remains standalone, and existing configurations retain their settings.

Publication. New Authority configurations explicitly select catalog.publication = "auto". Newly admitted Connector identities publish ordinary configured backends within their assigned namespace and scope. Existing files with no field remain manual, and an existing shared policy wins on restart. Change the enrollment policy with authority publication set; existing nodes keep their assigned mode. See manual resource assignments.

Minimum inputs. A pair requires the public address and security profile. dev supplies a persistent SQLite store. pilot and production require PostgreSQL. Every new PostgreSQL Authority, including one under dev, enables HA and needs an individual Authority address, inferred from a locally owned IPv4 public address or supplied with --authority-bind. production also requires OIDC and the configured key providers. An identity provider is always entered as an issuer/client ID pair.

For Authority alone, the public IPv4 address can also provide the bind when it is assigned to exactly one active interface on this server:

Shell
gdsgate setup prepare --role authority --domain "$NODE_IP" \
    --security-profile pilot --store-url "$STORE_URL" \
    --oidc-issuer "$OIDC_ISSUER" --oidc-client-id "$OIDC_CLIENT_ID" \
    --start

Run --start as root or from an elevated Windows prompt. Here NODE_IP must belong to this server. When clients dial an external LB or NAT address, pass --authority-bind "$PRIVATE_IP" as well. DNS names are not resolved to choose an interface. A saved bundle always requires its target's bind; interfaces on the preparing host do not choose it.

In setup --tui, enter OIDC on the Cluster step for any role. A Proxy-only installation writes that provider into its configuration. The wizard runs only when explicitly requested; missing CLI inputs name the required flag.

Bind and advertised addresses. The Proxy binds 0.0.0.0:<port>. The Authority's [endpoints] holds what a node is told at registration and at every renewal, and carries the deployment's name. A node told 0.0.0.0 or 127.0.0.1 cannot reach the gateway.

Authority addresses and PostgreSQL

A postgres:// or postgresql:// store enables HA and keyring synchronization in a new Authority configuration. This also applies to Authority + Proxy on one host and to the dev profile. The group starts with one member; additional Authorities join later. One member alone does not provide failover. Existing configuration files are not changed by updating the binary.

HA needs an address for this particular Authority. Setup uses it for the control and registration listeners and its initial peer destination. A paired Proxy also derives its private peer address from it. Keep these inputs distinct:

Input Example Purpose
Store URL postgres://gdsgate@192.0.2.30:5432/gdsgate Database connection; it says nothing about this host's listener address.
External name / --domain gate.example.com or the public LB IP Entry clients and Connectors reach through Proxy.
Control-plane bind / --authority-bind 192.0.2.10 This Authority's own address, reachable by the other Authority and Proxy hosts.

When the public entry is also an IPv4 assigned to exactly one active local interface, setup can reuse it. Otherwise provide the node's private address: DNS is not resolved to select a bind, and an external LB/NAT address does not identify a local interface. IPv6 and saved bundles also require an explicit bind. Use an address owned by this Authority host, even when the database and gateway are elsewhere. A database or LB address is suitable only if it is also this node's own reachable address. Wildcards such as 0.0.0.0 cannot identify an HA peer.

For a deployment confined to one host, an explicit --authority-bind 127.0.0.1 is accepted. Other hosts cannot reach that address. Before adding a remote Authority or private Proxy peer, configure reachable individual addresses using the Authority HA procedure. Choosing --no-public-join also requires the Authority listeners to be reachable by the registering nodes.

The TUI uses the same rule: entering a PostgreSQL Store URL makes Control-plane bind relevant. Enter the node's own address, or leave it blank when the external IPv4 qualifies for automatic selection. In the Plan, check the resolved listeners and peer destinations before Apply.

Connector route

Flags Proxy file Authority file Discovered registration URL
none, DNS name or supplied public certificate [proxy].public_join = true, [endpoints].authority_enroll [proxy].public_join = true, [connector].authority_transport = "tunneled" https://<domain>:50061
none, IP without a public certificate [endpoints].proxy_join, authority_enroll [endpoints].proxy_join, authority_transport = "tunneled" https://<IP>:50064
--join-relay [endpoints].proxy_join, authority_enroll [endpoints].proxy_join, authority_transport = "tunneled" https://<domain>:50064
--no-public-join neither neither: route direct https://<authority-bind>:50050

Connectors run gdsgate join <public-domain-or-IP> with their backend and permission inputs for every row. The last column describes the discovered registration destination; it is not a required CLI flag. Trust confirmation or an approved --fingerprint verifies public discovery. Explicit registration overrides are described in join.

On tunneled, Authority tells a registering node no Authority address and a renewal address on the gateway: the client port, or the join relay when one is bound. A connector joins with no --route.

The client port presents --tls-cert. Without it, the Proxy presents its enrolled identity. Verified discovery can register through public_join using the accepted CA and proxy.gdsgate.internal. An explicit registration URL needs that TLS name and trust supplied separately; checking the public IP or domain against an enrolled identity fails. See public join for the current diagnostic warning on this configuration. An IP gateway without --tls-cert selects the relay automatically; --join-relay selects it explicitly. It passes registration to Authority's registration listener, whose certificate carries the address.

Issued by the cluster CA

With registration reached by IP address, no --enroll-cert and a store configured, the run has the cluster CA issue the registration certificate. This includes the default persistent store under dev. Not with --save: a bundle carries no key material.

Written Value
Authority, [authority] enroll_cert_from_cluster_ca = true; enroll_cert_file, enroll_key_file in Authority's state directory: /var/lib/gdsgate/authority/enroll.pem, enroll.key (Windows: %ProgramData%\gdsgate\state\authority\)
Proxy, [enroll] endpoint = "https://<authority address>:50050", transport_ca = transport-ca.pem beside proxy.toml
After the files the pair, issued from the cluster CA; the cluster CA in transport-ca.pem

The certificate carries the addresses in Authority's [endpoints], the loopback where registration is bound there, and enroll.gdsgate.internal. It is valid 90 days. Authority issues it again at start and hourly while it runs when it expires within 30 days, lacks an address, or was issued by a CA that is no longer the active one; see enroll_cert_from_cluster_ca.

Connectors pin the cluster CA by transport_ca.fingerprint, the value clients get:

Shell
gdsgate join 203.0.113.10 --enroll-endpoint https://203.0.113.10:50064 \
    --enroll-fingerprint <transport_ca.fingerprint> --serve <id>=ssh connect

On two machines, the control-plane run writes transport-ca.pem beside authority.toml. Copy it beside the gateway's proxy.toml before the gateway run; that run then writes https:// and names it.

The two halves on two machines

--role splits the pair. Run the command once on each machine, the control plane first: the Proxy's enrollment token is issued there.

Shell
# on the control plane, at 10.0.0.5
gdsgate setup prepare --domain gate.example.com --security-profile pilot \
    --role authority --authority-bind 10.0.0.5 \
    --store-url postgres://gdsgate@127.0.0.1:5432/gdsgate \
    --enroll-cert /etc/gdsgate/enroll.pem --enroll-key /etc/gdsgate/enroll-key.pem

# on the gateway
gdsgate setup prepare --domain gate.example.com --security-profile pilot \
    --role proxy --authority-host 10.0.0.5 \
    --enroll-cert /etc/gdsgate/enroll.pem \
    --tls-cert /etc/letsencrypt/live/gate.example.com/fullchain.pem \
    --tls-key /etc/letsencrypt/live/gate.example.com/privkey.pem

Each run writes its own machine's configuration and, on Linux, its own unit. The control-plane run also writes the seed policy and the keyrings. An argument for the other machine is refused: --store-url on a gateway, --tls-cert on a control plane. A gateway run prints no cluster summary; the transport CA fingerprint comes from the control-plane run.

With --no-public-join, --authority-bind is also the address Authority hands to every joining node, so it must be the address other machines reach it at, and a wildcard is refused: with 0.0.0.0 the Proxy still enrolls, and the first connector is refused for lack of an address. On tunneled no address is handed out.

The two runs agree on the route: pass --join-relay or --no-public-join to both, or to neither. The control-plane run prints the gateway command with the flag.

In a split install the registration listener crosses a network and carries one-time tokens. Name --enroll-cert/--enroll-key on the Authority run and --enroll-cert on the gateway run; that writes https:// into [enroll].endpoint. Without it the plan warns that the token crosses in cleartext, and production refuses. Reach the control plane and the registration listener over a private network, or restrict them with a firewall to the cluster's machines.

A completed run prints the JSON summary authority init prints, including transport_ca.fingerprint. Every workstation needs that value; pass it out of band.

Without --start, the run ends by printing the remaining steps in order, and a line saying none of them has been done or checked:

Step Linux (as root) Windows (elevated prompt)
1. Give the services access to their files create the gdsgate group and give it the configuration directory done by service install
2. Start the control plane systemctl enable gdsgate-authority.service, systemctl start gdsgate-authority.service gdsgate service install authority, sc.exe start gdsgate-authority
3. Take an administrative identity authority identities bootstrap --role admin, then [admin] in the Authority configuration same
4. Enroll the Proxy authority tokens create --role proxy; write GDSGATE_ENROLL_TOKEN=<token> to proxy.env, mode 0600; systemctl enable gdsgate-proxy.service, systemctl start gdsgate-proxy.service authority tokens create --role proxy; write the token alone to proxy.token, which the Proxy configuration names; gdsgate service install proxy, sc.exe start gdsgate-proxy
5. Check the host gdsgate doctor same
6. Add resources start the admitted Connector; automatic publication creates its qualified resources. Manual enrollment requires catalog rows and serving assignments first same
7. Set up workstations gdsgate connect <domain>:<port> --fingerprint <sha256>, gdsgate login, gdsgate setup check --role client same

Retry after a failure

Repeat the original setup prepare command. The CLI saves a local receipt beside the first configuration before writing deployment files: authority.toml.prepare.json for a pair or Authority, proxy.toml.prepare.json for a Proxy. The receipt contains paths and hashes of the intended files. It contains no credentials or private keys.

The retry writes missing files and keeps existing files, including comments and manual settings. Different preparation inputs are refused; use setup change to edit installed settings. An existing configuration without a receipt is also refused. A lock prevents two preparations from applying simultaneously. --dry-run creates no receipt or lock; --save writes a complete bundle for the target host. The TUI Apply action uses the same preparation receipt and lock. Repeat Apply with the original answers after a failure. Save carries the selected roles and defers keyring creation to the target host. With --approve-plan, review the retry plan and approve its current digest.

You can add --start to the original command. It reuses the administrative identity, the Proxy's saved enrollment token or its enrolled identity. Running services are left running. A failed start keeps the files for another retry. A valid registration TLS certificate and key are reused; a pair due for renewal is renewed under the existing cluster CA.

The CLI records completed cluster initialization in authority.initialized.json using public CA key hashes, and Proxy enrollment in proxy.enrolled.json. Lost keyrings, a missing initialized CA, or missing or incomplete identities require recovery. A retry does not issue replacement identities for them. A store with a different CA is also refused. Overlapping CA generations are accepted; after a migration that removes all previously recorded generations, use service install with the saved configuration. If an unused enrollment token expires, replace that token explicitly before retrying.

A connector is admitted only for catalogue rows that already exist. A connector declaring another resource has its tunnel closed, and the error does not name the resource. gdsgate join prints the rows its --serve entries need before it uses the token.

Preparing for another machine. With --save, the bundle carries the two configurations and the instruction to create the keyrings; it carries no key material. Whether a keyring already exists is checked on the target: the plan lists it as unchecked. On the target, setup apply --bundle creates the keyrings from the Authority configuration in the bundle.

Shell
# on the workstation
gdsgate setup prepare --domain gate.example.com --security-profile pilot \
    --save ~/setup/gate-01 --node gate-01
# on gate-01, after copying the directory
gdsgate setup apply --bundle ~/setup/gate-01 --dry-run
gdsgate setup apply --bundle ~/setup/gate-01 --approve-plan '<reviewed-digest>'

gdsgate setup change

Change settings of a running deployment. Only the named keys are rewritten; comments, ordering, secret references and other keys stay as they were. The file keeps its mode and owner on Linux and its ACL on Windows.

Shell
# review, then apply the plan that was reviewed
gdsgate setup change --public-port 8443 --dry-run
gdsgate setup change --public-port 8443 --approve-plan '<reviewed-digest>'

# a second resource on the node that serves it
gdsgate setup change --serve prod-db=postgres@192.0.2.40:5432

# a kind the compact form cannot spell: the declaration and the rest of it
gdsgate setup change --serve shop=web --backend shop:url=https://shop.example.com

# one setting of a resource that is already declared
gdsgate setup change --backend prod-db:statement_timeout_ms=30000
Flag Default Meaning
--public-port <port> unset The port clients dial. Written to two files: the Proxy's bind and the Authority's [endpoints].proxy_public, which nodes and clients are given.
--tls-cert <path>, --tls-key <path> unset What the client-facing listener presents.
--serve <id>=<kind>[@<addr>] none A resource to add to what this node serves; repeat for more. Every kind is accepted, unlike gdsgate join; what the triple cannot express goes in --backend. The kind's address key (addr, api_url, url or allow) must come from the triple, a --backend, or the entry already in the file. The plan names the catalogue row it needs.
--backend <id>:<key>=<value> none One setting of one declared resource; repeat for more. Typed as in the file: yes/no is a boolean, digits are an integer, commas make a list. An empty value removes the key. Tables, arrays of tables and maps (routes, db_roles, cage and similar) cannot be edited this way and are left unchanged. @<path> and @- read a value as --set does.
--set <file>:<section>.<key>=<value> none One setting of a role file (authority, proxy or connector); repeat for more. Covers the rest of those files: ports, listener certificates, the identity provider, admission limits, rotation cadence. Typed as --backend; an empty value removes the key. A key with no section is at the file root (store_url); a missing section is created. @<path> reads the value from a file and @- from standard input; the plan does not print it. Use these for secrets, which other accounts on the host can see on a command line. @@ starts a value with @.
--replace off Let --serve rewrite an existing declaration. Without it, a --serve for a resource declared as something else is refused.
--unserve <id> none A resource this node stops serving; repeat for more. The declaration is removed from the file. The catalogue row stays; the plan names gdsgate authority resources remove to remove it. Removing an undeclared resource is not an error.
--authority-config, --proxy-config, --connector-config Installed role configuration Explicit paths override discovery. Multiple installed paths require the corresponding flag.
--checkpoint-dir <dir> .checkpoints beside the first file changed Where copies of the replaced files are kept. gdsgate setup restore reads them from its --from directory; pass the same directory there if you change it here.
--dry-run, --json, --approve-plan '<reviewed-digest>' off Show the plan; print it as JSON; refuse unless it is the plan that digest names.
--restart off After writing, restart the services that read the changed files. Linux: systemctl restart, as root. Windows: sc stop, then sc start, from an elevated prompt. Refused with --dry-run.

Without these path flags, setup change uses the same installed role records as service install and daemon commands. It discovers only the roles needed by the requested changes. Standard platform files remain discoverable. The selected client cluster does not choose local files to edit.

Shell
# Change the Connector registered by setup or join.
gdsgate setup change --backend demo-web:url=http://127.0.0.1:8000 --dry-run

# Choose a specific installation when several Connectors are registered.
gdsgate setup change --connector-config /etc/gdsgate/connector-ha.toml \
    --backend demo-web:url=http://127.0.0.1:8000

Changes retain other settings, comments, credential references and file access permissions. Repeating an applied change produces no file writes and returns exit code 3 (already present). Review with --dry-run; omit it to apply the change and save a checkpoint.

--public-port changes both the Proxy bind and the Authority's [endpoints].proxy_public in one plan. It does not change the firewall or workstations that hold the old port; on each workstation run gdsgate connect <domain>:<new port>.

Adding a resource writes the node's configuration only. The plan names the gdsgate authority resources set row to write, as gdsgate join does; the connector is admitted for the resource once that row exists.

All changes to one file are one write, and its checkpoint holds the file as it was before the run.

Without --restart nothing is restarted, and the run ends by printing the restart command: systemctl restart ... on Linux, Restart-Service ... on Windows. Exit codes are the setup contract, plus 3 when every change was already in place.

gdsgate setup --tui

Opens the full-screen setup wizard. An existing cluster configuration is not required. gdsgate setup without a sub-action prints usage and exits non-zero. Use a terminal at least 60 columns wide and 10 rows high.

Shell
sudo gdsgate setup --tui

On Linux, run as root on a host with systemd to install and start services. On Windows, use an elevated terminal. Without those privileges, Apply writes configuration and prints the remaining commands. To prepare files for another host, save a bundle from Plan and use setup apply on that host.

Choose a task with ↑↓. While install a new deployment is selected, ←→ chooses authority + proxy, authority or proxy. Authority manages identities, policy and the catalog; Proxy accepts connections and routes them to Connectors. Each task has its own steps:

Task Steps
Install a new deployment Task → Cluster → Authority → Proxy → Plan → Apply → Settings → Check
Change one setting in an installed file Task → Change → Settings → Result → Check
Restore a file from a checkpoint Task → Restore → Result → Check
Declare a resource on a connector node Task → Cluster → Connectors → Access → Check
Set up a client on this workstation Task → Cluster → Client → Check

Role steps belonging to another host are skipped. Change and resource editing use files found on this host, including files used by running roles. New installations use the standard configuration directory; an explicit --config PATH uses its parent directory. v on Task shows the survey and its paths. On Windows the survey cannot read running processes, service state or the Resident; it reports those limits.

Defaults and advanced settings

The wizard uses the same configuration generator as setup prepare. Only fields used by the selected task are shown. v shows advanced settings; they keep their defaults when left unchanged. Changing roles or hiding advanced settings keeps the selected field on a visible row.

Setting Default and when to change it
External name Required for installation: the DNS name or IP clients reach. Behind a load balancer, use its address.
Roles Authority + Proxy on this host. Select a single role for separate hosts.
Security profile dev for local testing with SQLite. Select pilot or production for PostgreSQL deployments. Production also requires OIDC and protected key material.
Cluster owners admins: the identity-provider group granted administration by the initial policy. Set the actual group before Apply.
Identity provider and client ID Empty. Set both to enable OIDC. Without OIDC the generated deployment uses development identities; the follow-up instructions explain this.
Store URL Empty with dev uses local SQLite. A PostgreSQL URL enables HA and makes Control-plane bind relevant, including under dev. Pilot/production require PostgreSQL; the password-file setting is under v.
Port base 50050, under v; the public gateway port is 50061. Change the block when these ports are occupied. Invalid or overflowing values are refused.
Output files /etc/gdsgate/authority.toml and /etc/gdsgate/proxy.toml on Linux. --config PATH selects another output directory; Change uses discovered role paths.
Control-plane bind This Authority's own address, not the store or LB address. SQLite pair: loopback. PostgreSQL or Authority-only: reuse an eligible local external IPv4, otherwise enter an address. For a single host, explicit 127.0.0.1 is accepted; remote HA members need a reachable node address. See Authority addresses.
Join relay auto, under v. IP-only deployments enable it automatically. Connector commands discover the verified registration route from the gateway.
Registration and public TLS Optional explicit certificate/key pairs. Cluster-generated TLS supports IP-only deployment; callers confirm the CA fingerprint. Public browser access has separate DNS/TLS requirements.
Keyrings, policy, state and service paths Generated defaults; existing values are preserved. Advanced fields allow explicit paths. Production key providers are configured through the full configuration workflow.

Review, apply and verify

Plan shows the files, values and effects before anything is written. s saves a bundle; a on Apply writes the reviewed installation. As root on Linux, Apply then:

  1. Checks that listeners for roles not already running are available.
  2. Installs and starts Authority, then waits for it to answer.
  3. Creates the local administrative identity and the Proxy enrollment token.
  4. Installs and starts Proxy, then checks readiness.

Windows uses service registration and service-account permissions for the same sequence. Apply stops on failure and shows completed, failed and unattempted steps. Correct the cause and retry; saved configuration and identities are retained. Commands for other hosts remain instructions: Apply does not register a remote Connector or sign in on a workstation.

Check re-reads this host's files and running roles and prints doctor commands with the role and exact configuration path. It does not prove that a remote resource is reachable or that a user is authorized. Run the displayed Connector and client checks to verify those separately.

Changes, resources and restore

Change edits a public port, TLS pair or compact backend declaration. c saves a checkpoint, writes the files and applies runtime changes to the affected roles. A supported hot change uses the role's reload channel. A refusal leaves the running configuration intact and shows a retry command; it does not fall back to a restart. As root, a change requiring restart restarts only the affected managed services and ends their sessions. If a matching role is stopped or cannot be managed here, the result lists the remaining action.

Settings shows all keys as a tree. ←→ on the file root selects a role file; open a section, edit values and use w to save. Connectors similarly edits local backend entries: a adds, d removes and w saves. Saving these trees writes files and checkpoints; apply runtime changes with reload --role connector or restart when the changed settings require it. A new Connector on another host gets a join command to run there. Automatic publication uses the node's assigned scope; manual publication needs administrator catalog entries and Connector assignments. The Access step prints SSH policy instructions; it does not apply them or configure policy for other protocols.

Restore lists checkpoints; r restores the selected files. Later edits are skipped and named in the report. Restore does not reload or restart a role. Run the displayed reload command for supported settings, or restart the affected role for settings requiring restart. Restoring files does not undo cluster-side identity, policy or catalog changes.

Client prints connect, login, resources list, up and status --explain; it does not run them. On first connection, compare the CA fingerprint with the administrator's value before accepting trust. The local state uses the selected context when one exists; --config PATH overrides it.

Keys and display

Key Action
b, n Previous or next step
↑↓ Select a task, field, tree row or checkpoint; scroll reports
←→ Change a choice; open/close tree sections; move the caret while editing
Enter From the step rail, focus the selected step's body. In the body, start/finish editing, open a tree row, or advance as shown in the footer
Tab Switch between the step rail and the body
Home, End, Delete Move within or edit a value
Esc Leave a field with its typed value, close a tree node, or step back
v Show/hide advanced fields; on Task, show/hide the host survey
? Show/hide the step and field descriptions
Ctrl←→ Scroll long literal commands and values horizontally
s, a, c, r, w The current step's action, shown in the footer
q Exit, outside a text field

While editing a field, the footer shows editing keys. Enter or Esc keeps the typed value and finishes editing; Tab finishes editing and returns to the step rail. Letters are entered as text, including q, b and n.

Report prose wraps to the available width. Commands and field values retain their exact text and can be scrolled. From 60 to 79 columns the rail folds into the context line. Below the minimum size the wizard reports the limit and exits.

Marks are + change, ! effect, ? unchecked, ✓ done and ✗ failed. Colour repeats the mark; NO_COLOR disables colour. A partial failure remains failed when navigating away. The exit code records the last applied operation, using the setup contract.

gdsgate setup restore

Restore files a change replaced. Before replacing files, setup change saves their content and mode to an owner-only .checkpoints directory beside the first of them. setup restore writes them back.

Shell
gdsgate setup restore --list
gdsgate setup restore --dry-run                 # the newest checkpoint
gdsgate setup restore --approve-plan '<reviewed-digest>'
Flag Default Meaning
--from <dir> /etc/gdsgate/.checkpoints on Linux, %ProgramData%\gdsgate\.checkpoints on Windows Where the checkpoints are.
--checkpoint <name> the newest Which one, by the name of its directory.
--list off List what is kept and stop there.
--over-a-later-edit off Restore a file that was edited after the change, discarding that edit.
--dry-run, --json, --approve-plan '<reviewed-digest>' off Show the plan; print it as JSON; refuse unless it is the plan that digest names.
--restart off Restart the services that read the restored files, as setup change --restart does. Refused with --dry-run and --list.

When a new checkpoint is taken, the oldest beyond twenty are removed. Nothing else removes them.

Only files are restored. A catalogue row, a policy, an identity, a certificate authority, a revocation and the activation epoch are reverted with a new change: authority resources set, authority policy push.

The plan names what cannot be restored before anything is written: a file edited since the change (left alone unless --over-a-later-edit), a saved copy this binary would not start with, a file the change created. Without --restart nothing is restarted, and the run ends by saying so.

gdsgate setup check [--role client]

Report what is set up on this machine and what is missing. It makes no network connection and works without a route to the gateway.

Shell
gdsgate setup check --role client
# installation https://gate.example.com:50061
# ✓ trust anchor ~/.gdsgate/ca.pem
# ✓ signed in as alice@example.com at https://idp.example.com/realms/gdsgate
# the identity is good for 7h
# ? which groups this cluster resolves you into ... gdsgate resources list
# ? what you may reach. The catalogue is the cluster's: gdsgate resources list

A gateway gdsgate connect wrote without [client].transport_ca has a publicly issued certificate; its line is ✓ trust anchor: this host's trust store. Group membership and the catalogue are decided by the cluster. Both are shown as ? with the command that reports them.

--json prints the same lines with the marks spelled as words.

gdsgate setup apply --bundle <dir>

Apply a prepared bundle on the host it was written for.

Shell
gdsgate setup apply --bundle ~/setup/gate-01 --dry-run
gdsgate setup apply --bundle ~/setup/gate-01 --approve-plan '<reviewed-digest>'

The bundle's files are checked against its report, then the node name. The plan is then rebuilt against this host; approvals from the preparing run do not carry over.

A bundle writes only to absolute paths of .toml, .cedar, .service and .keys files, and reads only files inside its own directory. A bundle naming anything else is refused before a plan is built. As root on Linux or from an elevated prompt on Windows, --approve-plan is required: run --dry-run first and approve the digest it prints.

Before the first approved write, apply saves <first-config>.bundle.json beside the Authority configuration, or the first role configuration when there is no Authority. A matching receipt makes a retry keep existing files, including manual settings, and write missing files. Review the retry plan with --dry-run and approve its new digest. Paths and hashes in the receipt identify the original preparation; a different bundle recipe is refused. No credentials or private keys are copied into the receipt.

The first approved apply can replace an existing file as shown in its plan. Repeat apply refuses changed identity/storage references and lost keyrings. The bundle and node checks run on every retry. The receipt lock prevents simultaneous application. Preview and approval failure create no receipt. Apply prepares files and keyrings; it does not start services or initialize a cluster CA. If a local preparation recorded an initialized CA, apply also checks that it is still in the saved store before writing files.

Flag Meaning
--bundle <dir> The directory --save wrote.
--approve-plan '<reviewed-digest>' Refuse unless the plan rebuilt here is the one that digest names. Required as root or elevated.
--target-is-this-host Go ahead although the bundle names another node, or this host's name cannot be read.
--dry-run, --json Show the plan; print it as JSON.

Exit codes, shared by every command that applies a plan:

Code Meaning What to do
0 applied in full -
1 nothing applied read the refusal
4 the plan no longer matches what is there prepare again and review
5 some steps are done, one refused continue from where it stopped

gdsgate setup kubernetes configure

Configure one cluster in the installed Connector configuration. Use --config for a different file. The command edits existing backend/source tables, preserves other resources and comments, and saves a checkpoint before applying. It starts no service and makes no API or Authority call.

Purpose Generated declarations
api Kubernetes API backend; no discovery source
discovery Discovery source; no Kubernetes API backend
both API backend and discovery source

The ID identifies both declarations locally. Reusing the ID updates its purpose; changing from both to discovery removes its API backend. A conflicting kind or duplicate ID is refused before writes. An existing inline Kubernetes probe moves to the discovery source, retaining its filters and polling interval.

Before configuring discovery, obtain the Connector's Registry UUID from authority nodes list and match it to the node column in authority scopes list. For an automatic Connector, use its assigned prefix, such as conn-k8s/. For a manual Connector, have the administrator create an explicit scope first. The source ID and scope prefix are different values; setup does not allocate a namespace. See publication modes.

Inside a Pod, with its ServiceAccount token mounted:

Shell
DISCOVERY_SCOPE='<assigned prefix from authority scopes list>'
gdsgate setup kubernetes configure inventory \
    --purpose discovery --scope "$DISCOVERY_SCOPE"

Setup derives the HTTPS API address from KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT_HTTPS (default 443). The CA and token paths use the standard ServiceAccount mount. Set automountServiceAccountToken: true or provide a projected token and explicit paths. Discovery needs list rights; API access additionally needs impersonation rights.

Outside Kubernetes, select a context explicitly:

Shell
gdsgate setup kubernetes configure production \
    --purpose both --context production --scope "$DISCOVERY_SCOPE" \
    --token-path /etc/gdsgate/kubernetes-api.token \
    --discovery-token-path /etc/gdsgate/kubernetes-discovery.token

Local kubectl config view reads the selected context from ~/.kube/config; --kubeconfig PATH selects another file. Setup reads the API address, public CA, and tokenFile reference. Embedded CA data is saved beside the Connector config under a content-derived filename. Credentials, client keys, inline tokens and credential plugins are not imported. Provide a ServiceAccount token path when the context has none. Token files remain referenced and are reread by Connector, including projected token rotation. A context disabling TLS verification is refused.

Existing addresses, CA/token references and discovery settings take priority over inferred defaults. Override them with --api-url, --ca-path, --token-path and --discovery-token-path. Different API and discovery credentials remain separate on subsequent runs. Discovery-only can use platform TLS roots when no CA is named; API access requires a CA path.

--scope names the publication boundary already authorized by Authority. Setup does not create that grant or a manual API catalog resource. A new source defaults to Services with selector gdsgate.io/expose=true; use --sources service,pod,node and --label-selector SELECTOR to change them. Existing selectors are retained.

Review with --dry-run; use --json for the plan and --approve-plan DIGEST to require that same plan on apply. Drift stops writes. An unchanged invocation returns exit 3. After applying, restart Connector and check its discovery and resource status. setup restore restores the configuration checkpoint; a newly imported public CA can remain as an unused file.

Search this documentation edition.