Squashed commit of the following:

commit c8126262de851ef2b9bfed5ca3b07b9dc927f203
Author: riomoo <alister@kamikishi.net>
Date:   Tue Jan 6 01:58:02 2026 -0500

    feat: planned additions

    - Watch folder
    - CBT support with AES-256-CFB encryption (script provided to make it
      easier)
This commit is contained in:
riomoo 2026-01-06 02:02:26 -05:00
parent c06c716d23
commit 9752725855
Signed by: riomoo
SSH key fingerprint: SHA256:dP5B5iLpXU5V8aBA8eGm9tN5YtxXJybnv4McyltPyzM
12 changed files with 1427 additions and 189 deletions

46
scripts-bash/run.sh Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash
IMAGE_NAME="localhost/gopherbook:latest"
CONTAINER_NAME="gopherbook"
echo "Building new image: $IMAGE_NAME..."
podman build --force-rm -t "$IMAGE_NAME" .
if [ $? -ne 0 ]; then
echo "Image build failed. Exiting script."
exit 1
fi
# Ensure directories exist with correct permissions
mkdir -p ./library ./cache ./etc ./watch
if podman container exists "$CONTAINER_NAME"; then
echo "Container '$CONTAINER_NAME' already exists. Stopping and removing it..."
podman stop "$CONTAINER_NAME"
podman rm "$CONTAINER_NAME"
fi
echo "Starting new container from image: $IMAGE_NAME..."
# IMPROVED: Better memory settings and limits
podman run -d --name "$CONTAINER_NAME" \
--memory=512m \
--restart unless-stopped \
-p 12010:8080 \
-v ./library:/app/library \
-v ./cache:/app/cache \
-v ./etc:/app/etc \
-v ./watch:/app/watch \
"$IMAGE_NAME"
if [ $? -ne 0 ]; then
echo "Failed to start new container. Exiting script."
exit 1
fi
echo "Cleaning up old images..."
podman image prune --force
echo "Update and cleanup complete!"
echo "Container is running with memory limit: 512MB, swap: 512MB"
echo "Go memory limit (GOMEMLIMIT): 512MiB"
echo "Aggressive GC enabled (GOGC=50)"