项目作者: postlight

项目描述 :
🕵 Encrypt messages for easy sharing
高级语言: TypeScript
项目地址: git://github.com/postlight/secretmsg.git
创建时间: 2019-02-26T13:20:54Z
项目社区:https://github.com/postlight/secretmsg

开源协议:

下载


secretmsg

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.

Requirements

Node.js v10 is required to run this project. If you use Volta, the version has been pinned in the package.json file.

Scripts

  1. # Start a dev server at http://localhost:3333
  2. npm start
  3. # Run jest tests
  4. npm test
  5. # Output production-ready JS & CSS bundles in dist folder
  6. npm run build
  7. # Build files, copy static assets to S3, and deploy worker to Cloudflare
  8. npm run deploy
  9. # Check source files for common errors
  10. npm run lint

Environment Variables

These environment variables are required to deploy the app.

  1. BUCKET=bucket-name
  2. AWS_KEY=XXXACCESSKEYXXX
  3. AWS_SECRET=XXXXXXXXXSECRETXXXXXXXXX
  4. AWS_REGION=us-east-1
  5. CF_ZONE_ID=XXXXXXXXXWORKERZONEIDXXXXXXXXX
  6. CF_KEY=XXXXCLOUDFLAREAUTHKEYXXXX
  7. 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.

  1. # single KV namespace
  2. CF_KV_NAMESPACES="NAME XXXXXXXXXNAMESPACEIDXXXXXXXXX"
  3. # multiple namespace are supported, separate with a comma
  4. CF_KV_NAMESPACES="NS_1 XXXXXXXNAMESPACEIDXXXXXXX, NS_2 XXXXXXXNAMESPACEIDXXXXXXX"

Similarly, you can bind any other strings like with CF_WORKER_BINDINGS

  1. CF_WORKER_BINDINGS="KEY_1 value1, KEY_2 value2"