4.7 KiB
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)
- Visit http://172.27.0.35:3000
- Click "+" in navigation
- Select "New Repository"
- Fill in repository details
- 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
- SSH: git@172.27.0.35:kenjim/appa-net.git
- HTTP: http://172.27.0.35:3000/kenjim/appa-net.git
- Web: http://172.27.0.35:3000/kenjim/appa-net
Dotfiles Repository
- SSH: git@172.27.0.35:kenjim/dotfiles.git
- HTTP: http://172.27.0.35:3000/kenjim/dotfiles.git
- Web: http://172.27.0.35:3000/kenjim/dotfiles
Test Repository
- SSH: git@172.27.0.35:kenjim/test.git
- HTTP: http://172.27.0.35:3000/kenjim/test.git
- Web: http://172.27.0.35:3000/kenjim/test
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:
- Visit http://172.27.0.35:3000/user/settings/applications
- Create a new token
- 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
Useful Links
- Gitea Documentation: https://docs.gitea.io/
- Gitea Configuration: https://docs.gitea.io/en-us/config-cheat-sheet/
- Gitea API: https://docs.gitea.io/en-us/api-usage/
Last Updated: 2026-04-22
Server: zet.home.arpa (172.27.0.35:3000)