crablog/README.md

79 lines
2.5 KiB
Markdown
Raw Normal View History

2023-10-13 18:11:23 +04:00
<img align="right" width="128" height="128" src="/crablog.png">
2019-06-02 18:47:32 +04:00
2023-10-13 18:11:23 +04:00
# Crablob
2019-06-02 18:47:58 +04:00
2018-10-14 10:09:40 +04:00
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.
2018-11-20 12:33:56 +04:00
- [x] Basic Content System without categories
- [ ] Multiple administrators supported
- [x] Administractor management panel
- [x] Article management panel
- [x] Draw supported
2019-04-19 11:42:10 +04:00
- [x] Customized template
- [x] RSS supported
2018-10-14 10:09:40 +04:00
## Template
2023-10-13 18:11:23 +04:00
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.
2018-10-14 10:09:40 +04:00
There are files in template folder as follow, which are the template for each page:
- `admin` folder
2019-04-19 11:42:10 +04:00
- `panel.html` dashboard of admin panel
- `login.html` admin login page
- `homepage.html` index of whole site
- `archives.html` template of single article page
2018-10-14 10:09:40 +04:00
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.
2019-04-19 11:42:10 +04:00
## How to use it
2023-10-13 18:11:23 +04:00
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:
2019-04-19 11:42:10 +04:00
- Username: `admin`
- Password: `password`
after logging in, please modify the default password of admin. Then you can enjoy the whole project system.
2018-10-14 10:09:40 +04:00
## Deploy using Docker
2023-10-13 18:11:23 +04:00
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`
2018-10-14 10:09:40 +04:00
2023-10-13 18:11:23 +04:00
Crablog uses PostgresQL as data storage, so before strating crablog application, you need to start your postgres service and link it to crablob.
2018-10-14 10:09:40 +04:00
2023-10-13 18:11:23 +04:00
Crablog image can accept some environment variable for setting up:
2018-10-14 10:09:40 +04:00
- `DATABASE_URL` url of postgresQL
### Docker Stack
2023-10-13 18:11:23 +04:00
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` :
2018-10-14 10:09:40 +04:00
```yml
2018-11-20 12:10:49 +04:00
version: "3"
services:
2023-10-13 18:11:23 +04:00
crablog:
image: andreytkachenko/crablog:latest
2018-11-20 12:10:49 +04:00
environment:
2023-10-13 18:11:23 +04:00
DATABASE_URL: postgres://root:password@postgres/crablog
2018-11-20 12:10:49 +04:00
depends_on:
- postgres
networks:
- backend
postgres:
image: postgres:9-alpine
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
2023-10-13 18:11:23 +04:00
POSTGRES_DB: crablog
2018-11-20 12:10:49 +04:00
networks:
- backend
networks:
backend:
2019-04-19 11:42:10 +04:00
```