home-network/forgeo.org
2025-04-09 08:53:53 +03:00

4.1 KiB
Raw Blame History

Forgejo

Hardware

Forgejo Setup on Raspberry Pi

Login data

property value
url https://git.ronnyabraham.com
admin user git-admin
admin pass 2reishit2ara
admin email ronny.abraham@ymail.com

Data Drive Setup

Git Repository Storage Info

Property Value
Physical Mount /mnt/git
Logical Bind Mount /srv/git
Device /dev/sdb1
Filesystem Type ext4
Label gitdisk
UUID 649f82e9-cfc0-4725-b260-d40f413bd0c3
Used for Forgejo repository storage

fstab entry

 UUID=649f82e9-cfc0-4725-b260-d40f413bd0c3 /mnt/git ext4 defaults,noatime 0 2
 /mnt/git /srv/git none bind 0 0

Data Volume Layout

To separate application configuration from repository data, the Forgejo Docker container uses specific internal paths. We map our host directories accordingly for clarity and ease of maintenance.

Folder Breakdown

The folder structure on the host (Raspberry Pi):

/mnt/storage/compose/docker/forgejo  ← holds docker-compose.yml

/srv/git/
├── data/      ← holds all persistent repo data (repositories, issues, uploads)
└── config/    ← holds configuration files (e.g. app.ini)

This split layout allows easy backup, inspection, and version control of the Forgejo configuration without interfering with large and changing repository data.

Volume Mapping

Host path Container path Purpose
/srv/git/data /data/data Git repos, issues, uploads
/srv/git/config /data/gitea/conf app.ini, server configuration

Make sure both folders on the host (`/srv/git/data` and `/srv/git/config`) are owned by the correct user (e.g. UID 1000), and match the containers expectations.

docker-compose.yml

Nginx

Create file: /etc/nginx/sites-available/forgejo

Enable and reload Nginx:

sudo ln -s /etc/nginx/sites-available/forgejo /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx

(Optional) Enable HTTPS with Certbot

sudo certbot --nginx -d git.ronnyabraham.com

Finish Setup

Visit: https://git.ronnyabraham.com Set up the admin user and create your first repository.

Push or Mirror Repositories to Forgejo

Push an Existing Local Repo to Forgejo

  1. Go to your local repo:
cd ~/your-local-project
  1. Add your Forgejo remote:
git remote add origin https://git.ronnyabraham.com/ronny/<repo-name>.git
  1. Push your local code:
git push -u origin main
  1. Optional: use SSH instead of HTTPS
git remote add origin git@git.ronnyabraham.com:ronny/<repo-name>.git

Mirror a Bitbucket Repo to Forgejo

  1. Clone your Bitbucket repo bare:
git clone --mirror git@bitbucket.org:your-username/your-repo.git
cd your-repo.git
  1. Add Forgejo as a new remote:
git remote set-url --push origin git@git.ronnyabraham.com:ronny/your-repo.git
  1. Push all branches and tags:
git push --mirror
  1. Delete the local clone if desired:
cd ..
rm -rf your-repo.git