[Gogs] An awesome GitHub alternative

Hi !

I packaged Gogs which is a very useful app: it offer a complete alternative to GitHub.

Official website: https://gogs.io/

Integration with YunoHost

  • Auto login with the SSO is working
  • LDAP is used for user infos (email,…)
  • install works on a path or at the root of the domain
  • In public mode, non authentificated user will be able to see and clone public repository
  • backup/restore script are fully functional


sudo yunohost app install -l Gogs https://github.com/YunoHost-Apps/gogs_ynh


sudo yunohost app upgrade -u https://github.com/YunoHost-Apps/gogs_ynh

Please let me know if it works for you!



Thank for your upgrade, It work well on my server. :grinning:

Thank you so much !!
i was waiting for a git ui on ynh since the begining!
Working good for me so far.

1 Like

I just installed it. Awesome work ! Very nicely integrated with the SSO, this is just perfect !

I can successfully push with https.
As to ssh, I can see my ssh key in /home/gogs/.ssh/authorized_keys but I get Permission denied error for the moment. Is SSH supposed to work too ?

Many thanks for this excellent contribution !

Thank you !

However, I’m running Yunohost on a VPS server, with only 512Mo RAM, and no swap (or at least, I cannot create a 1Go swap file). I had to hack the install script, using the binary package corresponding to my architecture.

I pushed this on my Github, I it might be of some use one day :
Gogs v0.8.25 for Linux amd64 : https://github.com/buzuck/gogs_ynh

For SSH access, I needed to enable :

UsePAM yes

in my /etc/ssh/sshd_config to enable ssh login with the gogs account.
Probably because the gogs user is created with the --disabled-login switch.

Otherwise you get in /var/log/auth.log :

Feb 10 11:52:35 ynh sshd[17386]: User gogs not allowed because account is locked
Feb 10 11:52:35 ynh sshd[17386]: input_userauth_request: invalid user gogs [preauth]
1 Like

@juju ssh clone/push was working for me once I added my ssh key in my profile settings. I will check if I have “UsePAM yes” in my ssh config.

@Fol I run yunohost on a VPS with 512Mo RAM too, I have a 512Mo swap file. One better solution than a fork would be to create a temporary swap file like in searx https://github.com/abeudin/searx_ynh/blob/master/scripts/install#L20-L53

@tostaki I tried it (with a 1Go file). It seemed I didn’t have enough credentials to do so. A bit weird, but it wouldn’t be the first limitation I encounter with this VPS : (

I’ve updated the gogs package to the last released version. This major update use precompiled binary instead of building gogs from sources, because it’s so much easier and lighter. It also make use of yunohost helpers introduced in yunohost 2.4. Backup and restore are also fully functionnal.

Update from the old package is supported but please read the relevant section in the readme (tldr: backup).

Link: https://github.com/YunoHost-Apps/gogs_ynh


A request have been made to put Gogs packages on offical list of YunoHost apps!!!

We encourage to test and report bugs about Gogs package.

Thanks :cat2:

1 Like

i’m instensivly using gogs through YNH in two differente YNH instance without any issue since more than a year !
go for it :slight_smile:
for work : https://g-u-i.me/gogs
for school : https://esadhar.net/gogs

didn’t make the last update yet

1 Like

Thanks for this great package.

Is there a reason why Gogs is installed in /opt and not /var/www as all the other apps? Besides, what is the use of the gogs home folder? I can understand the need of a gogs user but why the home folder alongside actual users’ home folder?

Not all apps are in /var/www, in fact some other official apps use /opt like searx. I prefer to reserve the use of /var/www to static and php site that can be served directly by nginx.
In fact, if I was the only one to decide, I would put most apps in /opt since /var should be reserved to “files which may change in size” as described in man hier. There are already a lot of things in /var while /opt is empty on a fresh install and is well suited for apps IMO “should contain add-on packages that contain static files.”

Gogs need a linux user for ssh usage and also store data (all git repository, user avatar, issues attachments). I found more practical to have all of this in the same folder. I could have used /home/yunohost.app/gogs but I think using the standard /home/gogs makes it clearer to see that gogs is a real user with ssh access (limited to git) and data.

So in one word: clarity.

Thank you for the complete answer!

It makes great sense. Also, I agree with you about /opt and in this context it is very consistent.

Unless it appears in the YunoHost app packaging rules, it falls to people who pack the apps to use the proper directory, according to the filesystem hierarchy standard, I guess.

hi all,
I installed gogs but I have

502 Bad Gateway

when I m going on the site.com/gogs .
I have no logs in nginx or in gogs directory.

any idea ? thanks.

Maybe the command sudo service gogs start will help…

effectively,… that’s help :smiley:

@elekis there was a bug in the package systemd script, it should be fixed with the new version.