Reorganize repository structure and add configuration management
- Create organized directory structure: - docs/ for all documentation files - config/ for deployment configurations and scripts - Add CLAUDE.md with project architecture and development workflow - Update README.md with new structure and current status - Move all documentation to docs/ directory - Organize Docker and Nginx configurations under config/ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
26
config/docker/gitea/docker-compose.yml
Normal file
26
config/docker/gitea/docker-compose.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
# DEPLOYMENT LOCATION: /opt/docker/gitea/docker-compose.yml
|
||||
# Move this file with: sudo cp gitea-docker-compose.yml /opt/docker/gitea/docker-compose.yml
|
||||
# Create data directory: sudo mkdir -p /opt/docker/gitea/data
|
||||
# Set permissions: sudo chown -R hoborg:hoborg /opt/docker/gitea
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:latest
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "2223:22"
|
||||
40
config/docker/gitea/setup.sh
Normal file
40
config/docker/gitea/setup.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
# Gitea Docker Setup Script
|
||||
# Run with: sudo bash gitea-setup.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Setting up Gitea Docker environment..."
|
||||
|
||||
# Create directory structure
|
||||
echo "Creating /opt/docker/gitea directory..."
|
||||
mkdir -p /opt/docker/gitea/data
|
||||
|
||||
# Copy docker-compose file
|
||||
echo "Copying docker-compose.yml..."
|
||||
cp gitea-docker-compose.yml /opt/docker/gitea/docker-compose.yml
|
||||
|
||||
# Set correct permissions
|
||||
echo "Setting permissions..."
|
||||
chown -R hoborg:hoborg /opt/docker/gitea
|
||||
|
||||
# Start Gitea
|
||||
echo "Starting Gitea container..."
|
||||
cd /opt/docker/gitea
|
||||
docker-compose up -d
|
||||
|
||||
echo ""
|
||||
echo "✅ Gitea setup complete!"
|
||||
echo ""
|
||||
echo "🌐 Web interface: http://192.168.0.100:3000"
|
||||
echo "🌍 External access: http://ak-homelab.duckdns.org:3000 (after router port forwarding)"
|
||||
echo ""
|
||||
echo "📋 Next steps:"
|
||||
echo "1. Configure router port forwarding: 3000 → 192.168.0.100:3000"
|
||||
echo "2. Access web interface to complete initial setup"
|
||||
echo "3. Configure admin user and repository settings"
|
||||
echo ""
|
||||
echo "🔧 Container management:"
|
||||
echo " View logs: docker logs gitea"
|
||||
echo " Stop: docker-compose down"
|
||||
echo " Update: docker-compose pull && docker-compose up -d"
|
||||
55
config/nginx/homelab.conf
Normal file
55
config/nginx/homelab.conf
Normal file
@@ -0,0 +1,55 @@
|
||||
# DEPLOYMENT LOCATION: /etc/nginx/sites-available/homelab
|
||||
# Deploy with: sudo cp nginx-homelab.conf /etc/nginx/sites-available/homelab
|
||||
# Enable with: sudo ln -s /etc/nginx/sites-available/homelab /etc/nginx/sites-enabled/homelab
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name ak-homelab.duckdns.org;
|
||||
|
||||
# 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;
|
||||
|
||||
# Main landing page
|
||||
location / {
|
||||
root /var/www/homelab;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# Gitea reverse proxy
|
||||
location /gitea/ {
|
||||
proxy_pass http://127.0.0.1:3000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
# Handle websockets for live updates
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
# Increase timeout for large repos
|
||||
proxy_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
|
||||
# Future services (commented out for now)
|
||||
# location /cloud/ {
|
||||
# proxy_pass http://127.0.0.1:8080/;
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# }
|
||||
|
||||
# location /media/ {
|
||||
# proxy_pass http://127.0.0.1:8096/;
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_set_header X-Real-IP $remote_addr;
|
||||
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
# proxy_set_header X-Forwarded-Proto $scheme;
|
||||
# }
|
||||
}
|
||||
60
config/nginx/setup.sh
Normal file
60
config/nginx/setup.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
# Nginx Setup Script for Homelab
|
||||
# Run with: sudo bash nginx-setup.sh
|
||||
|
||||
set -e
|
||||
|
||||
echo "Setting up Nginx reverse proxy..."
|
||||
|
||||
# Install nginx and SSL tools
|
||||
echo "Installing nginx and certbot..."
|
||||
pacman -S --noconfirm nginx certbot certbot-nginx
|
||||
|
||||
# Create sites directories (some distributions don't have these)
|
||||
mkdir -p /etc/nginx/sites-available
|
||||
mkdir -p /etc/nginx/sites-enabled
|
||||
|
||||
# Enable sites-enabled in main nginx.conf if not already
|
||||
if ! grep -q "sites-enabled" /etc/nginx/nginx.conf; then
|
||||
echo "Adding sites-enabled include to nginx.conf..."
|
||||
sed -i '/http {/a \ \ \ \ include /etc/nginx/sites-enabled/*;' /etc/nginx/nginx.conf
|
||||
fi
|
||||
|
||||
# Copy site configuration
|
||||
echo "Copying site configuration..."
|
||||
cp nginx-homelab.conf /etc/nginx/sites-available/homelab
|
||||
|
||||
# Enable the site
|
||||
echo "Enabling homelab site..."
|
||||
ln -sf /etc/nginx/sites-available/homelab /etc/nginx/sites-enabled/homelab
|
||||
|
||||
# Create web root directory
|
||||
echo "Creating web root directory..."
|
||||
mkdir -p /var/www/homelab
|
||||
chown -R hoborg:hoborg /var/www/homelab
|
||||
|
||||
# Test nginx configuration
|
||||
echo "Testing nginx configuration..."
|
||||
nginx -t
|
||||
|
||||
# Enable and start nginx
|
||||
echo "Starting nginx service..."
|
||||
systemctl enable nginx
|
||||
systemctl start nginx
|
||||
|
||||
echo ""
|
||||
echo "✅ Nginx setup complete!"
|
||||
echo ""
|
||||
echo "📋 Next steps:"
|
||||
echo "1. Create landing page: sudo nvim /var/www/homelab/index.html"
|
||||
echo "2. Configure router port forwarding:"
|
||||
echo " - Port 80 → 192.168.0.100:80"
|
||||
echo " - Port 443 → 192.168.0.100:443"
|
||||
echo " - Remove port 3000 forwarding"
|
||||
echo "3. Test access: http://ak-homelab.duckdns.org/"
|
||||
echo "4. Set up SSL: sudo certbot --nginx -d ak-homelab.duckdns.org"
|
||||
echo ""
|
||||
echo "🔧 Management commands:"
|
||||
echo " Test config: sudo nginx -t"
|
||||
echo " Reload: sudo systemctl reload nginx"
|
||||
echo " Status: sudo systemctl status nginx"
|
||||
Reference in New Issue
Block a user