Simple rust blog engine
Go to file
Andrey Tkachenko 0e8316588b Crablog Initial Commit 2023-10-19 13:40:13 +04:00
.github/workflows chore: use github actions 2019-08-28 09:32:10 +08:00
migrations Crablog Initial Commit 2023-10-19 13:40:13 +04:00
src Crablog Initial Commit 2023-10-19 13:40:13 +04:00
templates Crablog Initial Commit 2023-10-19 13:40:13 +04:00
.dockerignore fix: musl rust openssl dependency 2019-05-11 11:27:21 +08:00
.gitattributes chore: add git attributes file to ignore css and js calculation in git repo language status. 2020-07-18 15:33:47 +08:00
.gitignore feat: remove extra panel 2019-06-04 11:38:24 +08:00
.travis.yml Crablog Initial Commit 2023-10-19 13:40:13 +04:00
Cargo.lock Crablog Initial Commit 2023-10-19 13:40:13 +04:00
Cargo.toml Crablog Initial Commit 2023-10-19 13:40:13 +04:00
Dockerfile Crablog Initial Commit 2023-10-19 13:40:13 +04:00
LICENSE Initial commit 2018-09-10 11:01:21 +08:00
README.md Crablog Initial Commit 2023-10-19 13:40:13 +04:00
build.rs Crablog Initial Commit 2023-10-19 13:40:13 +04:00
crablog.png Crablog Initial Commit 2023-10-19 13:40:13 +04:00
docker-compose.yml Crablog Initial Commit 2023-10-19 13:40:13 +04:00
rustfmt.toml chore: update actix-web to v1.0.2 2019-06-18 15:57:15 +08:00

README.md

Crablob

a lightweight blog engine written by Rust.

Feature

Cause this project is also the tentative staff I try to write something in Rust, it would not include too many features.

  • Basic Content System without categories
  • Multiple administrators supported
  • Administractor management panel
  • Article management panel
  • Draw supported
  • Customized template
  • RSS supported

Template

Project crablog highly depends on tera, a fast and effective template engine in Rust, which means that you can write your own template with tera syntax.

There are files in template folder as follow, which are the template for each page:

  • admin folder
    • panel.html dashboard of admin panel
    • login.html admin login page
  • homepage.html index of whole site
  • archives.html template of single article page

Obviously you can learn how to write this template by the guide of official template folder, and how to use tera syntax in tera's official website.

How to use it

After deploying crablog to your host, the first thing you need to do is login to the admin panel with url http://yourdomain.com/admin. And the default admin user and password is as follow:

  • Username: admin
  • Password: password

after logging in, please modify the default password of admin. Then you can enjoy the whole project system.

Deploy using Docker

you can easily use Docker to create your own crablog application. And the latest version of it and each tagged version would be built as docker images storing in Docker Hub automatically. So you can easily pull those images by using docker pull andreytkachenko/crablog:latest

Crablog uses PostgresQL as data storage, so before strating crablog application, you need to start your postgres service and link it to crablob.

Crablog image can accept some environment variable for setting up:

  • DATABASE_URL url of postgresQL

Docker Stack

But we recommend to deploy crablog with Docker Swarm or Kubenetes. here is a simple file to create a whole crablog application with postgresQL docker-compose.yml :

version: "3"
services:
  crablog:
    image: andreytkachenko/crablog:latest
    environment:
      DATABASE_URL: postgres://root:password@postgres/crablog
    depends_on:
      - postgres
    networks:
      - backend

  postgres:
    image: postgres:9-alpine
    restart: always
    environment:
      POSTGRES_USER: root
      POSTGRES_PASSWORD: password
      POSTGRES_DB: crablog
    networks:
      - backend

networks:
  backend: