Packaging Gitea

en

#1

Hi everybody,

I’m trying to package Gitea (Gogs fork) git forge for Yunohost right now and wanted to let you know if you want to try the package.

For now the package is not working, the installation hangs on :

 # Wait till login_source mysql table is created
while ! $(ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname"  <<< "SELECT * FROM login_source;" &>/dev/null)
do
    sleep 2
done

It ran the command all night long ans totally freezed my Rpi3.

As I’m no kind of dev I’m trying to debunk that issue ans want your help if you can do anything.


#2

Hi @Bridouz,

Thank you for packaging this app!

I managed to fix the install: https://github.com/Bridouz/gitea_ynh/issues/2

The packaged version is 1.1.4 which is not the last version: https://github.com/go-gitea/gitea/releases

In this post (https://discourse.gitea.io/t/how-to-backup-upgrade-and-migrate/124/3), it is stated that upgrade should be as easy as changing the binary but it was not the case for me.

If anyone has a lead, I’ll be around.

Cheers


#3

Hi @Bridouz @vey

I was able to fix the installation script for the last Gitea version. Could you test to confirm with a fresh install ?
I don’t considered the update script for now.


#4

Hi @guigo,

There is an issue with installation, blocking the process at the mysql stage. I managed to fix it, see below.

System Information

  • Gitea Version: 1.3.2
  • yunohost 2.7.7 (stable)
  • yunohost-admin 2.7.7 (stable)
  • moulinette 2.7.7 (stable)
  • ssowat 2.7.7 (stable)
  • local virtual machine
  • RAM: 1Go

this is my _common.sh:

install_gitea() {
  local DESTDIR=$1
  
  # Retrieve Gitea binary
  gitea_binary="/tmp/gitea"
  rm -f "$gitea_binary"
  wget -q -O "$gitea_binary" "$GITEA_BINARY_URL" \
    || ynh_die "Unable to download Gitea binary"
  sudo chmod +x "$gitea_binary"
  sudo rsync -a "$gitea_binary" "$DESTDIR"
  rm -rf "$gitea_binary" "${TMPDIR:-/tmp/fakefile}"
}

I added chmod +x “$gitea_binary” and fixed missing $ variable sign

Also I changed the chown you added (chown gitea “$DESTDIR”/custom/conf/app.ini) to:

sudo chown "$app":"$app" "$DESTDIR"/custom/conf/app.ini

Finally I added port testing as described here : https://github.com/Bridouz/gitea_ynh/issues/2 in order to future proof.

So, now it works for me ™

Hope this helps.


#5

I saw your PR, I implied to try merging your PR and mine, i should have made clearer, my bad.
So it works, cool !

What is the point to add group owner for this file ? It doesn’t seem necessary. Like “sudo”, it works without.
I noticed you replace “gitea” by $app, you’re right. The file needs more consistency for this point.

Maybe we (or @Bridouz ?) could merge this two PR for a functionnal installation and focus on a rework with new helpers then ?


#6

I think the original maintainer is not vailable any more.

So, if you have time to merge the PR, please do. I’ll gladly help where I can.

Regarding the unnecessary sudo and group owner, I only did it in an attempt to find where the error was coming from, futureproof and provide a consistent reading time.

I know yunohost helpers have changed quite a bit lately, so if anyone with a better understanding want to help, feel free.


#7

The merge is done. For those who are interested, the repository is here : https://github.com/Guigo-/gitea_ynh


#8

I’ve tested your update with the same context and this command from ssh:

sudo yunohost app install https://github.com/Guigo-/gitea_ynh

and installation worked.

Thank you @guigo

Let me know if you want to further improve the package, I’ll help where I can.


#9

Wow, I’ve been quite busy since january and did not look up at ynh-Gitea.

Congratulation to all for all your work :+1: