I also tried Gitea in a Jail some time ago and have been using it ever since to have version control for my (very simple) Ansible tasks and playbooks. The best thing about Gitea is that I don't have to worry about leaking information about my internal networks like I did with github. :)
@@esra_erimez I already work in IT and am currently trying to handle a lot of customer firewalls and routers in a team that is way too small... But thanks I guess
If you don't need all the issue management and ancillary niceties of Github and simply want your own self-hosted git repositories for syncing work between various machines you control, there's also a little-known feature of Git that allows you to set _any random accessible folder_ on your system as an "upstream" for the local repository. Combined with a mounted network fileshare (SMB or whatever else you prefer), this can provide an extremely low-effort way to centralize and back up your git work and sync it between machines. If you already have a fileserver at home, you need literally nothing else other than creating a git folder on it. I use this in conjunction with Sourcetree at home, but it works just as well from git's command-line interface or whatever IDE integration you prefer.
What you're referring to is known as a "bare git repository" and is indeed the simplest way to get a git remote set up that can be shared with multiple people. A bare git repository is simply a git repository without a work directory, so everything that would normally be in the .git directory of a repository is now in it's base directory.
i have a error i use reverse proxy when im pushing my repo to my gitea error: Enumerating objects: 3, done. Counting objects: 100% (3/3), done. Writing objects: 100% (3/3), 207 bytes | 207.00 KiB/s, done. Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0) error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403 send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up unexpectedly Everything up-to-date
i get errors with creating the system user, user already exist and cannot read /var/lib/gitea/lost+found permission denied so chown also does not work on that folder
Yup, they have Gitea Actions if you setup an act runner(s) to run the jobs. I didn't set that up here since I'm not planning on using them, but they do exist.
@@apalrdsadventures I had gitea running for a few years and used woodpecker for ci but it was kind of a hassle to get it up and running (I never really got it done the way I wanted to). Gitea Actions are new to me, I'll have to give that feature a try, thanks for making me aware of it. Seems way more convenient to have everything out of the box integrated without having to stitch it together yourself, less moving parts.
The systemd unit hang is because they have the type set in the unit as "Notify" which expects the application to notify systemd its ready by calling sdnotify() - it seems that unless you have done the initial install page, this doesnt take place, so the unit hangs waiting for the notification then eventually hits its wait timeout. Its something stupid that tripped me up when installing for the first time - they really need to document it so people are not caught out by it. For me it wasnt a big deal, i have a firm grasp on linux and systemd, for others it might leave them scratching their head for a bit.
Of course, it'll work just fine bare metal. I am containerizing it for networking reasons, not dependency isolation. Docker is really bad at networking, so that's something I avoid. I want the service to have its own DNS name and IP address so it can bind to 80/443 without any other layers, which basically means it needs its own network namespace on Linux if I'm sharing the hardware with other services. I could do that purely with systemd on bare metal, but if I'm already using Proxmox it's easier to create an LXC container, which will get a network namespace as well as a good backup system. What it doesn't need is to be isolated due to dependency hell like a node.js app. It also doesn't need a mess of NAT / userspace-proxy to get IPv6 working like Docker does.
In general a Git repo is stored as files in a folder, so recovering it doesn't require Gitea to be running. As to recovering infrastructure, sometimes it's good to have a bootstrapping plan on how to setup a minimal set of functions to get the code back to provision everything again.
@@apalrdsadventures I assume that Ansible, Terraform, and other related tools are part of a good recovery plan. Is your Ansible video still in the works?
Ansible is in the long term plans, not being produced yet. I'm slowly working on setting up some things I'd like to have in place before I start with IaaC (specifically, Netbox). I won't make a video until I'm using Ansible, so that's part of the delay. I did work through a Netbox test setup, so at least that is moving along and a video on that will come out eventually. I did just have to do a disaster recovery (ironically, the backup server itself failed) and the PBS dataset was very useful. I'll probably have a video on mounting / using PBS datasets for disaster recovery soon.
The only problem I've had with gitea in about a year or so of operation is that it's sensitive to filesystem latency. If I add a new glusterfs brick to my potato cluster it can't get a file lock until it's done syncing. Other than that I'm very happy with it.
I assume its possible to front it with something like Nginx instead. Letting gitea use port 443 might not be so convenient for people who might have a http service like nginx already using that port. You can then just let Nginx handle all the TLS stuff and have it proxy requests for the virtual host you create in Nginx for gitea over to the ip:port that gitea is listening on.
Yes that is certainly possible. There is even an advanced setup where you can have nginx serve the static content for Gitea from a different web root and let Gitea only handle the dynamic content, proxied and ssl offloaded by nginx of course. This will improve performance especially for large sites with lots of users
bro are you good enough with archiso or somethiing else in order to make a distro? i got a really good os and its all arch based with tiling and gnome and steamos haha
There's no such thing as "just" setting up a self-hosted Gitlab, it's way more complex to set up and manage than Gitea. I try to avoid it whenever I can. I've found that at most of the companies that I've worked at, they don't use half the features Gitlab offers and could make due just fine with Gitea, which is 100% free. But I guess they just want the support that comes with the Enterprise Edition of Gitlab. That said, if you're doing complex things with Git and have big repositories with CI/CD and all bells and whistles, Gitlab is the way to go.
I also tried Gitea in a Jail some time ago and have been using it ever since to have version control for my (very simple) Ansible tasks and playbooks.
The best thing about Gitea is that I don't have to worry about leaking information about my internal networks like I did with github. :)
That’s basically my use case. Ansible, storing config backups of switches and routers, that kind of stuff.
Its good that they have work programs like this in jail. Hopefully, when you get out, you'll be able to get a job in I.T.
Sorry, I couldn't resist. 😁
@@esra_erimez I already work in IT and am currently trying to handle a lot of customer firewalls and routers in a team that is way too small... But thanks I guess
A big thank you !!! I'm learning web development and it's a big step thanks to you.
I predict a password management video in the future
If you don't need all the issue management and ancillary niceties of Github and simply want your own self-hosted git repositories for syncing work between various machines you control, there's also a little-known feature of Git that allows you to set _any random accessible folder_ on your system as an "upstream" for the local repository. Combined with a mounted network fileshare (SMB or whatever else you prefer), this can provide an extremely low-effort way to centralize and back up your git work and sync it between machines. If you already have a fileserver at home, you need literally nothing else other than creating a git folder on it.
I use this in conjunction with Sourcetree at home, but it works just as well from git's command-line interface or whatever IDE integration you prefer.
What you're referring to is known as a "bare git repository" and is indeed the simplest way to get a git remote set up that can be shared with multiple people. A bare git repository is simply a git repository without a work directory, so everything that would normally be in the .git directory of a repository is now in it's base directory.
I have done this to work with branches over SSH on two laptops I own. Very handy.
I have been using Gitea for a year it’s great I like the fact you can create package repositories for docker, npm etc
With systemctl you can also use the flag --no-block to not wait for the service to get healthy
Love the mug 😸
Can you show how to configure git via ssh in gitea? There are many problems with url and users when we try to use ssh
Man you read my mind a second time! I was recently looking at Gitea! 🤔🤨
Been using Gitea for a couple years. recently being playing around with Gitea actions
Thanks for wonderful and informative tutorial.!.!!
I see a pal rd I smash like :)
Thank you
You’re the best! Thank you so much
i have a error i use reverse proxy when im pushing my repo to my gitea
error:
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 207 bytes | 207.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
error: RPC failed; HTTP 403 curl 22 The requested URL returned error: 403
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
Hey apalrd, when are you going to do the ansible semaphore video?
i get errors with creating the system user, user already exist and cannot read /var/lib/gitea/lost+found permission denied so chown also does not work on that folder
other than that, gitea is working
I'm looking for an alternative to Gitlab. Does Gitea have CI/CD? I'm looking forward to that Ansible tutorial!!!
Yup, they have Gitea Actions if you setup an act runner(s) to run the jobs. I didn't set that up here since I'm not planning on using them, but they do exist.
@@apalrdsadventuresOh, thank you!!!!
@@apalrdsadventures
I had gitea running for a few years and used woodpecker for ci but it was kind of a hassle to get it up and running (I never really got it done the way I wanted to). Gitea Actions are new to me, I'll have to give that feature a try, thanks for making me aware of it. Seems way more convenient to have everything out of the box integrated without having to stitch it together yourself, less moving parts.
@@la1n- Are you still using Gitea actions? If the performance is not as good as GitHub Actions, do you have any recommendations?
Nice video!! I like to understand how to use GIT. Is it possible that you can do a tutorial?
The systemd unit hang is because they have the type set in the unit as "Notify" which expects the application to notify systemd its ready by calling sdnotify() - it seems that unless you have done the initial install page, this doesnt take place, so the unit hangs waiting for the notification then eventually hits its wait timeout. Its something stupid that tripped me up when installing for the first time - they really need to document it so people are not caught out by it. For me it wasnt a big deal, i have a firm grasp on linux and systemd, for others it might leave them scratching their head for a bit.
I think a video on mTLS would be interesting.
what about a video where you have to authenticate against an ldap infrastructure? Could you do that tutorial as an extention to this tutorial?
Why you dont install gitea as docker container? I know that you're using LXC but docker installation is pretty simple
Podman > Docker
Gitea is a single binary. Installing it is just downloading and executing the binary. It doesn't need a whole package for its single binary.
@@apalrdsadventures By that logic, it doesn't need to be run in a LXC container either; bare metal server should suffice?
Of course, it'll work just fine bare metal. I am containerizing it for networking reasons, not dependency isolation. Docker is really bad at networking, so that's something I avoid.
I want the service to have its own DNS name and IP address so it can bind to 80/443 without any other layers, which basically means it needs its own network namespace on Linux if I'm sharing the hardware with other services. I could do that purely with systemd on bare metal, but if I'm already using Proxmox it's easier to create an LXC container, which will get a network namespace as well as a good backup system.
What it doesn't need is to be isolated due to dependency hell like a node.js app. It also doesn't need a mess of NAT / userspace-proxy to get IPv6 working like Docker does.
@@apalrdsadventuresvalid, if it works then it works lol 😂
Are there any implications of self-hosting repos, specifically Infra-as-code, and disaster recovery?
In general a Git repo is stored as files in a folder, so recovering it doesn't require Gitea to be running.
As to recovering infrastructure, sometimes it's good to have a bootstrapping plan on how to setup a minimal set of functions to get the code back to provision everything again.
@@apalrdsadventures I assume that Ansible, Terraform, and other related tools are part of a good recovery plan. Is your Ansible video still in the works?
Ansible is in the long term plans, not being produced yet. I'm slowly working on setting up some things I'd like to have in place before I start with IaaC (specifically, Netbox).
I won't make a video until I'm using Ansible, so that's part of the delay. I did work through a Netbox test setup, so at least that is moving along and a video on that will come out eventually.
I did just have to do a disaster recovery (ironically, the backup server itself failed) and the PBS dataset was very useful. I'll probably have a video on mounting / using PBS datasets for disaster recovery soon.
The only problem I've had with gitea in about a year or so of operation is that it's sensitive to filesystem latency. If I add a new glusterfs brick to my potato cluster it can't get a file lock until it's done syncing. Other than that I'm very happy with it.
I've used gitolite in the past for simple local git hosting.
I assume its possible to front it with something like Nginx instead. Letting gitea use port 443 might not be so convenient for people who might have a http service like nginx already using that port. You can then just let Nginx handle all the TLS stuff and have it proxy requests for the virtual host you create in Nginx for gitea over to the ip:port that gitea is listening on.
Yes that is certainly possible. There is even an advanced setup where you can have nginx serve the static content for Gitea from a different web root and let Gitea only handle the dynamic content, proxied and ssl offloaded by nginx of course. This will improve performance especially for large sites with lots of users
You made a typo at the end of the blog post: "journactl -xeu gitea" should be "journalctl -xeu gitea".
But great tutorial!
bro are you good enough with archiso or somethiing else in order to make a distro? i got a really good os and its all arch based with tiling and gnome and steamos haha
LetsEncrypt certificate don't work. Gitea service can't start.
Nice video
I wonder how to install Taranis AI😀
hm, why not just a self-hosted gitlab?
Because Gitlab is more complicated and uses more resources. That said: I'm use Gitlab at the company I work at and it does the job.
There's no such thing as "just" setting up a self-hosted Gitlab, it's way more complex to set up and manage than Gitea. I try to avoid it whenever I can. I've found that at most of the companies that I've worked at, they don't use half the features Gitlab offers and could make due just fine with Gitea, which is 100% free. But I guess they just want the support that comes with the Enterprise Edition of Gitlab.
That said, if you're doing complex things with Git and have big repositories with CI/CD and all bells and whistles, Gitlab is the way to go.
every ssh account can self host git repository, only requarement is installed git command.
That doesn’t give you the same level of permission control though, at least without some additional tool
Issue tracking?
container id should have been 418 ;)
pls reply to me if you can help me with linux development
Gitea is criticized by someone it means it's not self hosted.