Files
appa-net/zet.home.arpa/git-server/QUICK-REFERENCE.md
2026-04-22 14:59:04 -05:00

4.7 KiB

Git Server Quick Reference

Quick commands and tips for managing the Gitea git server on zet.home.arpa.

Access

What URL/Command Notes
Web Interface http://172.27.0.35:3000 View repos, manage settings
SSH Clone git@172.27.0.35:username/repo.git Requires SSH key setup
HTTPS Clone http://172.27.0.35:3000/username/repo.git Public repos only
API Base http://172.27.0.35:3000/api/v1 Programmatic access
Logs journalctl -u gitea Service logs

Common Tasks

Check Service Status

ssh zet "sudo systemctl status gitea"

View Recent Logs

ssh zet "sudo journalctl -u gitea -n 30 --no-pager"

Restart Gitea

ssh zet "sudo systemctl restart gitea"

Check Memory Usage

ssh zet "ps aux | grep gitea | grep -v grep"

List All Repositories (API)

curl http://172.27.0.35:3000/api/v1/repos/search

Create New Repository (Web UI)

  1. Visit http://172.27.0.35:3000
  2. Click "+" in navigation
  3. Select "New Repository"
  4. Fill in repository details
  5. Click "Create Repository"

Clone a Repository

# Via HTTPS
git clone http://172.27.0.35:3000/kenjim/appa-net.git

# Via SSH (requires SSH key)
git clone git@172.27.0.35:kenjim/appa-net.git

Push Changes (Requires Permission)

git push origin main

If you get "Permission denied", request push access through the web UI.

Service Commands

Manage Service

sudo systemctl start gitea       # Start
sudo systemctl stop gitea        # Stop
sudo systemctl restart gitea     # Restart
sudo systemctl reload gitea      # Reload config (if supported)

Enable/Disable Auto-start

sudo systemctl enable gitea      # Auto-start on boot
sudo systemctl disable gitea     # Don't auto-start on boot

View Service Unit File

cat /etc/systemd/system/gitea.service

Monitoring

Real-time Process Monitor

watch -n 2 'ps aux | grep gitea | grep -v grep'

Disk Usage

du -sh /var/lib/gitea
du -sh /var/lib/gitea/repositories

Live Logs

journalctl -u gitea -f

Troubleshooting

Service Won't Start

journalctl -u gitea -n 50 --no-pager  # Check error messages
sudo systemctl status gitea --no-pager

SSH Clone Not Working

# Test SSH connection
ssh -vvv git@172.27.0.35

# Verify your SSH key
cat ~/.ssh/id_rsa.pub

HTTP Clone Fails

# Test web server
curl -I http://172.27.0.35:3000
curl -I http://172.27.0.35:3000/api/v1/version

High Memory Usage

# Restart the service
sudo systemctl restart gitea

# Check if issue resolves
watch -n 2 'ps aux | grep gitea'

Repository URLs

Appa-net Repository

Dotfiles Repository

Test Repository

Useful Files

Path Purpose Owner
/usr/local/bin/gitea Gitea executable root
/etc/gitea/app.ini Configuration file root
/var/lib/gitea Data directory git
/var/lib/gitea/repositories Repository storage git
/etc/systemd/system/gitea.service Service definition root
/home/git Git user home git

Configuration Location

Config File: /etc/gitea/app.ini

To view/edit:

sudo nano /etc/gitea/app.ini
sudo systemctl restart gitea  # After changes

API Authentication

Generate a personal access token in the web UI:

  1. Visit http://172.27.0.35:3000/user/settings/applications
  2. Create a new token
  3. Use in API calls:
    curl -H "Authorization: token YOUR_TOKEN" \
      http://172.27.0.35:3000/api/v1/repos/search
    

SSH Key Setup (If Needed)

To use SSH with Gitea:

# Generate key (if you don't have one)
ssh-keygen -t ed25519 -C "your-email@example.com"

# Add key to your Gitea account
# Visit: http://172.27.0.35:3000/user/settings/keys
# Click "Add Key" and paste your public key (~/.ssh/id_ed25519.pub)

# Test SSH access
ssh -T git@172.27.0.35

Last Updated: 2026-04-22
Server: zet.home.arpa (172.27.0.35:3000)