{"id":50388160,"url":"https://github.com/design4pro/astro-github-support-form","last_synced_at":"2026-05-30T16:30:20.962Z","repository":{"id":356014313,"uuid":"1230641482","full_name":"design4pro/astro-github-support-form","owner":"design4pro","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-06T08:08:26.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-06T09:38:33.060Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Astro","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/design4pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-06T07:23:33.000Z","updated_at":"2026-05-06T08:08:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/design4pro/astro-github-support-form","commit_stats":null,"previous_names":["design4pro/astro-github-support-form"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/design4pro/astro-github-support-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/design4pro%2Fastro-github-support-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/design4pro%2Fastro-github-support-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/design4pro%2Fastro-github-support-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/design4pro%2Fastro-github-support-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/design4pro","download_url":"https://codeload.github.com/design4pro/astro-github-support-form/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/design4pro%2Fastro-github-support-form/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33700863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T16:30:20.281Z","updated_at":"2026-05-30T16:30:20.950Z","avatar_url":"https://github.com/design4pro.png","language":"Astro","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Astro GitHub Support Form\n\nThis is a small Astro SSR example that turns a website feedback form into GitHub Issues through a GitHub App installation token. It is configured for Cloudflare Workers.\n\nLive demo: https://astro-github-support-form.design4pro.workers.dev\n\nIt is intentionally simple:\n\n- one Astro page with a native HTML form\n- one API route at `POST /api/feedback`\n- server-side GitHub App authentication through Octokit\n- Cloudflare Turnstile verification before issue creation\n- no client-side framework\n- no secret committed to the repository\n\n## GitHub App setup\n\nCreate a GitHub App with these settings:\n\n- App name: `D4P Support Form Demo`\n- Homepage URL: this repository URL\n- Webhooks: inactive\n- Repository permissions:\n  - Metadata: read\n  - Issues: read and write\n- Installation: selected repositories only, then choose this repository\n\nGenerate a private key in the app settings and copy the app ID.\n\n## Local setup\n\n```bash\nbun install\ncp .dev.vars.example .dev.vars\n```\n\nFill `.dev.vars` for local Cloudflare Workers development:\n\n```bash\nGITHUB_APP_ID=1234567\nGITHUB_PRIVATE_KEY=\"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\"\nTURNSTILE_SITE_KEY=1x00000000000000000000AA\nTURNSTILE_SECRET_KEY=1x0000000000000000000000000000000AA\n```\n\n`GITHUB_OWNER`, `GITHUB_REPO`, and the production `TURNSTILE_SITE_KEY` are defined in `wrangler.jsonc` because they are not secrets. The example `.dev.vars` values use Cloudflare's dummy Turnstile keys for local development.\n\nGitHub downloads GitHub App private keys as PKCS#1 PEM files. Cloudflare Workers needs a PKCS#8 PEM for this dependency stack. Convert the downloaded key before putting it in `.dev.vars` or Cloudflare secrets:\n\n```bash\nopenssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt \\\n  -in github-app.private-key.pem \\\n  -out github-app.private-key.pkcs8.pem\n```\n\nThen run:\n\n```bash\nbun run dev\n```\n\nOpen `http://localhost:4321`, submit the form, and check the Issues tab in this repository.\n\n## Cloudflare Workers deployment\n\nThe demo uses `@astrojs/cloudflare` and `wrangler.jsonc`.\n\nCreate a production Turnstile widget for your Workers domain, then replace `TURNSTILE_SITE_KEY` in `wrangler.jsonc`.\n\nSet production secrets in Cloudflare:\n\n```bash\nCLOUDFLARE_ACCOUNT_ID=your-account-id bun x wrangler secret put GITHUB_APP_ID\nCLOUDFLARE_ACCOUNT_ID=your-account-id bun x wrangler secret put GITHUB_PRIVATE_KEY\nCLOUDFLARE_ACCOUNT_ID=your-account-id bun x wrangler secret put TURNSTILE_SECRET_KEY\n```\n\n`GITHUB_OWNER`, `GITHUB_REPO`, and `TURNSTILE_SITE_KEY` are public variables in `wrangler.jsonc`.\n\nDeploy:\n\n```bash\nCLOUDFLARE_ACCOUNT_ID=your-account-id bun run deploy\n```\n\n## API contract\n\n`POST /api/feedback` accepts JSON:\n\n```json\n{\n  \"type\": \"bug\",\n  \"title\": \"Calendar export fails\",\n  \"message\": \"I clicked Export and the request returned a 500 response.\",\n  \"email\": \"reader@example.com\",\n  \"environment\": \"Safari 18, macOS 15\",\n  \"consent\": true,\n  \"turnstileToken\": \"token-from-cf-turnstile-response\",\n  \"company\": \"\"\n}\n```\n\nSuccessful response:\n\n```json\n{\n  \"ok\": true,\n  \"referenceId\": \"SUP-ABC12345\"\n}\n```\n\nValidation error response:\n\n```json\n{\n  \"ok\": false,\n  \"error\": \"Invalid feedback payload\",\n  \"details\": [\"Message must be between 10 and 4000 characters.\"],\n  \"fieldErrors\": {\n    \"message\": [\"Message must be between 10 and 4000 characters.\"]\n  }\n}\n```\n\n## Production notes\n\nFor a real support system, create issues in a private repository, keep Turnstile enabled, add rate limiting, decide what personal data you store, and document the retention policy in your privacy notice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesign4pro%2Fastro-github-support-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdesign4pro%2Fastro-github-support-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdesign4pro%2Fastro-github-support-form/lists"}