Notepad/enter/Coding Tips (Classical)/Terminal Tips/GUIs/Internet/Repos/Gitea.md

5.3 KiB
Raw Blame History

Gitea

A beautiful self-hosted non-commercial git server. Small but powerful. A better alternative to the monoliths of Github & Gitlab.

Scripting migrations: If you have a lot of repositories to migrate, it may be easier to write a script to migrate them.

The easiest way to go about this would be to use the Gitea API to create a blank repository, and then use the Git command line to clone repositories from your existing service into Gitea:

git clone --mirror «url to old repository»  
git remote set-url origin «url to new gitea repository»  
git push --mirror origin

Customizing your Gitea:


Installing the Gitea Server


There are numerous ways you can install Gitea on your machine but don't get overwhelmed by the choices. Just choose what is easiest for you to get started and you can optimize afterwards.

For me, since I'm currently on a Macbook it will be easiest to do a MacPorts install but perhaps I'll switch it over to be a Linux install at some point later.

  1. Go to MacPorts, Click your Apple flavor, and download + install the .pkg (no fancy CLI needed for this step!)
  2. Using Homebrew, install Gitea on your laptop!
  3. Now go to Linode to set up your server with Alpine Linux.
  4. Set up steps in this video and create a node
  5. SSH into the root IP
  6. Push a test repo and there we have it! You set up your gitea :) !Pasted image 20230626034045.png

Gitea Server details

  • Site: Shwetha-Base : my self-hosted gitea server
  • Path: /var/lib/gitea/data/gitea-repositories
  • Run as username: msgit
  • Server domain: 172.104.8.87
  • Gitea base url: http://172.104.8.87:3000/
  • log path:/var/lib/gitea/log
  • server port and listening port - 22,3000

Using Gitea Server


Linode

To start the server:

systemctl start gitea.service 
Caddy:

Using the gitea server with Caddy: -->add the following server block to your Caddyfile

git.example.com {  
reverse_proxy localhost:3000  
}

For Caddy with a subpath: In case you already have a site, and you want Gitea to share the domain name, you can setup Caddy to serve Gitea under a sub-path by adding the following to your server block in your Caddyfile:

git.example.com {    route /git/* {        uri strip_prefix /git        reverse_proxy localhost:3000    }}

Then set [server] ROOT_URL = http://git.example.com/git/ in your configuration.

For instructions on syncing your Obsidian vault to your gitea server, head to Obsidian-git sync tutorial.

More references: