Simple plaintext diary
Find a file
2024-06-02 00:46:58 +03:00
.github/workflows Add rudimentary GitHub action for docker 2024-06-02 00:46:58 +03:00
config Add config editing to UI 2024-05-09 23:44:37 +03:00
i18n Make Telegram notification translatable, update README 2024-06-02 00:23:22 +03:00
pages Move to embedded dirs 2024-05-18 16:15:20 +03:00
public Bump version and adjust CSS 2024-06-02 00:36:37 +03:00
.gitignore Rework date and grace indicator 2024-05-06 14:53:18 +03:00
api.go Add config editing to UI 2024-05-09 23:44:37 +03:00
auth.go Make Telegram notification translatable, update README 2024-06-02 00:23:22 +03:00
CHANGELOG.md Bump version and adjust CSS 2024-06-02 00:36:37 +03:00
compose.yml Fix timezone issue in reference compose.yml 2024-05-01 00:22:23 +03:00
config.go Add config to send messages to a specific Telegram topic 2024-06-02 00:12:55 +05:30
Dockerfile Fix Dockerfile 2024-05-18 18:43:05 +03:00
export.go Fix export function 2024-05-07 10:56:50 +03:00
files.go Add config editing to UI 2024-05-09 23:44:37 +03:00
flags.go Add debug flag 2024-05-04 14:29:49 +03:00
go.mod Bump to go 1.22 2024-03-18 19:33:57 +03:00
go.sum Init 2024-03-15 18:34:24 +03:00
i18n.go Move to embedded dirs 2024-05-18 16:15:20 +03:00
info.go Bump version and adjust CSS 2024-06-02 00:36:37 +03:00
LICENSE License under MIT 2024-03-17 18:26:13 +03:00
logger.go Make log location configurable 2024-05-04 15:39:15 +03:00
main.go Add debug flag 2024-05-04 14:29:49 +03:00
README.md Make Telegram notification translatable, update README 2024-06-02 00:23:22 +03:00
routes.go Move to embedded dirs 2024-05-18 16:15:20 +03:00
serve.go Move to embedded dirs 2024-05-18 16:15:20 +03:00
TODO.md Make Telegram notification translatable, update README 2024-06-02 00:23:22 +03:00
update-docker.sh Use Local as default TZ 2024-04-23 23:16:20 +03:00

🌺 Hibiscus.txt

Simple plaintext diary.

This project is very opinionated and minimal, and is designed primarily for my usage. As a result, I can't guarantee that it's either secure or stable.

Features:

  • Each day, you get a new text file. You have until the end 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

  • You can easily export the files 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)

  • Optional Telegram notifications for failed login attempts

Technical details

CHANGELOG.md provides a good overview of updates, and TODO.md file shows what I will (or may) work on in the future.

You can read a relevant entry in my blog here. It provides some useful information and context for why this app exists in the first place. This repository is mirrored to GitHub in case my server goes down.

Data format:

data
+-- day
|   +-- yyyy-mm-dd.txt (ISO 8601)
|       ...
+-- notes
|   +-- note1.txt
|   +-- note2.txt
|       ...
+-- readme.txt

config
+-- config.txt

Deleting notes is done by clearing contents and clicking "Save" - the app deletes empty files when saving.

Config options:

Below are available configuration options and their defaults. The settings are defined as newline separated key=value pairs in config.txt. If you do not provide an option in your config, it will be using the default. Please don't include the bash-style "comments" in your actual 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=Local  # IANA Time zone database identifier ("UTC", Local", "Europe/Moscow" etc.), Defaults to Local if can't parse.
grace_period=0s  # Time after a new day begins, but before the switch to next day's file. e.g. 2h30m - files will change at 2:30am
language=en  # ISO-639 language code (available - en, ru)
theme=default  # Picked theme (available - default, high-contrast, lavender, gruvbox, sans)
title=🌺 Hibiscus.txt  # The text in the header
log_to_file=false  # Whether to write logs to a file
log_file=config/log.txt  # Where to store the log file if it is enabled
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
# Values correspond to API flags, see https://core.telegram.org/bots/api#sendmessage
tg_token=your_telegram_token
tg_chat=chat_id
tg_topic=message_thread_id

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 provided in this repository is for linux/amd64 architecture, and there is a Dockerfile in case you want to compile for something rarer (like a Pi). This repo contains the compose.yml that I personally use.

Note: versioned images may be provided in the future, possibly via ghcr.io.

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
-debug
    show debug log

API methods

You can access the API at /api/<method>. They are protected by same HTTP Basic Auth as "normal" site.

GET  /today        - get file contents for today
POST /today        - save request body into today's file
GET  /day          - get JSON list of all daily entries
GET  /day/<name>   - get file contents for a specific day

GET  /notes        - get JSON list of all named notes
GET  /notes/<name> - get file contents for a specific note
POST /notes/<name> - save request body into a named note
GET  /readme       - get file contents for readme.txt in data dir's root
POST /readme       - save request body into readme.txt

GET  /export       - get .zip archive of entire data directory
GET  /grace        - "true" if grace period is active, otherwise "false"
GET  /version      - get app's version
GET  /reload       - reload app config