From ec07af9469b8d762162fc3cb4f1f96f45068dbea Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Fri, 24 Dec 2021 14:50:36 +0100 Subject: [PATCH] Add more docs --- docs/storage.md | 8 +++++++- docs/usage.md | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/storage.md b/docs/storage.md index 7a28586..e993677 100644 --- a/docs/storage.md +++ b/docs/storage.md @@ -1,5 +1,7 @@ # GoBlog's storage system +GoBlog stores all data that must be persistent in the subdirectory `data` of the current working directory. This directory contains the SQLite database file and the directory media that contains all uploaded files. + ## Database GoBlog uses a SQLite database for storing most of the data (posts, comments, webmention, sessions, etc.). The database is accessed using the Go library [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3). With each startup it is checked if there are schema migrations to be performed on the database. @@ -22,4 +24,8 @@ queue sessions shortpath webmentions -``` \ No newline at end of file +``` + +## Media files + +To prevent data duplication, GoBlog stores files with the filename of the SHA-256 hash of the file. \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md index a496030..ba818eb 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -8,6 +8,28 @@ This section of the documentation is a work in progress! To schedule a post, create a post with `status: scheduled` and set the `published` field to the desired date. A scheduler runs in the background and checks every 10 seconds if a scheduled post should be published. If there's a post to publish, the post status is changed to `published`. That will also trigger configured hooks. Scheduled posts are only visible when logged in. +## Media storage + +By default, GoBlog stores all uploaded files in the `media` subdirectory of the current working directory. It is possible to change this by configuring the `micropub.mediaStorage` setting. Currently it is possible to use BunnyCDN or any FTP storage as an alternative to the local filesystem. + +### Media compression + +To reduce the data transfer for blog visitors, GoBlog can compress the media files after they have been uploaded. If configured, media files with supported file extensions get compressed and the compressed file gets stored as well. + +GoBlog currently supports the following media compression providers: + +- [Cloudflare](https://cloudflare.com/) (no API key required) +- [ShortPixel](https://shortpixel.com/) (API key required) +- [Tinify](https://tinify.com/) (API key required) + +Take a look at the `example-config.yml` on how to configure the compression providers. + +It is possible to configure multiple compression providers. If one fails, the next one is tried. The current priority is as follows: + +1. ShortPixel +2. Tinify +3. Cloudflare + ## Text-to-Speech GoBlog features a button on each post that allows you to read the post's content aloud. By default, that uses an API from the browser to generate the speech. But it's not available on all browsers and on some operating systems it sounds horrible.