23 stable releases

1.4.3 Nov 25, 2022
1.3.5 Nov 22, 2022
1.1.1 Oct 28, 2022

#155 in Template engine

Download history 4/week @ 2024-02-26 17/week @ 2024-03-11 316/week @ 2024-04-01

333 downloads per month

MIT license

50KB
1K SLoC

Rust 1K SLoC // 0.0% comments JavaScript 255 SLoC

insight

insight is a web server allowing you to edit markdown articles and host the rendered result publicly.

Features

  • customizable homepage (it's an article as well)
  • anonymous and email-protected articles (sending emails requires easy DKIM/SPF configuration)
  • CSS queries-based light/dark theme selection
  • on-disk JSON database → easy backups
  • easily dockerized

To-do

  • email templates
  • automatic deletion of anonymous posts after configurable duration

Setup

  1. Install the Rust toolchain
  2. Get insight:
$ cargo install insight
  1. Create config.json:
{
    "domain-name": "i.l0.pm",
    "dkim-private-key-path": "dkim.pem",
    "dkim-selector": "insight2022",
    "articles-dir": "articles",
    "mail-dir": "mail",
    "mail-username": "insight",
    "listen-address": "127.0.0.1:9090",
    "new-article": "new",
    "manage": "manage",
    "home": "home",
    "allow-creation": true
}
  1. Create required directories:
$ mkdir articles mail
  1. Start the server:
$ insight -c config.json

This will accept requests from all IP addresses

  1. Access the server from a web browser to generate the home page: http://localhost:9090/
  2. Edit your home page
  3. Save the home page edition link (which is secret) to be able to edit it again later
  4. Go to http://localhost:9090/new to create other posts.

Security considerations

HTML tags are currently stripped from posts at render-time to prevent cross-site scripting vulnerabilities. We rely on the pulldown_cmark crate to detect these tags. If you manage to get any JS code to execute in the post viewer via markdown, please file an issue because it shouldn't happen.

License: MIT

Dependencies

~19–32MB
~605K SLoC