From 223cc2ac6a79a9d171d96a7ffe72b00784709fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 8 Oct 2025 13:54:19 +0200 Subject: [PATCH] feat: docus --- Projects/kompose/FILES_OVERVIEW.md | 365 ------------- Projects/kompose/INSTALLATION_GUIDE.md | 410 --------------- Projects/kompose/QUICK_REFERENCE.md | 264 ---------- Projects/kompose/add-readmes.sh | 142 ----- Projects/kompose/chain/README.md | 118 ++++- Projects/kompose/cleanup-docs.sh | 12 - Projects/kompose/code/README.md | 273 +++++++++- Projects/kompose/dash/config/services.yaml | 14 +- Projects/kompose/docs/.gitignore | 27 + Projects/kompose/docs/Dockerfile | 36 ++ Projects/kompose/docs/README.md | 257 ++++++++++ Projects/kompose/docs/app.vue | 46 ++ Projects/kompose/docs/assets/css/main.css | 214 ++++++++ Projects/kompose/docs/build.sh | 31 ++ .../kompose/docs/components/CodeBlock.vue | 38 ++ Projects/kompose/docs/compose.yaml | 32 ++ Projects/kompose/docs/content/docs/index.md | 65 +++ .../kompose/docs/content/docs/installation.md | 280 ++++++++++ Projects/kompose/docs/layouts/default.vue | 222 ++++++++ Projects/kompose/docs/nginx.conf | 82 +++ Projects/kompose/docs/nuxt.config.ts | 115 +++++ Projects/kompose/docs/package.json | 31 ++ .../kompose/docs/pages/docs/[...slug].vue | 143 ++++++ Projects/kompose/docs/pages/index.vue | 234 +++++++++ Projects/kompose/docs/tailwind.config.js | 168 ++++++ Projects/kompose/docs/tsconfig.json | 3 + Projects/kompose/home/README.md | 95 +++- Projects/kompose/make-executable.sh | 5 - Projects/kompose/setup-new-stacks.sh | 484 ------------------ Projects/kompose/sync.sh | 11 - Projects/kompose/verify-traefik.sh | 79 --- 31 files changed, 2476 insertions(+), 1820 deletions(-) delete mode 100644 Projects/kompose/FILES_OVERVIEW.md delete mode 100644 Projects/kompose/INSTALLATION_GUIDE.md delete mode 100644 Projects/kompose/QUICK_REFERENCE.md delete mode 100755 Projects/kompose/add-readmes.sh delete mode 100755 Projects/kompose/cleanup-docs.sh create mode 100644 Projects/kompose/docs/.gitignore create mode 100644 Projects/kompose/docs/Dockerfile create mode 100644 Projects/kompose/docs/README.md create mode 100644 Projects/kompose/docs/app.vue create mode 100644 Projects/kompose/docs/assets/css/main.css create mode 100644 Projects/kompose/docs/build.sh create mode 100644 Projects/kompose/docs/components/CodeBlock.vue create mode 100644 Projects/kompose/docs/compose.yaml create mode 100644 Projects/kompose/docs/content/docs/index.md create mode 100644 Projects/kompose/docs/content/docs/installation.md create mode 100644 Projects/kompose/docs/layouts/default.vue create mode 100644 Projects/kompose/docs/nginx.conf create mode 100644 Projects/kompose/docs/nuxt.config.ts create mode 100644 Projects/kompose/docs/package.json create mode 100644 Projects/kompose/docs/pages/docs/[...slug].vue create mode 100644 Projects/kompose/docs/pages/index.vue create mode 100644 Projects/kompose/docs/tailwind.config.js create mode 100644 Projects/kompose/docs/tsconfig.json delete mode 100755 Projects/kompose/make-executable.sh delete mode 100755 Projects/kompose/setup-new-stacks.sh delete mode 100755 Projects/kompose/sync.sh delete mode 100755 Projects/kompose/verify-traefik.sh diff --git a/Projects/kompose/FILES_OVERVIEW.md b/Projects/kompose/FILES_OVERVIEW.md deleted file mode 100644 index ef7d2baa..00000000 --- a/Projects/kompose/FILES_OVERVIEW.md +++ /dev/null @@ -1,365 +0,0 @@ -# ๐Ÿ“ฆ Kompose New Stacks - Complete File Overview - -This document lists all files added to the kompose project. - -## ๐Ÿ—‚๏ธ Directory Structure - -``` -kompose/ -โ”œโ”€โ”€ home/ # Created by setup script -โ”‚ โ”œโ”€โ”€ compose.yaml # โœ“ Auto-generated -โ”‚ โ”œโ”€โ”€ .env # โœ“ Auto-generated with secrets -โ”‚ โ”œโ”€โ”€ config/ # โœ“ Created (empty, for Home Assistant) -โ”‚ โ””โ”€โ”€ README.md # โœ“ Added by add-readmes.sh -โ”‚ -โ”œโ”€โ”€ chain/ # Created by setup script -โ”‚ โ”œโ”€โ”€ compose.yaml # โœ“ Auto-generated -โ”‚ โ”œโ”€โ”€ .env # โœ“ Auto-generated with N8N_ENCRYPTION_KEY -โ”‚ โ””โ”€โ”€ README.md # โœ“ Added by add-readmes.sh -โ”‚ -โ”œโ”€โ”€ git/ # Created by setup script -โ”‚ โ”œโ”€โ”€ compose.yaml # โœ“ Auto-generated -โ”‚ โ”œโ”€โ”€ .env # โœ“ Auto-generated -โ”‚ โ””โ”€โ”€ README.md # โœ“ Added by add-readmes.sh -โ”‚ -โ”œโ”€โ”€ link/ # Created by setup script -โ”‚ โ”œโ”€โ”€ compose.yaml # โœ“ Auto-generated -โ”‚ โ”œโ”€โ”€ .env # โœ“ Auto-generated with NEXTAUTH_SECRET -โ”‚ โ””โ”€โ”€ README.md # โœ“ Added by add-readmes.sh -โ”‚ -โ”œโ”€โ”€ dash/ -โ”‚ โ””โ”€โ”€ config/ -โ”‚ โ””โ”€โ”€ services.yaml # โœ“ UPDATED with new stacks -โ”‚ -โ”œโ”€โ”€ setup-new-stacks.sh # โœ“ Main setup script -โ”œโ”€โ”€ add-readmes.sh # โœ“ README installer script -โ”œโ”€โ”€ make-executable.sh # โœ“ Helper script -โ”œโ”€โ”€ NEW_STACKS.md # โœ“ Overview documentation -โ”œโ”€โ”€ QUICK_REFERENCE.md # โœ“ Command cheat sheet -โ”œโ”€โ”€ INSTALLATION_GUIDE.md # โœ“ Complete installation guide -โ””โ”€โ”€ FILES_OVERVIEW.md # โœ“ This file -``` - -## ๐Ÿ“ File Descriptions - -### Setup Scripts - -#### `setup-new-stacks.sh` โญ MAIN SCRIPT -**Purpose**: Creates all stack directories, files, and databases -**What it does**: -- Creates 4 stack directories (home, chain, git, link) -- Generates all compose.yaml files -- Creates .env files with auto-generated secrets -- Creates PostgreSQL databases -- Displays generated secrets - -**Run**: `./setup-new-stacks.sh` - -#### `add-readmes.sh` -**Purpose**: Adds README placeholders to stack directories -**Run after**: setup-new-stacks.sh -**Run**: `./add-readmes.sh` - -#### `make-executable.sh` -**Purpose**: Makes the setup scripts executable -**Run first**: `chmod +x make-executable.sh && ./make-executable.sh` - -### Stack Configuration Files - -#### `home/compose.yaml` -- Home Assistant container definition -- Privileged mode for USB device access -- Health checks included -- Traefik integration - -#### `home/.env` -- Stack configuration -- Timezone setting (important!) -- Traefik hostname -- App port (8123) - -#### `chain/compose.yaml` -- n8n container definition -- PostgreSQL connection -- Email integration -- Basic auth settings - -#### `chain/.env` -- Stack configuration -- **Auto-generated N8N_ENCRYPTION_KEY** -- Basic auth credentials -- Database settings - -#### `git/compose.yaml` -- Gitea container definition -- PostgreSQL connection -- SSH port configuration (2222) -- Email integration - -#### `git/.env` -- Stack configuration -- SSH port settings -- Database settings -- Email enabled - -#### `link/compose.yaml` -- Linkwarden container definition -- PostgreSQL connection -- Screenshot/archive features -- Email integration - -#### `link/.env` -- Stack configuration -- **Auto-generated NEXTAUTH_SECRET** -- Feature toggles -- Database settings - -### Documentation Files - -#### `NEW_STACKS.md` -**Contents**: -- Quick setup guide -- Stack overview table -- Access URLs -- Generated secrets info -- Next steps - -**Audience**: Quick reference for getting started - -#### `QUICK_REFERENCE.md` -**Contents**: -- Fast command reference -- Stack management commands -- Database operations -- Monitoring commands -- Troubleshooting quick fixes - -**Audience**: Daily operations, quick lookups - -#### `INSTALLATION_GUIDE.md` -**Contents**: -- Complete step-by-step installation -- Prerequisites checklist -- Detailed setup instructions -- Security checklist -- Post-installation tasks -- Comprehensive troubleshooting - -**Audience**: First-time setup, detailed guide - -#### `FILES_OVERVIEW.md` (this file) -**Contents**: -- Complete file listing -- File descriptions -- Usage instructions -- Detailed specs - -**Audience**: Understanding the project structure - -### README Files - -#### `home/README.md` -- Home Assistant overview -- Quick start instructions -- Key features -- Link to full documentation (artifacts) - -#### `chain/README.md` -- n8n overview -- Quick start instructions -- Key features -- Link to full documentation (artifacts) - -#### `git/README.md` -- Gitea overview -- Quick start instructions -- SSH information -- Link to full documentation (artifacts) - -#### `link/README.md` -- Linkwarden overview -- Quick start instructions -- Key features -- Link to full documentation (artifacts) - -### Updated Existing Files - -#### `dash/config/services.yaml` -**Changes**: -- Added "Development" section with Git and Workflows -- Added "Home" section with Home Assistant -- Updated "Content" section with Bookmarks -- Reorganized service groupings -- Added Home Assistant widget configuration - -## ๐ŸŽฏ Usage Workflow - -### First Time Setup - -```bash -# 1. Make scripts executable -chmod +x make-executable.sh && ./make-executable.sh - -# 2. Run main setup -./setup-new-stacks.sh - -# 3. Add READMEs -./add-readmes.sh - -# 4. Review configuration -cat home/.env -cat chain/.env -cat git/.env -cat link/.env - -# 5. Start stacks -cd home && docker compose up -d -cd ../chain && docker compose up -d -cd ../git && docker compose up -d -cd ../link && docker compose up -d -``` - -### Daily Operations - -See `QUICK_REFERENCE.md` for: -- Starting/stopping stacks -- Viewing logs -- Checking status -- Backup commands - -### Troubleshooting - -See `INSTALLATION_GUIDE.md` for: -- Detailed troubleshooting steps -- Common issues and solutions -- Log analysis -- Recovery procedures - -## ๐Ÿ“Š File Statistics - -### Total Files Added: 13 - -**Scripts**: 3 -- setup-new-stacks.sh -- add-readmes.sh -- make-executable.sh - -**Documentation**: 4 -- NEW_STACKS.md -- QUICK_REFERENCE.md -- INSTALLATION_GUIDE.md -- FILES_OVERVIEW.md - -**Stack Files**: 12 (generated by scripts) -- 4 ร— compose.yaml -- 4 ร— .env -- 4 ร— README.md - -**Updated Files**: 1 -- dash/config/services.yaml - -### Lines of Code/Documentation - -- **setup-new-stacks.sh**: ~400 lines -- **INSTALLATION_GUIDE.md**: ~500 lines -- **QUICK_REFERENCE.md**: ~300 lines -- **NEW_STACKS.md**: ~100 lines -- **Total**: ~1,300 lines added/generated - -## ๐Ÿ” Generated Secrets - -The setup script automatically generates: - -1. **N8N_ENCRYPTION_KEY** (chain/.env) - - 64-character hex string - - Used to encrypt n8n credentials - - Command: `openssl rand -hex 32` - -2. **NEXTAUTH_SECRET** (link/.env) - - Base64 encoded string - - Used for NextAuth session encryption - - Command: `openssl rand -base64 32` - -**Important**: These secrets are displayed during setup and saved in the respective .env files. Save them securely! - -## ๐Ÿ—„๏ธ Database Information - -Created databases: -- `n8n` - for chain stack (n8n workflow automation) -- `gitea` - for git stack (Gitea Git service) -- `linkwarden` - for link stack (Linkwarden bookmarks) - -All use PostgreSQL from the `data` stack. - -## ๐ŸŒ Network Information - -All new stacks use: -- Network: `kompose` (external) -- Reverse Proxy: Traefik -- SSL: Let's Encrypt (via Traefik) - -## ๐Ÿ“ฆ Docker Volumes - -Created volumes: -- `n8n_data` - n8n workflows and credentials -- `gitea_data` - Git repositories and metadata -- `linkwarden_data` - Bookmark archives and screenshots - -Home Assistant uses a bind mount: `./home/config` - -## ๐Ÿš€ Next Steps - -1. **Run Setup**: - ```bash - ./setup-new-stacks.sh - ``` - -2. **Review Generated Files**: - Check the created directories and configuration - -3. **Start Services**: - Follow the INSTALLATION_GUIDE.md - -4. **Explore Features**: - Use QUICK_REFERENCE.md for daily operations - -## ๐Ÿ“š Full Documentation - -**Complete READMEs** (300-400 lines each) are available as artifacts in the Claude conversation: -- home/README.md - Home Assistant guide (300+ lines) -- chain/README.md - n8n automation guide (350+ lines) -- git/README.md - Gitea Git service guide (400+ lines) -- link/README.md - Linkwarden bookmarks guide (350+ lines) - -These contain: -- Detailed setup instructions -- Feature explanations -- Configuration examples -- Troubleshooting guides -- Best practices -- Integration guides - -Copy them from the artifacts for the complete documentation! - -## โœ… Verification Checklist - -After setup, verify: - -- [ ] All scripts are executable -- [ ] setup-new-stacks.sh ran successfully -- [ ] 4 stack directories created -- [ ] All .env files have generated secrets -- [ ] PostgreSQL databases created -- [ ] README files added -- [ ] Dashboard updated -- [ ] All containers starting successfully - -## ๐ŸŽ‰ Success! - -You now have a complete, documented, production-ready setup of 4 new self-hosted services! - ---- - -**For questions or issues**: Check the INSTALLATION_GUIDE.md troubleshooting section or review the individual stack README files. - -**Happy self-hosting!** ๐Ÿš€ diff --git a/Projects/kompose/INSTALLATION_GUIDE.md b/Projects/kompose/INSTALLATION_GUIDE.md deleted file mode 100644 index b643e3f8..00000000 --- a/Projects/kompose/INSTALLATION_GUIDE.md +++ /dev/null @@ -1,410 +0,0 @@ -# ๐ŸŽ‰ Installation Guide - 4 New Kompose Stacks - -Complete step-by-step guide to install and configure the new stacks. - -## ๐Ÿ“‹ Prerequisites - -Before starting, ensure you have: - -- โœ… Kompose base infrastructure running: - - `data` stack (PostgreSQL + Redis) - - `proxy` stack (Traefik) - - `kompose` Docker network created - -- โœ… Root `.env` file configured with: - - Database credentials (`DB_USER`, `DB_PASSWORD`, `DB_HOST`) - - Email settings (optional but recommended) - - Admin email - -- โœ… Sufficient resources: - - CPU: 4+ cores - - RAM: 8+ GB - - Disk: 50+ GB free - -## ๐Ÿš€ Step-by-Step Installation - -### Step 1: Make Scripts Executable - -```bash -cd /home/valknar/Projects/kompose - -# Make all scripts executable -chmod +x setup-new-stacks.sh -chmod +x add-readmes.sh -chmod +x make-executable.sh -``` - -### Step 2: Run Main Setup Script - -This creates all directories, compose files, .env files, and databases: - -```bash -./setup-new-stacks.sh -``` - -**What this does:** -- Creates `home/`, `chain/`, `git/`, `link/` directories -- Generates all `compose.yaml` files -- Creates `.env` files with generated secrets -- Creates PostgreSQL databases (n8n, gitea, linkwarden) -- Displays generated secrets for your records - -**Expected output:** -``` -======================================== - Kompose New Stacks Setup -======================================== - -Generating secrets... -โœ“ Secrets generated - -Creating home stack... -โœ“ Home stack created - -Creating chain stack... -โœ“ Chain stack created - -Creating git stack... -โœ“ Git stack created - -Creating link stack... -โœ“ Link stack created - -... -``` - -### Step 3: Add README Files - -```bash -./add-readmes.sh -``` - -This creates README placeholders in each stack directory. - -**Note:** The complete, detailed READMEs (300-400 lines each) are available as artifacts in the Claude conversation. Copy them manually for full documentation. - -### Step 4: Review Configuration - -Check and customize the `.env` files: - -```bash -# Review each stack's configuration -cat home/.env -cat chain/.env -cat git/.env -cat link/.env -``` - -**Important settings to review:** -- `TRAEFIK_HOST` - Change from `*.localhost` to your actual domain -- `TZ` - Verify timezone is correct -- Email settings are inherited from root `.env` - -### Step 5: Start the Stacks - -Start each stack individually: - -```bash -# Start Home Assistant -cd home -docker compose up -d -cd .. - -# Start n8n -cd chain -docker compose up -d -cd .. - -# Start Gitea -cd git -docker compose up -d -cd .. - -# Start Linkwarden -cd link -docker compose up -d -cd .. -``` - -**Or start all at once:** -```bash -for stack in home chain git link; do - cd $stack && docker compose up -d && cd ..; -done -``` - -### Step 6: Verify Installation - -Check that all containers are running: - -```bash -docker ps | grep -E "home|chain|git|link" -``` - -**Expected output:** -``` -CONTAINER ID IMAGE STATUS -abc123def456 ghcr.io/home-assistant/... Up (healthy) -def456abc789 n8nio/n8n:latest Up (healthy) -ghi789jkl012 gitea/gitea:latest Up (healthy) -jkl012mno345 ghcr.io/linkwarden/... Up (healthy) -``` - -Check logs for any errors: - -```bash -docker logs home_app --tail 20 -docker logs chain_app --tail 20 -docker logs git_app --tail 20 -docker logs link_app --tail 20 -``` - -### Step 7: Initial Configuration - -Access each service and complete setup: - -#### ๐Ÿ  Home Assistant (https://home.localhost) - -1. **First Visit**: Setup wizard appears -2. **Create Owner Account**: - - Name: Your name - - Username: Choose username - - Password: Strong password -3. **Set Location**: For automations and weather -4. **Choose Units**: Metric or Imperial -5. **Share Analytics**: Your choice -6. **Done!** Home Assistant starts discovering devices - -#### โ›“๏ธ n8n (https://chain.localhost) - -1. **Basic Auth**: Login with `admin` / `changeme` -2. **โš ๏ธ IMMEDIATELY**: Go to Settings โ†’ Change password! -3. **Create First Workflow**: Click "New Workflow" -4. **Explore Templates**: Browse 1000+ pre-built workflows - -#### ๐ŸฆŠ Gitea (https://git.localhost) - -1. **First Visit**: Setup wizard appears -2. **Database Settings**: Pre-filled from environment -3. **General Settings**: - - Site Title: "My Git Server" - - SSH Port: 2222 - - Base URL: https://git.localhost -4. **Create Administrator Account**: - - Username: admin - - Password: Strong password - - Email: your@email.com -5. **Install Gitea** - -#### ๐Ÿ”— Linkwarden (https://link.localhost) - -1. **First Visit**: Sign Up page -2. **Create Account**: - - Name: Your name - - Email: your@email.com - - Username: Choose username - - Password: Strong password -3. **Done!** Start saving bookmarks - -### Step 8: Update Dashboard - -The dashboard has been automatically updated! Restart it: - -```bash -cd dash -docker compose restart -``` - -Visit your dashboard to see the new stacks: https://dash.localhost - -## ๐Ÿ” Security Checklist - -After installation, ensure: - -- [ ] Changed all default passwords -- [ ] Reviewed generated secrets (saved in `.env` files) -- [ ] Disabled public registration on Linkwarden (already done) -- [ ] Changed n8n basic auth password -- [ ] Set up Gitea SSH keys -- [ ] Configured Home Assistant 2FA -- [ ] Reviewed Traefik SSL certificates -- [ ] Set up regular backups - -## ๐Ÿ”ง Post-Installation Tasks - -### Set Up Backups - -Create a backup script: - -```bash -#!/bin/bash -BACKUP_DIR="/backups/kompose-$(date +%Y%m%d)" -mkdir -p $BACKUP_DIR - -# Databases -docker exec data_postgres pg_dump -U $DB_USER n8n > $BACKUP_DIR/n8n.sql -docker exec data_postgres pg_dump -U $DB_USER gitea > $BACKUP_DIR/gitea.sql -docker exec data_postgres pg_dump -U $DB_USER linkwarden > $BACKUP_DIR/linkwarden.sql - -# Home Assistant config -tar -czf $BACKUP_DIR/home-config.tar.gz home/config - -# Git repositories -docker run --rm -v git_gitea_data:/data -v $BACKUP_DIR:/backup \ - alpine tar czf /backup/gitea-repos.tar.gz /data - -# Linkwarden archives -docker run --rm -v link_linkwarden_data:/data -v $BACKUP_DIR:/backup \ - alpine tar czf /backup/linkwarden-archives.tar.gz /data - -echo "Backup completed: $BACKUP_DIR" -``` - -### Configure Monitoring - -Add health checks to your monitoring system: - -```bash -# Check all services are healthy -docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "home|chain|git|link" -``` - -### Set Up Integrations - -**n8n โ†” Gitea**: Automate deployments on git push -**Home Assistant โ†” n8n**: Complex automations -**Linkwarden โ†” n8n**: Auto-save RSS feeds to bookmarks - -## ๐Ÿ“Š Resource Usage - -After installation, monitor resource usage: - -```bash -docker stats home_app chain_app git_app link_app -``` - -**Typical usage:** -- Home Assistant: 200-500 MB RAM -- n8n: 200-400 MB RAM -- Gitea: 100-300 MB RAM -- Linkwarden: 200-400 MB RAM - -**Total**: ~1-2 GB RAM for all 4 stacks - -## ๐Ÿ†˜ Troubleshooting - -### Containers Not Starting - -```bash -# Check logs -docker logs _app -f - -# Common issues: -# 1. Database not accessible -docker exec data_postgres psql -U $DB_USER -l - -# 2. Network not found -docker network ls | grep kompose -docker network create kompose # if missing - -# 3. Port conflicts -netstat -tulpn | grep -E "8123|5678|3000|2222" -``` - -### Can't Access via Browser - -```bash -# 1. Check Traefik is running -docker ps | grep proxy - -# 2. Check Traefik logs -docker logs proxy_app | grep -E "home|chain|git|link" - -# 3. Test direct access (bypass Traefik) -curl http://localhost:8123 # Home Assistant -curl http://localhost:5678 # n8n -curl http://localhost:3000 # Gitea -``` - -### Database Connection Failed - -```bash -# 1. Verify database exists -docker exec data_postgres psql -U $DB_USER -l | grep -E "n8n|gitea|linkwarden" - -# 2. Test connection from container -docker exec chain_app ping postgres -docker exec git_app ping postgres -docker exec link_app ping postgres - -# 3. Check credentials in .env match root .env -cat .env | grep DB_ -cat chain/.env | grep DB_ -``` - -### Secrets Not Working - -```bash -# Regenerate secrets -openssl rand -hex 32 # For n8n -openssl rand -base64 32 # For Linkwarden - -# Update in .env files -vim chain/.env # Update N8N_ENCRYPTION_KEY -vim link/.env # Update NEXTAUTH_SECRET - -# Restart containers -docker compose restart -``` - -## ๐Ÿ“š Next Steps - -Now that everything is installed: - -1. **Explore Each Service**: - - Add your first smart home device in Home Assistant - - Create your first automation in n8n - - Create your first repository in Gitea - - Save your first bookmark in Linkwarden - -2. **Integrate Services**: - - Connect n8n to Gitea for CI/CD - - Link Home Assistant with n8n for complex automations - - Use Linkwarden to bookmark your documentation - -3. **Customize**: - - Change themes and layouts - - Set up custom domains - - Configure external access - -4. **Share**: - - Invite team members - - Share collections - - Collaborate on repos - -## ๐ŸŽ“ Learning Resources - -- **Home Assistant**: https://www.home-assistant.io/docs/ -- **n8n**: https://docs.n8n.io/ -- **Gitea**: https://docs.gitea.io/ -- **Linkwarden**: https://docs.linkwarden.app/ - -## ๐ŸŽ‰ Congratulations! - -You now have 4 powerful self-hosted services: -- ๐Ÿ  **Smart Home Control** -- โ›“๏ธ **Workflow Automation** -- ๐ŸฆŠ **Git Hosting** -- ๐Ÿ”— **Bookmark Management** - -All running on YOUR infrastructure! - ---- - -**Need help?** Check the individual README files or the Quick Reference guide. - -**Found a bug?** Check the logs and troubleshooting sections. - -**Want more?** Explore the extensive features of each service! - -Happy self-hosting! ๐Ÿš€ diff --git a/Projects/kompose/QUICK_REFERENCE.md b/Projects/kompose/QUICK_REFERENCE.md deleted file mode 100644 index 61878439..00000000 --- a/Projects/kompose/QUICK_REFERENCE.md +++ /dev/null @@ -1,264 +0,0 @@ -# ๐Ÿš€ Quick Reference - New Stacks - -Fast command reference for managing the 4 new kompose stacks. - -## ๐Ÿ“ฆ Stack Directories - -``` -kompose/ -โ”œโ”€โ”€ home/ # Home Assistant -โ”œโ”€โ”€ chain/ # n8n -โ”œโ”€โ”€ git/ # Gitea -โ””โ”€โ”€ link/ # Linkwarden -``` - -## โšก Quick Commands - -### Start All New Stacks -```bash -cd /home/valknar/Projects/kompose -for stack in home chain git link; do cd $stack && docker compose up -d && cd ..; done -``` - -### Stop All New Stacks -```bash -for stack in home chain git link; do cd $stack && docker compose down && cd ..; done -``` - -### View All Logs -```bash -docker logs -f home_app & -docker logs -f chain_app & -docker logs -f git_app & -docker logs -f link_app -``` - -### Check Status -```bash -docker ps | grep -E "home|chain|git|link" -``` - -## ๐Ÿ”‘ Default Access - -| Stack | URL | Port | Notes | -|-------|-----|------|-------| -| Home Assistant | https://home.localhost | 8123 | Setup wizard on first start | -| n8n | https://chain.localhost | 5678 | Basic auth: admin/changeme | -| Gitea | https://git.localhost | 3000 | Setup wizard, SSH: 2222 | -| Linkwarden | https://link.localhost | 3000 | Create account on first visit | - -## ๐Ÿ—„๏ธ Database Commands - -### Create Databases -```bash -docker exec data_postgres createdb -U $DB_USER n8n -docker exec data_postgres createdb -U $DB_USER gitea -docker exec data_postgres createdb -U $DB_USER linkwarden -``` - -### Backup Databases -```bash -docker exec data_postgres pg_dump -U $DB_USER n8n > backups/n8n-$(date +%Y%m%d).sql -docker exec data_postgres pg_dump -U $DB_USER gitea > backups/gitea-$(date +%Y%m%d).sql -docker exec data_postgres pg_dump -U $DB_USER linkwarden > backups/linkwarden-$(date +%Y%m%d).sql -``` - -## ๐Ÿ” Generate Secrets - -```bash -# For n8n -openssl rand -hex 32 - -# For Linkwarden -openssl rand -base64 32 - -# For Gitea SSH -ssh-keygen -t ed25519 -C "your_email@example.com" -``` - -## ๐Ÿ“Š Monitoring - -### Resource Usage -```bash -docker stats home_app chain_app git_app link_app -``` - -### Logs (last 50 lines) -```bash -docker logs --tail 50 home_app -docker logs --tail 50 chain_app -docker logs --tail 50 git_app -docker logs --tail 50 link_app -``` - -### Health Check -```bash -docker inspect home_app | jq '.[].State.Health' -docker inspect chain_app | jq '.[].State.Health' -docker inspect git_app | jq '.[].State.Health' -docker inspect link_app | jq '.[].State.Health' -``` - -## ๐Ÿ”ง Maintenance - -### Update Stack -```bash -cd && docker compose pull && docker compose up -d -``` - -### Restart Stack -```bash -cd && docker compose restart -``` - -### Full Backup -```bash -# Databases -docker exec data_postgres pg_dump -U $DB_USER n8n > backups/n8n.sql -docker exec data_postgres pg_dump -U $DB_USER gitea > backups/gitea.sql -docker exec data_postgres pg_dump -U $DB_USER linkwarden > backups/linkwarden.sql - -# Home Assistant config -tar -czf backups/home-config.tar.gz home/config - -# Git repos (from volume) -docker run --rm -v git_gitea_data:/data -v $(pwd)/backups:/backup \ - alpine tar czf /backup/gitea-repos.tar.gz /data - -# Linkwarden archives -docker run --rm -v link_linkwarden_data:/data -v $(pwd)/backups:/backup \ - alpine tar czf /backup/linkwarden-archives.tar.gz /data -``` - -## ๐Ÿท๏ธ Stack-Specific Commands - -### Home Assistant -```bash -# Check config -docker exec home_app hass --script check_config - -# Restart core -docker exec home_app hass restart -``` - -### n8n -```bash -# Export workflows -docker exec chain_app n8n export:workflow --backup --output=/backup/ - -# List workflows -docker exec chain_app n8n list:workflow -``` - -### Gitea -```bash -# Create admin user -docker exec git_app gitea admin user create \ - --username admin --password secretpass \ - --email admin@example.com --admin - -# List users -docker exec git_app gitea admin user list -``` - -### Linkwarden -```bash -# Run migrations -docker exec link_app npx prisma migrate deploy - -# Open Prisma Studio -docker exec link_app npx prisma studio -``` - -## ๐Ÿšจ Troubleshooting - -### Container Won't Start -```bash -# Check logs -docker logs _app --tail 100 - -# Check network -docker network inspect kompose - -# Verify database -docker exec data_postgres psql -U $DB_USER -l -``` - -### Can't Access via Browser -```bash -# Check Traefik -docker logs proxy_app | grep - -# Verify routing -docker exec proxy_app traefik healthcheck -``` - -### Database Issues -```bash -# Test connection from container -docker exec _app ping postgres - -# Check database exists -docker exec data_postgres psql -U $DB_USER -l | grep -``` - -## ๐Ÿ”„ Update All Stacks -```bash -#!/bin/bash -for stack in home chain git link; do - echo "Updating $stack..." - cd $stack - docker compose pull - docker compose up -d - cd .. -done -``` - -## ๐Ÿงน Cleanup Commands - -### Remove Unused Images -```bash -docker image prune -a -``` - -### Remove Unused Volumes (โš ๏ธ BE CAREFUL) -```bash -docker volume prune -``` - -### Clean Everything (โš ๏ธ NUCLEAR OPTION) -```bash -docker system prune -a --volumes -``` - -## ๐Ÿ“ฑ Mobile Setup - -### Home Assistant App -1. Install from App Store/Play Store -2. Server URL: https://home.localhost -3. Login with credentials - -### n8n (PWA) -1. Open in mobile browser -2. Menu โ†’ "Add to Home Screen" - -### Gitea -Use Git client apps: -- iOS: Working Copy -- Android: MGit - -### Linkwarden (PWA) -1. Open in mobile browser -2. Menu โ†’ "Add to Home Screen" - ---- - -**๐Ÿ’ก Pro Tip**: Add these commands to your shell aliases for even faster access! - -```bash -# Add to ~/.bashrc or ~/.zshrc -alias kompose-start='cd /home/valknar/Projects/kompose && for s in home chain git link; do cd $s && docker compose up -d && cd ..; done' -alias kompose-stop='cd /home/valknar/Projects/kompose && for s in home chain git link; do cd $s && docker compose down && cd ..; done' -alias kompose-logs='docker logs -f home_app &; docker logs -f chain_app &; docker logs -f git_app &; docker logs -f link_app' -alias kompose-status='docker ps | grep -E "home|chain|git|link"' -``` diff --git a/Projects/kompose/add-readmes.sh b/Projects/kompose/add-readmes.sh deleted file mode 100755 index 42470601..00000000 --- a/Projects/kompose/add-readmes.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/bash - -# Script to add comprehensive READMEs to each new stack directory - -set -e - -GREEN='\033[0;32m' -BLUE='\033[0;34m' -NC='\033[0m' - -BASE_DIR="/home/valknar/Projects/kompose" - -echo -e "${BLUE}Adding READMEs to new stacks...${NC}" -echo "" - -cd "$BASE_DIR" - -# Check if stack directories exist -for stack in home chain git link; do - if [ ! -d "$stack" ]; then - echo "Error: Directory $stack does not exist!" - echo "Please run ./setup-new-stacks.sh first" - exit 1 - fi -done - -# Note: The full READMEs are very long (300-400 lines each) -# They are available as artifacts and should be copied manually -# or you can download them from the conversation - -echo -e "${GREEN}Creating README placeholders...${NC}" - -# Home README placeholder -cat > home/README.md << 'EOF' -# ๐Ÿ  Home Stack - Smart Home Automation - -Complete documentation for Home Assistant is available in the artifacts. - -## Quick Start - -```bash -docker compose up -d -``` - -Access: https://home.localhost - -## Key Features -- 2000+ device integrations -- Powerful automations -- Voice control -- Mobile apps - -For the complete 300+ line README with full documentation, -please refer to the artifacts from the conversation. - -EOF - -# Chain README placeholder -cat > chain/README.md << 'EOF' -# โ›“๏ธ Chain Stack - Workflow Automation - -Complete documentation for n8n is available in the artifacts. - -## Quick Start - -```bash -docker compose up -d -``` - -Access: https://chain.localhost -Default credentials: admin / changeme (change immediately!) - -## Key Features -- Visual workflow builder -- 400+ integrations -- Code nodes for custom logic -- Webhook triggers - -For the complete 350+ line README with full documentation, -please refer to the artifacts from the conversation. - -EOF - -# Git README placeholder -cat > git/README.md << 'EOF' -# ๐ŸฆŠ Git Stack - Self-Hosted Git Service - -Complete documentation for Gitea is available in the artifacts. - -## Quick Start - -```bash -docker compose up -d -``` - -Access: https://git.localhost -SSH: ssh://git@git.localhost:2222 - -## Key Features -- Unlimited private repos -- Pull requests & code review -- Issue tracking -- Organizations & teams - -For the complete 400+ line README with full documentation, -please refer to the artifacts from the conversation. - -EOF - -# Link README placeholder -cat > link/README.md << 'EOF' -# ๐Ÿ”— Link Stack - Bookmark Manager - -Complete documentation for Linkwarden is available in the artifacts. - -## Quick Start - -```bash -docker compose up -d -``` - -Access: https://link.localhost - -## Key Features -- Bookmark with screenshots -- Full page archives -- Tags & collections -- Team collaboration - -For the complete 350+ line README with full documentation, -please refer to the artifacts from the conversation. - -EOF - -echo -e "${GREEN}โœ“ README placeholders created${NC}" -echo "" -echo -e "${BLUE}Note:${NC} The complete, detailed READMEs (300-400 lines each) are available" -echo "as artifacts in the Claude conversation. You can:" -echo "1. Copy them manually from the artifacts" -echo "2. Or use the placeholder READMEs as a starting point" -echo "" -echo -e "${GREEN}Done!${NC}" diff --git a/Projects/kompose/chain/README.md b/Projects/kompose/chain/README.md index 9c7561da..a43e3e56 100644 --- a/Projects/kompose/chain/README.md +++ b/Projects/kompose/chain/README.md @@ -1,22 +1,112 @@ -# โ›“๏ธ Chain Stack - Workflow Automation +# โ›“๏ธ Chain Stack - Workflow Automation Powerhouse -Complete documentation for n8n is available in the artifacts. +> *"If you can dream it, you can automate it!"* - n8n philosophy -## Quick Start +## What's This All About? -```bash -docker compose up -d +This stack is your automation Swiss Army knife! n8n lets you connect different apps and services to create powerful workflows without writing code (though you can if you want!). Think Zapier or IFTTT, but open-source, self-hosted, and infinitely more powerful. + +## The Star of the Show + +### โšก n8n + +**Container**: `chain_app` +**Image**: `n8nio/n8n:latest` +**Home**: https://chain.localhost +**Port**: 5678 + +n8n is workflow automation done right: +- ๐Ÿ”Œ **400+ Integrations**: Connect virtually anything +- ๐ŸŽจ **Visual Builder**: Drag-and-drop workflow creation +- ๐Ÿ’ป **Code Nodes**: Write JavaScript when you need it +- ๐Ÿช **Webhooks**: Trigger workflows from anywhere +- โฐ **Scheduling**: Cron-style automation +- ๐Ÿ“Š **Data Transformation**: Powerful data manipulation +- ๐Ÿ”„ **Error Handling**: Retry logic and fallbacks +- ๐Ÿ“ **Version Control**: Export workflows as JSON + +## Configuration Breakdown + +### Database Connection +All workflows and credentials stored in PostgreSQL: +``` +Database: n8n +Host: Shared data stack (postgres) ``` -Access: https://chain.localhost -Default credentials: admin / changeme (change immediately!) +### Basic Auth ๐Ÿ”’ +**Default Credentials**: +- Username: `admin` +- Password: `changeme` -## Key Features -- Visual workflow builder -- 400+ integrations -- Code nodes for custom logic -- Webhook triggers +**โš ๏ธ CRITICAL**: Change these immediately after first login! -For the complete 350+ line README with full documentation, -please refer to the artifacts from the conversation. +### Encryption Key +Credentials are encrypted using `N8N_ENCRYPTION_KEY`. This is auto-generated during setup. Never lose this key or you'll lose access to saved credentials! +## Getting Started + +### First Login + +1. **Start the stack**: + ```bash + docker compose up -d + ``` + +2. **Access n8n**: + ``` + URL: https://chain.localhost + Username: admin + Password: changeme + ``` + +3. **โš ๏ธ IMMEDIATELY Change Password**: + - Click user icon (top right) + - Settings โ†’ Personal + - Change password + +### Creating Your First Workflow + +1. **Click "New Workflow"** button +2. **Add trigger node**: Webhook, Schedule, or Manual +3. **Add action nodes**: Drag from left panel +4. **Connect with arrows** +5. **Test**: Execute manually +6. **Activate**: Toggle switch (top right) + +## Common Integrations + +- **Slack/Discord**: Send messages +- **Gmail**: Email operations +- **Google Sheets**: Read/write data +- **GitHub**: Issues, PRs, releases +- **Home Assistant**: Control devices +- **Webhooks**: Trigger anything + +## Troubleshooting + +**Q: Forgot password?** +A: Update `N8N_BASIC_AUTH_PASSWORD` in `.env` and restart + +**Q: Credentials not working?** +A: Check `N8N_ENCRYPTION_KEY` hasn't changed + +**Q: Workflow not triggering?** +A: Verify it's activated and check execution logs + +## Security Notes ๐Ÿ”’ + +- ๐Ÿ”‘ **Encryption Key**: Store securely +- ๐Ÿ” **Change Default Auth**: ASAP! +- ๐ŸŒ **HTTPS Only**: Via Traefik +- ๐Ÿ”’ **OAuth**: Use for sensitive integrations + +## Resources + +- [n8n Documentation](https://docs.n8n.io/) +- [Workflow Templates](https://n8n.io/workflows) +- [Community Forum](https://community.n8n.io/) + +--- + +*"Automation isn't about replacing humans - it's about freeing them to do what they do best: think creatively and solve complex problems."* โšก๐Ÿ”— diff --git a/Projects/kompose/cleanup-docs.sh b/Projects/kompose/cleanup-docs.sh deleted file mode 100755 index 6005599a..00000000 --- a/Projects/kompose/cleanup-docs.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -echo "๐Ÿงน Cleaning up old documentation files..." - -# Remove old documentation -rm -f DATABASE_OPS.md -rm -f HOOKS.md -rm -f NETWORK_CONFIG.md -rm -f SMTP_STATUS.md - -echo "โœ… Old documentation files removed!" -echo "๐Ÿ“– All documentation is now in README.md" diff --git a/Projects/kompose/code/README.md b/Projects/kompose/code/README.md index be01bd3d..a0098694 100644 --- a/Projects/kompose/code/README.md +++ b/Projects/kompose/code/README.md @@ -1,22 +1,267 @@ -# ๐ŸฆŠ Git Stack - Self-Hosted Git Service +# ๐ŸฆŠ Code Stack - Your Private GitHub Alternative -Complete documentation for Gitea is available in the artifacts. +> *"Give them Git, make them great!"* - Some wise developer -## Quick Start +## What's This All About? -```bash -docker compose up -d +This stack is your personal GitHub - a lightweight, powerful, self-hosted Git service that gives you complete control over your repositories. Gitea is like having GitHub's best features without the Microsoft strings attached! + +## The Star of the Show + +### ๐ŸฆŠ Gitea + +**Container**: `code_app` +**Image**: `gitea/gitea:latest` +**Home**: https://git.localhost +**SSH**: ssh://git@git.localhost:2222 + +Gitea packs a serious punch for its size: +- ๐Ÿ“ฆ **Git Hosting**: Unlimited private/public repositories +- ๐Ÿ”€ **Pull Requests**: Full code review workflow +- ๐Ÿ› **Issue Tracking**: Built-in project management +- ๐Ÿ‘ฅ **Organizations & Teams**: Multi-user collaboration +- ๐Ÿช **Webhooks**: CI/CD integration ready +- ๐Ÿ“ **Wiki**: Documentation for your projects +- ๐Ÿท๏ธ **Releases**: Package and distribute your software +- ๐Ÿ” **Built-in OAuth**: Use it as an auth provider! + +## Configuration Breakdown + +### Database Connection +All your Git magic is stored in PostgreSQL: +``` +Database: gitea +Host: Shared data stack (postgres) +Connection: Via kompose network ``` -Access: https://git.localhost -SSH: ssh://git@git.localhost:2222 +### SSH Access +Clone and push repos via SSH on a custom port (2222) to avoid conflicts with the host's SSH: +```bash +# Clone example +git clone ssh://git@git.localhost:2222/username/repo.git -## Key Features -- Unlimited private repos -- Pull requests & code review -- Issue tracking -- Organizations & teams +# Add remote +git remote add origin ssh://git@git.localhost:2222/username/repo.git +``` -For the complete 400+ line README with full documentation, -please refer to the artifacts from the conversation. +### First-Time Setup +On first access, you'll see the installation wizard. Most settings are pre-configured from environment variables! +## Environment Variables Explained + +| Variable | What It Does | Cool Factor | +|----------|-------------|-------------| +| `COMPOSE_PROJECT_NAME` | Stack identifier | ๐Ÿ“ฆ Keeps things organized | +| `DOCKER_IMAGE` | Gitea version to use | ๐Ÿท๏ธ Stay current or pinned | +| `TRAEFIK_HOST` | Your domain | ๐ŸŒ How the world finds you | +| `SSH_PORT` | SSH clone port | ๐Ÿ”Œ Non-standard for safety | +| `APP_PORT` | Web interface port | ๐ŸŽฏ Internal routing | +| `DB_*` | Database connection | ๐Ÿ˜ Where memories live | + +## Ports & Networking + +- **Web Port**: 3000 (internal) โ†’ 443 (via Traefik) +- **SSH Port**: 2222 (exposed) +- **External Access**: + - Web: https://git.localhost + - SSH: git@git.localhost:2222 +- **Network**: `kompose` (the usual gang) + +## Health & Monitoring + +Gitea has built-in health checks: +```bash +# Check if Gitea is healthy +docker exec code_app gitea admin check + +# View logs +docker logs code_app -f +``` + +## Getting Started + +### Initial Configuration (First Run) + +1. **Start the stack**: + ```bash + docker compose up -d + ``` + +2. **Access the installer**: + ``` + URL: https://git.localhost + ``` + +3. **Database Settings** (pre-filled!): + - Type: PostgreSQL + - Host: postgres:5432 + - Database: gitea + - Username: From root .env + - Password: From root .env + +4. **General Settings**: + - Site Title: "My Git Server" (or whatever you like!) + - SSH Server Port: 2222 + - Base URL: https://git.localhost + - Email Settings: Inherited from root .env + +5. **Create Admin Account**: + - Username: admin (or your preference) + - Email: your@email.com + - Password: Strong and unique! + +6. **Install!** ๐ŸŽ‰ + +### Creating Your First Repository + +1. **Sign in** with your admin account +2. **Click the +** icon in the top right +3. **Select "New Repository"** +4. **Fill in**: + - Name: my-awesome-project + - Description: What makes it awesome + - Visibility: Private or Public + - Initialize: โœ… Add README, .gitignore, License +5. **Create Repository!** + +### Clone & Push + +```bash +# Clone your new repo +git clone ssh://git@git.localhost:2222/username/my-awesome-project.git +cd my-awesome-project + +# Make some changes +echo "# My Awesome Project" >> README.md +git add README.md +git commit -m "Update README" + +# Push changes +git push origin main +``` + +## Common Tasks + +### Add SSH Key + +1. **Generate key** (if you don't have one): + ```bash + ssh-keygen -t ed25519 -C "your@email.com" + ``` + +2. **Copy public key**: + ```bash + cat ~/.ssh/id_ed25519.pub + ``` + +3. **In Gitea**: Settings โ†’ SSH / GPG Keys โ†’ Add Key + +### Create an Organization + +1. **Click +** โ†’ New Organization +2. **Set name and visibility** +3. **Invite team members** +4. **Create team-owned repositories** + +### Set Up Webhooks + +1. **Go to** Repository โ†’ Settings โ†’ Webhooks +2. **Add Webhook** (Discord, Slack, or custom URL) +3. **Configure** events to trigger (push, pull request, etc.) +4. **Test** the webhook + +### Enable Actions (CI/CD) + +Gitea supports GitHub Actions-compatible workflows! + +1. **Enable in** Admin โ†’ Site Administration โ†’ Actions +2. **Add `.gitea/workflows/`** to your repo +3. **Create** workflow YAML files +4. **Push** and watch them run! + +## Integration Tips + +### As OAuth Provider + +Gitea can authenticate users for other apps: + +1. **Create OAuth App**: Settings โ†’ Applications โ†’ Manage OAuth2 Applications +2. **Get credentials**: Client ID and Secret +3. **Configure** in your app with these endpoints: + - Authorization: `https://git.localhost/login/oauth/authorize` + - Token: `https://git.localhost/login/oauth/access_token` + - User Info: `https://git.localhost/api/v1/user` + +### With CI/CD (Semaphore, Jenkins, etc.) + +Use webhooks to trigger builds on push: +```json +{ + "url": "https://your-ci-server.com/webhook", + "content_type": "json", + "secret": "your-webhook-secret", + "events": ["push", "pull_request"] +} +``` + +### Mirror External Repos + +Keep a local copy of GitHub/GitLab repos: +1. **Create new migration** +2. **Enter source** URL +3. **Enable periodic sync** + +## Troubleshooting + +**Q: Can't clone via SSH?** +A: Verify SSH key is added, and use correct port (2222): +```bash +git clone ssh://git@git.localhost:2222/username/repo.git +``` + +**Q: Database connection failed?** +A: Check the `data` stack is running: +```bash +docker ps | grep data_postgres +``` + +**Q: Can't push due to size?** +A: Increase `client_max_body_size` in compose.yaml + +**Q: Forgot admin password?** +A: Reset from CLI: +```bash +docker exec code_app gitea admin user change-password --username admin --password newpassword +``` + +## Security Notes ๐Ÿ”’ + +- ๐Ÿ”‘ **SSH Keys**: Always use SSH keys, not passwords +- ๐Ÿ” **Database Credentials**: Stored in root `.env` +- ๐ŸŒ **HTTPS Only**: Traefik handles SSL automatically +- ๐Ÿ‘ฅ **Private Repos**: Default for security +- ๐Ÿ”’ **2FA**: Enable in user settings for extra security +- ๐Ÿ“ **Audit Log**: Review in admin panel regularly + +## Pro Tips ๐Ÿ’ก + +1. **Protected Branches**: Require reviews before merging to main +2. **Git LFS**: Enable for large files (models, assets, etc.) +3. **Repository Templates**: Create templates for consistent project structure +4. **Labels & Milestones**: Organize issues effectively +5. **Project Boards**: Kanban-style project management +6. **Branch Rules**: Enforce naming conventions and workflows +7. **Custom .gitignore**: Add templates for common languages +8. **Release Tags**: Use semver for version management + +## Resources + +- [Gitea Documentation](https://docs.gitea.io/) +- [Gitea API Reference](https://docs.gitea.io/en-us/api-usage/) +- [Community Forums](https://discourse.gitea.io/) +- [Gitea on GitHub](https://github.com/go-gitea/gitea) + +--- + +*"Why use someone else's Git when you can host your own? Take back control, one commit at a time."* ๐ŸฆŠโœจ diff --git a/Projects/kompose/dash/config/services.yaml b/Projects/kompose/dash/config/services.yaml index 96b0a765..8c899de4 100644 --- a/Projects/kompose/dash/config/services.yaml +++ b/Projects/kompose/dash/config/services.yaml @@ -64,15 +64,15 @@ - Development: - Git: icon: gitea.png - href: https://git.localhost + href: https://code.pivoine.art description: Gitea self-hosted Git service - siteMonitor: http://git:3000 + siteMonitor: https://code.pivoine.art - Workflows: icon: si-n8n.svg - href: https://chain.localhost + href: https://chain.pivoine.art description: n8n workflow automation - siteMonitor: http://chain:5678 + siteMonitor: https://chain.pivoine.art # Content & Media - Content: @@ -92,12 +92,12 @@ - Home: - Home Assistant: icon: home-assistant.png - href: https://home.localhost + href: https://home.pivoine.art description: Smart home automation - siteMonitor: http://homeassistant:8123 + siteMonitor: https://home.pivoine.art widget: type: homeassistant - url: http://homeassistant:8123 + url: https://home.pivoine.art # key: your-long-lived-access-token # Monitoring & Analytics diff --git a/Projects/kompose/docs/.gitignore b/Projects/kompose/docs/.gitignore new file mode 100644 index 00000000..4f5743fc --- /dev/null +++ b/Projects/kompose/docs/.gitignore @@ -0,0 +1,27 @@ +# Nuxt +.nuxt +.output +.env +dist + +# Node +node_modules +*.log* +.DS_Store +.vscode +.idea + +# Build +.output +.nuxt + +# Cache +.cache + +# Temp +*.tmp +*.bak +*.swp + +# pnpm +pnpm-lock.yaml diff --git a/Projects/kompose/docs/Dockerfile b/Projects/kompose/docs/Dockerfile new file mode 100644 index 00000000..2a72d248 --- /dev/null +++ b/Projects/kompose/docs/Dockerfile @@ -0,0 +1,36 @@ +# Build stage +FROM node:20-alpine AS builder + +# Install pnpm +RUN npm install -g pnpm@9.0.0 + +WORKDIR /app + +# Copy package files +COPY package.json pnpm-lock.yaml* ./ + +# Install dependencies +RUN pnpm install --frozen-lockfile + +# Copy source code +COPY . . + +# Generate static site +RUN pnpm run generate + +# Production stage +FROM nginx:alpine + +# Copy custom nginx config +COPY nginx.conf /etc/nginx/nginx.conf + +# Copy built static site +COPY --from=builder /app/.output/public /usr/share/nginx/html + +# Add healthcheck +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1 + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] diff --git a/Projects/kompose/docs/README.md b/Projects/kompose/docs/README.md new file mode 100644 index 00000000..0c295f2a --- /dev/null +++ b/Projects/kompose/docs/README.md @@ -0,0 +1,257 @@ +# Kompose Documentation + +Modern, stylish documentation site for Kompose built with Nuxt Content and featuring a funky dark theme with orange and purple gradients. + +## ๐ŸŽจ Features + +- โœจ **Modern Dark Theme** - Funky design with orange and purple gradients +- ๐Ÿ“ **Markdown Support** - Write documentation in Markdown +- ๐Ÿ” **Full-Text Search** - Search through all documentation +- ๐Ÿ“ฑ **Responsive Design** - Works perfectly on all devices +- ๐ŸŽฏ **Table of Contents** - Auto-generated navigation +- ๐ŸŽจ **Syntax Highlighting** - Beautiful code blocks with multiple language support +- ๐Ÿš€ **Static Generation** - Fast, SEO-friendly static site +- ๐Ÿ“Š **PWA Ready** - Progressive Web App capabilities + +## ๐Ÿš€ Quick Start + +### Development + +```bash +# Install dependencies +pnpm install + +# Start development server +pnpm run dev + +# Open http://localhost:3000 +``` + +### Production Build + +```bash +# Generate static site +pnpm run generate + +# Preview production build +pnpm run preview +``` + +### Docker Deployment + +```bash +# Build and start the docs container +cd /path/to/kompose +./kompose.sh docs up -d --build + +# View logs +./kompose.sh docs logs -f +``` + +## ๐Ÿ“ Project Structure + +``` +docs/ +โ”œโ”€โ”€ assets/ # Static assets and global CSS +โ”‚ โ””โ”€โ”€ css/ +โ”‚ โ””โ”€โ”€ main.css # Custom Tailwind styles +โ”œโ”€โ”€ components/ # Vue components +โ”œโ”€โ”€ content/ # Markdown documentation +โ”‚ โ””โ”€โ”€ docs/ # Documentation pages +โ”‚ โ””โ”€โ”€ index.md +โ”œโ”€โ”€ layouts/ # Page layouts +โ”‚ โ””โ”€โ”€ default.vue # Main layout with sidebar +โ”œโ”€โ”€ pages/ # Application pages +โ”‚ โ”œโ”€โ”€ index.vue # Homepage +โ”‚ โ””โ”€โ”€ docs/ +โ”‚ โ””โ”€โ”€ [...slug].vue # Documentation pages +โ”œโ”€โ”€ public/ # Static files +โ”œโ”€โ”€ app.vue # App entry point +โ”œโ”€โ”€ nuxt.config.ts # Nuxt configuration +โ”œโ”€โ”€ tailwind.config.js # Tailwind configuration +โ”œโ”€โ”€ package.json # Dependencies +โ”œโ”€โ”€ Dockerfile # Docker build configuration +โ”œโ”€โ”€ nginx.conf # Nginx configuration +โ””โ”€โ”€ compose.yaml # Docker Compose configuration +``` + +## ๐Ÿ“ Writing Documentation + +Documentation files are stored in `content/docs/` directory as Markdown files. + +### Creating a New Page + +1. Create a new `.md` file in `content/docs/`: + +```markdown +--- +title: Your Page Title +description: Brief description of the page +--- + +# Your Page Title + +Your content goes here... +``` + +2. The page will be automatically available at `/docs/your-file-name` + +### Frontmatter Options + +```yaml +--- +title: Page Title # Required: Page title +description: Description # Optional: Meta description +--- +``` + +### Markdown Features + +#### Code Blocks + +\`\`\`bash +./kompose.sh "*" up -d +\`\`\` + +#### Alerts + +> ๐Ÿ’ก **Tip:** This is a helpful tip! + +#### Tables + +| Column 1 | Column 2 | +|----------|----------| +| Value 1 | Value 2 | + +#### Links + +[Link Text](/docs/page) + +## ๐ŸŽจ Customizing the Theme + +### Colors + +Edit `tailwind.config.js` to customize colors: + +```js +theme: { + extend: { + colors: { + primary: { + 500: '#f97316', // Orange + // ... other shades + }, + accent: { + 500: '#a855f7', // Purple + // ... other shades + } + } + } +} +``` + +### Styles + +Global styles are in `assets/css/main.css`. You can modify: +- Gradient effects +- Typography +- Component styles +- Animations + +## ๐Ÿ” Search Configuration + +Search is powered by Nuxt Content's built-in search. To customize: + +```ts +// nuxt.config.ts +content: { + experimental: { + search: { + indexed: true, + // Add search configuration + } + } +} +``` + +## ๐ŸŒ Deployment + +The site is automatically built and deployed via Docker when using Kompose: + +```bash +# Rebuild and redeploy +./kompose.sh docs down +./kompose.sh docs up -d --build +``` + +### Environment Variables + +Configure in `docs/.env`: + +```env +COMPOSE_PROJECT_NAME=docs +TRAEFIK_HOST=docs.example.com +APP_PORT=80 +``` + +## ๐Ÿ“ฆ Dependencies + +- **Nuxt 3** - Vue framework +- **Nuxt Content** - File-based CMS +- **Tailwind CSS** - Utility-first CSS framework +- **@nuxt/icon** - Icon component +- **@vueuse/nuxt** - Vue composition utilities + +## ๐Ÿ› ๏ธ Development Tips + +### Hot Reload + +The development server supports hot module replacement. Changes to components, pages, and markdown files will be reflected immediately. + +### TypeScript + +The project uses TypeScript. Type definitions are automatically generated by Nuxt. + +### Adding Components + +Create components in `components/` directory. They'll be auto-imported: + +```vue + + +``` + +Use in pages: + +```vue + +``` + +## ๐ŸŽฏ Features Roadmap + +- [ ] Advanced search with filters +- [ ] Dark/light mode toggle +- [ ] API documentation generator +- [ ] Interactive code examples +- [ ] Version selector +- [ ] Multi-language support + +## ๐Ÿ“„ License + +MIT License - see the main Kompose repository for details. + +## ๐Ÿค Contributing + +1. Fork the repository +2. Create your feature branch: `git checkout -b feature/amazing-feature` +3. Commit your changes: `git commit -m 'Add amazing feature'` +4. Push to the branch: `git push origin feature/amazing-feature` +5. Open a Pull Request + +--- + +Made with โค๏ธ and โ˜• by the Kompose Community diff --git a/Projects/kompose/docs/app.vue b/Projects/kompose/docs/app.vue new file mode 100644 index 00000000..07fc0734 --- /dev/null +++ b/Projects/kompose/docs/app.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/Projects/kompose/docs/assets/css/main.css b/Projects/kompose/docs/assets/css/main.css new file mode 100644 index 00000000..781bf45f --- /dev/null +++ b/Projects/kompose/docs/assets/css/main.css @@ -0,0 +1,214 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + html { + @apply scroll-smooth; + } + + body { + @apply bg-dark-950 text-gray-100 antialiased; + } + + /* Typography improvements */ + h1, h2, h3, h4, h5, h6 { + @apply font-bold tracking-tight; + } + + h1 { + @apply text-5xl md:text-6xl lg:text-7xl; + } + + h2 { + @apply text-4xl md:text-5xl; + } + + h3 { + @apply text-3xl md:text-4xl; + } +} + +@layer components { + /* Gradient text */ + .gradient-text { + @apply bg-gradient-to-r from-primary-400 via-accent-400 to-primary-500 bg-clip-text text-transparent; + } + + .gradient-text-hero { + @apply bg-gradient-hero bg-clip-text text-transparent animate-gradient-xy; + } + + /* Glass morphism */ + .glass { + @apply backdrop-blur-lg bg-white/5 border border-white/10; + } + + .glass-dark { + @apply backdrop-blur-lg bg-black/30 border border-white/5; + } + + /* Glow effects */ + .glow-box { + @apply shadow-glow-cyber; + } + + .glow-text { + @apply animate-glow; + } + + /* Button styles */ + .btn { + @apply px-6 py-3 rounded-lg font-semibold transition-all duration-300 transform hover:scale-105 active:scale-95; + } + + .btn-primary { + @apply btn bg-gradient-primary text-white shadow-glow-orange hover:shadow-lg; + } + + .btn-accent { + @apply btn bg-gradient-accent text-white shadow-glow-purple hover:shadow-lg; + } + + .btn-ghost { + @apply btn border-2 border-primary-500/50 text-primary-400 hover:bg-primary-500/10 hover:border-primary-400; + } + + /* Card styles */ + .card { + @apply rounded-xl p-6 transition-all duration-300; + } + + .card-glass { + @apply card glass hover:bg-white/10; + } + + .card-glow { + @apply card bg-dark-900 border border-primary-500/20 hover:border-primary-500/40 hover:shadow-glow-cyber; + } + + /* Code block improvements */ + .prose pre { + @apply relative overflow-hidden; + } + + .prose pre::before { + content: ''; + @apply absolute inset-0 bg-gradient-shine opacity-0 hover:opacity-100 transition-opacity duration-500 pointer-events-none; + animation: shimmer 2s linear infinite; + } + + /* Link styles */ + .link-fancy { + @apply relative inline-block text-primary-400 hover:text-primary-300 transition-colors; + } + + .link-fancy::after { + content: ''; + @apply absolute bottom-0 left-0 w-0 h-0.5 bg-gradient-primary transition-all duration-300; + } + + .link-fancy:hover::after { + @apply w-full; + } + + /* Sidebar */ + .sidebar-link { + @apply block px-4 py-2 rounded-lg text-gray-400 hover:text-white hover:bg-white/5 transition-all duration-200; + } + + .sidebar-link.active { + @apply text-white bg-gradient-to-r from-primary-500/20 to-accent-500/20 border-l-4 border-primary-500; + } + + /* Search box */ + .search-box { + @apply w-full px-4 py-3 bg-dark-900 border border-dark-700 rounded-lg text-white placeholder-gray-500 focus:outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-all; + } + + /* Table of contents */ + .toc-link { + @apply text-sm text-gray-400 hover:text-primary-400 transition-colors py-1 border-l-2 border-dark-700 pl-4 hover:border-primary-500; + } + + .toc-link.active { + @apply text-primary-400 border-primary-500; + } +} + +@layer utilities { + /* Gradient animations */ + .animate-gradient { + background-size: 200% 200%; + animation: gradient 8s ease infinite; + } + + /* Perspective utilities */ + .perspective-1000 { + perspective: 1000px; + } + + .transform-style-3d { + transform-style: preserve-3d; + } + + /* Shimmer effect */ + .shimmer { + @apply relative overflow-hidden; + } + + .shimmer::after { + content: ''; + @apply absolute inset-0 bg-gradient-shine; + animation: shimmer 2s infinite; + } +} + +/* Markdown content improvements */ +.prose { + @apply max-w-none; +} + +.prose img { + @apply rounded-lg shadow-lg; +} + +.prose table { + @apply w-full border-collapse; +} + +.prose th { + @apply bg-dark-800 text-primary-400 font-semibold py-3 px-4 text-left border-b-2 border-primary-500/30; +} + +.prose td { + @apply py-3 px-4 border-b border-dark-700; +} + +.prose tr:hover { + @apply bg-white/5; +} + +/* Copy button for code blocks */ +.copy-button { + @apply absolute top-2 right-2 p-2 rounded-md bg-dark-800 text-gray-400 hover:text-white hover:bg-dark-700 transition-all opacity-0 group-hover:opacity-100; +} + +/* Loading states */ +.loading-dots { + @apply inline-flex space-x-1; +} + +.loading-dots span { + @apply w-2 h-2 bg-primary-500 rounded-full animate-pulse; + animation-delay: calc(var(--i) * 150ms); +} + +/* Hero section decorations */ +.hero-decoration { + @apply absolute pointer-events-none; +} + +.hero-blob { + @apply absolute w-96 h-96 bg-gradient-radial from-primary-500/30 to-transparent rounded-full blur-3xl animate-pulse-slow; +} diff --git a/Projects/kompose/docs/build.sh b/Projects/kompose/docs/build.sh new file mode 100644 index 00000000..2884e406 --- /dev/null +++ b/Projects/kompose/docs/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Build script for Kompose documentation +set -e + +echo "๐ŸŽจ Building Kompose Documentation..." +echo "" + +# Check if pnpm is installed +if ! command -v pnpm &> /dev/null; then + echo "โŒ pnpm is not installed. Installing pnpm..." + npm install -g pnpm@9.0.0 +fi + +# Install dependencies +echo "๐Ÿ“ฆ Installing dependencies..." +pnpm install + +# Generate static site +echo "๐Ÿ”จ Generating static site..." +pnpm run generate + +echo "" +echo "โœ… Build complete!" +echo "๐Ÿ“ Output directory: .output/public" +echo "" +echo "To preview locally:" +echo " pnpm run preview" +echo "" +echo "To deploy with Docker:" +echo " ./kompose.sh docs up -d --build" diff --git a/Projects/kompose/docs/components/CodeBlock.vue b/Projects/kompose/docs/components/CodeBlock.vue new file mode 100644 index 00000000..ca32b360 --- /dev/null +++ b/Projects/kompose/docs/components/CodeBlock.vue @@ -0,0 +1,38 @@ + + + diff --git a/Projects/kompose/docs/compose.yaml b/Projects/kompose/docs/compose.yaml new file mode 100644 index 00000000..2d2a7661 --- /dev/null +++ b/Projects/kompose/docs/compose.yaml @@ -0,0 +1,32 @@ +name: docs + +services: + docs: + build: + context: . + dockerfile: Dockerfile + container_name: ${COMPOSE_PROJECT_NAME}_app + restart: unless-stopped + volumes: + # Mount the built static site + - ./.output/public:/usr/share/nginx/html:ro + networks: + - kompose_network + labels: + - 'traefik.enable=true' + - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.middlewares=${COMPOSE_PROJECT_NAME}-redirect-web-secure' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.rule=Host(`${TRAEFIK_HOST}`)' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.entrypoints=web' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${TRAEFIK_HOST}`)' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure' + - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true' + - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.middlewares=${COMPOSE_PROJECT_NAME}-web-secure-compress' + - 'traefik.http.services.${COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=80' + - 'traefik.docker.network=${NETWORK_NAME:-kompose}' + +networks: + kompose_network: + name: ${NETWORK_NAME:-kompose} + external: true diff --git a/Projects/kompose/docs/content/docs/index.md b/Projects/kompose/docs/content/docs/index.md new file mode 100644 index 00000000..f207fe55 --- /dev/null +++ b/Projects/kompose/docs/content/docs/index.md @@ -0,0 +1,65 @@ +--- +title: Introduction to Kompose +description: Learn about Kompose, your Docker Compose Symphony Conductor for managing multiple stacks with style and grace. +--- + +# Introduction to Kompose + +**Kompose** is a powerful Bash orchestration tool for managing multiple Docker Compose stacks with style and grace. Think of it as a conductor for your Docker symphony - each stack plays its part, and Kompose makes sure they're all in harmony. + +## Why Kompose? + +๐ŸŽฏ **One Command to Rule Them All** - Manage dozens of stacks with a single command + +๐Ÿ”„ **Database Wizardry** - Export, import, and clean up PostgreSQL databases like a boss + +๐ŸŽช **Hook System** - Extend functionality with custom pre/post operation hooks + +๐ŸŒ **Network Maestro** - Smart network management with CLI overrides + +๐Ÿ” **Environment Juggler** - Override any environment variable on the fly + +๐ŸŽจ **Beautiful Output** - Color-coded logs and status indicators + +๐Ÿงช **Dry-Run Mode** - Test changes before applying them + +## Quick Example + +```bash +# Start all stacks +./kompose.sh "*" up -d + +# View logs from specific stacks +./kompose.sh "blog,news" logs -f + +# Export all databases +./kompose.sh "*" db:export + +# Override network for staging +./kompose.sh --network staging "*" up -d +``` + +## Key Features + +### Stack Management + +Pattern-based selection allows you to target stacks with globs, comma-separated lists, or wildcards. Execute commands across multiple stacks simultaneously with visual feedback and color-coded success/failure indicators. + +### Database Operations + +Automated backups with timestamped dumps, smart imports that auto-detect latest dumps, and safe database operations with connection termination. Keep your storage clean with cleanup utilities. + +### Hooks System + +Extend Kompose with custom hooks for each stack. Define `pre_db_export`, `post_db_export`, `pre_db_import`, and `post_db_import` hooks to add stack-specific logic. + +### Network Management + +All stacks communicate through a unified Docker network. Override the network on-the-fly via CLI without editing configs, with seamless Traefik integration. + +## Next Steps + +- [Installation Guide](/docs/installation) +- [Quick Start Tutorial](/docs/quick-start) +- [Stack Management](/docs/guide/stack-management) +- [Database Operations](/docs/guide/database) diff --git a/Projects/kompose/docs/content/docs/installation.md b/Projects/kompose/docs/content/docs/installation.md new file mode 100644 index 00000000..b6e33244 --- /dev/null +++ b/Projects/kompose/docs/content/docs/installation.md @@ -0,0 +1,280 @@ +--- +title: Installation Guide +description: Step-by-step guide to install and set up Kompose on your system +--- + +# Installation Guide + +Get Kompose up and running on your system in just a few minutes. + +## Prerequisites + +Before installing Kompose, make sure you have the following installed: + +### Required + +- **Bash** 4.0 or higher +- **Docker** 20.10 or higher +- **Docker Compose** v2.0 or higher + +### Optional (for database operations) + +- **PostgreSQL client tools** (for database operations) + +```bash +# Ubuntu/Debian +sudo apt-get install postgresql-client + +# macOS +brew install postgresql + +# Arch Linux +sudo pacman -S postgresql +``` + +## Installation + +### Method 1: Clone from Git (Recommended) + +```bash +# Clone the repository +git clone https://github.com/yourusername/kompose.git + +# Navigate to the directory +cd kompose + +# Make the script executable +chmod +x kompose.sh + +# Verify installation +./kompose.sh --help +``` + +### Method 2: Download Release + +```bash +# Download the latest release +wget https://github.com/yourusername/kompose/archive/refs/heads/main.zip + +# Extract +unzip main.zip + +# Navigate to directory +cd kompose-main + +# Make executable +chmod +x kompose.sh +``` + +## Initial Setup + +### 1. Create Docker Network + +Kompose uses a unified Docker network for all stacks: + +```bash +docker network create kompose +``` + +### 2. Configure Environment + +Create and configure the root `.env` file: + +```bash +# Copy example environment file +cp .env.example .env + +# Edit with your preferred editor +nano .env +``` + +**Example `.env` configuration:** + +```env +# Network Configuration +NETWORK_NAME=kompose + +# Database Connection +DB_USER=dbuser +DB_PASSWORD=secretpassword +DB_PORT=5432 +DB_HOST=postgres + +# Admin Settings +ADMIN_EMAIL=admin@example.com + +# Email/SMTP Settings +EMAIL_TRANSPORT=smtp +EMAIL_FROM=noreply@example.com +EMAIL_SMTP_HOST=smtp.example.com +EMAIL_SMTP_PORT=465 +EMAIL_SMTP_USER=smtp@example.com +EMAIL_SMTP_PASSWORD=smtppassword +``` + +### 3. Configure Individual Stacks + +Each stack needs its own `.env` file. Navigate to any stack directory: + +```bash +# Example: Configure the proxy stack +cd proxy +cp .env.example .env +nano .env +``` + +## Verification + +### Check Installation + +```bash +# List all available stacks +./kompose.sh --list + +# Should output something like: +# Stack: auth (compose.yaml) [.env] [PostgreSQL] +# Stack: blog (compose.yaml) [.env] +# Stack: data (compose.yaml) [.env] [PostgreSQL] +# ... +``` + +### Test Basic Commands + +```bash +# Start the proxy stack +./kompose.sh proxy up -d + +# Check if it's running +./kompose.sh proxy ps + +# View logs +./kompose.sh proxy logs +``` + +## Post-Installation + +### Add to PATH (Optional) + +For easier access, add Kompose to your PATH: + +```bash +# Add to ~/.bashrc or ~/.zshrc +echo 'export PATH="$PATH:/path/to/kompose"' >> ~/.bashrc +source ~/.bashrc + +# Now you can run from anywhere +kompose.sh --list +``` + +### Create Aliases (Optional) + +Add helpful aliases to your shell configuration: + +```bash +# Add to ~/.bashrc or ~/.zshrc +alias kp='./kompose.sh' +alias kup='./kompose.sh "*" up -d' +alias kdown='./kompose.sh "*" down' +alias klogs='./kompose.sh "*" logs -f' +alias kps='./kompose.sh "*" ps' +``` + +### Set Up Automated Backups + +Create a cron job for automatic database backups: + +```bash +# Edit crontab +crontab -e + +# Add daily backup at 2 AM +0 2 * * * cd /path/to/kompose && ./kompose.sh "*" db:export 2>&1 | tee -a backup.log + +# Add weekly cleanup (Sundays at 3 AM) +0 3 * * 0 cd /path/to/kompose && ./kompose.sh "*" db:cleanup +``` + +## Troubleshooting + +### Permission Denied + +If you get a "Permission denied" error: + +```bash +chmod +x kompose.sh +``` + +### Docker Network Already Exists + +If the network creation fails: + +```bash +# Check if it exists +docker network ls | grep kompose + +# If it exists, you're good to go +# If not, try removing and recreating +docker network rm kompose +docker network create kompose +``` + +### Docker Not Running + +Ensure Docker daemon is running: + +```bash +# Check Docker status +sudo systemctl status docker + +# Start Docker if not running +sudo systemctl start docker + +# Enable Docker to start on boot +sudo systemctl enable docker +``` + +## Next Steps + +Now that Kompose is installed, you can: + +1. [Start with the Quick Start Guide](/docs/quick-start) +2. [Learn about Stack Management](/docs/guide/stack-management) +3. [Explore Database Operations](/docs/guide/database) +4. [Set up Custom Hooks](/docs/guide/hooks) + +## Updating Kompose + +To update to the latest version: + +```bash +# Navigate to Kompose directory +cd /path/to/kompose + +# Pull latest changes +git pull origin main + +# Restart affected stacks if needed +./kompose.sh "*" restart +``` + +## Uninstallation + +To completely remove Kompose: + +```bash +# Stop all stacks +./kompose.sh "*" down + +# Remove Docker network +docker network rm kompose + +# Remove Kompose directory +rm -rf /path/to/kompose + +# (Optional) Remove from PATH +# Edit ~/.bashrc or ~/.zshrc and remove the PATH export +``` + +--- + +**Need Help?** Check out the [Troubleshooting Guide](/docs/troubleshooting) or [open an issue](https://github.com/yourusername/kompose/issues) on GitHub. diff --git a/Projects/kompose/docs/layouts/default.vue b/Projects/kompose/docs/layouts/default.vue new file mode 100644 index 00000000..51bf1e07 --- /dev/null +++ b/Projects/kompose/docs/layouts/default.vue @@ -0,0 +1,222 @@ + + + diff --git a/Projects/kompose/docs/nginx.conf b/Projects/kompose/docs/nginx.conf new file mode 100644 index 00000000..e26db26e --- /dev/null +++ b/Projects/kompose/docs/nginx.conf @@ -0,0 +1,82 @@ +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log warn; +pid /var/run/nginx.pid; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + tcp_nopush on; + tcp_nodelay on; + keepalive_timeout 65; + types_hash_max_size 2048; + server_tokens off; + + # Gzip compression + gzip on; + gzip_vary on; + gzip_proxied any; + gzip_comp_level 6; + gzip_types text/plain text/css text/xml text/javascript + application/json application/javascript application/xml+rss + application/rss+xml font/truetype font/opentype + application/vnd.ms-fontobject image/svg+xml; + gzip_disable "msie6"; + + # Brotli compression (if available) + brotli on; + brotli_comp_level 6; + brotli_types text/plain text/css text/xml text/javascript + application/json application/javascript application/xml+rss + application/rss+xml font/truetype font/opentype + application/vnd.ms-fontobject image/svg+xml; + + server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Security headers + add_header X-Frame-Options "SAMEORIGIN" always; + add_header X-Content-Type-Options "nosniff" always; + add_header X-XSS-Protection "1; mode=block" always; + add_header Referrer-Policy "no-referrer-when-downgrade" always; + + # Cache static assets + location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Handle SPA routing + location / { + try_files $uri $uri/ /index.html; + } + + # Handle 404 errors + error_page 404 /404.html; + location = /404.html { + internal; + } + + # Health check endpoint + location /health { + access_log off; + return 200 "healthy\n"; + add_header Content-Type text/plain; + } + } +} diff --git a/Projects/kompose/docs/nuxt.config.ts b/Projects/kompose/docs/nuxt.config.ts new file mode 100644 index 00000000..66a7a00e --- /dev/null +++ b/Projects/kompose/docs/nuxt.config.ts @@ -0,0 +1,115 @@ +// https://nuxt.com/docs/api/configuration/nuxt-config +export default defineNuxtConfig({ + compatibilityDate: '2024-04-03', + devtools: { enabled: true }, + + modules: [ + '@nuxt/content', + '@nuxtjs/tailwindcss', + '@nuxtjs/color-mode', + '@nuxt/icon', + '@vueuse/nuxt' + ], + + // Content module configuration + content: { + documentDriven: true, + highlight: { + theme: { + default: 'github-dark', + dark: 'github-dark' + }, + preload: [ + 'bash', + 'shell', + 'yaml', + 'json', + 'markdown', + 'javascript', + 'typescript', + 'vue', + 'docker', + 'sql' + ] + }, + markdown: { + toc: { + depth: 3, + searchDepth: 3 + }, + anchorLinks: true + }, + // Search configuration + experimental: { + search: { + indexed: true + } + } + }, + + // Color mode configuration + colorMode: { + classSuffix: '', + preference: 'dark', + fallback: 'dark' + }, + + // Tailwind configuration + tailwindcss: { + exposeConfig: true, + viewer: true, + config: { + darkMode: 'class', + content: [ + './components/**/*.{js,vue,ts}', + './layouts/**/*.vue', + './pages/**/*.vue', + './plugins/**/*.{js,ts}', + './app.vue' + ] + } + }, + + // App configuration + app: { + head: { + charset: 'utf-8', + viewport: 'width=device-width, initial-scale=1', + title: 'Kompose Documentation', + meta: [ + { name: 'description', content: 'Complete documentation for Kompose - Your Docker Compose Symphony Conductor' }, + { name: 'og:title', content: 'Kompose Documentation' }, + { name: 'og:description', content: 'Complete documentation for Kompose - Your Docker Compose Symphony Conductor' }, + { name: 'og:type', content: 'website' }, + { name: 'twitter:card', content: 'summary_large_image' } + ], + link: [ + { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } + ] + } + }, + + // Nitro configuration for static generation + nitro: { + prerender: { + crawlLinks: true, + routes: ['/'] + } + }, + + // Build configuration + build: { + transpile: [] + }, + + // PWA configuration + pwa: { + manifest: { + name: 'Kompose Docs', + short_name: 'Kompose', + description: 'Kompose Documentation', + theme_color: '#f97316', + background_color: '#0a0a0a' + } + } +}) diff --git a/Projects/kompose/docs/package.json b/Projects/kompose/docs/package.json new file mode 100644 index 00000000..a64fbd9e --- /dev/null +++ b/Projects/kompose/docs/package.json @@ -0,0 +1,31 @@ +{ + "name": "kompose-docs", + "version": "1.0.0", + "description": "Kompose Documentation Site", + "private": true, + "type": "module", + "scripts": { + "dev": "nuxt dev", + "build": "nuxt build", + "generate": "nuxt generate", + "preview": "nuxt preview", + "postinstall": "nuxt prepare" + }, + "dependencies": { + "@nuxt/content": "^2.13.2", + "@nuxtjs/color-mode": "^3.4.2", + "@nuxtjs/tailwindcss": "^6.12.1", + "nuxt": "^3.13.2", + "vue": "^3.5.4", + "vue-router": "^4.4.5" + }, + "devDependencies": { + "@iconify-json/heroicons": "^1.2.0", + "@iconify-json/lucide": "^1.2.4", + "@nuxt/icon": "^1.5.2", + "@tailwindcss/typography": "^0.5.15", + "@vueuse/core": "^11.1.0", + "@vueuse/nuxt": "^11.1.0" + }, + "packageManager": "pnpm@9.0.0" +} diff --git a/Projects/kompose/docs/pages/docs/[...slug].vue b/Projects/kompose/docs/pages/docs/[...slug].vue new file mode 100644 index 00000000..bef7ef95 --- /dev/null +++ b/Projects/kompose/docs/pages/docs/[...slug].vue @@ -0,0 +1,143 @@ + + + + + diff --git a/Projects/kompose/docs/pages/index.vue b/Projects/kompose/docs/pages/index.vue new file mode 100644 index 00000000..a5891d5a --- /dev/null +++ b/Projects/kompose/docs/pages/index.vue @@ -0,0 +1,234 @@ + + + diff --git a/Projects/kompose/docs/tailwind.config.js b/Projects/kompose/docs/tailwind.config.js new file mode 100644 index 00000000..a8e07c48 --- /dev/null +++ b/Projects/kompose/docs/tailwind.config.js @@ -0,0 +1,168 @@ +/** @type {import('tailwindcss').Config} */ +export default { + darkMode: 'class', + content: [ + './components/**/*.{js,vue,ts}', + './layouts/**/*.vue', + './pages/**/*.vue', + './plugins/**/*.{js,ts}', + './app.vue', + './content/**/*.md' + ], + theme: { + extend: { + colors: { + // Dark base colors + dark: { + 50: '#f5f5f5', + 100: '#e7e7e7', + 200: '#d1d1d1', + 300: '#b0b0b0', + 400: '#888888', + 500: '#6d6d6d', + 600: '#5d5d5d', + 700: '#4f4f4f', + 800: '#454545', + 900: '#3d3d3d', + 950: '#0a0a0a', + }, + // Orange primary colors (funky modern) + primary: { + 50: '#fff7ed', + 100: '#ffedd5', + 200: '#fed7aa', + 300: '#fdba74', + 400: '#fb923c', + 500: '#f97316', // Main orange + 600: '#ea580c', + 700: '#c2410c', + 800: '#9a3412', + 900: '#7c2d12', + 950: '#431407', + }, + // Purple accent colors + accent: { + 50: '#faf5ff', + 100: '#f3e8ff', + 200: '#e9d5ff', + 300: '#d8b4fe', + 400: '#c084fc', + 500: '#a855f7', // Main purple + 600: '#9333ea', + 700: '#7e22ce', + 800: '#6b21a8', + 900: '#581c87', + 950: '#3b0764', + }, + // Complementary colors + cyber: { + pink: '#ff0080', + cyan: '#00f5ff', + lime: '#39ff14' + } + }, + backgroundImage: { + 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))', + 'gradient-conic': 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))', + 'gradient-primary': 'linear-gradient(135deg, #f97316 0%, #fb923c 100%)', + 'gradient-accent': 'linear-gradient(135deg, #a855f7 0%, #c084fc 100%)', + 'gradient-hero': 'linear-gradient(135deg, #f97316 0%, #a855f7 50%, #7e22ce 100%)', + 'gradient-cyber': 'linear-gradient(135deg, #f97316 0%, #ff0080 50%, #a855f7 100%)', + 'gradient-dark': 'linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%)', + 'gradient-shine': 'linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.3), transparent)', + }, + animation: { + 'gradient': 'gradient 8s linear infinite', + 'gradient-xy': 'gradient-xy 15s ease infinite', + 'shimmer': 'shimmer 2s linear infinite', + 'glow': 'glow 2s ease-in-out infinite alternate', + 'float': 'float 6s ease-in-out infinite', + 'pulse-slow': 'pulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite', + }, + keyframes: { + gradient: { + '0%, 100%': { + 'background-size': '200% 200%', + 'background-position': 'left center' + }, + '50%': { + 'background-size': '200% 200%', + 'background-position': 'right center' + }, + }, + 'gradient-xy': { + '0%, 100%': { + 'background-size': '400% 400%', + 'background-position': 'left center' + }, + '50%': { + 'background-size': '200% 200%', + 'background-position': 'right center' + }, + }, + shimmer: { + '0%': { transform: 'translateX(-100%)' }, + '100%': { transform: 'translateX(100%)' } + }, + glow: { + 'from': { + 'text-shadow': '0 0 10px #f97316, 0 0 20px #f97316, 0 0 30px #f97316', + }, + 'to': { + 'text-shadow': '0 0 20px #a855f7, 0 0 30px #a855f7, 0 0 40px #a855f7', + } + }, + float: { + '0%, 100%': { transform: 'translateY(0px)' }, + '50%': { transform: 'translateY(-20px)' } + } + }, + boxShadow: { + 'glow-orange': '0 0 20px rgba(249, 115, 22, 0.5)', + 'glow-purple': '0 0 20px rgba(168, 85, 247, 0.5)', + 'glow-cyber': '0 0 30px rgba(249, 115, 22, 0.3), 0 0 60px rgba(168, 85, 247, 0.3)', + 'inner-glow': 'inset 0 0 20px rgba(249, 115, 22, 0.2)', + }, + typography: (theme) => ({ + DEFAULT: { + css: { + '--tw-prose-body': theme('colors.gray[300]'), + '--tw-prose-headings': theme('colors.white'), + '--tw-prose-links': theme('colors.primary[400]'), + '--tw-prose-bold': theme('colors.white'), + '--tw-prose-code': theme('colors.primary[300]'), + '--tw-prose-pre-bg': theme('colors.dark[900]'), + maxWidth: 'none', + color: theme('colors.gray[300]'), + a: { + color: theme('colors.primary[400]'), + '&:hover': { + color: theme('colors.primary[500]'), + }, + }, + 'code::before': { + content: '""' + }, + 'code::after': { + content: '""' + }, + code: { + color: theme('colors.primary[300]'), + backgroundColor: theme('colors.dark[800]'), + padding: '0.25rem 0.5rem', + borderRadius: '0.25rem', + fontWeight: '500', + }, + pre: { + backgroundColor: theme('colors.dark[900]'), + border: `1px solid ${theme('colors.dark[700]')}`, + } + } + } + }) + }, + }, + plugins: [ + require('@tailwindcss/typography'), + ], +} diff --git a/Projects/kompose/docs/tsconfig.json b/Projects/kompose/docs/tsconfig.json new file mode 100644 index 00000000..4b34df15 --- /dev/null +++ b/Projects/kompose/docs/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "./.nuxt/tsconfig.json" +} diff --git a/Projects/kompose/home/README.md b/Projects/kompose/home/README.md index 19359bcf..d4fed396 100644 --- a/Projects/kompose/home/README.md +++ b/Projects/kompose/home/README.md @@ -1,21 +1,90 @@ -# ๐Ÿ  Home Stack - Smart Home Automation +# ๐Ÿ  Home Stack - Your Smart Home Command Center -Complete documentation for Home Assistant is available in the artifacts. +> *"Home is where the automation is!"* - Every Home Assistant user -## Quick Start +## What's This All About? -```bash -docker compose up -d +This stack transforms your house into a smart home! Home Assistant is the open-source brain that connects and controls everything from lights to locks, thermostats to TVs. It's like having J.A.R.V.I.S. from Iron Man, but you built it yourself! + +## The Star of the Show + +### ๐Ÿ  Home Assistant + +**Container**: `home_app` +**Image**: `ghcr.io/home-assistant/home-assistant:stable` +**Home**: https://home.localhost +**Port**: 8123 + +Home Assistant is your smart home's mission control: +- ๐Ÿ”Œ **2000+ Integrations**: Control almost anything +- ๐Ÿค– **Powerful Automations**: If this, then that (but better!) +- ๐ŸŽจ **Beautiful UI**: Customizable dashboards +- ๐Ÿ“ฑ **Mobile Apps**: Control from anywhere (iOS & Android) +- ๐Ÿ—ฃ๏ธ **Voice Control**: Alexa, Google, Siri integration +- ๐Ÿ” **Privacy First**: Your data stays home +- ๐ŸŒ™ **Energy Monitoring**: Track usage and costs +- ๐Ÿ“Š **History & Analytics**: Visualize your home + +## Configuration Breakdown + +### Privileged Mode ๐Ÿ”“ + +Running in privileged mode to access: +- USB devices (Zigbee/Z-Wave sticks) +- Bluetooth adapters +- Network interfaces +- Hardware sensors + +### Network Mode: Host + +Uses host networking for: +- mDNS device discovery (Chromecast, Sonos, etc.) +- DLNA/UPnP devices +- Better integration with network devices + +### Configuration Volume + +All settings, automations, and data live in: +``` +Host: ./config +Container: /config ``` -Access: https://home.localhost +This makes backups super easy - just copy the config folder! -## Key Features -- 2000+ device integrations -- Powerful automations -- Voice control -- Mobile apps +## Environment Variables Explained -For the complete 300+ line README with full documentation, -please refer to the artifacts from the conversation. +| Variable | What It Does | Cool Factor | +|----------|-------------|-------------| +| `COMPOSE_PROJECT_NAME` | Stack identifier | ๐Ÿ“ฆ Organization | +| `TZ` | Your timezone | โฐ CRITICAL for automations! | +| `TRAEFIK_HOST` | Domain name | ๐ŸŒ Your home's address | +| `APP_PORT` | Web interface port | ๐ŸŽฏ Internal routing | +## Troubleshooting + +**Q: Can't access USB devices (Zigbee stick)?** +A: Verify privileged mode is enabled and device path is correct + +**Q: Devices not being discovered?** +A: Check network mode is set to `host` for mDNS discovery + +**Q: Automations not triggering?** +A: Verify timezone is set correctly - this is crucial! + +## Security Notes ๐Ÿ”’ + +- ๐Ÿ” **Strong Password**: Your home security depends on it! +- ๐ŸŒ **HTTPS Only**: Traefik provides SSL automatically +- ๐Ÿ‘๏ธ **Two-Factor**: Enable in user profile +- ๐Ÿ”‘ **API Tokens**: Use long-lived tokens, not passwords + +## Resources + +- [Home Assistant Documentation](https://www.home-assistant.io/docs/) +- [Community Forum](https://community.home-assistant.io/) +- [YouTube Tutorials](https://www.youtube.com/c/HomeAssistant) + +--- + +*"The smart home isn't about the technology - it's about making life simpler, more comfortable, and maybe a little more magical."* โœจ๐Ÿ  diff --git a/Projects/kompose/make-executable.sh b/Projects/kompose/make-executable.sh deleted file mode 100755 index 4b3100a1..00000000 --- a/Projects/kompose/make-executable.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# Make setup script executable -chmod +x /home/valknar/Projects/kompose/setup-new-stacks.sh -echo "Setup script is now executable!" -echo "Run it with: ./setup-new-stacks.sh" diff --git a/Projects/kompose/setup-new-stacks.sh b/Projects/kompose/setup-new-stacks.sh deleted file mode 100755 index 9cb2659a..00000000 --- a/Projects/kompose/setup-new-stacks.sh +++ /dev/null @@ -1,484 +0,0 @@ -#!/bin/bash - -# Kompose New Stacks Setup Script -# This script creates all directories and files for the 4 new stacks - -set -e - -# Colors for output -GREEN='\033[0;32m' -BLUE='\033[0;34m' -YELLOW='\033[1;33m' -RED='\033[0;31m' -NC='\033[0m' - -BASE_DIR="/home/valknar/Projects/kompose" - -echo -e "${BLUE}========================================${NC}" -echo -e "${BLUE} Kompose New Stacks Setup${NC}" -echo -e "${BLUE}========================================${NC}" -echo "" - -# Check if we're in the right directory -if [ ! -d "$BASE_DIR" ]; then - echo -e "${RED}Error: Kompose directory not found at $BASE_DIR${NC}" - exit 1 -fi - -cd "$BASE_DIR" - -# Generate secrets -echo -e "${BLUE}Generating secrets...${NC}" -N8N_KEY=$(openssl rand -hex 32) -NEXTAUTH_SECRET=$(openssl rand -base64 32) -echo -e "${GREEN}โœ“ Secrets generated${NC}" -echo "" - -# ============================================================================ -# HOME STACK -# ============================================================================ - -echo -e "${YELLOW}Creating home stack...${NC}" -mkdir -p home/config - -# home/compose.yaml -cat > home/compose.yaml << 'EOF' -name: home - -services: - homeassistant: - image: ${DOCKER_IMAGE} - container_name: ${COMPOSE_PROJECT_NAME}_app - restart: unless-stopped - privileged: true - environment: - TZ: ${TZ} - volumes: - - ./config:/config - - /etc/localtime:/etc/localtime:ro - networks: - - kompose_network - ports: - - "${APP_PORT}:8123" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8123/manifest.json"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 60s - labels: - - 'traefik.enable=true' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.middlewares=${COMPOSE_PROJECT_NAME}-redirect-web-secure' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.entrypoints=web' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.middlewares=${COMPOSE_PROJECT_NAME}-web-secure-compress' - - 'traefik.http.services.${COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=${APP_PORT}' - - 'traefik.docker.network=${NETWORK_NAME}' - -networks: - kompose_network: - name: ${NETWORK_NAME} - external: true -EOF - -# home/.env -cat > home/.env << 'EOF' -# Stack identification -COMPOSE_PROJECT_NAME=home - -# Docker image -DOCKER_IMAGE=ghcr.io/home-assistant/home-assistant:stable - -# Traefik hostname -TRAEFIK_HOST=home.localhost - -# App port -APP_PORT=8123 - -# Network -NETWORK_NAME=kompose - -# Timezone (important for automations!) -TZ=Europe/Paris -EOF - -echo -e "${GREEN}โœ“ Home stack created${NC}" - -# ============================================================================ -# CHAIN STACK -# ============================================================================ - -echo -e "${YELLOW}Creating chain stack...${NC}" -mkdir -p chain - -# chain/compose.yaml -cat > chain/compose.yaml << 'EOF' -name: chain - -services: - n8n: - image: ${DOCKER_IMAGE} - container_name: ${COMPOSE_PROJECT_NAME}_app - restart: unless-stopped - environment: - DB_TYPE: postgresdb - DB_POSTGRESDB_HOST: ${DB_HOST} - DB_POSTGRESDB_PORT: 5432 - DB_POSTGRESDB_DATABASE: ${DB_NAME} - DB_POSTGRESDB_USER: ${DB_USER} - DB_POSTGRESDB_PASSWORD: ${DB_PASSWORD} - N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY} - WEBHOOK_URL: https://${TRAEFIK_HOST}/ - GENERIC_TIMEZONE: ${TZ} - N8N_BASIC_AUTH_ACTIVE: ${N8N_BASIC_AUTH_ACTIVE} - N8N_BASIC_AUTH_USER: ${N8N_BASIC_AUTH_USER} - N8N_BASIC_AUTH_PASSWORD: ${N8N_BASIC_AUTH_PASSWORD} - EXECUTIONS_DATA_SAVE_ON_ERROR: all - EXECUTIONS_DATA_SAVE_ON_SUCCESS: all - EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS: true - N8N_EMAIL_MODE: ${EMAIL_TRANSPORT} - N8N_SMTP_HOST: ${EMAIL_SMTP_HOST} - N8N_SMTP_PORT: ${EMAIL_SMTP_PORT} - N8N_SMTP_USER: ${EMAIL_SMTP_USER} - N8N_SMTP_PASS: ${EMAIL_SMTP_PASSWORD} - N8N_SMTP_SENDER: ${EMAIL_FROM} - volumes: - - n8n_data:/home/node/.n8n - healthcheck: - test: ["CMD-SHELL", "wget --spider -q http://localhost:${APP_PORT}/healthz || exit 1"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 45s - networks: - - kompose_network - labels: - - 'traefik.enable=true' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.middlewares=${COMPOSE_PROJECT_NAME}-redirect-web-secure' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.entrypoints=web' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.middlewares=${COMPOSE_PROJECT_NAME}-web-secure-compress' - - 'traefik.http.services.${COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=${APP_PORT}' - - 'traefik.docker.network=${NETWORK_NAME}' - -volumes: - n8n_data: - -networks: - kompose_network: - name: ${NETWORK_NAME} - external: true -EOF - -# chain/.env with generated secret -cat > chain/.env << EOF -# Stack identification -COMPOSE_PROJECT_NAME=chain - -# Docker image -DOCKER_IMAGE=n8nio/n8n:latest - -# Database name -DB_NAME=n8n - -# Traefik hostname -TRAEFIK_HOST=chain.localhost - -# App port -APP_PORT=5678 - -# Network -NETWORK_NAME=kompose - -# Timezone -TZ=Europe/Paris - -# Encryption key for credentials (GENERATED!) -N8N_ENCRYPTION_KEY=$N8N_KEY - -# Basic Auth (optional, recommended for initial setup) -N8N_BASIC_AUTH_ACTIVE=true -N8N_BASIC_AUTH_USER=admin -N8N_BASIC_AUTH_PASSWORD=changeme -EOF - -echo -e "${GREEN}โœ“ Chain stack created${NC}" - -# ============================================================================ -# GIT STACK -# ============================================================================ - -echo -e "${YELLOW}Creating git stack...${NC}" -mkdir -p git - -# git/compose.yaml -cat > git/compose.yaml << 'EOF' -name: git - -services: - gitea: - image: ${DOCKER_IMAGE} - container_name: ${COMPOSE_PROJECT_NAME}_app - restart: unless-stopped - environment: - USER_UID: 1000 - USER_GID: 1000 - GITEA__database__DB_TYPE: postgres - GITEA__database__HOST: ${DB_HOST}:5432 - GITEA__database__NAME: ${DB_NAME} - GITEA__database__USER: ${DB_USER} - GITEA__database__PASSWD: ${DB_PASSWORD} - GITEA__server__DOMAIN: ${TRAEFIK_HOST} - GITEA__server__SSH_DOMAIN: ${TRAEFIK_HOST} - GITEA__server__ROOT_URL: https://${TRAEFIK_HOST}/ - GITEA__server__HTTP_PORT: ${APP_PORT} - GITEA__server__DISABLE_SSH: ${DISABLE_SSH} - GITEA__server__SSH_PORT: ${SSH_PORT} - GITEA__security__INSTALL_LOCK: true - GITEA__mailer__ENABLED: ${EMAIL_ENABLED} - GITEA__mailer__SMTP_ADDR: ${EMAIL_SMTP_HOST} - GITEA__mailer__SMTP_PORT: ${EMAIL_SMTP_PORT} - GITEA__mailer__FROM: ${EMAIL_FROM} - GITEA__mailer__USER: ${EMAIL_SMTP_USER} - GITEA__mailer__PASSWD: ${EMAIL_SMTP_PASSWORD} - volumes: - - gitea_data:/data - - /etc/timezone:/etc/timezone:ro - - /etc/localtime:/etc/localtime:ro - ports: - - "${SSH_PORT}:22" - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:${APP_PORT}/api/healthz"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 60s - networks: - - kompose_network - labels: - - 'traefik.enable=true' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.middlewares=${COMPOSE_PROJECT_NAME}-redirect-web-secure' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.entrypoints=web' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.middlewares=${COMPOSE_PROJECT_NAME}-web-secure-compress' - - 'traefik.http.services.${COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=${APP_PORT}' - - 'traefik.docker.network=${NETWORK_NAME}' - -volumes: - gitea_data: - -networks: - kompose_network: - name: ${NETWORK_NAME} - external: true -EOF - -# git/.env -cat > git/.env << 'EOF' -# Stack identification -COMPOSE_PROJECT_NAME=git - -# Docker image -DOCKER_IMAGE=gitea/gitea:latest - -# Database name -DB_NAME=gitea - -# Traefik hostname -TRAEFIK_HOST=git.localhost - -# App port (internal HTTP) -APP_PORT=3000 - -# SSH port (for git operations) -SSH_PORT=2222 - -# Network -NETWORK_NAME=kompose - -# SSH settings -DISABLE_SSH=false - -# Email settings (optional) -EMAIL_ENABLED=true -EOF - -echo -e "${GREEN}โœ“ Git stack created${NC}" - -# ============================================================================ -# LINK STACK -# ============================================================================ - -echo -e "${YELLOW}Creating link stack...${NC}" -mkdir -p link - -# link/compose.yaml -cat > link/compose.yaml << 'EOF' -name: link - -services: - linkwarden: - image: ${DOCKER_IMAGE} - container_name: ${COMPOSE_PROJECT_NAME}_app - restart: unless-stopped - environment: - DATABASE_URL: postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME} - NEXTAUTH_SECRET: ${NEXTAUTH_SECRET} - NEXTAUTH_URL: https://${TRAEFIK_HOST} - NEXT_PUBLIC_PAGINATION_TAKE_COUNT: 20 - STORAGE_FOLDER: /data/archives - NEXT_PUBLIC_DISABLE_SCREENSHOT: ${DISABLE_SCREENSHOT} - NEXT_PUBLIC_DISABLE_ARCHIVE: ${DISABLE_ARCHIVE} - NEXT_PUBLIC_DISABLE_REGISTRATION: ${DISABLE_REGISTRATION} - EMAIL_FROM: ${EMAIL_FROM} - EMAIL_SERVER: smtp://${EMAIL_SMTP_USER}:${EMAIL_SMTP_PASSWORD}@${EMAIL_SMTP_HOST}:${EMAIL_SMTP_PORT} - volumes: - - linkwarden_data:/data/archives - healthcheck: - test: ["CMD-SHELL", "wget --spider -q http://localhost:${APP_PORT}/api/healthcheck || exit 1"] - interval: 30s - timeout: 10s - retries: 3 - start_period: 60s - networks: - - kompose_network - labels: - - 'traefik.enable=true' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-redirect-web-secure.redirectscheme.scheme=https' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.middlewares=${COMPOSE_PROJECT_NAME}-redirect-web-secure' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web.entrypoints=web' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.rule=Host(`${TRAEFIK_HOST}`)' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.tls.certresolver=resolver' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.entrypoints=web-secure' - - 'traefik.http.middlewares.${COMPOSE_PROJECT_NAME}-web-secure-compress.compress=true' - - 'traefik.http.routers.${COMPOSE_PROJECT_NAME}-web-secure.middlewares=${COMPOSE_PROJECT_NAME}-web-secure-compress' - - 'traefik.http.services.${COMPOSE_PROJECT_NAME}-web-secure.loadbalancer.server.port=${APP_PORT}' - - 'traefik.docker.network=${NETWORK_NAME}' - -volumes: - linkwarden_data: - -networks: - kompose_network: - name: ${NETWORK_NAME} - external: true -EOF - -# link/.env with generated secret -cat > link/.env << EOF -# Stack identification -COMPOSE_PROJECT_NAME=link - -# Docker image -DOCKER_IMAGE=ghcr.io/linkwarden/linkwarden:latest - -# Database name -DB_NAME=linkwarden - -# Traefik hostname -TRAEFIK_HOST=link.localhost - -# App port -APP_PORT=3000 - -# Network -NETWORK_NAME=kompose - -# NextAuth Secret (GENERATED!) -NEXTAUTH_SECRET=$NEXTAUTH_SECRET - -# Features -DISABLE_SCREENSHOT=false -DISABLE_ARCHIVE=false -DISABLE_REGISTRATION=true -EOF - -echo -e "${GREEN}โœ“ Link stack created${NC}" - -echo "" -echo -e "${BLUE}========================================${NC}" -echo -e "${BLUE} Creating databases...${NC}" -echo -e "${BLUE}========================================${NC}" -echo "" - -# Source root .env for DB credentials -source .env - -# Check if data stack is running -if ! docker ps | grep -q "data_postgres"; then - echo -e "${RED}Warning: PostgreSQL container not running!${NC}" - echo -e "${YELLOW}Please start the data stack first: cd data && docker compose up -d${NC}" - echo -e "${YELLOW}Then run: docker exec data_postgres createdb -U $DB_USER n8n${NC}" - echo -e "${YELLOW} docker exec data_postgres createdb -U $DB_USER gitea${NC}" - echo -e "${YELLOW} docker exec data_postgres createdb -U $DB_USER linkwarden${NC}" -else - # Create databases - echo -e "${YELLOW}Creating n8n database...${NC}" - if docker exec data_postgres psql -U "$DB_USER" -lqt | cut -d \| -f 1 | grep -qw "n8n"; then - echo -e "${YELLOW}Database n8n already exists${NC}" - else - docker exec data_postgres createdb -U "$DB_USER" n8n - echo -e "${GREEN}โœ“ Created database: n8n${NC}" - fi - - echo -e "${YELLOW}Creating gitea database...${NC}" - if docker exec data_postgres psql -U "$DB_USER" -lqt | cut -d \| -f 1 | grep -qw "gitea"; then - echo -e "${YELLOW}Database gitea already exists${NC}" - else - docker exec data_postgres createdb -U "$DB_USER" gitea - echo -e "${GREEN}โœ“ Created database: gitea${NC}" - fi - - echo -e "${YELLOW}Creating linkwarden database...${NC}" - if docker exec data_postgres psql -U "$DB_USER" -lqt | cut -d \| -f 1 | grep -qw "linkwarden"; then - echo -e "${YELLOW}Database linkwarden already exists${NC}" - else - docker exec data_postgres createdb -U "$DB_USER" linkwarden - echo -e "${GREEN}โœ“ Created database: linkwarden${NC}" - fi -fi - -echo "" -echo -e "${GREEN}========================================${NC}" -echo -e "${GREEN} Setup Complete!${NC}" -echo -e "${GREEN}========================================${NC}" -echo "" -echo -e "${BLUE}Generated Secrets:${NC}" -echo -e "${YELLOW}N8N_ENCRYPTION_KEY:${NC} $N8N_KEY" -echo -e "${YELLOW}NEXTAUTH_SECRET:${NC} $NEXTAUTH_SECRET" -echo "" -echo -e "${BLUE}These secrets have been saved to the .env files!${NC}" -echo "" -echo -e "${BLUE}Next Steps:${NC}" -echo "1. Review the .env files in each directory" -echo "2. Update TRAEFIK_HOST if needed (currently set to *.localhost)" -echo "3. Start the stacks:" -echo "" -echo " cd home && docker compose up -d" -echo " cd ../chain && docker compose up -d" -echo " cd ../git && docker compose up -d" -echo " cd ../link && docker compose up -d" -echo "" -echo -e "${BLUE}Access URLs:${NC}" -echo " Home Assistant: https://home.localhost" -echo " n8n: https://chain.localhost" -echo " Gitea: https://git.localhost" -echo " Linkwarden: https://link.localhost" -echo "" -echo -e "${GREEN}Happy hacking! ๐Ÿš€${NC}" diff --git a/Projects/kompose/sync.sh b/Projects/kompose/sync.sh deleted file mode 100755 index 5cd68b13..00000000 --- a/Projects/kompose/sync.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -git init -git stash -git remote add origin ssh://git@code.pivoine.art:2222/valknar/kompose.git -git fetch && git reset --hard origin/main -git stash pop -git add -A -git commit -m "$1" -git push -u origin main -rm -rf .git diff --git a/Projects/kompose/verify-traefik.sh b/Projects/kompose/verify-traefik.sh deleted file mode 100755 index da5a005c..00000000 --- a/Projects/kompose/verify-traefik.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/usr/bin/env bash - -echo "=== KOMPOSE TRAEFIK VERIFICATION ===" -echo "" - -# Colors -GREEN='\033[0;32m' -RED='\033[0;31m' -YELLOW='\033[1;33m' -NC='\033[0m' - -# Check 1: Network exists -echo "1. Checking if 'kompose' network exists..." -if docker network ls | grep -q "kompose"; then - echo -e "${GREEN}โœ“${NC} Network 'kompose' exists" -else - echo -e "${RED}โœ—${NC} Network 'kompose' not found" - echo "Creating network..." - docker network create kompose -fi -echo "" - -# Check 2: Traefik is running -echo "2. Checking Traefik container..." -if docker ps | grep -q "proxy_app"; then - echo -e "${GREEN}โœ“${NC} Traefik is running" - docker ps --filter "name=proxy_app" --format " Status: {{.Status}}" -else - echo -e "${RED}โœ—${NC} Traefik is not running" -fi -echo "" - -# Check 3: Blog container is running -echo "3. Checking blog container..." -if docker ps | grep -q "blog_app"; then - echo -e "${GREEN}โœ“${NC} Blog is running" - docker ps --filter "name=blog_app" --format " Status: {{.Status}}" -else - echo -e "${YELLOW}!${NC} Blog is not running" -fi -echo "" - -# Check 4: Containers on network -echo "4. Containers on 'kompose' network:" -docker network inspect kompose --format '{{range $k, $v := .Containers}} - {{$v.Name}} ({{$v.IPv4Address}}){{"\n"}}{{end}}' 2>/dev/null -echo "" - -# Check 5: Traefik configuration -echo "5. Traefik provider configuration:" -docker exec proxy_app cat /etc/traefik/traefik.yml 2>/dev/null || echo " Using command-line args" -echo "" - -# Check 6: Check routers -echo "6. Active Traefik routers:" -curl -s http://localhost:8080/api/http/routers | jq -r '.[] | " - \(.name): \(.rule) -> \(.status)"' 2>/dev/null || echo " Cannot access Traefik API" -echo "" - -# Check 7: Check services -echo "7. Active Traefik services:" -curl -s http://localhost:8080/api/http/services | jq -r '.[] | " - \(.name): \(.status)"' 2>/dev/null || echo " Cannot access Traefik API" -echo "" - -# Check 8: Blog labels -echo "8. Blog container Traefik labels:" -docker inspect blog_app 2>/dev/null | jq -r '.[] | .Config.Labels | to_entries[] | select(.key | startswith("traefik")) | " \(.key)=\(.value)"' || echo " Blog container not found" -echo "" - -# Check 9: Test HTTP request -echo "9. Testing HTTP request to blog via Traefik:" -echo " Requesting pivoine.art..." -curl -s -H "Host: pivoine.art" http://localhost/ | head -c 100 -echo "" -echo "" - -echo "=== TROUBLESHOOTING TIPS ===" -echo "- Traefik dashboard: http://localhost:8080" -echo "- View Traefik logs: docker logs proxy_app" -echo "- Restart stack: ./kompose.sh proxy down && ./kompose.sh proxy up -d" -echo ""