Skip to content

feat: read the bridge's bot token and bridge secret from the host secrets file - #88

Merged
EthanThatOneKid merged 1 commit into
mainfrom
bridge-host-secrets
Sep 23, 2026
Merged

EthanThatOneKid merged 1 commit into
mainfrom
bridge-host-secrets

Conversation

@EthanThatOneKid

Copy link
Copy Markdown
Contributor

The Discord Gateway bridge runs as a Zo process service, which starts from a bare environment: it inherits neither the host shell nor the deployment's Vercel variables. DISCORD_BOT_TOKEN and DISCORD_BRIDGE_SECRET exist on Vercel as sensitive values that cannot be read back, so a service definition could not carry them.

lib/host-secrets.ts reads them from /root/.zo_secrets — the same file the other Zo-hosted bots load — before anything reads the environment. An environment value always wins over the file, and ZO_SECRETS_PATH overrides the location, so both the service definition and the file stay able to supply any value.

This makes the bridge registrable without duplicating credentials into the service definition.

…rets file

A Zo process service starts from a bare environment: it inherits neither the
host shell nor the deployment's Vercel variables, and the token and shared
secret are stored there as sensitive values that cannot be read back. Load
them from /root/.zo_secrets instead, so the service definition carries only
the non-secret routing configuration. The environment still wins over the
file.
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
computer Ready Ready Preview Sep 23, 2026 9:27pm UTC

@wazoocomputer

wazoocomputer Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request modifies the Discord Gateway bridge to read DISCORD_BOT_TOKEN and DISCORD_BRIDGE_SECRET from the host secrets file (/root/.zo_secrets) instead of environment variables. This change ensures that these sensitive credentials are not duplicated in the service definition, aligning with how other Zo-hosted bots load their secrets. An environment variable will still override values from the host secrets file.

File Change Type Summary
README.md modified Updates deployment instructions for host secrets.
bridge/discord-gateway/index.ts modified Imports and calls loadHostSecrets to fill credentials.
lib/host-secrets.test.ts added Adds tests for parsing and loading host secrets.
lib/host-secrets.ts added Implements logic to parse and load host secrets.

Reviewers should begin by examining lib/host-secrets.ts to understand the new secret loading mechanism.

1 similar comment
@wazoocomputer

wazoocomputer Bot commented Sep 23, 2026

Copy link
Copy Markdown

This pull request modifies the Discord Gateway bridge to read DISCORD_BOT_TOKEN and DISCORD_BRIDGE_SECRET from the host secrets file (/root/.zo_secrets) instead of environment variables. This change ensures that these sensitive credentials are not duplicated in the service definition, aligning with how other Zo-hosted bots load their secrets. An environment variable will still override values from the host secrets file.

File Change Type Summary
README.md modified Updates deployment instructions for host secrets.
bridge/discord-gateway/index.ts modified Imports and calls loadHostSecrets to fill credentials.
lib/host-secrets.test.ts added Adds tests for parsing and loading host secrets.
lib/host-secrets.ts added Implements logic to parse and load host secrets.

Reviewers should begin by examining lib/host-secrets.ts to understand the new secret loading mechanism.

@EthanThatOneKid
EthanThatOneKid merged commit b50887e into main Sep 23, 2026
3 checks passed
@EthanThatOneKid
EthanThatOneKid deleted the bridge-host-secrets branch September 23, 2026 21:37

This branch was successfully deployed

1 active deployment
Preview — f1b606f4 Deployed Sep 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant