Giter VIP home page Giter VIP logo

edge-wiki's Introduction

Edge Wiki

A stupid experiment building a Wiki on Cloudflare Workers with Workers KV for persistence.

Durable Objects would probably be a better idea, and enable simple page edit history.

Setup

You will need npm and a Cloudflare account (free).

  1. Run npm install.

  2. You'll need a Workers account, register at https://dash.cloudflare.com/sign-up/workers

  3. Create an API token from the "Edit Cloudflare Workers" template on https://dash.cloudflare.com/profile/api-tokens

  4. Export CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID in the shell you use wrangler

  5. Create a PAGES and a PAGE_INDEX KV namespace through wrangler: https://developers.cloudflare.com/workers/wrangler/cli-wrangler/commands/#kv

  6. Edit wrangler.toml to insert your KV space ids

  7. Set basic auth username and password through the secrets BASICAUTH_USERNAME and BASICAUTH_PASSWORD: https://developers.cloudflare.com/workers/wrangler/commands/#secret

Running

npm run start-worker

Publishing

npm run publish-worker will make your worker public, remember to set the basic auth secrets.

License

MIT, see LICENSE.

Notes

(as of 2022-05-28) wrangler has a transitive dependency on a vulnerable version of dicer, it's been bumped in miniflare cloudflare/miniflare#269 so should soon be fixed in wrangler I assume.

TODO

  • basic auth
  • oidc auth

edge-wiki's People

Contributors

fabjan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.