A blog software. It's meant to be as minimal as possible (thin client), while still maintaining basic readability and styling.
Find a file
2021-04-02 23:16:07 +02:00
content added a div element to prevent the whole left side of a post to be a link 2020-12-05 22:43:11 +01:00
site added a div element to prevent the whole left side of a post to be a link 2020-12-05 22:43:11 +01:00
.gitignore serving social icons from static instead of using the ones from their sites (faster, does not set cookies from <website of icon>) 2020-12-05 22:23:37 +01:00
crablog.env Include a default environment file 2021-02-09 11:51:58 +01:00
docker-compose.yml Include a default environment file 2021-02-09 11:51:58 +01:00
Dockerfile Change docker file structure and reduce image size drastically 2021-02-09 11:44:44 +01:00
README.md we only need sqlite for our diesel_cli 2021-04-02 23:16:07 +02:00

Crablog

Pure rust. Built with actix, diesel, tera, serde and sqlite3.

Build instructions using docker

  1. Clone the repository
git clone https://github.com/leonardlorenz/crablog
cd crablog/site
  1. Install diesel and create a database
cargo install diesel_cli --no-default-features --features "sqlite"
diesel setup --database-url ../content/db.sqlite3
diesel migration run --database-url ../content/db.sqlite3
  1. Set up your configuration file (see below)
  2. Build and run the docker container (Will compile from source and thus take a while)
docker-compose up -d

Configuration environment file

All configuration options are defined in .env, to be created in the same directory as this readme.

An example configuration:

USERNAME=yourusername
EMAIL=me@mydomain.tld
BIND_PORT=8000
SUBMIT_TOKEN=Submit!123 # token needed for submitting
GITHUB_ACCOUNT=usernam3
TWITTER_ACCOUNT=usernam3
MASTODON_ACCOUNT=usernam3@mastodon.social
REDDIT_ACCOUNT=usernam3
DISCORD_ACCOUNT=usernam3

# only needed when not using a docker container
ROOT_PATH=/path/to/template/directory/and/sqliteDB

Routes

  • / site welcome
  • /blog shows the last 5 posts
  • /blog/id/ shows a single post by id
  • /blog/all shows all posts
  • /blog/submit set your submit token and create posts
  • /blog/edit/ edit, delete or hide posts

API Routes

  • /api/blog/posts returns all posts as json