From e3ba7fd62e6624676f909331b324a14ecbc077d4 Mon Sep 17 00:00:00 2001 From: Per Magnus Petersen Date: Sat, 21 Feb 2026 10:10:19 +0100 Subject: [PATCH] Add CLAUDE.md with project guidance for Claude Code Co-Authored-By: Claude Opus 4.6 --- CLAUDE.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 CLAUDE.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..8bf02b3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,42 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Self-hosted Gitea deployment using Docker Compose with a remote PostgreSQL database and automated daily backups to NAS storage. + +## Architecture + +Two-container setup via `docker-compose.yml`: + +- **gitea** — Main Gitea application (`gitea/gitea:latest`). Web UI on port 3008, SSH on port 2222. Connects to a remote PostgreSQL instance at `192.168.50.42:5432`. +- **gitea-backup** — Alpine sidecar that installs `docker-cli`, sets up a cron job (2 AM daily), and runs `backup.sh` via `docker exec` into the gitea container. + +Backup files (`gitea-dump-YYYY-MM-DD_HHMM.zip`) are written to `/mnt/nasen/backup/gitea` (NAS mount) with 7-day retention. + +## Common Commands + +```bash +# Start/stop services +docker-compose up -d +docker-compose down + +# View logs +docker-compose logs -f gitea +docker-compose logs -f gitea-backup + +# Run a manual backup +docker exec gitea-backup /usr/local/bin/backup.sh + +# Check backup logs inside sidecar +docker exec gitea-backup cat /var/log/backup.log + +# Access Gitea admin CLI +docker exec -u git gitea /app/gitea/gitea admin [subcommand] +``` + +## Key Files + +- `docker-compose.yml` — Service definitions, environment config, volume mounts +- `backup.sh` — Backup script: runs `gitea dump`, verifies output, enforces retention policy