11# All Things Linux
22
33[ ![ Deploy to Production] ( https://img.shields.io/badge/Production-Deployed-brightgreen )] ( https://allthingslinux.org )
4- [ ![ Deploy to Dev] ( https://img.shields.io/badge/Dev-Deployed-blue )] ( https://allthingslinux-dev.allthingslinux.workers .dev )
4+ [ ![ Deploy to Dev] ( https://img.shields.io/badge/Dev-Deployed-blue )] ( https://allthingslinux.dev )
55
66The official website for All Things Linux ([ allthingslinux.org] ( https://allthingslinux.org ) ).
77
@@ -13,9 +13,8 @@ git clone https://github.com/allthingslinux/allthingslinux.git
1313cd allthingslinux
1414pnpm install
1515
16- # Set up secrets
17- cp .env.secrets.example .env.secrets
18- # Edit .env.secrets with your actual secrets
16+ # Setup Cloudflare bindings (R2, KV) - IMPORTANT: Update wrangler.jsonc with KV ID from output
17+ pnpm run setup:bindings
1918
2019# Start development
2120pnpm run dev:all
@@ -49,20 +48,35 @@ cd allthingslinux
4948pnpm install
5049```
5150
52- ### 2. Configure Secrets
51+ ### 2. Setup Cloudflare Bindings
5352
5453``` bash
55- # Copy templates for environment-specific secrets
56- cp .env.secrets.dev.example .env.secrets.dev # Development (sandbox)
57- cp .env.secrets.prod.example .env.secrets.prod # Production
58- # Edit each file with appropriate credentials (gitignored)
59-
60- # Upload secrets to Cloudflare (when needed for deployment)
61- # pnpm run secrets:dev # Upload dev/sandbox secrets
62- # pnpm run secrets:prod # Upload production secrets
54+ # Create R2 buckets and KV namespaces
55+ pnpm run setup:bindings
56+
57+ # IMPORTANT: Update wrangler.jsonc with the KV namespace ID shown in the script output
58+ ```
59+
60+ ### 3. Configure Secrets
61+
62+ ** For local development** , create ` .env.secrets.dev ` and ` .env.secrets.prod ` files (these are gitignored):
63+
64+ ``` bash
65+ # Create .env.secrets.dev for local development (sandbox credentials)
66+ # Create .env.secrets.prod for production credentials
67+ # Add your secrets following the format: KEY=value (one per line)
68+ ```
69+
70+ ** For CI/CD** , secrets are managed via GitHub Environments (see Deployment section below).
71+
72+ ** Upload secrets to Cloudflare manually** (when needed):
73+
74+ ``` bash
75+ pnpm run secrets:dev # Upload dev/sandbox secrets (sets DEV_* prefixed secrets)
76+ pnpm run secrets:prod # Upload production secrets (sets PROD_* prefixed secrets)
6377```
6478
65- ### 3 . Start Development
79+ ### 4 . Start Development
6680
6781``` bash
6882pnpm run dev:all # Next.js + Wrangler + Trigger.dev
@@ -79,19 +93,21 @@ pnpm run dev:all # Next.js + Wrangler + Trigger.dev
7993
8094** GitHub Actions with GitHub Environments** - Automatic deployments on push/PR:
8195
82- | Branch | Environment | URL |
83- | -------- | ----------- | ------------------------------------------------------------------------ |
84- | ` main ` | Production | [ allthingslinux.org] ( https://allthingslinux.org ) |
85- | PR/other | Development | [ dev.allthingslinux.workers.dev] ( https://dev.allthingslinux.workers.dev ) |
86-
87- ** Setup:** See [ GitHub Environments Setup Guide] ( docs/GITHUB_ENVIRONMENTS_SETUP.md ) for detailed configuration.
96+ | Branch | Environment | URL |
97+ | -------- | ----------- | ------------------------------------------------ |
98+ | ` main ` | Production | [ allthingslinux.org] ( https://allthingslinux.org ) |
99+ | PR/other | Development | [ allthingslinux.dev] ( https://allthingslinux.dev ) |
88100
89101** Quick setup:**
90102
911031 . Create GitHub Environments: ` dev ` and ` prod ` (Settings → Environments)
92- 2 . Add secrets to each environment (see guide for required secrets)
93- 3 . Push to any branch → Auto-deploys via GitHub Actions
94- 4 . Merge to ` main ` → Auto-deploys to production
104+ 2 . Add secrets and variables to each environment:
105+ - ** Secrets** (sensitive): ` QUICKBOOKS_CLIENT_ID ` , ` QUICKBOOKS_CLIENT_SECRET ` , ` QUICKBOOKS_REFRESH_TOKEN ` , ` QUICKBOOKS_REALM_ID ` , ` QUICKBOOKS_ADMIN_KEY ` , ` GITHUB_TOKEN ` , ` MONDAY_API_KEY ` , ` CLOUDFLARE_API_TOKEN ` , ` CLOUDFLARE_ACCOUNT_ID ` , ` TRIGGER_SECRET_KEY `
106+ - ** Variables** (non-sensitive): ` MONDAY_BOARD_ID ` , ` DISCORD_WEBHOOK_URL ` , ` QUICKBOOKS_ENVIRONMENT `
107+ 3 . Push to any branch → Auto-deploys to development environment
108+ 4 . Merge to ` main ` → Auto-deploys to production environment
109+
110+ See [ ` docs/integrations/quickbooks.md ` ] ( docs/integrations/quickbooks.md ) for detailed QuickBooks integration setup.
95111
96112** Workflow:** ` .github/workflows/deploy.yml ` automatically handles branch detection and environment selection.
97113
@@ -122,10 +138,13 @@ pnpm run version:deploy # Deploy latest version
122138### Build Process
123139
124140``` bash
125- # Full production build
141+ # Full production build (Next.js + OpenNext for Cloudflare)
142+ pnpm run build:all
143+
144+ # Next.js build only
126145pnpm run build
127146
128- # Preview build locally
147+ # Preview build locally (tests the Cloudflare Workers build)
129148pnpm run preview
130149```
131150
@@ -139,24 +158,23 @@ pnpm run preview
1391582 . ** Add secrets** to each environment (same secret names, different values per environment)
1401593 . ** Secrets are automatically available** in GitHub Actions workflows
141160
142- See [ GitHub Environments Setup Guide ] ( docs/GITHUB_ENVIRONMENTS_SETUP.md ) for complete setup instructions .
161+ ** Secrets are prefixed ** ( ` DEV_* ` and ` PROD_* ` ) in the single Cloudflare Worker and selected at runtime based on the request host .
143162
144- ### Manual Deployment (Local)
163+ ### Manual Secret Management (Local)
145164
146- ** For manual deployments from your local machine: **
165+ ** Note: ** GitHub Actions automatically manages secrets during CI/CD. Manual secret management is mainly for local testing.
147166
148- ``` bash
149- # 1. Copy templates for each environment
150- cp .env.secrets.dev.example .env.secrets.dev # Sandbox credentials
151- cp .env.secrets.prod.example .env.secrets.prod # Production credentials
167+ ** For manual secret setup from your local machine:**
152168
153- # 2. Edit with real values
169+ ``` bash
170+ # 1. Create .env.secrets.dev and .env.secrets.prod files (gitignored)
171+ # Format: KEY=value (one per line)
154172# .env.secrets.dev: Sandbox QuickBooks + other dev secrets
155173# .env.secrets.prod: Production QuickBooks + other prod secrets
156174
157- # 3 . Upload to Cloudflare (when needed )
158- pnpm run secrets:dev # Dev environment (uses .env. secrets.dev)
159- pnpm run secrets:prod # Production (uses .env. secrets.prod)
175+ # 2 . Upload to Cloudflare Worker (sets prefixed secrets: DEV_*, PROD_* )
176+ pnpm run secrets:dev # Sets DEV_* prefixed secrets
177+ pnpm run secrets:prod # Sets PROD_* prefixed secrets
160178```
161179
162180### Security Notes
@@ -166,7 +184,7 @@ pnpm run secrets:prod # Production (uses .env.secrets.prod)
166184- ** Secrets are encrypted** and managed via ` wrangler secret put ` or GitHub Environments
167185- ** Use ` .dev.vars ` ** only for non-sensitive local config
168186- ** Environment variables** are defined in ` wrangler.jsonc ` per environment
169- - ** No prefixing needed ** : GitHub Environments handle isolation automatically
187+ - ** Prefixed secrets ** : Secrets are stored as ` DEV_* ` and ` PROD_* ` in the single worker, selected at runtime
170188
171189## 📁 Project Structure
172190
@@ -214,12 +232,13 @@ pnpm run version:list # List all versions
214232pnpm run version:deploy # Deploy latest version
215233
216234# Secrets
217- pnpm run secrets:dev # Upload to dev env
218- pnpm run secrets:prod # Upload to prod env
235+ pnpm run secrets:dev # Upload dev secrets (sets DEV_* prefixed)
236+ pnpm run secrets:prod # Upload prod secrets (sets PROD_* prefixed)
219237
220238# Infrastructure
221- pnpm run cf:typegen # Generate Cloudflare types
222- pnpm run coc:generate # Generate Code of Conduct
239+ pnpm run setup:bindings # Setup Cloudflare bindings (R2, KV)
240+ pnpm run cf:typegen # Generate Cloudflare types
241+ pnpm run coc:generate # Generate Code of Conduct
223242```
224243
225244See [ ` PNPM_SCRIPTS.md ` ] ( PNPM_SCRIPTS.md ) for detailed script explanations.
0 commit comments