Skip to content
🕵 Encrypt messages for easy sharing
TypeScript JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
scripts
src
.eslintignore
.eslintrc.json
.gitignore
README.md
jest.config.js
package-lock.json
package.json
tsconfig.json
webpack.client.js
webpack.worker.js

README.md

secretmsg.app

A Cloudflare Workers and Workers KV demo that encrypts messages in the browser and stores them in a global key-value store for easy sharing.

(This project was generated with Cloudflare Worker App Kit)

Crypto

All the cryptography is done in the browser using Triplesec. A library made by the folks at Keybase. They do publish an npm module for Node.js. Unfortunately, that doesn't include the browser version of the library, so I've included the latest release in the repo.

Scripts

# Start a dev server at http://localhost:3333
npm start

# Run jest tests
npm test

# Output production-ready JS & CSS bundles in dist folder
npm run build

# Build files, copy static assets to S3, and deploy worker to Cloudflare
npm run deploy

# Check source files for common errors
npm run lint

Environment Variables

These environment variables are required to deploy the app.

BUCKET=bucket-name
AWS_KEY=XXXACCESSKEYXXX
AWS_SECRET=XXXXXXXXXSECRETXXXXXXXXX
AWS_REGION=us-east-1
CF_ZONE_ID=XXXXXXXXXWORKERZONEIDXXXXXXXXX
CF_KEY=XXXXCLOUDFLAREAUTHKEYXXXX
CF_EMAIL=account@email.com

If you want to use Workers KV you'll need the CF_KV_NAMESPACES environment variable during development and when you deploy.

# single KV namespace
CF_KV_NAMESPACES="NAME XXXXXXXXXNAMESPACEIDXXXXXXXXX"

# multiple namespace are supported, separate with a comma
CF_KV_NAMESPACES="NS_1 XXXXXXXNAMESPACEIDXXXXXXX, NS_2 XXXXXXXNAMESPACEIDXXXXXXX"

Similarly, you can bind any other strings like with CF_WORKER_BINDINGS

CF_WORKER_BINDINGS="KEY_1 value1, KEY_2 value2"
You can’t perform that action at this time.