hatch-surf/setup-gitea.sh
Chris Anderson 8bce1cb670
Some checks failed
Deploy hatch.surf / build-and-deploy (push) Failing after 1m37s
Switch from GitHub Actions to self-hosted Gitea CI/CD
- Removed .github/workflows/deploy.yml (GitHub Actions)
- Added .gitea/workflows/deploy.yml (Gitea Actions)
- Added setup-gitea.sh for installing Gitea
- Added configure-gitea.sh for configuring Gitea
- Self-hosted Git + CI/CD on local server
- GitHub org only for final open-source projects

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-24 09:57:20 +02:00

55 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Gitea Setup Script for El Foundation
# Self-hosted Git + CI/CD
set -e
GITEA_VERSION="1.22"
GITEA_PORT="3000"
GITEA_DATA="/var/lib/gitea"
GITEA_CONFIG="/etc/gitea"
echo "=== Setting up Gitea for El Foundation ==="
# Install Gitea
echo "Installing Gitea..."
wget -O /usr/local/bin/gitea https://dl.gitea.com/gitea/${GITEA_VERSION}.0/gitea-${GITEA_VERSION}.0-linux-amd64
chmod +x /usr/local/bin/gitea
# Create directories
sudo mkdir -p $GITEA_DATA $GITEA_CONFIG
sudo chown -R nara:nara $GITEA_DATA $GITEA_CONFIG
# Create systemd service
cat > /tmp/gitea.service << 'EOF'
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target
[Service]
Type=simple
User=nara
Group=nara
WorkingDirectory=/var/lib/gitea
ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
Restart=always
Environment=USER=nara HOME=/home/nara GITEA_WORK_DIR=/var/lib/gitea
[Install]
WantedBy=multi-user.target
EOF
sudo mv /tmp/gitea.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable gitea
sudo systemctl start gitea
echo "Gitea installed and started on port $GITEA_PORT"
echo "Access at http://localhost:$GITEA_PORT"
echo ""
echo "Next steps:"
echo "1. Open http://localhost:$GITEA_PORT in browser"
echo "2. Complete initial setup"
echo "3. Create admin account"
echo "4. Run: ./configure-gitea.sh"