From 0a391984f3f5b6d6b6964f85b9cd1aa4e3269a5e Mon Sep 17 00:00:00 2001 From: Andrew-71 Date: Tue, 23 Apr 2024 21:24:11 +0300 Subject: [PATCH] Improve documentation --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- TODO.md | 5 ++++- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f6d35da..6c1d591 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,13 @@ Simple plaintext diary. This project is *very* opinionated and minimal, and is designed primarily for my usage. -As a result of this, it is also neither secure nor stable. +As a result, I can't guarantee that it's either secure or stable. ## Features: * Each day, you get a text file. You have until 23:59 of that very day to finalise it. * You can save named notes to document milestones, big events, or just a nice game you played this month* * There is also a readme.txt file (just like this one, except you get to write it!)* -* You can easily export everything in a zip file for backups +* You can easily export entire `data` dir in a `.zip` archive for backups * Everything is plain(text) and simple. No databases, encryption, OAuth, or anything fancy. Even the password is plainte- *wait is this a feature?* * Docker support (in fact, that's probably the best way to run this) @@ -17,7 +17,12 @@ As a result of this, it is also neither secure nor stable. *only available through API, subject to change and removal -## Data format: +## Technical details +You can read a relevant entry in my blog [here](https://a71.su/notes/hibiscus/). +It provides some useful information and context for why this app exists in the first place. +There is also [TODO.md](./TODO.md) file that shows what I will (or *may*) change in the future. + +### Data format: ``` data +-- day @@ -31,4 +36,51 @@ data config +-- config.txt +``` + +### Config options: +Below are defaults of config.txt. The settings are defined in newline separated key=value pairs. +Please don't include the bash-style "comments" in your config, +they are provided purely for demonstration only and **will break the config if present**. +``` +username=admin # Your username +password=admin # Your password +port=7101 # What port to run on (probably leave on 7101 if using docker) +timezone=UTC # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to UTC if can't parse. +log_to_file=false # Whether to write logs to a file (located in /log.txt) +enable_scram=false # Whether the app should shut down if there are 3 or more failed login attempts within 100 seconds + +# Not present by default, set only if you want to be notified of any failed login attempts over telegram +tg_token=tgtoken +tg_chat=chatid +``` + +### Docker deployment: +Due to project's simplicity ~~and me rarely using them~~ there are no image tags, I just use `latest` and push to it. +The [package](https://git.a71.su/Andrew71/hibiscus/packages) provided in this repository is for ` linux/amd64` architecture, +and there is a [Dockerfile](./Dockerfile) in case you want to compile for something rarer (like a Pi). Below is `compose.yml` that I personally use: +```yaml +version: "3.8" +services: + hibiscus: + image: git.a71.su/andrew71/hibiscus:latest + restart: unless-stopped + ports: + - "7101:7101" + volumes: + - path-to-config-dir/config:/config + - path-to-data-dir/data:/data +``` + +### Executable flags +If you for some reason decide to run plain executable instead of docker, it supports following flags: +``` +-config string + override config file location +-user string + override username +-pass string + override password +-port int + override port ``` \ No newline at end of file diff --git a/TODO.md b/TODO.md index f295b39..f480bf1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,14 @@ # TODO List of things to add to this project +* Better docs in case others want to use ths for some reason +* Github/Codeberg/whatever mirror for when `faye` (my server) is offline * Improve config and use reflection when loading it * Do to other methods what was done to GetDays/GetNotes? * API revamp * Check export function for improvements -* Add note creation and deletion to frontend +* Add note creation and deletion to frontend (*properly*) +* Customise log file * More slog.Debug and a debug flag? * Consider less clunky auth method * *Go* dependency-less? <-- this is a terrible idea \ No newline at end of file