feat: docus

This commit is contained in:
2025-10-08 13:54:19 +02:00
parent 47539d8cc8
commit 223cc2ac6a
31 changed files with 2476 additions and 1820 deletions

View File

@@ -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!** 🚀

View File

@@ -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 <stack>_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! 🚀

View File

@@ -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 <stack> && docker compose pull && docker compose up -d
```
### Restart Stack
```bash
cd <stack> && 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 <stack>_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 <stack>
# Verify routing
docker exec proxy_app traefik healthcheck
```
### Database Issues
```bash
# Test connection from container
docker exec <stack>_app ping postgres
# Check database exists
docker exec data_postgres psql -U $DB_USER -l | grep <dbname>
```
## 🔄 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"'
```

View File

@@ -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}"

View File

@@ -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."* ⚡🔗

View File

@@ -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"

View File

@@ -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."* 🦊✨

View File

@@ -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

27
Projects/kompose/docs/.gitignore vendored Normal file
View File

@@ -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

View File

@@ -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;"]

View File

@@ -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
<!-- components/MyComponent.vue -->
<template>
<div>My Component</div>
</template>
```
Use in pages:
```vue
<template>
<MyComponent />
</template>
```
## 🎯 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

View File

@@ -0,0 +1,46 @@
<template>
<div class="min-h-screen bg-dark-950 text-gray-100">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</div>
</template>
<script setup>
useHead({
htmlAttrs: {
class: 'dark'
}
})
</script>
<style>
@import '@/assets/css/main.css';
/* Custom scrollbar */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
@apply bg-dark-900;
}
::-webkit-scrollbar-thumb {
@apply bg-gradient-to-b from-primary-500 to-accent-500 rounded-full;
}
::-webkit-scrollbar-thumb:hover {
@apply from-primary-400 to-accent-400;
}
/* Selection */
::selection {
@apply bg-primary-500/30 text-white;
}
::-moz-selection {
@apply bg-primary-500/30 text-white;
}
</style>

View File

@@ -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;
}

View File

@@ -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"

View File

@@ -0,0 +1,38 @@
<template>
<div class="relative group">
<slot />
<button
@click="copyCode"
class="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"
:class="{ '!opacity-100': copied }"
>
<Icon v-if="!copied" name="lucide:copy" class="w-4 h-4" />
<Icon v-else name="lucide:check" class="w-4 h-4 text-green-500" />
</button>
</div>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({
code: {
type: String,
required: true
}
})
const copied = ref(false)
const copyCode = async () => {
try {
await navigator.clipboard.writeText(props.code)
copied.value = true
setTimeout(() => {
copied.value = false
}, 2000)
} catch (err) {
console.error('Failed to copy code:', err)
}
}
</script>

View File

@@ -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

View File

@@ -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)

View File

@@ -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.

View File

@@ -0,0 +1,222 @@
<template>
<div class="flex flex-col min-h-screen">
<!-- Header -->
<header class="sticky top-0 z-50 w-full border-b border-dark-800 glass-dark">
<div class="container mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex h-16 items-center justify-between">
<!-- Logo -->
<NuxtLink to="/" class="flex items-center space-x-3 group">
<div class="text-3xl font-bold gradient-text group-hover:scale-110 transition-transform">
KOMPOSE
</div>
</NuxtLink>
<!-- Navigation -->
<nav class="hidden md:flex items-center space-x-6">
<NuxtLink to="/docs" class="link-fancy text-sm font-medium">
Documentation
</NuxtLink>
<NuxtLink to="/api" class="link-fancy text-sm font-medium">
API Reference
</NuxtLink>
<NuxtLink to="/examples" class="link-fancy text-sm font-medium">
Examples
</NuxtLink>
<a href="https://github.com/yourusername/kompose" target="_blank"
class="text-gray-400 hover:text-white transition-colors">
<Icon name="lucide:github" class="w-5 h-5" />
</a>
</nav>
<!-- Mobile menu button -->
<button @click="mobileMenuOpen = !mobileMenuOpen" class="md:hidden text-gray-400 hover:text-white">
<Icon :name="mobileMenuOpen ? 'lucide:x' : 'lucide:menu'" class="w-6 h-6" />
</button>
</div>
</div>
<!-- Mobile menu -->
<Transition
enter-active-class="transition duration-200 ease-out"
enter-from-class="opacity-0 scale-95"
enter-to-class="opacity-100 scale-100"
leave-active-class="transition duration-100 ease-in"
leave-from-class="opacity-100 scale-100"
leave-to-class="opacity-0 scale-95"
>
<div v-show="mobileMenuOpen" class="md:hidden border-t border-dark-800 bg-dark-900 p-4">
<nav class="flex flex-col space-y-3">
<NuxtLink @click="mobileMenuOpen = false" to="/docs" class="text-gray-300 hover:text-white">
Documentation
</NuxtLink>
<NuxtLink @click="mobileMenuOpen = false" to="/api" class="text-gray-300 hover:text-white">
API Reference
</NuxtLink>
<NuxtLink @click="mobileMenuOpen = false" to="/examples" class="text-gray-300 hover:text-white">
Examples
</NuxtLink>
</nav>
</div>
</Transition>
</header>
<div class="flex-1 flex">
<!-- Sidebar -->
<aside class="hidden lg:block w-64 border-r border-dark-800 overflow-y-auto sticky top-16 h-[calc(100vh-4rem)]">
<div class="p-6 space-y-6">
<!-- Search -->
<div class="relative">
<Icon name="lucide:search" class="absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500" />
<input
type="search"
placeholder="Search docs..."
class="w-full pl-10 pr-4 py-2 bg-dark-900 border border-dark-700 rounded-lg text-sm focus:outline-none focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20"
/>
</div>
<!-- Navigation sections -->
<nav class="space-y-6">
<div v-for="section in navigation" :key="section.title">
<h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider mb-3">
{{ section.title }}
</h3>
<ul class="space-y-1">
<li v-for="item in section.items" :key="item.to">
<NuxtLink :to="item.to" class="sidebar-link">
{{ item.label }}
</NuxtLink>
</li>
</ul>
</div>
</nav>
</div>
</aside>
<!-- Main content -->
<main class="flex-1 overflow-x-hidden">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-8 max-w-5xl">
<slot />
</div>
</main>
<!-- Table of contents -->
<aside class="hidden xl:block w-64 border-l border-dark-800 overflow-y-auto sticky top-16 h-[calc(100vh-4rem)]">
<div class="p-6">
<h3 class="text-sm font-semibold text-gray-400 uppercase tracking-wider mb-4">
On This Page
</h3>
<nav class="space-y-2">
<a
v-for="link in toc"
:key="link.id"
:href="`#${link.id}`"
class="toc-link"
:class="{ active: activeId === link.id }"
:style="{ paddingLeft: `${(link.depth - 2) * 12 + 16}px` }"
>
{{ link.text }}
</a>
</nav>
</div>
</aside>
</div>
<!-- Footer -->
<footer class="border-t border-dark-800 bg-dark-950">
<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
<div class="col-span-1 md:col-span-2">
<div class="text-2xl font-bold gradient-text mb-4">KOMPOSE</div>
<p class="text-gray-400 text-sm mb-4">
Your Docker Compose Symphony Conductor
</p>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-primary-400 transition-colors">
<Icon name="lucide:github" class="w-5 h-5" />
</a>
<a href="#" class="text-gray-400 hover:text-primary-400 transition-colors">
<Icon name="lucide:twitter" class="w-5 h-5" />
</a>
</div>
</div>
<div>
<h4 class="text-sm font-semibold text-white mb-4">Documentation</h4>
<ul class="space-y-2 text-sm">
<li><NuxtLink to="/docs" class="text-gray-400 hover:text-white">Getting Started</NuxtLink></li>
<li><NuxtLink to="/docs/guide" class="text-gray-400 hover:text-white">Guide</NuxtLink></li>
<li><NuxtLink to="/api" class="text-gray-400 hover:text-white">API Reference</NuxtLink></li>
</ul>
</div>
<div>
<h4 class="text-sm font-semibold text-white mb-4">Community</h4>
<ul class="space-y-2 text-sm">
<li><a href="#" class="text-gray-400 hover:text-white">GitHub</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Discord</a></li>
<li><a href="#" class="text-gray-400 hover:text-white">Twitter</a></li>
</ul>
</div>
</div>
<div class="border-t border-dark-800 mt-8 pt-8 text-center text-sm text-gray-400">
<p>&copy; 2025 Kompose. Made with and </p>
</div>
</div>
</footer>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue'
const mobileMenuOpen = ref(false)
const activeId = ref('')
const toc = ref([])
const navigation = [
{
title: 'Getting Started',
items: [
{ label: 'Introduction', to: '/docs' },
{ label: 'Installation', to: '/docs/installation' },
{ label: 'Quick Start', to: '/docs/quick-start' },
]
},
{
title: 'Guide',
items: [
{ label: 'Stack Management', to: '/docs/guide/stack-management' },
{ label: 'Database Operations', to: '/docs/guide/database' },
{ label: 'Hooks System', to: '/docs/guide/hooks' },
{ label: 'Network Architecture', to: '/docs/guide/network' },
]
},
{
title: 'Reference',
items: [
{ label: 'Configuration', to: '/docs/reference/configuration' },
{ label: 'CLI Commands', to: '/docs/reference/cli' },
{ label: 'Environment Variables', to: '/docs/reference/env' },
]
}
]
// Table of contents intersection observer
onMounted(() => {
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
activeId.value = entry.target.id
}
})
},
{ rootMargin: '-80px 0px -80% 0px' }
)
document.querySelectorAll('h2, h3').forEach((heading) => {
observer.observe(heading)
})
})
</script>

View File

@@ -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;
}
}
}

View File

@@ -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'
}
}
})

View File

@@ -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"
}

View File

@@ -0,0 +1,143 @@
<template>
<div class="docs-page">
<article class="prose prose-lg max-w-none">
<ContentDoc v-slot="{ doc }">
<div>
<!-- Page header -->
<div class="mb-8 pb-8 border-b border-dark-800">
<h1 class="text-5xl font-bold gradient-text mb-4">
{{ doc.title }}
</h1>
<p v-if="doc.description" class="text-xl text-gray-400">
{{ doc.description }}
</p>
</div>
<!-- Content -->
<ContentRenderer :value="doc" class="markdown-content" />
<!-- Navigation -->
<div class="mt-16 pt-8 border-t border-dark-800 flex justify-between items-center">
<NuxtLink
v-if="doc.prev"
:to="doc.prev.path"
class="flex items-center gap-2 text-primary-400 hover:text-primary-300 transition-colors"
>
<Icon name="lucide:arrow-left" class="w-5 h-5" />
<span>{{ doc.prev.title }}</span>
</NuxtLink>
<div v-else></div>
<NuxtLink
v-if="doc.next"
:to="doc.next.path"
class="flex items-center gap-2 text-primary-400 hover:text-primary-300 transition-colors"
>
<span>{{ doc.next.title }}</span>
<Icon name="lucide:arrow-right" class="w-5 h-5" />
</NuxtLink>
<div v-else></div>
</div>
</div>
</ContentDoc>
</article>
</div>
</template>
<script setup>
definePageMeta({
layout: 'default'
})
</script>
<style scoped>
.markdown-content :deep(h2) {
@apply text-3xl font-bold text-white mt-12 mb-6 flex items-center gap-3;
}
.markdown-content :deep(h2::before) {
content: '';
@apply w-1 h-8 bg-gradient-primary rounded;
}
.markdown-content :deep(h3) {
@apply text-2xl font-semibold text-white mt-8 mb-4;
}
.markdown-content :deep(p) {
@apply text-gray-300 leading-relaxed mb-6;
}
.markdown-content :deep(ul),
.markdown-content :deep(ol) {
@apply space-y-2 mb-6;
}
.markdown-content :deep(li) {
@apply text-gray-300;
}
.markdown-content :deep(code) {
@apply bg-dark-800 text-primary-300 px-2 py-1 rounded text-sm font-mono;
}
.markdown-content :deep(pre) {
@apply bg-dark-900 border border-dark-700 rounded-lg p-6 overflow-x-auto mb-6 relative group;
}
.markdown-content :deep(pre code) {
@apply bg-transparent text-gray-300 p-0;
}
.markdown-content :deep(blockquote) {
@apply border-l-4 border-primary-500 pl-6 py-2 my-6 bg-dark-900/50 rounded-r-lg;
}
.markdown-content :deep(blockquote p) {
@apply text-gray-400 italic;
}
.markdown-content :deep(a) {
@apply text-primary-400 hover:text-primary-300 underline decoration-primary-500/30 hover:decoration-primary-400 transition-colors;
}
.markdown-content :deep(table) {
@apply w-full border-collapse mb-6;
}
.markdown-content :deep(th) {
@apply bg-dark-800 text-primary-400 font-semibold py-3 px-4 text-left border-b-2 border-primary-500/30;
}
.markdown-content :deep(td) {
@apply py-3 px-4 border-b border-dark-700;
}
.markdown-content :deep(tr:hover) {
@apply bg-white/5;
}
.markdown-content :deep(img) {
@apply rounded-lg shadow-glow-cyber my-6;
}
.markdown-content :deep(.alert) {
@apply p-4 rounded-lg mb-6 border-l-4;
}
.markdown-content :deep(.alert-info) {
@apply bg-blue-500/10 border-blue-500;
}
.markdown-content :deep(.alert-warning) {
@apply bg-yellow-500/10 border-yellow-500;
}
.markdown-content :deep(.alert-danger) {
@apply bg-red-500/10 border-red-500;
}
.markdown-content :deep(.alert-success) {
@apply bg-green-500/10 border-green-500;
}
</style>

View File

@@ -0,0 +1,234 @@
<template>
<div class="relative overflow-hidden">
<!-- Hero section -->
<section class="relative py-20 lg:py-32">
<!-- Background decorations -->
<div class="absolute top-0 left-1/4 hero-blob bg-primary-500/20 animate-float" style="animation-delay: 0s"></div>
<div class="absolute bottom-0 right-1/4 hero-blob bg-accent-500/20 animate-float" style="animation-delay: 2s"></div>
<div class="container mx-auto px-4 relative z-10">
<div class="max-w-4xl mx-auto text-center">
<!-- Main heading with gradient -->
<h1 class="text-6xl md:text-8xl font-black mb-6 gradient-text-hero">
KOMPOSE
</h1>
<p class="text-2xl md:text-3xl text-gray-300 mb-8 font-light">
Your Docker Compose Symphony Conductor
</p>
<p class="text-lg text-gray-400 mb-12 max-w-2xl mx-auto">
Manage multiple Docker Compose stacks with style and grace.
One command to rule them all, with beautiful output and powerful features.
</p>
<!-- CTA Buttons -->
<div class="flex flex-col sm:flex-row gap-4 justify-center items-center">
<NuxtLink to="/docs" class="btn-primary text-lg px-8 py-4">
<span class="flex items-center gap-2">
<Icon name="lucide:book-open" class="w-5 h-5" />
Get Started
</span>
</NuxtLink>
<NuxtLink to="/docs/quick-start" class="btn-ghost text-lg px-8 py-4">
<span class="flex items-center gap-2">
<Icon name="lucide:zap" class="w-5 h-5" />
Quick Start
</span>
</NuxtLink>
</div>
<!-- Installation command -->
<div class="mt-12 glass-dark rounded-xl p-6 inline-block">
<div class="flex items-center justify-between gap-4">
<code class="text-primary-400 text-sm font-mono">
git clone https://github.com/yourusername/kompose.git
</code>
<button @click="copyCommand" class="text-gray-400 hover:text-white transition-colors">
<Icon :name="copied ? 'lucide:check' : 'lucide:copy'" class="w-5 h-5" />
</button>
</div>
</div>
</div>
</div>
</section>
<!-- Features section -->
<section class="py-20 relative">
<div class="container mx-auto px-4">
<div class="text-center mb-16">
<h2 class="text-4xl md:text-5xl font-bold mb-4 gradient-text">
Powerful Features
</h2>
<p class="text-xl text-gray-400">
Everything you need to manage your Docker infrastructure
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<div v-for="feature in features" :key="feature.title"
class="card-glow group hover:-translate-y-2">
<div class="mb-4">
<div class="w-12 h-12 rounded-lg bg-gradient-primary flex items-center justify-center">
<Icon :name="feature.icon" class="w-6 h-6 text-white" />
</div>
</div>
<h3 class="text-xl font-semibold text-white mb-3">
{{ feature.title }}
</h3>
<p class="text-gray-400">
{{ feature.description }}
</p>
</div>
</div>
</div>
</section>
<!-- Code example section -->
<section class="py-20 bg-dark-900/50">
<div class="container mx-auto px-4">
<div class="max-w-4xl mx-auto">
<div class="text-center mb-12">
<h2 class="text-4xl md:text-5xl font-bold mb-4 gradient-text">
Simple Yet Powerful
</h2>
<p class="text-xl text-gray-400">
Manage all your stacks with intuitive commands
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div v-for="example in examples" :key="example.title" class="card-glass">
<h3 class="text-lg font-semibold text-white mb-4 flex items-center gap-2">
<Icon name="lucide:terminal" class="w-5 h-5 text-primary-400" />
{{ example.title }}
</h3>
<pre class="bg-dark-950 p-4 rounded-lg overflow-x-auto">
<code class="text-sm text-gray-300">{{ example.code }}</code></pre>
</div>
</div>
<div class="text-center mt-12">
<NuxtLink to="/docs" class="btn-accent px-8 py-4">
<span class="flex items-center gap-2">
Explore Full Documentation
<Icon name="lucide:arrow-right" class="w-5 h-5" />
</span>
</NuxtLink>
</div>
</div>
</div>
</section>
<!-- Stats section -->
<section class="py-20">
<div class="container mx-auto px-4">
<div class="max-w-5xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-8">
<div v-for="stat in stats" :key="stat.label"
class="text-center card-glass">
<div class="text-5xl font-bold gradient-text mb-2">
{{ stat.value }}
</div>
<div class="text-gray-400">
{{ stat.label }}
</div>
</div>
</div>
</div>
</section>
<!-- CTA section -->
<section class="py-20 relative">
<div class="absolute inset-0 bg-gradient-hero opacity-10"></div>
<div class="container mx-auto px-4 relative z-10">
<div class="max-w-3xl mx-auto text-center">
<h2 class="text-4xl md:text-5xl font-bold mb-6 text-white">
Ready to Conduct Your Docker Symphony?
</h2>
<p class="text-xl text-gray-300 mb-8">
Get started with Kompose today and simplify your Docker workflow
</p>
<NuxtLink to="/docs/installation" class="btn-primary text-lg px-8 py-4">
<span class="flex items-center gap-2">
<Icon name="lucide:download" class="w-5 h-5" />
Install Now
</span>
</NuxtLink>
</div>
</div>
</section>
</div>
</template>
<script setup>
import { ref } from 'vue'
const copied = ref(false)
const features = [
{
title: 'Stack Management',
icon: 'lucide:layers',
description: 'Manage multiple Docker Compose stacks with pattern-based selection and bulk operations.'
},
{
title: 'Database Operations',
icon: 'lucide:database',
description: 'Automated backups, smart imports, and database cleanup with PostgreSQL support.'
},
{
title: 'Hooks System',
icon: 'lucide:git-branch',
description: 'Extend functionality with custom pre/post operation hooks for each stack.'
},
{
title: 'Network Maestro',
icon: 'lucide:network',
description: 'Smart network management with CLI overrides and seamless Traefik integration.'
},
{
title: 'Environment Control',
icon: 'lucide:settings',
description: 'Override environment variables on-the-fly without editing configuration files.'
},
{
title: 'Beautiful Output',
icon: 'lucide:sparkles',
description: 'Color-coded logs, status indicators, and intuitive command-line interface.'
}
]
const examples = [
{
title: 'Start Everything',
code: './kompose.sh "*" up -d'
},
{
title: 'Export Databases',
code: './kompose.sh "*" db:export'
},
{
title: 'View Logs',
code: './kompose.sh "blog,news" logs -f'
},
{
title: 'Override Network',
code: './kompose.sh --network staging "*" up'
}
]
const stats = [
{ value: '10+', label: 'Production Stacks' },
{ value: '100%', label: 'Bash Powered' },
{ value: '1', label: 'Command to Rule Them All' }
]
const copyCommand = () => {
navigator.clipboard.writeText('git clone https://github.com/yourusername/kompose.git')
copied.value = true
setTimeout(() => {
copied.value = false
}, 2000)
}
</script>

View File

@@ -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'),
],
}

View File

@@ -0,0 +1,3 @@
{
"extends": "./.nuxt/tsconfig.json"
}

View File

@@ -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."* ✨🏠

View File

@@ -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"

View File

@@ -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}"

View File

@@ -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

View File

@@ -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 ""