From db3fabe4b27aa3955c7a62ff15a9f71ab066fe2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 15 May 2018 10:57:25 +0200 Subject: [PATCH 1/3] copy default config before call function --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 75c9403..5afec62 100644 --- a/scripts/install +++ b/scripts/install @@ -72,10 +72,10 @@ ynh_add_systemd_config config_nginx # Configure gitea with app.ini file +cp -a ../conf/app.ini $final_path config_gitea # Install gitea -cp -a ../conf/app.ini $final_path cd $final_path wget https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-amd64 mv gitea-1.3.3-linux-amd64 gitea From def86309502df4e386e4665bae3681a0757aed20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 15 May 2018 10:59:08 +0200 Subject: [PATCH 2/3] stay in install directory and download gitea at the right place directly --- scripts/install | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 5afec62..f675049 100644 --- a/scripts/install +++ b/scripts/install @@ -76,9 +76,7 @@ cp -a ../conf/app.ini $final_path config_gitea # Install gitea -cd $final_path -wget https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-amd64 -mv gitea-1.3.3-linux-amd64 gitea +wget https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-amd64 -O $final_path/gitea # Start gitea for building mysql tables systemctl start "$app".service From a3bb83127fa3d53c76804a544812ae6118137581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 15 May 2018 10:59:56 +0200 Subject: [PATCH 3/3] make gitea executable before starting the service --- scripts/_common.sh | 1 + scripts/install | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 884ffd5..05fafe3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -74,6 +74,7 @@ set_permission() { chown -R $app:$app "/home/$app" chown -R $app:$app "/var/log/$app" chmod u=rwX,g=rX,o= "$final_path" + chmod u=rwx,g=rx,o= "$final_path/gitea" chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" } diff --git a/scripts/install b/scripts/install index f675049..c835815 100644 --- a/scripts/install +++ b/scripts/install @@ -78,12 +78,12 @@ config_gitea # Install gitea wget https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-amd64 -O $final_path/gitea -# Start gitea for building mysql tables -systemctl start "$app".service - # Set permissions set_permission +# Start gitea for building mysql tables +systemctl start "$app".service + # Wait till login_source mysql table is created while ! $(ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" <<< "SELECT * FROM login_source;" &>/dev/null) do