back

pub / ktistec-tweaks

Tweaks for the ActivityPub server ktistec
git clone https://src.jayvii.de/pub/ktistec-tweaks.git
Home | Log | Files | Exports | Refs | Submodules | README | RSS

Activity: Jul, 2024 - Oct, 2025

Less More

ktistec tweaks

Small tweaks and hacks for ktistec.

Please send patches or remarks to jayvii+ktistec-tweaks[AT]posteo[DOT]de.


Docker

You can run ktistec via the provided docker-compose

cd docker/
docker-compose -f docker-compose.yaml up -d

In order to use machine generated translations, you can set the DEEPL_API_KEY or the LIBRETRANSLATE_API_KEY environment variables while starting up the container:

cd docker/
LIBRETRANSLATE_API_KEY="abcd" docker-compose -f docker-compose.yaml up -d

CSS

Some of previous CSS hacks have found their way into upstream ktistec by now, for example:

Currently, the ./css/ directory contains following theming tweaks:

Purple-Ish Theme:

Purpleish Theme in Dark and Bright Mode

Visibility:

Preview-Images without clipping and grey borders around the image previews
A post thread with several layers. The grey borders on the left side indicate layer depth.

The Visibility CSS rules also mark all external URLs with an arrow-icon.

Minify CSS:

make minify-css

Place the minified purpleish.min.css, and/or visibility.min.css in the public/theming/ directory.

Manual installation:

KTISTEC_PATH="/var/www/ktistec"
KTISTEC_CSS="${KTISTEC_PATH}/public/theming"
cp ./css/*.min.css ${KTISTEC_CSS}/

Docker (via this repo’s docker-compose file):

docker cp ./css/purpleish.min.css ktistec:/app/public/theming/purpleish.min.css
docker cp ./css/visibility.min.css ktistec:/app/public/theming/visibility.min.css

Backups

Database

Database backups should be done either by file-copying when the database is not in use, i.e. as long as ktistec is not running, or better yet with the .backup command, which handles file-locking and changes to the database during the backup procedure. However, either way, because .backup also honours file locking by the ktistec process itself and because changes to the database are constantly accounted for (which, depending on your instances volume, can prolonge the backup process indefinitely), ktistec should not be running during backup process.

Manual installation:

KTISTEC_PATH="/var/www/ktistec"
kill server && \
sqlite3 ${KTISTEC_PATH}/db/ktistec.db \
".backup \"${KTISTEC_PATH}/db/ktistec_backup_$(date +%Y-%m-%d).sq3\""; \
${KTISTEC_PATH}/server &

Docker (via this repo’s docker-compose file):

docker stop ktistec && \
docker run -ti --rm \
-v /var/www/ktistec/db:/db \
-v /var/www/ktistec/backups:/backups \
alpine:latest \
sh -c '
apk update && \
apk add sqlite && \
sqlite3 /db/ktistec.db \
".backup \"/backups/ktistec_backup_$(date +%Y-%m-%d).sq3\""
'; \
docker restart ktistec

Uploads

The uploads-folder contains images and other media files that you uploaded or included in one of your posts. It makes sense to back them up as well in order to prevent data loss.

Since these are typically just image files, the easiest way to back them up is by archiving them with tar.

Manual installation:

KTISTEC_PATH="/var/www/ktistec"
tar -cf ${KTISTEC_PATH}/uploads_backup_$(date +%Y-%m-%d).tar \
${KTISTEC_PATH}/public/uploads/

Docker (via this repo’s docker-compose file):

docker run -ti --rm \
-v /var/www/ktistec/uploads:/uploads \
-v /var/www/ktistec/backups:/backups \
alpine:latest \
sh -c '
apk update && \
apk add tar && \
tar -vcf /backups/uploads_backup_$(date +%Y-%m-%d).tar /uploads/
'

Clone this repository via:
git clone https://src.jayvii.de/pub/ktistec-tweaks.git