Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions docs/heroku-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ heroku create codebar-auth-production --region eu

# app.json is NOT read by `heroku create`, so provision everything manually:
heroku stack:set heroku-26 -a codebar-auth-production
heroku labs:enable runtime-dyno-metadata -a codebar-auth-production
heroku addons:create heroku-postgresql:essential-0 --as DATABASE -a codebar-auth-production

# Set required GitHub OAuth credentials
Expand Down Expand Up @@ -59,14 +60,15 @@ After deploying, update your GitHub OAuth app settings:

## Environment Variables

| Variable | Source | Description |
| ---------------------- | ---------------- | ---------------------------- |
| `DATABASE_URL` | Auto-provisioned | PostgreSQL connection string |
| `GITHUB_CLIENT_ID` | Required | GitHub OAuth client ID |
| `GITHUB_CLIENT_SECRET` | Required | GitHub OAuth client secret |
| `BETTER_AUTH_SECRET` | Auto-generated | Session encryption key |
| `CODEBAR_AUTH_URL` | Auto-set | Application base URL |
| `PORT` | Heroku | Dyno port |
| Variable | Source | Description |
| ------------------------ | --------------------- | ---------------------------------- |
| `DATABASE_URL` | Auto-provisioned | PostgreSQL connection string |
| `GITHUB_CLIENT_ID` | Required | GitHub OAuth client ID |
| `GITHUB_CLIENT_SECRET` | Required | GitHub OAuth client secret |
| `BETTER_AUTH_SECRET` | Auto-generated | Session encryption key |
| `CODEBAR_AUTH_URL` | Auto-set | Application base URL |
| `PORT` | Heroku | Dyno port |
| `HEROKU_RELEASE_VERSION` | runtime-dyno-metadata | Static asset cache-busting version |

## Files

Expand Down
10 changes: 3 additions & 7 deletions src/app/components/layout.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { html } from "hono/html";

// Derive a version stamp for cache-busting static assets.
// HEROKU_SLUG_COMMIT is the deployed git SHA, set automatically by Heroku.
// Falls back to SOURCE_VERSION (build-time env), then 'dev' for local.
const STATIC_VERSION =
(process.env.HEROKU_SLUG_COMMIT || process.env.SOURCE_VERSION || "").slice(
0,
7,
) || "dev";
// HEROKU_RELEASE_VERSION is set by Heroku when runtime-dyno-metadata is enabled.
// Falls back to 'dev' for local development.
const STATIC_VERSION = process.env.HEROKU_RELEASE_VERSION || "dev";

// Base layout component
export const Layout = ({ title, children }) => html`
Expand Down