-
Notifications
You must be signed in to change notification settings - Fork 18
config: replace dotenv with varlock for env validation #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Hornet agent configuration schema | ||
| # See CONFIGURATION.md for details on each variable. | ||
| # | ||
| # Secrets live at ~/.config/.env (600 perms, never committed). | ||
| # This schema is deployed to ~/.config/.env.schema alongside the .env file. | ||
| # | ||
| # @defaultSensitive=true | ||
| # @defaultRequired=false | ||
| # --- | ||
|
|
||
| # ── LLM Access ─────────────────────────────────────────────────────────────── | ||
|
|
||
| # API key for the LLM provider (Anthropic, OpenAI, or a proxy) | ||
| # @required @type=string | ||
| # @docs(https://docs.anthropic.com/en/api/getting-started) | ||
| OPENCODE_ZEN_API_KEY= | ||
|
|
||
| # ── GitHub ─────────────────────────────────────────────────────────────────── | ||
|
|
||
| # GitHub Personal Access Token (fine-grained, scoped to agent repos) | ||
| # @required @type=string(startsWith=ghp_) | ||
| # @docs(https://github.com/settings/tokens) | ||
| GITHUB_TOKEN= | ||
|
|
||
| # ── Slack ──────────────────────────────────────────────────────────────────── | ||
|
|
||
| # Slack bot OAuth token | ||
| # @required @type=string(startsWith=xoxb-) | ||
| # @docs("Create a Slack app", https://api.slack.com/apps) | ||
| SLACK_BOT_TOKEN= | ||
|
|
||
| # Slack app-level token (Socket Mode) | ||
| # @required @type=string(startsWith=xapp-) | ||
| SLACK_APP_TOKEN= | ||
|
|
||
| # Comma-separated Slack user IDs allowed to interact with the agent | ||
| # Bridge refuses to start without at least one user ID. | ||
| # @required @sensitive=false @type=string | ||
| # @example="U01ABCDEF,U02GHIJKL" | ||
| SLACK_ALLOWED_USERS= | ||
|
|
||
| # ── Email Monitor ──────────────────────────────────────────────────────────── | ||
|
|
||
| # AgentMail API key | ||
| # @type=string | ||
| # @docs(https://app.agentmail.to) | ||
| AGENTMAIL_API_KEY= | ||
|
|
||
| # Agent's monitored email address | ||
| # @sensitive=false @type=email | ||
| HORNET_EMAIL= | ||
|
|
||
| # Shared secret for email sender authentication | ||
| # @type=string | ||
| HORNET_SECRET= | ||
|
|
||
| # Comma-separated sender email allowlist | ||
| # @sensitive=false @type=string | ||
| # @example="you@example.com,teammate@example.com" | ||
| HORNET_ALLOWED_EMAILS= | ||
|
|
||
| # ── Sentry (optional) ─────────────────────────────────────────────────────── | ||
|
|
||
| # Sentry API bearer token | ||
| # @type=string | ||
| # @docs(https://sentry.io/settings/account/api/auth-tokens/) | ||
| SENTRY_AUTH_TOKEN= | ||
|
|
||
| # Sentry organization slug | ||
| # @sensitive=false @type=string | ||
| SENTRY_ORG= | ||
|
|
||
| # Slack channel ID for Sentry alerts | ||
| # @sensitive=false @type=string(startsWith=C) | ||
| SENTRY_CHANNEL_ID= | ||
|
|
||
| # ── Slack Channels (optional) ─────────────────────────────────────────────── | ||
|
|
||
| # Additional monitored channel (responds to all messages, not just @mentions) | ||
| # @sensitive=false @type=string(startsWith=C) | ||
| SLACK_CHANNEL_ID= | ||
|
|
||
| # ── Kernel (optional) ─────────────────────────────────────────────────────── | ||
|
|
||
| # Kernel cloud browser API key | ||
| # @type=string | ||
| # @docs(https://kernel.computer) | ||
| KERNEL_API_KEY= | ||
|
|
||
| # ── Tool Guard ─────────────────────────────────────────────────────────────── | ||
|
|
||
| # Unix username of the agent | ||
| # @sensitive=false @type=string | ||
| HORNET_AGENT_USER=hornet_agent | ||
|
|
||
| # Agent's home directory | ||
| # @sensitive=false @type=string | ||
| HORNET_AGENT_HOME=/home/hornet_agent | ||
|
|
||
| # Path to admin-owned source repo (enables source repo write protection) | ||
| # @sensitive=false @type=string | ||
| HORNET_SOURCE_DIR= | ||
|
|
||
| # ── Bridge ─────────────────────────────────────────────────────────────────── | ||
|
|
||
| # Local HTTP API port for outbound Slack messages | ||
| # @sensitive=false @type=port | ||
| BRIDGE_API_PORT=7890 | ||
|
|
||
| # Target pi session ID (auto-detects control-agent if unset) | ||
| # @sensitive=false @type=string | ||
| PI_SESSION_ID= |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,13 @@ set -euo pipefail | |
| cd ~ | ||
|
|
||
| # Set PATH | ||
| export PATH="$HOME/opt/node-v22.14.0-linux-x64/bin:$PATH" | ||
| export PATH="$HOME/.varlock/bin:$HOME/opt/node-v22.14.0-linux-x64/bin:$PATH" | ||
|
|
||
| # Load secrets | ||
| # Validate and load secrets via varlock | ||
| varlock load --path ~/.config/ || { | ||
| echo "❌ Environment validation failed — check ~/.config/.env against .env.schema" | ||
| exit 1 | ||
| } | ||
|
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The script introduces a hard dependency on Suggested FixBefore calling Prompt for AI Agent |
||
| set -a | ||
| source ~/.config/.env | ||
| set +a | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.