-
Notifications
You must be signed in to change notification settings - Fork 0
feat: ChittyRegister CI/CD registration pipeline #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0352d3c
chore: add helper script to set CHITTY_REGISTER_TOKEN on CF worker
e578666
fix: handle already-registered response in register workflow
7db5967
feat: add ChittyConnect env var and fix status check
18d6aaf
fix: add root wrangler.toml for CF Workers Builds
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
| # Sets CHITTY_REGISTER_TOKEN on the chittyregister Cloudflare Worker. | ||
| # Run from a machine with CLOUDFLARE_API_TOKEN set, or with wrangler auth. | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # | ||
| # Usage: | ||
| # CLOUDFLARE_API_TOKEN=<token> bash scripts/set-register-token.sh <token-value> | ||
| # # OR from the chittyregister project dir: | ||
| # echo "<token-value>" | wrangler secret put CHITTY_REGISTER_TOKEN --name chittyregister | ||
|
|
||
| ACCOUNT_ID="0bc21e3a5a9de1a4cc843be9c3e98121" | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| WORKER_NAME="chittyregister" | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| TOKEN_VALUE="${1:?Usage: $0 <token-value>}" | ||
|
|
||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if [ -z "${CLOUDFLARE_API_TOKEN:-}" ]; then | ||
| echo "ERROR: CLOUDFLARE_API_TOKEN not set." >&2 | ||
| echo "Get one at: https://dash.cloudflare.com/profile/api-tokens" >&2 | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Setting CHITTY_REGISTER_TOKEN on $WORKER_NAME..." | ||
| curl -sS -X PUT \ | ||
| "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/scripts/$WORKER_NAME/secrets" \ | ||
| -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"name\":\"CHITTY_REGISTER_TOKEN\",\"text\":\"$TOKEN_VALUE\",\"type\":\"secret_text\"}" | jq . | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo "Done. Test with:" | ||
| echo " curl -sS -X POST https://register.chitty.cc/api/v1/register \\" | ||
| echo " -H 'Authorization: Bearer $TOKEN_VALUE' \\" | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| echo " -H 'Content-Type: application/json' \\" | ||
| echo " --data @deploy/registration/chittyfinance.registration.json | jq ." | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Cloudflare Workers configuration for ChittyFinance (System Mode) | ||
| # Root-level config for CF Workers Builds integration | ||
| # Canonical config: deploy/system-wrangler.toml (keep in sync) | ||
|
|
||
| name = "chittyfinance" | ||
| main = "server/worker.ts" | ||
| compatibility_date = "2026-03-01" | ||
|
|
||
| account_id = "0bc21e3a5a9de1a4cc843be9c3e98121" | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| workers_dev = false | ||
|
|
||
| routes = [ | ||
| { pattern = "finance.chitty.cc/*", zone_name = "chitty.cc" } | ||
| ] | ||
|
|
||
| [vars] | ||
| MODE = "system" | ||
| NODE_ENV = "production" | ||
| APP_VERSION = "2.0.0" | ||
| CHITTYCONNECT_API_BASE = "https://connect.chitty.cc" | ||
|
|
||
| [observability] | ||
| enabled = true | ||
|
|
||
| [[tail_consumers]] | ||
| service = "chittytrack" | ||
|
|
||
| [build] | ||
| command = "npx vite build --outDir dist/public" | ||
|
|
||
| [assets] | ||
| directory = "dist/public" | ||
|
|
||
| [limits] | ||
| cpu_ms = 50 | ||
|
|
||
| [[kv_namespaces]] | ||
| binding = "FINANCE_KV" | ||
| id = "517b63be4d7144c197b5bdf851f12041" | ||
| preview_id = "89d0b3bc875e49c4a3a9091de6a080aa" | ||
|
|
||
| [[r2_buckets]] | ||
| binding = "FINANCE_R2" | ||
| bucket_name = "chittyfinance-storage" | ||
| preview_bucket_name = "chittyfinance-storage-preview" | ||
|
|
||
| [[durable_objects.bindings]] | ||
| name = "CF_AGENT" | ||
| class_name = "ChittyAgent" | ||
|
|
||
| [[migrations]] | ||
| tag = "v1" | ||
| new_sqlite_classes = ["ChittyAgent"] | ||
|
|
||
| [env.staging] | ||
| name = "chittyfinance-staging" | ||
| vars = { MODE = "system", NODE_ENV = "staging" } | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [env.production] | ||
| name = "chittyfinance" | ||
| vars = { MODE = "system", NODE_ENV = "production" } | ||
|
|
||
| compatibility_flags = ["nodejs_compat"] | ||
chitcommit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.