8000 GitHub - peruibeloko/typewriter: Simple CMS for simple blogging
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

peruibeloko/typewriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typewriter

Simple CMS written in TypeScript, runs on Hono and Deno. Data is stored using Markdown files on disk and SQLite for metadata.

Installation

  1. Install Deno
  2. git clone
  3. deno install
  4. Configure typewriter
  5. deno task start

Configuration

Typewriter uses two sources for its config: Either a TOML file or environment variables. The former takes precedence over the latter.

TOML file example (for self hosting)

# A signing secret for your JWT
JWT_SECRET = "some big random string for signing JWTs"

# [Optional] Contains either:
# - A folder where a database file will be created for you
# - A database file itself
DB_PATH = "/some/path/to/folder/or/typewriter.db"

# [Optional] Enables console verbosity. Also prints all registered routes
VERBOSE = false

Environment variables example (for cloud hosting)

# A signing secret for your JWT
export TYPEWRITER_JWT_SECRET="some big random string for signing JWTs"

# [Optional] Contains either:
# - A folder where a database file will be created for you
# - A database file itself
export TYPEWRITER_DB_PATH="/some/path/to/folder/or/typewriter.db"

# [Optional] Enables console verbosity. Also prints all registered routes
export TYPEWRITER_VERBOSE=false

Authentication

Typewriter's authentication model is a combination of an allowlist with OTPs.

There are three steps:

  1. Send a register <email> command on the typewriter CLI to get your email on the allowlist
> register test@example.com
successfully registered test@example.com
  1. Send a POST request to /auth/signup to get an OTP secret
{
  "displayName": "John Smith",
  "email": "john@example.com"
}
  1. Send a POST request to /auth/login to get your JWT
{
  "email": "john@example.com",
  "code": "123456",
}

Usage

Typewriter has its own web server, which answers to RESTful requests. The full API is outlined here (Not built yet)

It also provides a simple CLI for issuing administrative commands, such as registering a new user and gracefully shutting down the server.

Commands

TODO

About

Simple CMS for simple blogging

Topics

Resources

Stars

Watchers

Forks

0