feat(installer): seed slack allowlists + allow-all-users via values.yaml#112
Merged
Conversation
cmd_render_gateway_runtime_env grows three new values-driven env vars: - SLACK_ALLOWED_CHANNELS from slack.runtime.allowed_channels - GATEWAY_ALLOW_ALL_USERS from gateway.allow_all_users (bool) - (SLACK_ALLOWED_USERS empty-list semantics already in place) All three land in <auth>/gateway-runtime.env which is loaded by the z-runtime-env.conf systemd drop-in (lexical sort: loads LAST, wins). That means values.yaml is now the single source of truth for slack allowlists; stale assignments in legacy auth/slack.env or /etc/default/hermes-gateway are overridden on every install. Motivation: the krustentier rails deploy went stale because PR #109 never rendered into the running tree, but even after re-rendering the gateway dropped in-thread @mentions because (a) SLACK_ALLOWED_CHANNELS in auth/slack.env was an older single-channel value masking the 3- channel list in config.yaml, and (b) SLACK_ALLOWED_USERS was empty so the gateway denied every user in normal flow. Routing both through the existing values-driven render-gateway-runtime-env step makes re-running setup-hermes.sh sufficient to propagate channel/user allowlist edits across all hosts. deploy.values.yaml additions: - gateway.allow_all_users: true (the deployment trusts channel-level authz via slack.runtime.allowed_channels; per-user gate is redundant) - schema-doc entries for slack.runtime.allowed_channels and gateway.allow_all_users. 8 new tests across TestRenderGatewayRuntimeEnv covering write/empty/ non-list/non-bool/absent cases for both new fields. 181 total in test_values_helper.py pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lafawnduh1966
approved these changes
May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends
installer/values_helper.py:cmd_render_gateway_runtime_envto emit three more values-driven env vars into<auth>/gateway-runtime.env:SLACK_ALLOWED_CHANNELSfromslack.runtime.allowed_channelsGATEWAY_ALLOW_ALL_USERSfromgateway.allow_all_users(bool)SLACK_ALLOWED_USERS(already existed) gets a documented empty-list contract for clearing stale env valuesPlus
deploy.values.yamlschema docs + seeds for the new fields, and 8 new tests acrossTestRenderGatewayRuntimeEnv.Why
The
z-runtime-env.confsystemd drop-in loadsgateway-runtime.envLAST in lexical drop-in order (thez-prefix is intentional, per its docstring), so anything emitted here OVERRIDES the same env var staged earlier byauth/slack.envor/etc/default/hermes-gateway. This is the right place for values-derived runtime config because:stage-secrets.shruns intoauth/slack.envget cleanly overridden without operators needing to chase them down.setup-hermes.shis sufficient to propagate channel/user allowlist edits across the fleet.Production fallout that motivated this: PR #109's bypass for in-thread @mentions deployed cleanly, but the gateway still dropped @bot replies in
#brix-feedback-sandboxbecause:SLACK_ALLOWED_CHANNELS=C0B23MZ0USVinauth/slack.env(left by an olderstage-secrets.shrun) masked the 3-channel list inconfig.yaml→ the allowlist gate at_handle_slack_messageblocked the feedback-sandbox channel.SLACK_ALLOWED_USERS=was empty → the gateway's per-user authz gate denied every user.Operator fix today: manually drop the stale env line + add
GATEWAY_ALLOW_ALL_USERS=trueto.hermes/.env. Operator fix tomorrow: updatedeploy.values.yamland re-runsetup-hermes.sh.Schema (new)
Both fields are optional. Omitted fields don't emit the corresponding env var.
Behavior matrix
allowed_channels: [C_A, C_B]SLACK_ALLOWED_CHANNELS=C_A,C_Ballowed_channels: []SLACK_ALLOWED_CHANNELS=(wipes stale)allowed_channelsabsentallow_all_users: trueGATEWAY_ALLOW_ALL_USERS=trueallow_all_users: falseGATEWAY_ALLOW_ALL_USERS=false(wipes stale)allow_all_usersabsentHow to verify
python3 -m pytest tests/installer/test_values_helper.py -q(181 pass; 8 new inTestRenderGatewayRuntimeEnv).cat /home/hermes/.hermes/auth/gateway-runtime.envshould show all three vars; gateway logs should not warnNo user allowlists configured; in-thread@bot file 1in#brix-feedback-sandboxshould reach the agent (bypass + allowlist + user-gate all pass).