107 lines
5.6 KiB
Markdown
107 lines
5.6 KiB
Markdown
# Gitea
|
||
A beautiful self-hosted non-commercial git server. Small but powerful. A better alternative to the monoliths of Github & Gitlab.
|
||
|
||
- Get set up with [these instructions](https://www.makeuseof.com/install-gitea-raspberry-pi-create-your-own-code-repository/) on hosting a gitea server using a raspberry pi
|
||
|
||
|
||
**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](https://docs.gitea.io/en-us/api-usage) 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:
|
||
---
|
||
- Create a README.md to [your profile](1. https://docs.gitea.com/next/usage/profile-readme)
|
||
- create a git profile called `.profile`
|
||
- then add a single markdown file to the repo
|
||
- this will be displayed on your page
|
||
- To change the front page of the Gitea server, [head here for instructions. ](https://docs.gitea.com/next/administration/customizing-gitea#customizing-gitea-pages)
|
||
- One theme that i like is Cattppuccin! :3 it's really cute. [Example](https://gitea.catppuccin.com/)
|
||
- ![[Pasted image 20230717132307.png]]
|
||
- The entire [config cheat sheet is located here. ](https://docs.gitea.com/next/administration/config-cheat-sheet#ui-ui)
|
||
- The [Awesome Gitea Repo ](https://gitea.com/gitea/awesome-gitea#themes)for more updates
|
||
- For Gitea Pages it is suggested to use [Caddy](https://github.com/42wim/caddy-gitea#gitea-pages-repo) or[ Codeberg Pages ](https://codeberg.org/Codeberg/pages-server)Server
|
||
- Adding Themes to Gitea
|
||
- Full instructions are found [here](https://docs.theme-park.dev/themes/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](https://www.macports.org/install.php#installing), 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](https://www.youtube.com/watch?v=bVB24I7B0JQ) 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. ](obsidian://open?vault=enter&file=Coding%20Tips%20(Classical)%2FProject%20Vault%2FOn%20Obsidian%2FObsidian-git%20process)
|
||
|
||
|
||
|
||
### More references:
|
||
---
|
||
- Migrate from [github/gitlab to gitea](https://hostedgitea.com/article/how-to-migrate-from-github-to-gitea)
|
||
- Similar to github pages but for [gitea](https://github.com/42wim/caddy-gitea)
|
||
- Gitea for [many user databases](https://www.talkingquickly.co.uk/gitea-sso-with-keycloak-openldap-openid-connect)
|
||
- Gitea is highly customizeable. Here is a key of [all its configs](https://docs.gitea.com/next/administration/config-cheat-sheet)
|
||
- Using gitea with [Jenkins](https://plugins.jenkins.io/gitea/)
|
||
- A self-hosting[ cloud tutorial ](https://spin.atomicobject.com/2022/02/08/git-service-gitea/)
|
||
- You can also run gitea on [cloudron](obsidian://open?vault=Obsidian&file=Cloudron)
|
||
- Installing gitea onto [raspberry pi ](https://www.makeuseof.com/install-gitea-raspberry-pi-create-your-own-code-repository/#:~:text=Using%20Gitea&text=You%20can%20choose%20to%20make,as%20if%20it%20were%20GitHub.)
|
||
- A[ gitpod instance](https://gogitea-gitea-5jiuqihle03.ws-us97.gitpod.io/) of gitea
|
||
- gitpod is just an automated dev environment - think of it as a pre-build
|
||
- Disaster recovery for Gitea - Gitea’s [repository mirroring](https://docs.gitea.io/en-us/repo-mirror/) makes it relatively easy to replicate critical Git repositories so that teams can still work at minimal capacity until the production environment is back up and running.
|
||
- Dev [Themes Set up instructions](https://docs.theme-park.dev/setup/)
|
||
For more information, [read here. ](https://blog.inedo.com/self-hosted/gitea/#:~:text=Gitea%20will%20run%20on%20all,client%20tools%20on%20the%20server.)
|
||
- User themes
|
||
- Hotline![img](https://docs.theme-park.dev/site_assets/gitea/hotline.png)
|
||
- HotPink ![img2](https://docs.theme-park.dev/site_assets/gitea/hotpink.png)
|
||
- and more! |