dev: public ready

dev: Readme, COC, others

dev: xml-template
This commit is contained in:
riomoo 2025-11-19 13:16:25 -05:00
parent 5db584830b
commit 1cf5119f46
Signed by: riomoo
SSH key fingerprint: SHA256:dP5B5iLpXU5V8aBA8eGm9tN5YtxXJybnv4McyltPyzM
12 changed files with 3716 additions and 0 deletions

View file

@ -0,0 +1,70 @@
#!/bin/bash
# --- Configuration ---
# Set the directory containing your comic book images
IMAGE_DIR="./"
# Set the name of the file to save the output to
OUTPUT_FILE="pages_xml_output.txt"
# --- Script Start ---
# Check if the image directory exists
if [ ! -d "$IMAGE_DIR" ]; then
echo "Error: Directory '$IMAGE_DIR' not found." >&2
echo "Please create the directory and place your images inside, or update the IMAGE_DIR variable." >&2
exit 1
fi
# Ensure the output file is clear or create it
> "$OUTPUT_FILE"
# Start the <Pages> tag
echo " <Pages>" >> "$OUTPUT_FILE"
# Initialize a counter for the <Page Image="..."> attribute
page_counter=0
# Use 'find' to get a list of image files, sort them numerically (important for comic order)
# Adjust the pattern (*.jpg|*.jpeg|*.png) to match your file types if necessary
find "$IMAGE_DIR" -maxdepth 1 -type f -regex ".*\.\(jpg\|jpeg\|png\|jxl\|avif\)$" | sort -V | while read -r image_path; do
# 1. Get the ImageSize in bytes
# Use 'stat' with a format to get the size in bytes (the command might differ slightly on non-Linux systems like macOS)
# Linux (GNU stat): %s
# macOS (BSD stat): %z
# Simple cross-platform attempt (often works):
# FALLBACK: If the 'stat' command is complex or fails, a simple 'wc -c' (byte count) can be used.
# We will try 'stat' for better compatibility with typical setups.
file_size_bytes=$(stat -c%s "$image_path" 2>/dev/null || wc -c < "$image_path")
# 2. Determine if it's the first page (for Type="FrontCover")
if [ "$page_counter" -eq 0 ]; then
# This is the cover page (Page Image="0")
xml_line=" <Page Image=\"${page_counter}\" ImageSize=\"${file_size_bytes}\" Type=\"FrontCover\"/>"
else
# Subsequent pages
xml_line=" <Page Image=\"${page_counter}\" ImageSize=\"${file_size_bytes}\"/>"
fi
# 3. Print the generated XML line
echo "$xml_line" >> "$OUTPUT_FILE"
# 4. Increment the counter
((page_counter++))
done
# End the <Pages> tag
echo " </Pages>" >> "$OUTPUT_FILE"
echo "---"
echo "✅ Script completed."
echo "Generated $page_counter <Page> entries and saved the output to: $OUTPUT_FILE"
echo "You can now paste the content of '$OUTPUT_FILE' into your ComicInfo.xml file."
echo "---"
# Optional: Display the content of the generated file
cat "$OUTPUT_FILE"

View file

@ -0,0 +1,5 @@
#!/bin/sh
user="$(gpg2 -qd /home/moo/test/gopherbook/moo.pass.asc)"
EXTEN="jpg"
mkdir -p ./cbzs
7z a -tzip -mem=AES256 -mx=9 ./cbzs/$1-others.cbz -p *.$EXTEN ComicInfo.xml

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

@ -0,0 +1,35 @@
#!/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
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..."
podman run -d --name "$CONTAINER_NAME" --memory=256m --restart unless-stopped \
-p 12010:8080 -v ./library:/app/library -v ./cache:/app/cache -v ./etc:/app/etc "$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!"