Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maple3142/cf-webhook
https://github.com/maple3142/cf-webhook
cloudflare cloudflare-workers workers
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/maple3142/cf-webhook
- Owner: maple3142
- Created: 2023-11-23T20:51:15.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-08T06:46:06.000Z (6 months ago)
- Last Synced: 2024-08-08T21:48:31.813Z (6 months ago)
- Topics: cloudflare, cloudflare-workers, workers
- Language: HTML
- Homepage:
- Size: 165 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - maple3142/cf-webhook - (HTML)
README
# cf-webhook
A [webhook.site](https://webhook.site/)-like service running on Cloudflare Workers or self-hosted using Bun.
## Deployment (using D1 as backing storage)
1. Install [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
2. `wrangler d1 create cf-webhook` to create a Durable Object named `cf-webhook`
3. Edit `wrangler.toml` and update `database_id` in `d1_databases` section to the id of the created Durable Object. (Also update `database_name` if you used a different name)
4. Comment out or remove `kv_namespaces` sections in `wrangler.toml`.
5. `wrangler d1 execute cf-webhook --file=./schema.sql`
6. `wrangler publish`
7. Visit the published URL and you should see the web interface.## Deployment (using KV as backing storage)
1. Install [Wrangler](https://developers.cloudflare.com/workers/wrangler/install-and-update/)
2. `wrangler2 kv:namespace create files` and `wrangler2 kv:namespace create requests` to create necessary KV namespaces
3. Edit `wrangler.toml` and update `namespace_id` in `kv_namespaces` section to the id of the created KV namespace. (Ensure the `id` matches the correct `binding`)
4. Comment out or remove `d1_databases` section in `wrangler.toml`.
5. Edit `BACKING_STORAGE` in `vars` section to `kv`.
6. `wrangler publish`
7. Visit the published URL and you should see the web interface.## Deployment (with Bun)
1. `bun run ./src/bun-entry.ts`
## Deployment (with Docker)
1. `docker compose up -d`
## Development
### Setup env vars
Create `.dev.vars` file with the following content:
```bash
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin
```### Setup Local D1
```bash
wrangler2 d1 execute cf-webhook --local --file=./schema.sql
```## Demo instance
* URL: https://cf-webhook.fly.dev/
* Logs: https://cf-webhook.fly.dev/logs
* Edit: https://cf-webhook.fly.dev/editUsername: `admin`, Password: `admin`