Add some docs

This commit is contained in:
Jan-Lukas Else 2021-07-15 18:56:03 +02:00
parent b82a6c59e8
commit a933f47c7a
4 changed files with 100 additions and 9 deletions

View File

@ -11,7 +11,7 @@ The goals of GoBlog are:
- Flexibility
- IndieWeb
To configure GoBlog, take a look at the `example-config.yml` file and save your configuration to `config\config.yml`.
To configure GoBlog, take a look at the `example-config.yml` file and save your configuration to `config\config.yml`. How to install and run GoBlog is explained in the [docs](docs/install.md).
Administration paths:
@ -22,6 +22,4 @@ Administration paths:
- Webmentions: `/webmention`
- Comments: `/comment`
More detailed documentation on how to use GoBlog yourself will follow soon.
[jlelse](https://jlelse.blog)

42
docs/build.md Normal file
View File

@ -0,0 +1,42 @@
# How to build GoBlog
There are two ways to build GoBlog:
## With Docker
(There are already pre-built images available at `rg.fr-par.scw.cloud/jlelse/goblog:latest` and `rg.fr-par.scw.cloud/jlelse/goblog:tools`)
- Linux
- git
- docker
Build command:
```bash
git clone https://git.jlel.se/jlelse/GoBlog.git
cd GoBlog
docker build -f Dockerfile -t rg.fr-par.scw.cloud/jlelse/goblog:latest .
```
If you want to build and use the advanced image (with additional tools), also execute:
```bash
docker build -f Dockerfile.Tools -t rg.fr-par.scw.cloud/jlelse/goblog:tools .
```
## With Go installed
Requirements:
- Linux
- git
- go >= 1.16
- libsqlite3 >= 3.31 (the newer the better)
Build command:
```bash
git clone https://git.jlel.se/jlelse/GoBlog.git
cd GoBlog
go build -tags=linux,libsqlite3,sqlite_fts5 -o GoBlog
```

46
docs/install.md Normal file
View File

@ -0,0 +1,46 @@
# How to install and run GoBlog
It's recommended to install GoBlog using Docker (Compose). You can simply pull the latest image from `rg.fr-par.scw.cloud/jlelse/goblog:latest` (basic image) or `rg.fr-par.scw.cloud/jlelse/goblog:tools` (for when you want to use `sqlite3`, `bash` or `curl` in hook commands) when there are updates. Those images are tested and contain all necessary libraries and tools.
Create your config file (`./config/config.yml`) with inspiration from `example-config.yml` and create a new data directory (`./data`). For static files, you can also create a directory at `./static`.
Then you can use Docker Compose to run GoBlog. Here's an example `docker-compose.yml` file:
```yaml
version: "3"
services:
goblog:
container_name: goblog
image: rg.fr-par.scw.cloud/jlelse/goblog:latest # or :tools
restart: unless-stopped # auto restart the container
volumes:
- ./config:/app/config # Config directory
- ./data:/app/data # Data directory, used for database, keys, uploads etc.
- ./static:/app/static # Static directory, if you want to publish static files
environment:
- TZ=Europe/Berlin # You timezone
```
If you don't want to use a reverse proxy (like Caddy) you can also publish the ports directly from the GoBlog container. Remember to enable public https in the config, so GoBlog gets Let's Encrypt certificates.
```yaml
goblog:
container_name: goblog
...
ports:
- 80:80
- 443:443
```
Start the container:
```bash
docker-compose up -d
```
Update the container with a newer image:
```bash
docker-compose pull
docker-compose up -d
```

View File

@ -6,6 +6,7 @@
database:
file: data/db.sqlite # File for the SQLite database
dumpFile: data/db.sql # (Optional) File for database dump, will be executed hourly
debug: true # Enable if you want to see all the SQL statements
# Web server
server:
@ -22,7 +23,7 @@ server:
cspDomains: # Specify additional domains to allow embedded content with enabled securityHeaders
- media.example.com
# Cookies
jwtSecret: changeThisWeakSecret # JWT secret to use for Json Web Token in cookies (login and captcha)
jwtSecret: changeThisWeakSecret # secret to use for cookies (login and captcha)
# Tor
tor: true # Publish onion service, requires Tor to be installed and available in path
@ -164,25 +165,25 @@ blogs:
photos:
enabled: true # Enable
parameter: images # Parameter which includes photo links
path: /photos # Path
path: /photos # (Optional) Set a custom path (relative to blog path)
title: Photos # Title
description: Instead of using Instagram, I prefer uploading pictures to my blog. # Description
# Full text search
search:
enabled: true # Enable
title: Search # Title
path: /search # Path
path: /search # (Optional) Set a custom path (relative to blog path)
placeholder: Search on this blog # Description
# Page with blog statistics (posts per year)
blogStats:
enabled: true # Enable
path: /statistics # Path
path: /statistics # (Optional) Set a custom path (relative to blog path)
title: Statistics # Title
description: "Here are some statistics with the number of posts per year:" # Description
# Blogroll
blogroll:
enabled: true # Enable
path: /blogroll # Path
path: /blogroll # (Optional) Set a custom path (relative to blog path)
title: Blogroll # Title
description: "I follow these blog:" # Description
opml: https://example.com/blogroll.opml # Required, URL to the OPML file
@ -211,4 +212,8 @@ blogs:
instantViewHash: INSTANT-VIEW-HASH # Use custom TG IV template
# Comments
comments:
enabled: true # Enable comments
enabled: true # Enable comments
# Map
map:
enabled: true # Enable the map feature (shows a map with all post locations)
path: /map # (Optional) Set a custom path (relative to blog path)