Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
344 lines (322 loc) · 19 KB
/
Copy path.env.example
File metadata and controls
344 lines (322 loc) · 19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
# ─── Core ─────────────────────────────────────────────────────────────────────
# Postgres connection string; Orchard supplies this in production
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/halflife?schema=public"
# 32+ random bytes (`openssl rand -base64 32`). Rotating it invalidates every session
BETTER_AUTH_SECRET=
# Public origin; must exactly match the registered OAuth redirect base, no trailing slash
BETTER_AUTH_URL=http://localhost:3000
# Same value, exposed to the browser for absolute links.
# Also the origin encoded into phone-handoff QR codes: behind an
# ingress the request's own host is internal, and a QR nobody's phone
# can reach is a QR that silently never works.
# Build-time in Docker: the value is inlined into the bundle when the image is
# built, so pass it as a build arg (`--build-arg NEXT_PUBLIC_APP_URL`) and set the
# same value as a runtime env var, which is what the scripts in the image read.
# In production, set this to the PUBLIC ORIGIN – the address people use to reach the
# site. Left blank here on purpose: a copy of this file that still says localhost
# points every project link, review link and committed repo file at localhost.
NEXT_PUBLIC_APP_URL=
# The hosts this deployment answers on, comma-separated. The redirect resolver and
# better-auth's allowed hosts both read this list, so a deployment reached on another
# name (a second ingress, a vanity domain) is a configuration change and not a code
# change. Blank means the default: halflife.hackclub.com and half-life.k.hackclub.dev.
APP_PUBLIC_HOSTS=
# ─── Hack Club Auth (identity, Slack ID, YSWS verification status) ────────────
# OAuth client id from auth.hackclub.com; request one per environment
HCA_CLIENT_ID=
# OAuth client secret
HCA_CLIENT_SECRET=
# OIDC discovery document
HCA_DISCOVERY_URL=https://auth.hackclub.com/.well-known/openid-configuration
# HCA's endpoints, pinned so a rate-limited discovery at startup cannot leave the
# provider unregistered. These are what the discovery document returns; override
# only if HCA moves them. Each falls back to the value below.
# HCA_AUTHORIZATION_URL=https://auth.hackclub.com/oauth/authorize
# HCA_TOKEN_URL=https://auth.hackclub.com/oauth/token
# HCA_USERINFO_URL=https://auth.hackclub.com/oauth/userinfo
# HCA_JWKS_URL=https://auth.hackclub.com/oauth/discovery/keys
# HCA_ISSUER=https://auth.hackclub.com
# true also requests address+birthdate scopes; requires PII_ENCRYPTION_KEY, and
# the HCA app must have both scopes enabled or sign-in is refused for everyone.
PULL_HCA_PII=false
# HKDF input for AES-256-GCM at-rest encryption. Losing it makes stored PII unrecoverable
PII_ENCRYPTION_KEY=
# ─── Hackatime (coding hours for firmware work) ───────────────────────────────
# OAuth client id for linking a Hackatime identity
HACKATIME_CLIENT_ID=
# OAuth client secret
HACKATIME_CLIENT_SECRET=
# Base URL of the Hackatime API
HACKATIME_API_BASE=https://hackatime.hackclub.com
# Lapse — every timelapse is recorded there. Register an OAuth app at Lapse
# with redirect URI https://<host>/api/auth/callback/lapse and the scopes
# user:read timelapse:read.
LAPSE_CLIENT_ID=
LAPSE_CLIENT_SECRET=
LAPSE_API_BASE=https://api.lapse.hackclub.com/api
# Repo checks before a week can be submitted (lib/repo-checks). Set ONE of:
# GH_PROXY_API_KEY for Hack Club's gh-proxy (what Stasis uses), or GITHUB_TOKEN
# (a fine-grained token with public repo read) for the GitHub API. With neither,
# the GitHub API is called unauthenticated: fine locally, 60 requests an hour.
GH_PROXY_API_KEY=
GITHUB_TOKEN=
# ─── GitHub repo sync (devlogs + BOM into the maker's repo) ──────────────────
# A DIFFERENT app from the read-only token above. Register an OAuth app at
# github.com/settings/developers with callback URL
# https://<host>/api/auth/callback/github, then set both. The repo sync asks for
# read:user and repo — write access to the repos a maker can push to — because
# that is the narrowest scope GitHub offers that can commit to a repo the maker
# chooses. Unset, the "Connect GitHub" control is hidden and no project can turn
# the sync on.
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# ─── GitLab repo sync (the same feature, for makers on GitLab) ───────────────
# Register an application at gitlab.com/-/user_settings/applications with the
# scopes api and read_user, and redirect URI
# https://<host>/api/auth/callback/gitlab. `api` is required rather than
# write_repository: GitLab's write_repository scope is Git-over-HTTP only and
# does not cover creating a commit through the REST API. Unset, the "Connect
# GitLab" button is hidden; GitHub keeps working regardless.
GITLAB_CLIENT_ID=
GITLAB_CLIENT_SECRET=
# Optional, for reading public GitLab repos in the pre-submission checks. GitLab
# serves public projects without any token, so this only raises the rate ceiling
# — unlike GitHub there is no proxy pool for it.
GITLAB_TOKEN=
# ─── Uploads (Cloudflare R2, S3-compatible) ──────────────────────────────────
# R2 access key id
S3_ACCESS_KEY_ID=
# R2 secret access key
S3_SECRET_ACCESS_KEY=
# Bucket holding journal images and timelapses
S3_BUCKET_NAME=
# https://<accountid>.r2.cloudflarestorage.com
# Do not append /<bucket>. The app strips one if present, but objects written
# through an endpoint that carried it live under <bucket>/<key> and need
# `uploads:migrate-legacy` before their root-key URLs resolve.
S3_ENDPOINT=
# Public base that objects are served from, INCLUDING any path prefix. A custom
# domain mapped to one bucket serves it at the root, so the base is the bare
# origin (https://assets.example.com). A domain fronting the whole account
# serves each bucket under its own path instead
# (https://assets.example.com/<bucket-name>). Get this wrong and uploads
# succeed while every new image 404s – an older URL can keep working from the
# edge cache, which makes the breakage look intermittent.
# `bun run verify:uploads` checks the whole round trip and will tell you.
S3_PUBLIC_URL=
# Hostname part of S3_PUBLIC_URL; next/image refuses hosts not listed in next.config.ts
# Build-time in Docker: pass it as a build arg (`--build-arg NEXT_PUBLIC_UPLOAD_HOST`),
# because next.config.ts is evaluated during the image build.
NEXT_PUBLIC_UPLOAD_HOST=
# Per-file upload ceiling in bytes (default 100 MiB)
UPLOAD_MAX_BYTES=104857600
# ─── Airtable (RSVP funnel + the YSWS grant sink) ────────────────────────────
# Every Airtable write no-ops with a warning when these are unset, so local dev
# works with no Airtable at all.
# Personal access token with data.records:read/write on the base below
AIRTABLE_API_KEY=
# Half-Life base id (appXXXXXXXXXXXXXX)
AIRTABLE_BASE_ID=
# Table id of "YSWS Project Submission" (tblXXXXXXXXXXXXXX). Half Life writes
# its hand-ins here, and /admin/program imports the pre-season warm-up rows
# the Fillout form left behind in it.
AIRTABLE_YSWS_TABLE_ID=
# Table id of "Signups", the landing page's sign-up list
AIRTABLE_RSVP_TABLE_ID=
# Hack Club unified YSWS base; used to remove rows on un-approval
AIRTABLE_UNIFIED_BASE_ID=app3A5kJwYqxMLOgh
# "Approved Projects" table in the unified base
AIRTABLE_UNIFIED_APPROVED_TABLE=tblzWWGUYHVH7Zyqf
# Optional key for reading the unified base, for T2's duplicate check (data.records:read on the base above). Falls back to AIRTABLE_API_KEY
AIRTABLE_UNIFIED_API_KEY=
# ─── Slack (profile enrichment, review notifications) ────────────────────────
# Create the app from slack-app-manifest.yml at the repo root, then:
# Bot User OAuth Token (xoxb-…) → SLACK_BOT_TOKEN
# Basic Information → Signing Secret → SLACK_SIGNING_SECRET
# The two are independent: a token on its own leaves /api/slack/* rejecting
# every delivery 401, because both routes verify the HMAC signature first.
# xoxb- token; unset disables the outbound calls that need it (profile lookups,
# message posts, invites). The event routes fail closed on the secret instead.
SLACK_BOT_TOKEN=
# Signing secret. Without it the Slack routes 401 every request, silently.
SLACK_SIGNING_SECRET=
# The four channels the auto-invite and ticket relay act on. IDs are at the
# bottom of a channel's details pane; names will not work. The bot must already
# be a member of all of them — conversations.invite requires membership of the
# target, and member_joined_channel only fires for channels the bot is in.
# Anyone joining this channel is added to BULLETIN and HELP
SLACK_MAIN_CHANNEL_ID=
SLACK_BULLETIN_CHANNEL_ID=
SLACK_HELP_CHANNEL_ID=
# Private channel that new/resolved help tickets get mirrored into, and where
# the daily summary (opened/closed counts + leaderboard) is posted
SLACK_TICKETS_CHANNEL_ID=
# The daily project-review summary is posted here.
SLACK_REVIEW_CHANNEL_ID=
# Where a disputed review is announced. Unset: the dispute is still in the
# console and the audit log, just not pushed to Slack.
SLACK_DISPUTES_CHANNEL_ID=
# ─── Profile pictures ────────────────────────────────────────────────────────
# A Slack user's picture is read through Cachet, which caches it behind a stable
# URL (Slack's own image URLs expire). Optional: defaults to Hack Club's Cachet.
# Point this at your own instance to self-host, or leave it unset.
CACHET_BASE_URL=https://cachet.dunkirk.sh
# ─── Journal images ──────────────────────────────────────────────────────────
# The Content-Security-Policy only lets images load from the upload host, the
# identity CDNs and Hack Club's hosts, so an image pasted from anywhere else
# cannot hand a third party every reader's IP address. If your imported journals
# use another image host, list it here (comma-separated hostnames).
JOURNAL_IMAGE_HOSTS=
# ─── HCB (grant payouts) ─────────────────────────────────────────────────────
# The v3 API is read-only; grants are sent through the authenticated v4 API.
# Register an OAuth app at hcb.hackclub.com, invite it to the org as a manager,
# then set either a static token or the refresh-token flow. The app needs
# `card_grants:write` to issue and cancel, `card_grants:read` to check what a
# lost response left behind, and organisation read access to preflight the
# balance. Unconfigured, the v4 issuance on /admin/grants is locked and the old
# "Send grant" action is hidden; the HCB CSV import on that page works without
# any of these, because the file is uploaded to HCB by hand instead.
HCB_ORG_SLUG=
# A static bearer token (simplest)
HCB_ACCESS_TOKEN=
# …or the OAuth application flow. Sign in to Half Life as an admin and press
# "Connect HCB" on /admin/grants: that POST starts the authorisation with a
# state cookie and PKCE, and /api/integrations/hcb/callback exchanges the code
# and stores the refresh token encrypted in hcb_credential, rotating it on
# every refresh. HCB_REFRESH_TOKEN is only a headless bootstrap; leave it blank
# once the callback has been used. Reconnecting from the same page replaces the
# stored token, after a confirmation.
HCB_CLIENT_ID=
HCB_CLIENT_SECRET=
HCB_REFRESH_TOKEN=
# The redirect URI registered on the HCB application:
# https://<host>/api/integrations/hcb/callback. The callback requires the state
# and PKCE verifier the "Connect HCB" action planted, a signed-in admin and a
# top-level navigation, so opening the authorise link by hand no longer
# completes anything. Half Life echoes this value when it refreshes, so no
# redirect reaches the route in normal operation.
HCB_REDIRECT_URI=
# Optional; only for a self-hosted or test HCB.
HCB_BASE_URL=
# Optional; the scopes the authorise link asks for. Defaults to the runbook's
# `restricted card_grants:read card_grants:write organizations:read
# transactions:write`.
HCB_SCOPES=
# Whether a grant's HCB card is checked against the maker before it is paid.
# On by default. HCB renders another account's email only to a token carrying
# `pii` and `admin:write` and authorised by an HCB admin, which an ordinary org
# manager cannot get - so on such a token every grant is refused. Set this to
# false ONLY then: the payment goes ahead and the audit row records that nobody
# checked whose card it was.
HCB_VERIFY_GRANT_OWNER=true
# ─── Client address ──────────────────────────────────────────────────────────
# Set to true ONLY when every request reaches the app through Cloudflare, which
# overwrites cf-connecting-ip. On a direct host it lets a caller pick its own
# rate-limit bucket with a fresh header on every request.
TRUST_CF_CONNECTING_IP=false
# ─── Ari (project review) ────────────────────────────────────────────────────
# Server-only. Create a program at ari.hackclub.com, then copy its three
# secrets in. Without them this integration no-ops and reviews stay local.
# Program id from the Ari program settings
ARI_PROGRAM_ID=
# Signs requests Half Life sends to Ari (ships.create / withdraw / status)
ARI_SIGNING_SECRET=
# A DIFFERENT secret, for verifying inbound webhooks. Without it the webhook
# route answers 503 rather than trusting an unverified body.
ARI_WEBHOOK_SECRET=
# Optional. Only for staging or local tests; defaults to
# https://webhooks.ari.hackclub.com
ARI_BASE_URL=
# Optional. The web app reviewers open, for links in notifications; defaults to
# https://ari.hackclub.com. Distinct from ARI_BASE_URL, which is the API host.
ARI_BASE=
# ─── Ire (shadow review platform) ────────────────────────────────────────────
# Server-only. Ire receives a read-only copy of every hand-in while Ari
# remains the decision surface. All of these are optional; without them the
# shadow integration no-ops and Ari is unchanged.
#
# Ire's API host. IRE_SIGNING_SECRET must equal Ire's
# IRE_INGEST_SECRET. The programme slug, not its opaque id: half-life.
IRE_API_URL=
IRE_PROGRAM=half-life
IRE_SIGNING_SECRET=
# Different secret, for a future inbound Ire webhook. Ire signs
# timestamp.delivery_id.body; it is not the sending secret.
IRE_WEBHOOK_SECRET=
# shadow keeps decisions with Ari. live is the later cutover and is not used by
# the initial read-only integration. Ire's own deployment must also set
# IRE_SHADOW=1; this flag only labels Half Life's side.
IRE_MODE=shadow
# Optional. The Ire web origin for queue links when it differs from
# IRE_API_URL.
IRE_BASE=
# ─── Review file viewer: server-side model conversion ───────────────────────
# STEP/IGES/BREP files too big for the browser (over 100 MB, or that run it out
# of memory) are converted to GLB by FART (hackclub/fart), which runs OpenCascade
# for Fabricate too. FART_TOKEN must be one of the secrets in FART's
# CONVERT_TOKENS. With either unset, the viewer reports that server conversion
# is not set up.
FART_URL=https://fart.hackclub.com
FART_TOKEN=
# Where converted models are kept, and how much disk they may take (default the
# system temp dir, 4096 MB; the oldest results go first).
MODEL_CONVERSION_DIR=
MODEL_CONVERSION_DISK_MB=
# ─── Machine-to-machine ──────────────────────────────────────────────────────
# Bearer token for /api/integrations/*; Orchard jobs present this
INTEGRATION_API_KEY=
# Narrower bearer accepted only by the read-only participant export. The
# export omits email and Slack id for this key; INTEGRATION_API_KEY sees them.
EXPORT_API_KEY=
# ─── Program defaults (seed values for the ProgramSettings row) ──────────────
# After the first migration these live in the database and are edited from
# /admin/program. The env vars are only read when seeding a fresh database.
# ISO date of week 1, day 1. All week math derives from this
PROGRAM_START_DATE=2026-10-05
# IANA zone used for week boundaries and journal effective dates
PROGRAM_TIMEZONE=America/New_York
# ─── Access control ──────────────────────────────────────────────────────────
# Comma-separated emails auto-granted ADMIN on first sign-in; keep this to one or two people
SUPERADMIN_EMAILS=
# true puts HTTP basic auth in front of the whole site (pre-launch / staging)
REQUIRE_BASICAUTH=false
# Only read when REQUIRE_BASICAUTH=true
BASICAUTH_USERNAME=
# Only read when REQUIRE_BASICAUTH=true
BASICAUTH_PASSWORD=
# true writes by Airtable field id (survives column renames). Run `yarn dump-airtable-schema` and fill lib/airtable/schema.ts first
AIRTABLE_USE_FIELD_IDS=false
# true lets unverified accounts buy from the shop. Development only
SKIP_YSWS_VERIFICATION_CHECK=false
# ─── Landing signup sink (only used when Airtable is not configured) ─────────
# Optional POST target for /api/subscribe; falls back to ./data/signups.jsonl
SIGNUP_WEBHOOK_URL=
# Optional bearer for that webhook
SIGNUP_WEBHOOK_TOKEN=
# Signups table name, if the Airtable base names it something else
AIRTABLE_TABLE_NAME=
# ─── Third-party base overrides (leave blank in production) ──────────────────
# Fake/staging hosts for Akairo (Lapse) and HCA's /api/v1/me
LAPSE_WEB_BASE=
HCA_ME_URL=
# ─── Scripts (read by the scripts in scripts/, not by the app) ───────────────
# A deployment needs none of these: the app ignores them, and they are here so
# somebody running a script knows what it wants.
# The base URL the PII verification script runs against (scripts/verify-pii.ts);
# defaults to http://localhost:3000
VERIFY_BASE_URL=http://localhost:3000
# The Ari program the resend and audit log scripts work on, as it appears in an
# ari.hackclub.com URL (scripts/ari-resend-all.ts, scripts/ari-audit-log.ts);
# defaults to Half Life's own
ARI_PROGRAM=
# The `ari_session` cookie the resend and audit log scripts authenticate with. A
# local operator tool – copy it out of a signed-in ari.hackclub.com session, with
# an account holding OVERRIDE_DECISIONS (resend) or VIEW_AUDIT_LOG (audit log).
# Never set this in production.
ARI_COOKIE=
# How many ships the resend script sends at once (default 5)
ARI_CONCURRENCY=
# How many times the resend script retries a failed send (default 5)
ARI_MAX_ATTEMPTS=
# How long the resend script waits between ships, in seconds (default 0)
ARI_DELAY=