{"id":13550197,"url":"https://github.com/Charca/cloudflare-pages-auth","last_synced_at":"2025-04-02T23:32:05.484Z","repository":{"id":43302198,"uuid":"446004717","full_name":"Charca/cloudflare-pages-auth","owner":"Charca","description":"Basic Authentication for Cloudflare Pages","archived":false,"fork":false,"pushed_at":"2024-10-28T23:59:18.000Z","size":569,"stargazers_count":236,"open_issues_count":8,"forks_count":61,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-29T00:28:37.228Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Charca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-01-09T05:45:44.000Z","updated_at":"2024-10-28T23:59:22.000Z","dependencies_parsed_at":"2024-08-01T12:17:53.831Z","dependency_job_id":"157a10a3-8f56-48d9-b85f-f2e7709af9df","html_url":"https://github.com/Charca/cloudflare-pages-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charca%2Fcloudflare-pages-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charca%2Fcloudflare-pages-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charca%2Fcloudflare-pages-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Charca%2Fcloudflare-pages-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Charca","download_url":"https://codeload.github.com/Charca/cloudflare-pages-auth/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246911268,"owners_count":20853653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-01T12:01:30.065Z","updated_at":"2025-04-02T23:32:04.928Z","avatar_url":"https://github.com/Charca.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# cloudflare-pages-auth\n\nStatic site that is password-protected when deployed to Cloudflare Pages. This is a SvelteKit project, but the password-protection works independently of the framework you use.\n\n![Screenshot](screenshot.png)\n\n## 🚀 Getting Started\n\nIf you want to password-protect your own Cloudflare Pages site, you'll need to:\n\n1. Copy the contents of the `functions` directory from this repo into your own project.\n2. Add a `CFP_PASSWORD` environment variable to your Cloudflare Pages dashboard with the password you want to use.\n\nThe next time you deploy your site, it will be password-protected! 🎉\n\n\u003e ⚠️ Note: You might want to update your Cloudflare project settings to be \"[Failed closed](https://developers.cloudflare.com/pages/functions/pricing/#fail-closed)\". Otherwise, your site will be unprotected if you reach your daily limit of Function requests. Thanks Thomas for letting me know about this!\n\n## 🛠 Running Locally\n\nSince this is a SvelteKit project, first run the build command to generate the static site:\n\n```bash\nnpm run build\n```\n\nThen, you'll need to use the [wrangler](https://github.com/cloudflare/wrangler2) CLI to run the site (with functions) locally:\n\n```bash\nnpx wrangler pages dev build -b CFP_PASSWORD=test\n```\n\nNotice that you'll need to pass the `CFP_PASSWORD` environment variable when running the CLI command. If you don't pass it, the site will not be password-protected.\n\n## 💅 Customization\n\n- The `functions/template.ts` file contains the HTML template of the login page. You can customize it to your liking.\n- The `functions/constants.ts` contains some other things you can customize, like the expiration of the auth cookie, or the list of paths that don't require authentication.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCharca%2Fcloudflare-pages-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCharca%2Fcloudflare-pages-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCharca%2Fcloudflare-pages-auth/lists"}