Make SITE_API_KEY not required (#150)

This commit is contained in:
Mish 2026-01-26 18:58:22 +00:00 committed by GitHub
parent 2415abd4b1
commit 6afc28a27c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 7 deletions

View file

@ -10,8 +10,6 @@ SLACK_HELP_CHANNEL="C..."
SLACK_USER_GROUP="S..."
SLACK_MAINTAINER_ID="U..."
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/nephthys"
SITE_URL="https://summer.hackclub.com"
SITE_API_KEY="..."
APP_TITLE="helper heidi"
PROGRAM="summer_of_making"
HACK_CLUB_AI_API_KEY="sk-hc-v1-..."

View file

@ -73,13 +73,11 @@ Note: These steps have to be done by a Workspace Admin (otherwise it will be una
APP_TITLE="Heidi the Assistant"
# Hack Club AI API key for generating ticket titles (highly recommended)
HACK_CLUB_AI_API_KEY="sk-hc-v1-..."
# Set this to anything
SITE_API_KEY="none"
# Set this to the URL where the site will be hosted
BASE_URL="https://summer.nephthys.hackclub.com"
```
- `SITE_API_KEY` (and `SITE_URL`) are only used for generating magic links for Summer of Making, so they don't have to be included (but `SITE_API_KEY` must be set due to a bug)
- `SITE_API_KEY` (and `SITE_URL`) are only used for generating magic links for Summer of Making, so they don't have to be included
3. There's more optional environment variables that you can set, which I shall document here:

View file

@ -22,10 +22,15 @@ class Environment:
self.slack_app_token = os.environ.get("SLACK_APP_TOKEN")
self.uptime_url = os.environ.get("UPTIME_URL")
self.site_url = os.environ.get("SITE_URL", "https://summer.hackclub.com")
self.site_api_key = os.environ.get("SITE_API_KEY", "unset")
self.hack_club_ai_api_key = os.environ.get("HACK_CLUB_AI_API_KEY")
self.site_url = os.environ.get("SITE_URL")
self.site_api_key = os.environ.get("SITE_API_KEY")
if self.site_url and not self.site_api_key:
raise ValueError(
"SITE_API_KEY must be set if SITE_URL is set to generate magic links"
)
self.otel_logs_url = os.environ.get("OTEL_EXPORTER_OTLP_LOGS_ENDPOINT")
self.otel_service_name = os.environ.get("OTEL_SERVICE_NAME", "nephthys")
# Allows easily providing HTTP Basic Auth credentials formatted as user:pass