From a933f47c7a8cdd9b0cd949a8b2babbaabcb7716f Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Thu, 15 Jul 2021 18:56:03 +0200 Subject: [PATCH] Add some docs --- README.md | 4 +--- docs/build.md | 42 ++++++++++++++++++++++++++++++++++++++++++ docs/install.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ example-config.yml | 17 +++++++++++------ 4 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 docs/build.md create mode 100644 docs/install.md diff --git a/README.md b/README.md index b6b44ae..4e56be2 100644 --- a/README.md +++ b/README.md @@ -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) \ No newline at end of file diff --git a/docs/build.md b/docs/build.md new file mode 100644 index 0000000..587e5cf --- /dev/null +++ b/docs/build.md @@ -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 +``` \ No newline at end of file diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..1295b4c --- /dev/null +++ b/docs/install.md @@ -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 +``` \ No newline at end of file diff --git a/example-config.yml b/example-config.yml index c8cd185..101ba41 100644 --- a/example-config.yml +++ b/example-config.yml @@ -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 \ No newline at end of file + 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) \ No newline at end of file