From f6bc21a1d0de81cd1fb81494d4ab2f3ed104980a Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 17 Dec 2025 23:08:19 +0000 Subject: [PATCH] chore: add KAN_ADMIN_API_KEY to docker and readme --- README.md | 73 ++++++++++++++++++++-------------------- apps/web/src/env.ts | 1 + cloud/docker-compose.yml | 1 + docker-compose.yml | 3 ++ turbo.json | 1 + 5 files changed, 43 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index d09d1742..dd278ef6 100644 --- a/README.md +++ b/README.md @@ -138,44 +138,45 @@ pnpm dev ## Environment Variables 🔐 -| Variable | Description | Required | Example | -| ----------------------------------------- | --------------------------------------------------------- | ------------------------ | ----------------------------------------------------------- | -| `POSTGRES_URL` | PostgreSQL connection URL | To use external database | `postgres://user:pass@localhost:5432/db` | -| `EMAIL_FROM` | Sender email address | For Email | `"Kan "` | -| `SMTP_HOST` | SMTP server hostname | For Email | `smtp.resend.com` | -| `SMTP_PORT` | SMTP server port | For Email | `465` | -| `SMTP_USER` | SMTP username/email | No | `resend` | -| `SMTP_PASSWORD` | SMTP password/token | No | `re_xxxx` | -| `SMTP_SECURE` | Use secure SMTP connection (defaults to true if not set) | For Email | `true` | -| `SMTP_REJECT_UNAUTHORIZED` | Reject invalid certificates (defaults to true if not set) | For Email | `false` | -| `NEXT_PUBLIC_DISABLE_EMAIL` | To disable all email features | For Email | `true` | -| `NEXT_PUBLIC_BASE_URL` | Base URL of your installation | Yes | `http://localhost:3000` | -| `BETTER_AUTH_ALLOWED_DOMAINS` | Comma-separated list of allowed domains for OIDC logins | For OIDC/Social login | `example.com,subsidiary.com` | -| `BETTER_AUTH_SECRET` | Auth encryption secret | Yes | Random 32+ char string | -| `BETTER_AUTH_TRUSTED_ORIGINS` | Allowed callback origins | No | `http://localhost:3000,http://localhost:3001` | -| `GOOGLE_CLIENT_ID` | Google OAuth client ID | For Google login | `xxx.apps.googleusercontent.com` | -| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret | For Google login | `xxx` | -| `DISCORD_CLIENT_ID` | Discord OAuth client ID | For Discord login | `xxx` | -| `DISCORD_CLIENT_SECRET` | Discord OAuth client secret | For Discord login | `xxx` | -| `GITHUB_CLIENT_ID` | GitHub OAuth client ID | For GitHub login | `xxx` | -| `GITHUB_CLIENT_SECRET` | GitHub OAuth client secret | For GitHub login | `xxx` | -| `OIDC_CLIENT_ID` | Generic OIDC client ID | For OIDC login | `xxx` | -| `OIDC_CLIENT_SECRET` | Generic OIDC client secret | For OIDC login | `xxx` | -| `OIDC_DISCOVERY_URL` | OIDC discovery URL | For OIDC login | `https://auth.example.com/.well-known/openid-configuration` | -| `TRELLO_APP_API_KEY` | Trello app API key | For Trello import | `xxx` | -| `TRELLO_APP_API_SECRET` | Trello app API secret | For Trello import | `xxx` | -| `S3_REGION` | S3 storage region | For file uploads | `WEUR` | -| `S3_ENDPOINT` | S3 endpoint URL | For file uploads | `https://xxx.r2.cloudflarestorage.com` | +| Variable | Description | Required | Example | +| ----------------------------------------- | --------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------- | +| `POSTGRES_URL` | PostgreSQL connection URL | To use external database | `postgres://user:pass@localhost:5432/db` | +| `EMAIL_FROM` | Sender email address | For Email | `"Kan "` | +| `SMTP_HOST` | SMTP server hostname | For Email | `smtp.resend.com` | +| `SMTP_PORT` | SMTP server port | For Email | `465` | +| `SMTP_USER` | SMTP username/email | No | `resend` | +| `SMTP_PASSWORD` | SMTP password/token | No | `re_xxxx` | +| `SMTP_SECURE` | Use secure SMTP connection (defaults to true if not set) | For Email | `true` | +| `SMTP_REJECT_UNAUTHORIZED` | Reject invalid certificates (defaults to true if not set) | For Email | `false` | +| `NEXT_PUBLIC_DISABLE_EMAIL` | To disable all email features | For Email | `true` | +| `NEXT_PUBLIC_BASE_URL` | Base URL of your installation | Yes | `http://localhost:3000` | +| `BETTER_AUTH_ALLOWED_DOMAINS` | Comma-separated list of allowed domains for OIDC logins | For OIDC/Social login | `example.com,subsidiary.com` | +| `BETTER_AUTH_SECRET` | Auth encryption secret | Yes | Random 32+ char string | +| `BETTER_AUTH_TRUSTED_ORIGINS` | Allowed callback origins | No | `http://localhost:3000,http://localhost:3001` | +| `GOOGLE_CLIENT_ID` | Google OAuth client ID | For Google login | `xxx.apps.googleusercontent.com` | +| `GOOGLE_CLIENT_SECRET` | Google OAuth client secret | For Google login | `xxx` | +| `DISCORD_CLIENT_ID` | Discord OAuth client ID | For Discord login | `xxx` | +| `DISCORD_CLIENT_SECRET` | Discord OAuth client secret | For Discord login | `xxx` | +| `GITHUB_CLIENT_ID` | GitHub OAuth client ID | For GitHub login | `xxx` | +| `GITHUB_CLIENT_SECRET` | GitHub OAuth client secret | For GitHub login | `xxx` | +| `OIDC_CLIENT_ID` | Generic OIDC client ID | For OIDC login | `xxx` | +| `OIDC_CLIENT_SECRET` | Generic OIDC client secret | For OIDC login | `xxx` | +| `OIDC_DISCOVERY_URL` | OIDC discovery URL | For OIDC login | `https://auth.example.com/.well-known/openid-configuration` | +| `TRELLO_APP_API_KEY` | Trello app API key | For Trello import | `xxx` | +| `TRELLO_APP_API_SECRET` | Trello app API secret | For Trello import | `xxx` | +| `S3_REGION` | S3 storage region | For file uploads | `WEUR` | +| `S3_ENDPOINT` | S3 endpoint URL | For file uploads | `https://xxx.r2.cloudflarestorage.com` | | `S3_ACCESS_KEY_ID` | S3 access key | For file uploads (optional with IRSA) | `xxx` | | `S3_SECRET_ACCESS_KEY` | S3 secret key | For file uploads (optional with IRSA) | `xxx` | -| `S3_FORCE_PATH_STYLE` | Use path-style URLs for S3 | For file uploads | `true` | -| `NEXT_PUBLIC_STORAGE_URL` | Storage service URL | For file uploads | `https://storage.kanbn.com` | -| `NEXT_PUBLIC_STORAGE_DOMAIN` | Storage domain name | For file uploads | `kanbn.com` | -| `NEXT_PUBLIC_AVATAR_BUCKET_NAME` | S3 bucket name for avatars | For file uploads | `avatars` | -| `NEXT_PUBLIC_ATTACHMENTS_BUCKET_NAME` | S3 bucket name for attachments | For file uploads | `attachments` | -| `NEXT_PUBLIC_ALLOW_CREDENTIALS` | Allow email & password login | For authentication | `true` | -| `NEXT_PUBLIC_DISABLE_SIGN_UP` | Disable sign up | For authentication | `false` | -| `NEXT_PUBLIC_WHITE_LABEL_HIDE_POWERED_BY` | Hide “Powered by kan.bn” on public boards (self-host) | For white labelling | `true` | +| `S3_FORCE_PATH_STYLE` | Use path-style URLs for S3 | For file uploads | `true` | +| `NEXT_PUBLIC_STORAGE_URL` | Storage service URL | For file uploads | `https://storage.kanbn.com` | +| `NEXT_PUBLIC_STORAGE_DOMAIN` | Storage domain name | For file uploads | `kanbn.com` | +| `NEXT_PUBLIC_AVATAR_BUCKET_NAME` | S3 bucket name for avatars | For file uploads | `avatars` | +| `NEXT_PUBLIC_ATTACHMENTS_BUCKET_NAME` | S3 bucket name for attachments | For file uploads | `attachments` | +| `NEXT_PUBLIC_ALLOW_CREDENTIALS` | Allow email & password login | For authentication | `true` | +| `NEXT_PUBLIC_DISABLE_SIGN_UP` | Disable sign up | For authentication | `false` | +| `NEXT_PUBLIC_WHITE_LABEL_HIDE_POWERED_BY` | Hide “Powered by kan.bn” on public boards (self-host) | For white labelling | `true` | +| `KAN_ADMIN_API_KEY` | Admin API key for stats and admin endpoints | For admin/monitoring | `your-secret-admin-key` | See `.env.example` for a complete list of supported environment variables. diff --git a/apps/web/src/env.ts b/apps/web/src/env.ts index 3eae3990..b3389c2c 100644 --- a/apps/web/src/env.ts +++ b/apps/web/src/env.ts @@ -14,6 +14,7 @@ export const env = createEnv({ * This way you can ensure the app isn't built with invalid env vars. */ server: { + KAN_ADMIN_API_KEY: z.string().optional(), BETTER_AUTH_SECRET: z.string(), BETTER_AUTH_TRUSTED_ORIGINS: z .string() diff --git a/cloud/docker-compose.yml b/cloud/docker-compose.yml index 78bab191..e8f61dc5 100644 --- a/cloud/docker-compose.yml +++ b/cloud/docker-compose.yml @@ -13,6 +13,7 @@ services: - .env restart: unless-stopped environment: + - KAN_ADMIN_API_KEY=${KAN_ADMIN_API_KEY} - NEXT_PUBLIC_KAN_ENV=${NEXT_PUBLIC_KAN_ENV} - NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL} - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET} diff --git a/docker-compose.yml b/docker-compose.yml index 1e1fc06a..79caeb99 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,9 @@ services: - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET} - POSTGRES_URL=${POSTGRES_URL} + # Admin API key (optional) + - KAN_ADMIN_API_KEY=${KAN_ADMIN_API_KEY} + # SMTP (optional) - SMTP_HOST=${SMTP_HOST} - SMTP_PORT=${SMTP_PORT} diff --git a/turbo.json b/turbo.json index 22b8c9be..58361b3f 100644 --- a/turbo.json +++ b/turbo.json @@ -46,6 +46,7 @@ } }, "globalEnv": [ + "KAN_ADMIN_API_KEY", "POSTGRES_URL", "TRELLO_APP_API_KEY", "TRELLO_APP_SECRET",