From 2a5e86d8223d3e21653e22d97ca564b33ff3b290 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Fri, 25 Jan 2019 15:52:24 +0100 Subject: [PATCH 01/30] Upgrade to 1.7.0 --- conf/arm.src | 4 ++-- conf/i386.src | 4 ++-- conf/x86-64.src | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf/arm.src b/conf/arm.src index 90a9e5b..c829f50 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.0/gitea-1.6.0-linux-arm-6 -SOURCE_SUM=36a19d4cf5328bd41382489c7b27856b18a86dd1523148c43e95ffe705f21454 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-6 +SOURCE_SUM=7502937fd6cb1ff11a9d51c7df658d5c6346f9f2312c6384f12b4c305fb7f7bc SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/i386.src b/conf/i386.src index 2adbf25..805e122 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.0/gitea-1.6.0-linux-386 -SOURCE_SUM=28404390f70ae5c6c71326606a6aedf39bff0c3f7a4c16c14f6d28a6adf92bd3 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-386 +SOURCE_SUM=4a9639e1642d55cafa05d8988b3f9b23e61f003102ceee4e68205f2abcb9d94f SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/x86-64.src b/conf/x86-64.src index f5d789f..b3366e5 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.0/gitea-1.6.0-linux-amd64 -SOURCE_SUM=9c66d4207b49309de9d4d750bab1090c15bf6de5d99e0de819f5215cba35d2cb +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-amd64 +SOURCE_SUM=fbce93006146f2e96901bd5940b04c4f54582051a363a1146b10b398958aaab6 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false From 1c213a9ad8dbd59505febfe751c4b3bbbdf2fd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:47:27 +0100 Subject: [PATCH 02/30] Fix max body size When we push a big git fragement by https nginx refuse the request --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 36617de..aaa990e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,8 +4,8 @@ location __PATH__/ { proxy_set_header Host $host; proxy_buffering off; fastcgi_param REMOTE_USER $remote_user; - client_max_body_size 50M; - + client_max_body_size 200M; + # Force https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; From d89b9c06c5640e0ee6cfd14ce26ddee6d0953748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:49:57 +0100 Subject: [PATCH 03/30] Fix shell for new user --- scripts/install | 7 ++++++- scripts/restore | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9fee527..b592d7b 100644 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,12 @@ config_nginx ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" # Add users -ynh_system_user_create $app +# We can't use the official helper (for now) because we need to set the shell for the login +test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" +# Should be replaced by this when getops is available in the helper ynh_system_user_create (probably in Yunohost 3.5) +# ynh_system_user_create --username= $app --home_dir=/opt/yunohost/$app --use_shell # create needed directories create_dir diff --git a/scripts/restore b/scripts/restore index c3c06f5..185f048 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,7 +35,12 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" #================================================= # Add users -ynh_system_user_create $app +# We can't use the official helper (for now) because we need to set the shell for the login +test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" +# Should be replaced by this when getops is available in the helper ynh_system_user_create (probably in Yunohost 3.5) +# ynh_system_user_create --username= $app --home_dir=/opt/yunohost/$app --use_shell # Restore all files ynh_restore From 300340cfc9cae726e739988bed4bcb3e38e1210b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:51:19 +0100 Subject: [PATCH 04/30] Allow https access from git in private mode --- scripts/_common.sh | 18 ++++++++++++++++++ scripts/install | 5 +---- scripts/upgrade | 3 +++ 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 62fac07..8723dba 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -81,3 +81,21 @@ set_permission() { chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" } + +set_access_settings() { + if [ "$is_public" = '1' ] + then + ynh_app_setting_set $app unprotected_uris "/" + else + # For an access to the git server by https in private mode we need to allow the access to theses URL : + # - "DOMAIN/PATH/USER/REPOSITORY/info/refs" + # - "DOMAIN/PATH/USER/REPOSITORY/git-upload-pack" + # - "DOMAIN/PATH/USER/REPOSITORY/git-receive-pack" + + excaped_domain=${domain//'.'/'%.'} + excaped_domain=${excaped_domain//'-'/'%-'} + excaped_path=${path_url//'.'/'%.'} + excaped_path=${excaped_path//'-'/'%-'} + ynh_app_setting_set $app skipped_regex "$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-receive%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/git%-upload%-pack,$excaped_domain$excaped_path/[%w-.]*/[%w-.]*/info/refs" + fi +} diff --git a/scripts/install b/scripts/install index b592d7b..174ffb5 100644 --- a/scripts/install +++ b/scripts/install @@ -104,10 +104,7 @@ ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql #================================================= # Unprotect root from SSO if public -if [ "$is_public" = '1' ] -then - ynh_app_setting_set $app unprotected_uris "/" -fi +set_access_settings # Add gitea to YunoHost's monitored services yunohost service add "$app" --log "/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index 54b53b6..898b6fb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -106,6 +106,9 @@ config_nginx # Set permissions set_permission +# Unprotect root from SSO if public +set_access_settings + # Reload services # ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" sleep 20 From e93f8556ae91973dc222fa2ab6d268b1043ea11a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:52:14 +0100 Subject: [PATCH 05/30] Simplify change-url script --- scripts/change_url | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 8cda492..3a8de48 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -18,9 +18,8 @@ cp -r /etc/yunohost/apps/${app}/conf ../ # Quick hack for https://github.com/Yu # RETRIEVE ARGUMENTS old_domain=$YNH_APP_OLD_DOMAIN -old_path=$YNH_APP_OLD_PATH -new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +domain=$YNH_APP_NEW_DOMAIN +path_url=$(ynh_normalize_url_path ${YNH_APP_NEW_PATH:-'/'}) app=$YNH_APP_INSTANCE_NAME dbpass=$(ynh_app_setting_get "$app" mysqlpwd) @@ -28,28 +27,6 @@ admin=$(ynh_app_setting_get "$app" adminusername) key=$(ynh_app_setting_get "$app" secret_key) port=$(ynh_app_setting_get "$app" web_port) -# CHECK THE SYNTAX OF THE PATHS -test -n "$old_path" || old_path="/" -test -n "$new_path" || new_path="/" -new_path=$(ynh_normalize_url_path $new_path) -old_path=$(ynh_normalize_url_path $old_path) - -domain="$new_domain" -path_url="$new_path" - -# CHECK WHICH PARTS SHOULD BE CHANGED -change_domain=0 -if [ "$old_domain" != "$new_domain" ] -then - change_domain=1 -fi - -change_path=0 -if [ "$old_path" != "$new_path" ] -then - change_path=1 -fi - #================================================= # STANDARD MODIFICATIONS #================================================= @@ -58,13 +35,13 @@ fi nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf # Change the domain for nginx -if [ $change_domain -eq 1 ] -then +# Change the domain for nginx +if [[ "$old_domain" != "$domain" ]]; then # Delete file checksum for the old conf file location ynh_delete_file_checksum "$nginx_conf_path" - mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + mv $nginx_conf_path /etc/nginx/conf.d/$domain.d/$app.conf # Store file checksum for the new config file location - ynh_store_file_checksum "/etc/nginx/conf.d/$new_domain.d/$app.conf" + ynh_store_file_checksum "/etc/nginx/conf.d/$domain.d/$app.conf" fi config_nginx @@ -74,4 +51,4 @@ config_gitea # RELOAD services ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" -sleep 1 \ No newline at end of file +sleep 1 From 3c8b6ca051934a21ca9f270f4b72ebf76b71de0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:53:29 +0100 Subject: [PATCH 06/30] Fix URL normalisation at install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 174ffb5..0ff36d1 100644 --- a/scripts/install +++ b/scripts/install @@ -16,7 +16,7 @@ source ./_common.sh # Retrieve arguments domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url=$(ynh_normalize_url_path $YNH_APP_ARG_PATH) admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC From ee15d3c5d6945810c0b06f443dd4379695013570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:58:05 +0100 Subject: [PATCH 07/30] Replace gogs by gitea in comments --- scripts/remove | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index c9a5682..8207695 100644 --- a/scripts/remove +++ b/scripts/remove @@ -15,7 +15,7 @@ source ./_common.sh # STANDARD REMOVE #================================================= -# Stop gogs +# Stop gitea systemctl stop "$app".service # Drop MySQL database and user @@ -36,7 +36,7 @@ ynh_remove_logrotate # Remove nginx config ynh_remove_nginx_config -# Remove gogs user and data +# Remove gitea user and data ynh_system_user_delete $app # Remove init script From 462418582e0b54a65356775bf8f47069890f941a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 15:42:55 +0100 Subject: [PATCH 08/30] Replace gitea by --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 898b6fb..68314ee 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -85,7 +85,7 @@ fi #================================================= # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove "/opt/gitea/templates" +ynh_secure_remove "/opt/$app/templates" # Install gitea ynh_setup_source $final_path $architecture From fb15a9c48948c7c4e9fdfb950c2055aea4029f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 16:00:22 +0100 Subject: [PATCH 09/30] Add armv7 support --- conf/armv7.src | 5 +++++ scripts/_common.sh | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 conf/armv7.src diff --git a/conf/armv7.src b/conf/armv7.src new file mode 100644 index 0000000..d07338e --- /dev/null +++ b/conf/armv7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-7 +SOURCE_SUM=2d8c095de0f0d83da5681aa84b14fb8ee278a5e020787227d88583c8b544da69 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/scripts/_common.sh b/scripts/_common.sh index 8723dba..cfbd13f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -17,6 +17,8 @@ if [ -n "$(uname -m | grep 64)" ]; then architecture="x86-64" elif [ -n "$(uname -m | grep 86)" ]; then architecture="i386" +elif [ -n "$(uname -m | grep armv7)" ]; then + architecture="armv7" elif [ -n "$(uname -m | grep arm)" ]; then architecture="arm" else From 0e108f1261c9840612da94e6a99132dfd70927a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 17:42:39 +0100 Subject: [PATCH 10/30] Use ynh_systemd_action to control service start --- scripts/change_url | 3 +- scripts/experimental_helper.sh | 134 +++++++++++++++++++++------------ scripts/install | 4 +- scripts/restore | 4 +- scripts/upgrade | 4 +- 5 files changed, 91 insertions(+), 58 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index 3a8de48..a0d945c 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -50,5 +50,4 @@ config_nginx config_gitea # RELOAD services -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" -sleep 1 +ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" -a restart diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 600a653..9e3869c 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -9,53 +9,91 @@ ynh_delete_file_checksum () { ynh_app_setting_delete $app $checksum_setting_name } -# Start or restart a service and follow its booting +# Start (or other actions) a service, print a log in case of failure and optionnaly wait until the service is completely started # -# usage: ynh_check_starting "Line to match" [Log file] [Timeout] [Service name] +# usage: ynh_systemd_action [-n service_name] [-a action] [ [-l "line to match"] [-p log_path] [-t timeout] [-e length] ] +# | arg: -n, --service_name= - Name of the service to reload. Default : $app +# | arg: -a, --action= - Action to perform with systemctl. Default: start +# | arg: -l, --line_match= - Line to match - The line to find in the log to attest the service have finished to boot. +# If not defined it don't wait until the service is completely started. +# | arg: -p, --log_path= - Log file - Path to the log file. Default : /var/log/$app/$app.log +# | arg: -t, --timeout= - Timeout - The maximum time to wait before ending the watching. Default : 300 seconds. +# | arg: -e, --length= - Length of the error log : Default : 20 +ynh_systemd_action() { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [n]=service_name= [a]=action= [l]=line_match= [p]=log_path= [t]=timeout= [e]=length= ) + local service_name + local action + local line_match + local length + local log_path + local timeout + + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + local service_name="${service_name:-$app}" + local action=${action:-start} + local log_path="${log_path:-/var/log/$service_name/$service_name.log}" + local length=${length:-20} + local timeout=${timeout:-300} + + # Start to read the log + if [[ -n "${line_match:-}" ]] + then + local templog="$(mktemp)" + # Following the starting of the app in its log + if [ "$log_path" == "systemd" ] ; then + # Read the systemd journal + journalctl --unit=$service_name --follow --since=-0 --quiet > "$templog" & + else + # Read the specified log file + tail -F -n0 "$log_path" > "$templog" & + fi + # Get the PID of the tail command + local pid_tail=$! + fi + + echo "${action^} the service $service_name" >&2 + systemctl $action $service_name \ + || ( journalctl --lines=$length -u $service_name >&2 \ + ; test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 \ + ; false ) + + # Start the timeout and try to find line_match + if [[ -n "${line_match:-}" ]] + then + local i=0 + for i in $(seq 1 $timeout) + do + # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout + if grep --quiet "$line_match" "$templog" + then + echo "The service $service_name has correctly started." >&2 + break + fi + echo -n "." >&2 + sleep 1 + done + if [ $i -eq $timeout ] + then + echo "The service $service_name didn't fully started before the timeout." >&2 + echo "Please find here an extract of the end of the log of the service $service_name:" + journalctl --lines=$length -u $service_name >&2 + test -e "$log_path" && echo "--" && tail --lines=$length "$log_path" >&2 + fi + + echo "" + ynh_clean_check_starting + fi +} + +# Clean temporary process and file used by ynh_check_starting +# (usually used in ynh_clean_setup scripts) # -# | arg: Line to match - The line to find in the log to attest the service have finished to boot. -# | arg: Log file - The log file to watch -# | arg: Service name -# /var/log/$app/$app.log will be used if no other log is defined. -# | arg: Timeout - The maximum time to wait before ending the watching. Defaut 300 seconds. -ynh_check_starting () { - local line_to_match="$1" - local service_name="${4:-$app}" - local app_log="${2:-/var/log/$service_name/$service_name.log}" - local timeout=${3:-300} - - ynh_clean_check_starting () { - # Stop the execution of tail. - kill -s 15 $pid_tail 2>&1 - ynh_secure_remove "$templog" 2>&1 - } - - echo "Starting of $service_name" >&2 - systemctl stop $service_name - local templog="$(mktemp)" - # Following the starting of the app in its log - tail -F -n0 "$app_log" > "$templog" & - # Get the PID of the tail command - local pid_tail=$! - systemctl start $service_name - - local i=0 - for i in `seq 1 $timeout` - do - # Read the log until the sentence is found, that means the app finished to start. Or run until the timeout - if grep --quiet "$line_to_match" "$templog" - then - echo "The service $service_name has correctly started." >&2 - break - fi - echo -n "." >&2 - sleep 1 - done - if [ $i -eq $timeout ] - then - echo "The service $service_name didn't fully started before the timeout." >&2 - fi - - echo "" - ynh_clean_check_starting -} \ No newline at end of file +# usage: ynh_clean_check_starting +ynh_clean_check_starting () { + # Stop the execution of tail. + kill -s 15 $pid_tail 2>&1 + ynh_secure_remove "$templog" 2>&1 +} diff --git a/scripts/install b/scripts/install index 0ff36d1..4e62ea8 100644 --- a/scripts/install +++ b/scripts/install @@ -113,6 +113,4 @@ yunohost service add "$app" --log "/var/log/$app/$app.log" ynh_use_logrotate "/var/log/$app" # Reload services -# ynh_check_starting "Serving [::]:$port with pid" "/var/log/$app/gitea.log" -sleep 20 -systemctl start gitea +ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" diff --git a/scripts/restore b/scripts/restore index 185f048..80b5d93 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,7 @@ domain=$(ynh_app_setting_get "$app" domain) path_url=$(ynh_app_setting_get "$app" path) dbpass=$(ynh_app_setting_get "$app" mysqlpwd) admin=$(ynh_app_setting_get "$app" adminusername) +port=$(ynh_app_setting_get "$app" web_port) # Check domain/path availability with app helper ynh_webpath_available $domain $path_url || ynh_die "$domain is not available as domain, please use an other domain." @@ -68,5 +69,4 @@ yunohost service add "$app" --log /var/log/"$app"/"$app".log # Reload services systemctl reload nginx.service -sleep 20 -systemctl start gitea \ No newline at end of file +ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" diff --git a/scripts/upgrade b/scripts/upgrade index 68314ee..2f626a8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -110,6 +110,4 @@ set_permission set_access_settings # Reload services -# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" -sleep 20 -systemctl restart gitea +ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" From 910777fd354cc941c7cb9519f24e9c19452dfb33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 19:56:46 +0100 Subject: [PATCH 11/30] Add support for custom ssh port --- conf/app.ini | 2 +- scripts/_common.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conf/app.ini b/conf/app.ini index 96503e7..e06c763 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -18,7 +18,7 @@ DOMAIN = __DOMAIN__ HTTP_PORT = __PORT__ ROOT_URL = https://__URL__/ DISABLE_SSH = false -SSH_PORT = 22 +SSH_PORT = __SSH_PORT_ OFFLINE_MODE = false APP_DATA_PATH = __DATA_PATH__ LANDING_PAGE = explore diff --git a/scripts/_common.sh b/scripts/_common.sh index cfbd13f..b57a1de 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -48,6 +48,7 @@ config_nginx() { } config_gitea() { + ssh_port=$(grep -P "Port\s+\d+" /etc/ssh/sshd_config | grep -P -o "\d+") ynh_backup_if_checksum_is_different "$final_path/custom/conf/app.ini" cp ../conf/app.ini "$final_path/custom/conf" @@ -68,6 +69,7 @@ config_gitea() { ynh_replace_string "__DATA_PATH__" "$DATA_PATH" "$final_path/custom/conf/app.ini" ynh_replace_string "__PORT__" $port "$final_path/custom/conf/app.ini" ynh_replace_string "__APP__" $app "$final_path/custom/conf/app.ini" + ynh_replace_string "__SSH_PORT_" $ssh_port "$final_path/custom/conf/app.ini" ynh_store_file_checksum "$final_path/custom/conf/app.ini" } From 45c0460c4f180193003abf51caf743ca77de0d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 16 Feb 2019 12:59:32 +0100 Subject: [PATCH 12/30] Store checksum for app.ini with INTERNAL_TOKEN value --- scripts/change_url | 4 ++++ scripts/install | 4 ++++ scripts/upgrade | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index a0d945c..64f6146 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -51,3 +51,7 @@ config_gitea # RELOAD services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" -a restart + +# Store the checksum with the 'INTERNAL_TOKEN' value. +# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed +ynh_store_file_checksum "$final_path/custom/conf/app.ini" diff --git a/scripts/install b/scripts/install index 4e62ea8..0821617 100644 --- a/scripts/install +++ b/scripts/install @@ -114,3 +114,7 @@ ynh_use_logrotate "/var/log/$app" # Reload services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" + +# Store the checksum with the 'INTERNAL_TOKEN' value. +# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed +ynh_store_file_checksum "$final_path/custom/conf/app.ini" diff --git a/scripts/upgrade b/scripts/upgrade index 2f626a8..5874ff2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,3 +111,7 @@ set_access_settings # Reload services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" + +# Store the checksum with the 'INTERNAL_TOKEN' value. +# Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed +ynh_store_file_checksum "$final_path/custom/conf/app.ini" From e5f1e079d6f6d41a9bd4a28ec5755c2236aada36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 16 Feb 2019 13:43:04 +0100 Subject: [PATCH 13/30] Add sleep after service start --- scripts/change_url | 1 + scripts/install | 1 + scripts/restore | 1 + scripts/upgrade | 1 + 4 files changed, 4 insertions(+) diff --git a/scripts/change_url b/scripts/change_url index 64f6146..87eea15 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -51,6 +51,7 @@ config_gitea # RELOAD services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" -a restart +sleep 1 # Store the checksum with the 'INTERNAL_TOKEN' value. # Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed diff --git a/scripts/install b/scripts/install index 0821617..a31fd41 100644 --- a/scripts/install +++ b/scripts/install @@ -114,6 +114,7 @@ ynh_use_logrotate "/var/log/$app" # Reload services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" +sleep 1 # Store the checksum with the 'INTERNAL_TOKEN' value. # Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed diff --git a/scripts/restore b/scripts/restore index 80b5d93..c13cf0d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,3 +70,4 @@ yunohost service add "$app" --log /var/log/"$app"/"$app".log # Reload services systemctl reload nginx.service ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" +sleep 1 diff --git a/scripts/upgrade b/scripts/upgrade index 5874ff2..ed849fc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -111,6 +111,7 @@ set_access_settings # Reload services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" +sleep 1 # Store the checksum with the 'INTERNAL_TOKEN' value. # Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed From f3b46f422a2274fecb4565029fcaea1d91c6ff8e Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 28 Feb 2019 18:02:13 +0100 Subject: [PATCH 14/30] Upgrade to 1.7.3 --- conf/arm.src | 4 ++-- conf/armv7.src | 4 ++-- conf/i386.src | 4 ++-- conf/x86-64.src | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/arm.src b/conf/arm.src index c829f50..8f37252 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-6 -SOURCE_SUM=7502937fd6cb1ff11a9d51c7df658d5c6346f9f2312c6384f12b4c305fb7f7bc +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-6 +SOURCE_SUM=c38394be40634b0e1bd0fac0898474ff50e4535af610c12ee16ec3cabd2d4771 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/armv7.src b/conf/armv7.src index d07338e..5eb2360 100644 --- a/conf/armv7.src +++ b/conf/armv7.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-7 -SOURCE_SUM=2d8c095de0f0d83da5681aa84b14fb8ee278a5e020787227d88583c8b544da69 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-7 +SOURCE_SUM=fd4ba028a30eb2fac1f8570fd3f6157f0c46c21992a2062dd7a6751cc8a47f2f SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/i386.src b/conf/i386.src index 805e122..2fcf64e 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-386 -SOURCE_SUM=4a9639e1642d55cafa05d8988b3f9b23e61f003102ceee4e68205f2abcb9d94f +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-386 +SOURCE_SUM=a420bccb17e6e1c317c014475ce5a5bf8091da123cc55b0569660ae43ababf44 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/x86-64.src b/conf/x86-64.src index b3366e5..ce97cc3 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-amd64 -SOURCE_SUM=fbce93006146f2e96901bd5940b04c4f54582051a363a1146b10b398958aaab6 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-amd64 +SOURCE_SUM=49b733a3272dc49cb869c1ba9624a9880168f27b8112197d0c7fa32411dbf625 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false From 915efa69e030c128065ccd17f8baee2696be75cb Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Sat, 2 Mar 2019 14:14:42 +0100 Subject: [PATCH 15/30] Fix version and add maintainer in manifest --- manifest.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifest.json b/manifest.json index 57bcfde..a02bf1e 100644 --- a/manifest.json +++ b/manifest.json @@ -9,10 +9,10 @@ }, "url": "http://gitea.io", "license": "MIT", - "version": "1.5.2~ynh1", + "version": "1.7.3~ynh1", "maintainer": { - "name": "", - "email": "" + "name": "rafi59", + "email": "rafi59_dev@srvmaison.fr.nf" }, "multi_instance": true, "services": [ From e36fda963d72d29182bfcab97692cda5028310d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 15 Feb 2019 11:33:29 +0100 Subject: [PATCH 16/30] Implement migrations from gogs --- conf/gogs_migrations | 5 + conf/gogs_post_migration.sh | 32 ++++ conf/{ => source}/arm.src | 0 conf/source/arm_1.0.src | 5 + conf/source/arm_1.1.src | 5 + conf/source/arm_1.2.src | 5 + conf/source/arm_1.3.src | 5 + conf/source/arm_1.4.src | 5 + conf/source/arm_1.5.src | 5 + conf/source/arm_1.6.src | 5 + conf/source/armv7.src | 5 + conf/source/armv7_1.0.src | 5 + conf/source/armv7_1.1.src | 5 + conf/source/armv7_1.2.src | 5 + conf/source/armv7_1.3.src | 5 + conf/source/armv7_1.4.src | 5 + conf/source/armv7_1.5.src | 5 + conf/source/armv7_1.6.src | 5 + conf/{ => source}/i386.src | 0 conf/source/i386_1.0.src | 5 + conf/source/i386_1.1.src | 5 + conf/source/i386_1.2.src | 5 + conf/source/i386_1.3.src | 5 + conf/source/i386_1.4.src | 5 + conf/source/i386_1.5.src | 5 + conf/source/i386_1.6.src | 5 + conf/{ => source}/x86-64.src | 0 conf/source/x86-64_1.0.src | 5 + conf/source/x86-64_1.1.src | 5 + conf/source/x86-64_1.2.src | 5 + conf/source/x86-64_1.3.src | 5 + conf/source/x86-64_1.4.src | 5 + conf/source/x86-64_1.5.src | 5 + conf/source/x86-64_1.6.src | 5 + scripts/experimental_helper.sh | 295 +++++++++++++++++++++++++++++++++ scripts/install | 5 +- scripts/upgrade | 144 +++++++++++----- 37 files changed, 584 insertions(+), 42 deletions(-) create mode 100644 conf/gogs_migrations create mode 100644 conf/gogs_post_migration.sh rename conf/{ => source}/arm.src (100%) create mode 100644 conf/source/arm_1.0.src create mode 100644 conf/source/arm_1.1.src create mode 100644 conf/source/arm_1.2.src create mode 100644 conf/source/arm_1.3.src create mode 100644 conf/source/arm_1.4.src create mode 100644 conf/source/arm_1.5.src create mode 100644 conf/source/arm_1.6.src create mode 100644 conf/source/armv7.src create mode 100644 conf/source/armv7_1.0.src create mode 100644 conf/source/armv7_1.1.src create mode 100644 conf/source/armv7_1.2.src create mode 100644 conf/source/armv7_1.3.src create mode 100644 conf/source/armv7_1.4.src create mode 100644 conf/source/armv7_1.5.src create mode 100644 conf/source/armv7_1.6.src rename conf/{ => source}/i386.src (100%) create mode 100644 conf/source/i386_1.0.src create mode 100644 conf/source/i386_1.1.src create mode 100644 conf/source/i386_1.2.src create mode 100644 conf/source/i386_1.3.src create mode 100644 conf/source/i386_1.4.src create mode 100644 conf/source/i386_1.5.src create mode 100644 conf/source/i386_1.6.src rename conf/{ => source}/x86-64.src (100%) create mode 100644 conf/source/x86-64_1.0.src create mode 100644 conf/source/x86-64_1.1.src create mode 100644 conf/source/x86-64_1.2.src create mode 100644 conf/source/x86-64_1.3.src create mode 100644 conf/source/x86-64_1.4.src create mode 100644 conf/source/x86-64_1.5.src create mode 100644 conf/source/x86-64_1.6.src diff --git a/conf/gogs_migrations b/conf/gogs_migrations new file mode 100644 index 0000000..5e7a3c4 --- /dev/null +++ b/conf/gogs_migrations @@ -0,0 +1,5 @@ +/opt/$app +/home/$app +/var/log/$app +/etc/systemd/system/$app.service +/etc/nginx/conf.d/$domain.d/$app.conf diff --git a/conf/gogs_post_migration.sh b/conf/gogs_post_migration.sh new file mode 100644 index 0000000..5d71529 --- /dev/null +++ b/conf/gogs_post_migration.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Ending the migration process from Gogs to Gitea + +set -u + +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source /usr/share/yunohost/helpers + +#================================================= +# SET VARIABLES +#================================================= + +old_app="__OLD_APP__" +new_app="__NEW_APP__" +script_name="$0" + +#================================================= +# DELETE OLD APP'S SETTINGS +#================================================= + +ynh_secure_remove "/etc/yunohost/apps/$old_app" +yunohost app ssowatconf + +#================================================= +# DELETE THIS SCRIPT +#================================================= + +echo "rm $script_name" | at now + 1 minutes diff --git a/conf/arm.src b/conf/source/arm.src similarity index 100% rename from conf/arm.src rename to conf/source/arm.src diff --git a/conf/source/arm_1.0.src b/conf/source/arm_1.0.src new file mode 100644 index 0000000..fe6aee6 --- /dev/null +++ b/conf/source/arm_1.0.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.0.2/gitea-1.0.2-linux-arm-6 +SOURCE_SUM=d8cd551840b4b5620609eba92e810f4963b259d2809a34724e8fae7b1db00d91 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.1.src b/conf/source/arm_1.1.src new file mode 100644 index 0000000..9b8691d --- /dev/null +++ b/conf/source/arm_1.1.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.1.4/gitea-1.1.4-linux-arm-6 +SOURCE_SUM=f39bce7927b363402d37774484a5d0c893ee55595175e3a4d14a12126bccdd80 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.2.src b/conf/source/arm_1.2.src new file mode 100644 index 0000000..6b5755d --- /dev/null +++ b/conf/source/arm_1.2.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.2.3/gitea-1.2.3-linux-arm-6 +SOURCE_SUM=06023c75babee8c9d76cee2886890ae9fe82b84a0e723c11ef9fafe3c5ba9539 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.3.src b/conf/source/arm_1.3.src new file mode 100644 index 0000000..22ad6a9 --- /dev/null +++ b/conf/source/arm_1.3.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-arm-6 +SOURCE_SUM=b1b20d5905cd275b384da2a08d36ed0730801f23fb33df5c45302c9a6ec62dc6 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.4.src b/conf/source/arm_1.4.src new file mode 100644 index 0000000..2b3c5bd --- /dev/null +++ b/conf/source/arm_1.4.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.4.3/gitea-1.4.3-linux-arm-6 +SOURCE_SUM=d7341bd9536dbc7b1c3935efe3b0b6be953b0c3f0390b9b794e8fd54d58fee5b +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.5.src b/conf/source/arm_1.5.src new file mode 100644 index 0000000..51d6bf6 --- /dev/null +++ b/conf/source/arm_1.5.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.5.3/gitea-1.5.3-linux-arm-6 +SOURCE_SUM=6d16b6bcc3cf804cc9b4e0e9ce3aa42e6699662f99998a06c25c7a43df64b0b6 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.6.src b/conf/source/arm_1.6.src new file mode 100644 index 0000000..3b74aca --- /dev/null +++ b/conf/source/arm_1.6.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.4/gitea-1.6.4-linux-arm-6 +SOURCE_SUM=30bb6220cde6b35522bdaf5ffca0d2daba8a0eebee56e3f11cd40d3e5f8f5669 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7.src b/conf/source/armv7.src new file mode 100644 index 0000000..d07338e --- /dev/null +++ b/conf/source/armv7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-7 +SOURCE_SUM=2d8c095de0f0d83da5681aa84b14fb8ee278a5e020787227d88583c8b544da69 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.0.src b/conf/source/armv7_1.0.src new file mode 100644 index 0000000..9d39570 --- /dev/null +++ b/conf/source/armv7_1.0.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.0.2/gitea-1.0.2-linux-arm-7 +SOURCE_SUM=1533c4b9142d89e3ac78ac9650a1f1507d24f9ac7afcdbe73c83ae5517c36165 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.1.src b/conf/source/armv7_1.1.src new file mode 100644 index 0000000..6b83741 --- /dev/null +++ b/conf/source/armv7_1.1.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.1.4/gitea-1.1.4-linux-arm-7 +SOURCE_SUM=3b66cbca2f6ad10c8323c3d35280d63d17e192ab5e4aaa7415f5048710c00705 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.2.src b/conf/source/armv7_1.2.src new file mode 100644 index 0000000..63fe266 --- /dev/null +++ b/conf/source/armv7_1.2.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.2.3/gitea-1.2.3-linux-arm-7 +SOURCE_SUM=92a1a6fccae6d9382dccee90223457850124a8a9e9505401a04f507b8a90c1dd +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.3.src b/conf/source/armv7_1.3.src new file mode 100644 index 0000000..f5dd751 --- /dev/null +++ b/conf/source/armv7_1.3.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-arm-7 +SOURCE_SUM=1f52cbaf97ca70cf6db5c152f6cff7921e9b066ffbe21ee4015616946c9d4251 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.4.src b/conf/source/armv7_1.4.src new file mode 100644 index 0000000..7849e95 --- /dev/null +++ b/conf/source/armv7_1.4.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.4.3/gitea-1.4.3-linux-arm-7 +SOURCE_SUM=2a93d7a09f0f9b999651f156a4c0c65a1d4da0c75a68a13bdd0b920082d514de +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.5.src b/conf/source/armv7_1.5.src new file mode 100644 index 0000000..7d7c476 --- /dev/null +++ b/conf/source/armv7_1.5.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.5.3/gitea-1.5.3-linux-arm-7 +SOURCE_SUM=eb939edb6cdc46702109410f38e358cc572564307e619c4798b6b8b99d6ec7e5 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.6.src b/conf/source/armv7_1.6.src new file mode 100644 index 0000000..100a3b3 --- /dev/null +++ b/conf/source/armv7_1.6.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.4/gitea-1.6.4-linux-arm-7 +SOURCE_SUM=e78d31922e42ccaaf6566f32e249fb6ba4af2876102c6248b3ba32d051e69327 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/i386.src b/conf/source/i386.src similarity index 100% rename from conf/i386.src rename to conf/source/i386.src diff --git a/conf/source/i386_1.0.src b/conf/source/i386_1.0.src new file mode 100644 index 0000000..2ca0757 --- /dev/null +++ b/conf/source/i386_1.0.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.0.2/gitea-1.0.2-linux-386 +SOURCE_SUM=966840c7b815662332c3785a65685bed08c8eab508b8af0fe41307b5ebce8399 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.1.src b/conf/source/i386_1.1.src new file mode 100644 index 0000000..80a2235 --- /dev/null +++ b/conf/source/i386_1.1.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.1.4/gitea-1.1.4-linux-386 +SOURCE_SUM=d3fc91e4da9282abc2785bb96d1d805c85ae0a253228c2277e21fb332946c0fe +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.2.src b/conf/source/i386_1.2.src new file mode 100644 index 0000000..d80179c --- /dev/null +++ b/conf/source/i386_1.2.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.2.3/gitea-1.2.3-linux-386 +SOURCE_SUM=a8593c5e908c7e6c26620d45122d017e38441e915a4ea472543251772dc5a6d9 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.3.src b/conf/source/i386_1.3.src new file mode 100644 index 0000000..aa33a24 --- /dev/null +++ b/conf/source/i386_1.3.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-386 +SOURCE_SUM=1b746cccffca446876ccc71efe328699f002622dab1d438e2142c8d7c23a22d7 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.4.src b/conf/source/i386_1.4.src new file mode 100644 index 0000000..61dd883 --- /dev/null +++ b/conf/source/i386_1.4.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.4.3/gitea-1.4.3-linux-386 +SOURCE_SUM=760dda6f1cd76aa705915686a1d18837af3c4d912f731d1399048409a46ed2ea +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.5.src b/conf/source/i386_1.5.src new file mode 100644 index 0000000..a8b9d00 --- /dev/null +++ b/conf/source/i386_1.5.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.5.3/gitea-1.5.3-linux-386 +SOURCE_SUM=292ef977c46b15650a68782666710bc3379bb4b22a3ae2cae761724569ca5857 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.6.src b/conf/source/i386_1.6.src new file mode 100644 index 0000000..eabb1f5 --- /dev/null +++ b/conf/source/i386_1.6.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.4/gitea-1.6.4-linux-386 +SOURCE_SUM=1ccdca624582fbfb8c2b0a819b63b33e7b05a2d355bb4527cc55a6e367d5765d +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/x86-64.src b/conf/source/x86-64.src similarity index 100% rename from conf/x86-64.src rename to conf/source/x86-64.src diff --git a/conf/source/x86-64_1.0.src b/conf/source/x86-64_1.0.src new file mode 100644 index 0000000..134b97f --- /dev/null +++ b/conf/source/x86-64_1.0.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.0.2/gitea-1.0.2-linux-amd64 +SOURCE_SUM=02ed9a3bb7bcd1c8f3d8888e51a0887b3c0f44b2a80d50c99f9e407e457545ab +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.1.src b/conf/source/x86-64_1.1.src new file mode 100644 index 0000000..00da3ab --- /dev/null +++ b/conf/source/x86-64_1.1.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.1.4/gitea-1.1.4-linux-amd64 +SOURCE_SUM=1d8804ff7bed26464d61115b9d88ead8a7a7937ceed66fd0bfaceecd4be41274 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.2.src b/conf/source/x86-64_1.2.src new file mode 100644 index 0000000..faba5e0 --- /dev/null +++ b/conf/source/x86-64_1.2.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.2.3/gitea-1.2.3-linux-amd64 +SOURCE_SUM=bc71b6005617700c9b5654ddf5649aa9ee28dc2344d84254ddeb2678f4d44809 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.3.src b/conf/source/x86-64_1.3.src new file mode 100644 index 0000000..3cfdf88 --- /dev/null +++ b/conf/source/x86-64_1.3.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.3.3/gitea-1.3.3-linux-amd64 +SOURCE_SUM=4f37b280eb9dcde7820e801e51ca07682faee703c220548da2f8aa9b6adb5231 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.4.src b/conf/source/x86-64_1.4.src new file mode 100644 index 0000000..b493a9e --- /dev/null +++ b/conf/source/x86-64_1.4.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.4.3/gitea-1.4.3-linux-amd64 +SOURCE_SUM=fe60fca294baa24fe4862bbcfe29c92d5a8a883a48aadb80f3a1270cf5de9bd4 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.5.src b/conf/source/x86-64_1.5.src new file mode 100644 index 0000000..9b20d7b --- /dev/null +++ b/conf/source/x86-64_1.5.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.5.3/gitea-1.5.3-linux-amd64 +SOURCE_SUM=f84eb0b77b47d88b16b1de6ca443dab4a77e940835748d309956052887b9c507 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.6.src b/conf/source/x86-64_1.6.src new file mode 100644 index 0000000..8ea4b91 --- /dev/null +++ b/conf/source/x86-64_1.6.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.6.4/gitea-1.6.4-linux-amd64 +SOURCE_SUM=e9508e04688e9840708c341125b47b43a2c12cad52185be4b7b6cf7a2fb8bb71 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index 9e3869c..f7e7f26 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -97,3 +97,298 @@ ynh_clean_check_starting () { kill -s 15 $pid_tail 2>&1 ynh_secure_remove "$templog" 2>&1 } + +# Read the value of a key in a ynh manifest file +# +# usage: ynh_read_manifest manifest key +# | arg: -m, --manifest= - Path of the manifest to read +# | arg: -k, --key= - Name of the key to find +ynh_read_manifest () { + # Declare an array to define the options of this helper. + declare -Ar args_array=( [m]=manifest= [k]=manifest_key= ) + local manifest + local manifest_key + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + if [ ! -e "$manifest" ]; then + # If the manifest isn't found, try the common place for backup and restore script. + manifest="../settings/manifest.json" + fi + + jq ".$manifest_key" "$manifest" --raw-output +} + +# Read the upstream version from the manifest +# The version number in the manifest is defined by ~ynh +# For example : 4.3-2~ynh3 +# This include the number before ~ynh +# In the last example it return 4.3-2 +# +# usage: ynh_app_upstream_version [-m manifest] +# | arg: -m, --manifest= - Path of the manifest to read +ynh_app_upstream_version () { + declare -Ar args_array=( [m]=manifest= ) + local manifest + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + manifest="${manifest:-../manifest.json}" + version_key=$(ynh_read_manifest --manifest="$manifest" --manifest_key="version") + echo "${version_key/~ynh*/}" +} + +# Execute a command as another user +# usage: exec_as USER COMMAND [ARG ...] +exec_as() { + local USER=$1 + shift 1 + + if [[ $USER = $(whoami) ]]; then + eval "$@" + else + sudo -u "$USER" "$@" + fi +} + +# Need also the helper https://github.com/YunoHost-Apps/Experimental_helpers/blob/master/ynh_handle_getopts_args/ynh_handle_getopts_args + +# Make the main steps to migrate an app to its fork. +# +# This helper has to be used for an app which needs to migrate to a new name or a new fork +# (like owncloud to nextcloud or zerobin to privatebin). +# +# This helper will move the files of an app to its new name +# or recreate the things it can't move. +# +# To specify which files it has to move, you have to create a "migration file", stored in ../conf +# This file is a simple list of each file it has to move, +# except that file names must reference the $app variable instead of the real name of the app, +# and every instance-specific variables (like $domain). +# $app is especially important because it's this variable which will be used to identify the old place and the new one for each file. +# +# If a database exists for this app, it will be dumped and then imported in a newly created database, with a new name and new user. +# Don't forget you have to then apply these changes to application-specific settings (depends on the packaged application) +# +# Same things for an existing user, a new one will be created. +# But the old one can't be removed unless it's not used. See below. +# +# If you have some dependencies for your app, it's possible to change the fake debian package which manages them. +# You have to fill the $pkg_dependencies variable, and then a new fake package will be created and installed, +# and the old one will be removed. +# If you don't have a $pkg_dependencies variable, the helper can't know what the app dependencies are. +# +# The app settings.yml will be modified as follows: +# - finalpath will be changed according to the new name (but only if the existing $final_path contains the old app name) +# - The checksums of php-fpm and nginx config files will be updated too. +# - If there is a $db_name value, it will be changed. +# - And, of course, the ID will be changed to the new name too. +# +# Finally, the $app variable will take the value of the new name. +# The helper will set the $migration_process variable to 1 if a migration has been successfully handled. +# +# You have to handle by yourself all the migrations not done by this helper, like configuration or special values in settings.yml +# Also, at the end of the upgrade script, you have to add a post_migration script to handle all the things the helper can't do during YunoHost upgrade (mostly for permission reasons), +# especially remove the old user, move some hooks and remove the old configuration directory +# To launch this script, you have to move it elsewhere and start it after the upgrade script. +# `cp ../conf/$script_post_migration /tmp` +# `(cd /tmp; echo "/tmp/$script_post_migration" | at now + 2 minutes)` +# +# usage: ynh_handle_app_migration migration_id migration_list +# | arg: -i, --migration_id= - ID from which to migrate +# | arg: -l, --migration_list= - File specifying every file to move (one file per line) +ynh_handle_app_migration () { + # Need for end of install + ynh_package_install at + + #================================================= + # LOAD SETTINGS + #================================================= + + old_app=$YNH_APP_INSTANCE_NAME + local old_app_id=$YNH_APP_ID + local old_app_number=$YNH_APP_INSTANCE_NUMBER + + # Declare an array to define the options of this helper. + declare -Ar args_array=( [i]=migration_id= [l]=migration_list= ) + # Get the id from which to migrate + local migration_id + # And the file with the paths to move + local migration_list + # Manage arguments with getopts + ynh_handle_getopts_args "$@" + + # Get the new app id in the manifest + local new_app_id=$(grep \"id\": ../manifest.json | cut -d\" -f4) + if [ $old_app_number -eq 1 ]; then + local new_app=$new_app_id + else + local new_app=${new_app_id}__${old_app_number} + fi + + #================================================= + # CHECK IF IT HAS TO MIGRATE + #================================================= + + migration_process=0 + + if [ "$old_app_id" == "$new_app_id" ] + then + # If the 2 id are the same + # No migration to do. + echo 0 + return 0 + else + if [ "$old_app_id" != "$migration_id" ] + then + # If the new app is not the authorized id, fail. + ynh_die "Incompatible application for migration from $old_app_id to $new_app_id" + fi + + echo "Migrate from $old_app_id to $new_app_id" >&2 + + #================================================= + # CHECK IF THE MIGRATION CAN BE DONE + #================================================= + + # TODO Handle multi instance apps... + # Check that there is not already an app installed for this id. + (yunohost app list --installed -f "$new_app" | grep -q id) \ + && ynh_die "$new_app is already installed" + + #================================================= + # CHECK THE LIST OF FILES TO MOVE + #================================================= + + local temp_migration_list="$(tempfile)" + + # Build the list by removing blank lines and comment lines + sed '/^#.*\|^$/d' "../conf/$migration_list" > "$temp_migration_list" + + # Check if there is no file in the destination + local file_to_move="" + while read file_to_move + do + # Replace all occurences of $app by $new_app in each file to move. + local move_to_destination="${file_to_move//\$app/$new_app}" + test -e "$move_to_destination" && ynh_die "A file named $move_to_destination already exists." + done < "$temp_migration_list" + + #================================================= + # COPY YUNOHOST SETTINGS FOR THIS APP + #================================================= + + local settings_dir="/etc/yunohost/apps" + cp -a "$settings_dir/$old_app" "$settings_dir/$new_app" + + # Replace the old id by the new one + ynh_replace_string "\(^id: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" + # INFO: There a special behavior with yunohost app setting: + # if the id given in argument does not match with the id + # stored in the config file, the config file will be purged. + # That's why we use sed instead of app setting here. + # https://github.com/YunoHost/yunohost/blob/c6b5284be8da39cf2da4e1036a730eb5e0515096/src/yunohost/app.py#L1316-L1321 + + # Change the label if it's simply the name of the app + old_label=$(ynh_app_setting_get $new_app label) + if [ "${old_label,,}" == "$old_app_id" ] + then + # Build the new label from the id of the app. With the first character as upper case + new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-) + ynh_app_setting_set $new_app label $new_label + fi + + #================================================= + # MOVE FILES TO THE NEW DESTINATION + #================================================= + + while read file_to_move + do + # Replace all occurence of $app by $new_app in each file to move. + move_to_destination="$(eval echo "${file_to_move//\$app/$new_app}")" + local real_file_to_move="$(eval echo "${file_to_move//\$app/$old_app}")" + echo "Move file $real_file_to_move to $move_to_destination" >&2 + mv "$real_file_to_move" "$move_to_destination" + done < "$temp_migration_list" + + #================================================= + # UPDATE SETTINGS KNOWN ENTRIES + #================================================= + + # Replace nginx checksum + ynh_replace_string "\(^checksum__etc_nginx.*\)_$old_app" "\1_$new_app/" "$settings_dir/$new_app/settings.yml" + + # Replace php5-fpm checksums + ynh_replace_string "\(^checksum__etc_php5.*[-_]\)$old_app" "\1$new_app/" "$settings_dir/$new_app/settings.yml" + + # Replace final_path + ynh_replace_string "\(^final_path: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" + + #================================================= + # MOVE THE DATABASE + #================================================= + + db_pwd=$(ynh_app_setting_get $old_app mysqlpwd) + db_name=$dbname + + # Check if a database exists before trying to move it + local mysql_root_password=$(cat $MYSQL_ROOT_PWD_FILE) + if [ -n "$db_name" ] && mysqlshow -u root -p$mysql_root_password | grep -q "^| $db_name" + then + new_db_name=$(ynh_sanitize_dbid $new_app) + echo "Rename the database $db_name to $new_db_name" >&2 + + local sql_dump="/tmp/${db_name}-$(date '+%s').sql" + + # Dump the old database + ynh_mysql_dump_db "$db_name" > "$sql_dump" + + # Create a new database + ynh_mysql_setup_db $new_db_name $new_db_name $db_pwd + # Then restore the old one into the new one + ynh_mysql_connect_as $new_db_name $db_pwd $new_db_name < "$sql_dump" + + # Remove the old database + ynh_mysql_remove_db $db_name $db_name + # And the dump + ynh_secure_remove "$sql_dump" + + # Update the value of $db_name + db_name=$new_db_name + ynh_app_setting_set $new_app db_name $db_name + fi + + #================================================= + # CHANGE THE FAKE DEPENDENCIES PACKAGE + #================================================= + + # Check if a variable $pkg_dependencies exists + # If this variable doesn't exist, this part shall be managed in the upgrade script. + if [ -n "${pkg_dependencies:-}" ] + then + # Define the name of the package + local old_package_name="${old_app//_/-}-ynh-deps" + local new_package_name="${new_app//_/-}-ynh-deps" + + if ynh_package_is_installed "$old_package_name" + then + # Install a new fake package + app=$new_app + ynh_install_app_dependencies $pkg_dependencies + # Then remove the old one + app=$old_app + ynh_remove_app_dependencies + fi + fi + + #================================================= + # UPDATE THE ID OF THE APP + #================================================= + + app=$new_app + + + # Set migration_process to 1 to inform that an upgrade has been made + migration_process=1 + fi +} diff --git a/scripts/install b/scripts/install index a31fd41..40deb45 100644 --- a/scripts/install +++ b/scripts/install @@ -80,7 +80,7 @@ config_nginx config_gitea # Install gitea -ynh_setup_source $final_path $architecture +ynh_setup_source $final_path source/$architecture # Set permissions set_permission @@ -112,6 +112,9 @@ yunohost service add "$app" --log "/var/log/$app/$app.log" # Configure logrotate ynh_use_logrotate "/var/log/$app" +# Save Version +ynh_app_setting_set $app upstream_version $(ynh_app_upstream_version) + # Reload services ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" sleep 1 diff --git a/scripts/upgrade b/scripts/upgrade index ed849fc..0faa002 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ admin=$(ynh_app_setting_get "$app" adminusername) key=$(ynh_app_setting_get "$app" secret_key) is_public=$(ynh_app_setting_get "$app" is_public) port=$(ynh_app_setting_get "$app" web_port) +upstream_version=$(ynh_app_setting_get $app upstream_version) # Backup the current version of the app ynh_backup_before_upgrade @@ -33,51 +34,39 @@ ynh_clean_setup () { systemctl stop "$app".service #================================================= -# MIGRATION FROM OLD VERSION +# MIGRATION FROM GOGS #================================================= -# Update settings is_public to new standard -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set $app is_public 1 # Fixe is_public en booléen - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set $app is_public 0 - is_public=0 -fi +[[ $YNH_APP_ID == "gogs" ]] \ + && [[ "$(cat "/opt/$app/templates/.VERSION")" != 0.11.79.1211 ]] \ + && ynh_die "It look like that you have an old gogs install. You need first upgrade gogs instance (id : $gogs_migrate_id) and after migrate to gitea." +ynh_handle_app_migration gogs gogs_migrations -if [[ $port == "" ]] -then - port=$(ynh_find_port 6000) - ynh_app_setting_set $app web_port $port -fi +if [[ $migration_process -eq 1 ]]; then + # Replace the user + ynh_system_user_delete $old_app + test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" -# handle upgrade from old package installation -# this test that /etc/gitea exist since this was used in the old package -# but not in the new -# this code will be removed in the future -if [ -d "/etc/gitea" ] -then - # create needed directories if not already created - create_dir + # Reload variables + dbname=$app + dbuser=$app + final_path="/opt/$app" + DATADIR="/home/$app" + REPO_PATH="$DATADIR/repositories" + DATA_PATH="$DATADIR/data" - # move repositories to new dir - old_repo_path=$(ynh_app_setting_get "$app" repopath) - mv "${old_repo_path:-/home/yunohost.app/gitea}"/* "$REPO_PATH" || true # Avoid if the directory is empty - # cleanup old dir and conf - ynh_secure_remove /opt/gitea - ynh_secure_remove /etc/gitea - ynh_secure_remove /opt/gitea_src + # Clean old binary + ynh_secure_remove $final_path/gogs + ynh_secure_remove $final_path/custom/conf/auth.d - # create needed directories if not already created - create_dir -fi -# end of old package upgrade + # Restore authentication from SQL database + ynh_replace_string "__ADMIN__" "$admin" ../conf/login_source.sql + ynh_replace_string "__APP__" "$app" ../conf/login_source.sql + ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql -# test if user gitea is locked because of an old installation of the package. -# if it's blocked, unlock it to allow ssh usage with git -if [[ $(grep "$app" /etc/shadow | cut -d: -f2) == '!' ]] -then - usermod -p '*' "$app" + upstream_version="0.0.1" fi #================================================= @@ -87,9 +76,6 @@ fi # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 ynh_secure_remove "/opt/$app/templates" -# Install gitea -ynh_setup_source $final_path $architecture - # Configure gitea with app.ini file config_gitea @@ -99,6 +85,59 @@ ynh_add_systemd_config # Modify Nginx configuration file and copy it to Nginx conf directory config_nginx +#================================================= +# DB migration +#================================================= + +# Support for the time when the upstream_version was not updated +upstream_version=${upstream_version:-1.7} + +restart_gitea() { + # Set permissions + set_permission + ynh_systemd_action -l "Serving \[::\]:$port with pid" -p "systemd" + # Leave the time to update the database schema + sleep 5 + systemctl stop $app +} + +case $upstream_version in +"0.0.1" ) + ynh_setup_source $final_path source/${architecture}_1.0 + set_permission + systemctl start $app + sleep 20 + systemctl stop $app +;& +"1.0."* ) + ynh_setup_source $final_path source/${architecture}_1.1 + restart_gitea +;& +"1.1."* ) + ynh_setup_source $final_path source/${architecture}_1.2 + restart_gitea +;& +"1.2."* ) + ynh_setup_source $final_path source/${architecture}_1.3 + restart_gitea +;& +"1.3."* ) + ynh_setup_source $final_path source/${architecture}_1.4 + restart_gitea +;& +"1.4."* ) + ynh_setup_source $final_path source/${architecture}_1.5 + restart_gitea +;& +"1.5."* ) + ynh_setup_source $final_path source/${architecture}_1.6 + restart_gitea +;& +esac + +# Install gitea +ynh_setup_source $final_path source/$architecture + #================================================= # GENERIC FINALIZATION #================================================= @@ -106,6 +145,9 @@ config_nginx # Set permissions set_permission +# Save Version +ynh_app_setting_set $app upstream_version $(ynh_app_upstream_version) + # Unprotect root from SSO if public set_access_settings @@ -116,3 +158,23 @@ sleep 1 # Store the checksum with the 'INTERNAL_TOKEN' value. # Should be removed when the issue https://github.com/go-gitea/gitea/issues/3246 is fixed ynh_store_file_checksum "$final_path/custom/conf/app.ini" + +#================================================= +# FINISH MIGRATION PROCESS +#================================================= + +if [[ $migration_process -eq 1 ]]; then + echo "gogs has been successfully migrated to Gitea! \ +A last scheduled operation will run in a couple of minutes to finish the \ +migration in YunoHost side. Do not proceed any application operation while \ +you don't see Gogs as installed." >&2 + + # Execute a post migration script after the end of this upgrade. + # Mainly for some cleaning + script_post_migration=gogs_post_migration.sh + ynh_replace_string "__OLD_APP__" "$old_app" ../conf/$script_post_migration + ynh_replace_string "__NEW_APP__" "$app" ../conf/$script_post_migration + cp ../conf/$script_post_migration /tmp + chmod +x /tmp/$script_post_migration + (cd /tmp; echo "/tmp/$script_post_migration > /tmp/$script_post_migration.log 2>&1" | at now + 2 minutes) +fi From 6bf9db4c361123bba6ac08e5d112610d5a34b84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 17 Feb 2019 00:53:17 +0100 Subject: [PATCH 17/30] Update check_process for check upgrade from old version --- check_process | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 0e7e4b7..80e9493 100644 --- a/check_process +++ b/check_process @@ -28,4 +28,7 @@ Level 7=auto Level 8=0 Level 9=0 - Level 10=0 \ No newline at end of file + Level 10=0 +;;; Upgrade options + ; commit=bf663ad8695a64dba7c45aa518aec048cb2f2b2e + name=First package version From 0631a0d13f13fe71d4c8f34f96f827f54e3b964f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 28 Feb 2019 15:06:37 +0100 Subject: [PATCH 18/30] Update checkprocess to check the migration --- check_process | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 80e9493..500f843 100644 --- a/check_process +++ b/check_process @@ -12,6 +12,8 @@ setup_private=1 setup_public=1 upgrade=1 + upgrade=1 from_commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099 + upgrade=1 from_commit=4e078e91129725c8b09ba551ab2a04e0328a45b3 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -30,5 +32,7 @@ Level 9=0 Level 10=0 ;;; Upgrade options - ; commit=bf663ad8695a64dba7c45aa518aec048cb2f2b2e + ; commit=349992d4f3921e4e1adb37a0cace4a5a9eb67099 name=First package version + ; commit=4e078e91129725c8b09ba551ab2a04e0328a45b3 + name=Gogs code, check migration from gogs From c30e33a61229f53851cd49341502130ff5e4402c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 1 Mar 2019 23:29:52 +0100 Subject: [PATCH 19/30] Restore all scripts from old settings --- scripts/experimental_helper.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/experimental_helper.sh b/scripts/experimental_helper.sh index f7e7f26..6ce0371 100644 --- a/scripts/experimental_helper.sh +++ b/scripts/experimental_helper.sh @@ -280,6 +280,7 @@ ynh_handle_app_migration () { local settings_dir="/etc/yunohost/apps" cp -a "$settings_dir/$old_app" "$settings_dir/$new_app" + cp -a ../{scripts,conf} "$settings_dir/$new_app" # Replace the old id by the new one ynh_replace_string "\(^id: .*\)$old_app" "\1$new_app" "$settings_dir/$new_app/settings.yml" From 53e99747b04a7c50eb83b3da82c184ab80402be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 1 Mar 2019 23:38:18 +0100 Subject: [PATCH 20/30] Fix upstream version --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 57bcfde..5d8de60 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ }, "url": "http://gitea.io", "license": "MIT", - "version": "1.5.2~ynh1", + "version": "1.7.3~ynh1", "maintainer": { "name": "", "email": "" From e5906e7ab4e3c748cfb0d26dbabfc0ff9c0cd4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 1 Mar 2019 23:39:34 +0100 Subject: [PATCH 21/30] Remove old source file --- conf/armv7.src | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 conf/armv7.src diff --git a/conf/armv7.src b/conf/armv7.src deleted file mode 100644 index 5eb2360..0000000 --- a/conf/armv7.src +++ /dev/null @@ -1,5 +0,0 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-7 -SOURCE_SUM=fd4ba028a30eb2fac1f8570fd3f6157f0c46c21992a2062dd7a6751cc8a47f2f -SOURCE_SUM_PRG=sha256sum -SOURCE_FILENAME=gitea -SOURCE_EXTRACT=false From f1da5932782870a78e2babafb0608a2a245dd517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 2 Mar 2019 00:00:55 +0100 Subject: [PATCH 22/30] Reload variable before create user --- scripts/upgrade | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0faa002..5d2a156 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,11 +43,6 @@ systemctl stop "$app".service ynh_handle_app_migration gogs gogs_migrations if [[ $migration_process -eq 1 ]]; then - # Replace the user - ynh_system_user_delete $old_app - test getent passwd "$app" &>/dev/null || \ - useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ - ynh_die "Unable to create $app system account" # Reload variables dbname=$app @@ -57,6 +52,12 @@ if [[ $migration_process -eq 1 ]]; then REPO_PATH="$DATADIR/repositories" DATA_PATH="$DATADIR/data" + # Replace the user + ynh_system_user_delete $old_app + test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" + # Clean old binary ynh_secure_remove $final_path/gogs ynh_secure_remove $final_path/custom/conf/auth.d From 84725a3bc0588a4c5c4762b47d5b2b47f6c0199c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 2 Mar 2019 00:16:46 +0100 Subject: [PATCH 23/30] Fix hook --- scripts/upgrade | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5d2a156..72ff9c9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -43,7 +43,6 @@ systemctl stop "$app".service ynh_handle_app_migration gogs gogs_migrations if [[ $migration_process -eq 1 ]]; then - # Reload variables dbname=$app dbuser=$app @@ -67,6 +66,16 @@ if [[ $migration_process -eq 1 ]]; then ynh_replace_string "__APP__" "$app" ../conf/login_source.sql ynh_mysql_connect_as "$dbuser" "$dbpass" "$dbname" < ../conf/login_source.sql + # Fix hooks + if [[ -e $REPO_PATH ]];then + ls $REPO_PATH/*/*.git/hooks/pre-receive | while read p; do + ynh_secure_remove $p + done + ls $REPO_PATH/*/*.git/hooks/post-receive | while read p; do + ynh_secure_remove $p + done + fi + upstream_version="0.0.1" fi From 7afcb9ebe93f0ad55e5c681787107537ac817446 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 2 Mar 2019 20:31:38 +0100 Subject: [PATCH 24/30] Fix source armv7 --- conf/source/armv7.src | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/source/armv7.src b/conf/source/armv7.src index d07338e..5eb2360 100644 --- a/conf/source/armv7.src +++ b/conf/source/armv7.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.0/gitea-1.7.0-linux-arm-7 -SOURCE_SUM=2d8c095de0f0d83da5681aa84b14fb8ee278a5e020787227d88583c8b544da69 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-7 +SOURCE_SUM=fd4ba028a30eb2fac1f8570fd3f6157f0c46c21992a2062dd7a6751cc8a47f2f SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false From d268cd00346f64241b794bf96c2df06f7a97b1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 5 May 2019 12:02:02 +0200 Subject: [PATCH 25/30] Upgrade to gitea 1.8.0 --- conf/source/arm.src | 4 ++-- conf/source/arm_1.7.src | 5 +++++ conf/source/armv7.src | 4 ++-- conf/source/armv7_1.7.src | 5 +++++ conf/source/i386.src | 4 ++-- conf/source/i386_1.7.src | 5 +++++ conf/source/x86-64.src | 4 ++-- conf/source/x86-64_1.7.src | 5 +++++ manifest.json | 2 +- scripts/upgrade | 4 ++++ 10 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 conf/source/arm_1.7.src create mode 100644 conf/source/armv7_1.7.src create mode 100644 conf/source/i386_1.7.src create mode 100644 conf/source/x86-64_1.7.src diff --git a/conf/source/arm.src b/conf/source/arm.src index 8f37252..c542419 100644 --- a/conf/source/arm.src +++ b/conf/source/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-6 -SOURCE_SUM=c38394be40634b0e1bd0fac0898474ff50e4535af610c12ee16ec3cabd2d4771 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-arm-6 +SOURCE_SUM=46922ec7b9f4d87cd7ac3546fb2b152d211a79042446838b3c4f0796b3fc0a02 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/arm_1.7.src b/conf/source/arm_1.7.src new file mode 100644 index 0000000..8f37252 --- /dev/null +++ b/conf/source/arm_1.7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-6 +SOURCE_SUM=c38394be40634b0e1bd0fac0898474ff50e4535af610c12ee16ec3cabd2d4771 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/armv7.src b/conf/source/armv7.src index 5eb2360..874ebe1 100644 --- a/conf/source/armv7.src +++ b/conf/source/armv7.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-7 -SOURCE_SUM=fd4ba028a30eb2fac1f8570fd3f6157f0c46c21992a2062dd7a6751cc8a47f2f +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-arm-7 +SOURCE_SUM=134eb209071cb9fa2ddc7b58d343f5af5ddc9e718f6567e25bc4fdebd2d98dc0 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/armv7_1.7.src b/conf/source/armv7_1.7.src new file mode 100644 index 0000000..5eb2360 --- /dev/null +++ b/conf/source/armv7_1.7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-arm-7 +SOURCE_SUM=fd4ba028a30eb2fac1f8570fd3f6157f0c46c21992a2062dd7a6751cc8a47f2f +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/i386.src b/conf/source/i386.src index 2fcf64e..7569b54 100644 --- a/conf/source/i386.src +++ b/conf/source/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-386 -SOURCE_SUM=a420bccb17e6e1c317c014475ce5a5bf8091da123cc55b0569660ae43ababf44 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-386 +SOURCE_SUM=bc10af5cadd945c1d3a83dd5d3292f19337020e3bd6e04ad9882d1c190cc964c SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/i386_1.7.src b/conf/source/i386_1.7.src new file mode 100644 index 0000000..2fcf64e --- /dev/null +++ b/conf/source/i386_1.7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-386 +SOURCE_SUM=a420bccb17e6e1c317c014475ce5a5bf8091da123cc55b0569660ae43ababf44 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/conf/source/x86-64.src b/conf/source/x86-64.src index ce97cc3..c64c23e 100644 --- a/conf/source/x86-64.src +++ b/conf/source/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-amd64 -SOURCE_SUM=49b733a3272dc49cb869c1ba9624a9880168f27b8112197d0c7fa32411dbf625 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-amd64 +SOURCE_SUM=917497fd7ac3bd3d1c953cf11a117ccb0d7bcadb86243d3bc031fb4c9253c7ff SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/x86-64_1.7.src b/conf/source/x86-64_1.7.src new file mode 100644 index 0000000..ce97cc3 --- /dev/null +++ b/conf/source/x86-64_1.7.src @@ -0,0 +1,5 @@ +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.7.3/gitea-1.7.3-linux-amd64 +SOURCE_SUM=49b733a3272dc49cb869c1ba9624a9880168f27b8112197d0c7fa32411dbf625 +SOURCE_SUM_PRG=sha256sum +SOURCE_FILENAME=gitea +SOURCE_EXTRACT=false diff --git a/manifest.json b/manifest.json index a02bf1e..37df4e4 100644 --- a/manifest.json +++ b/manifest.json @@ -9,7 +9,7 @@ }, "url": "http://gitea.io", "license": "MIT", - "version": "1.7.3~ynh1", + "version": "1.8.0~ynh1", "maintainer": { "name": "rafi59", "email": "rafi59_dev@srvmaison.fr.nf" diff --git a/scripts/upgrade b/scripts/upgrade index 72ff9c9..a96d874 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -143,6 +143,10 @@ case $upstream_version in ynh_setup_source $final_path source/${architecture}_1.6 restart_gitea ;& +"1.6."* ) + ynh_setup_source $final_path source/${architecture}_1.7 + restart_gitea +;& esac # Install gitea From 7673931ef886f95ca5ea79268ef1f0732071bd67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 7 May 2019 10:56:04 +0200 Subject: [PATCH 26/30] Manage version upgrade when gitea install is < 1.7 --- scripts/upgrade | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a96d874..127e9bd 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,8 +99,16 @@ config_nginx # DB migration #================================================= -# Support for the time when the upstream_version was not updated -upstream_version=${upstream_version:-1.7} +# Before the version 1.7 the upstream version was not stored +# The way to find the version for the install < 1.7 is to parse the binary file to find which version is installed +if [ -z ${upstream_version:-} ]; then + for version in "0.0." "1.0." "1.1." "1.2." "1.3." "1.4." "1.5." "1.6." "1.7."; do + if strings $final_path/gitea | grep -P "^${version//./\\.}\d"; then + upstream_version="${version}0" + break + fi + done +fi restart_gitea() { # Set permissions @@ -112,7 +120,7 @@ restart_gitea() { } case $upstream_version in -"0.0.1" ) +"0.0."* ) ynh_setup_source $final_path source/${architecture}_1.0 set_permission systemctl start $app From 33dc90b06fa89b2fb64c7b88e72db8f5b18b90ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 13 May 2019 15:49:34 +0200 Subject: [PATCH 27/30] Upgrade to gitea 1.8.1 and use temporary armv6 build for armv7 --- conf/source/arm.src | 4 ++-- conf/source/armv7.src | 5 ++++- conf/source/i386.src | 4 ++-- conf/source/x86-64.src | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/conf/source/arm.src b/conf/source/arm.src index c542419..6187fd0 100644 --- a/conf/source/arm.src +++ b/conf/source/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-arm-6 -SOURCE_SUM=46922ec7b9f4d87cd7ac3546fb2b152d211a79042446838b3c4f0796b3fc0a02 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-arm-6 +SOURCE_SUM=c4996c2f413945bb131e7096751838ef49c5e9e40ce33b280f45ecd13e895274 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/armv7.src b/conf/source/armv7.src index 874ebe1..72f33b6 100644 --- a/conf/source/armv7.src +++ b/conf/source/armv7.src @@ -1,4 +1,7 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-arm-7 +# The armv7 build is brocken +# See : https://github.com/go-gitea/gitea/issues/6700 +# Use temporary the armv6 binary +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-arm-6 SOURCE_SUM=134eb209071cb9fa2ddc7b58d343f5af5ddc9e718f6567e25bc4fdebd2d98dc0 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea diff --git a/conf/source/i386.src b/conf/source/i386.src index 7569b54..285cfe6 100644 --- a/conf/source/i386.src +++ b/conf/source/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-386 -SOURCE_SUM=bc10af5cadd945c1d3a83dd5d3292f19337020e3bd6e04ad9882d1c190cc964c +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-386 +SOURCE_SUM=6fad1b9eede60e270d845ad962b61520af1673e7f7c6a1422c29e32947019409 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/x86-64.src b/conf/source/x86-64.src index c64c23e..2d54d0b 100644 --- a/conf/source/x86-64.src +++ b/conf/source/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.0/gitea-1.8.0-linux-amd64 -SOURCE_SUM=917497fd7ac3bd3d1c953cf11a117ccb0d7bcadb86243d3bc031fb4c9253c7ff +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-amd64 +SOURCE_SUM=cc985b7947cdd50cb47a68bbb51e3a8519d0d2710a9696255928ae9912dca598 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false From 6dd0a6d7c4bef365785cc7349d73e52e06c89386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Mon, 13 May 2019 16:23:42 +0200 Subject: [PATCH 28/30] Fix armv7 checksum --- conf/source/armv7.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/source/armv7.src b/conf/source/armv7.src index 72f33b6..2fe7b3b 100644 --- a/conf/source/armv7.src +++ b/conf/source/armv7.src @@ -2,7 +2,7 @@ # See : https://github.com/go-gitea/gitea/issues/6700 # Use temporary the armv6 binary SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-arm-6 -SOURCE_SUM=134eb209071cb9fa2ddc7b58d343f5af5ddc9e718f6567e25bc4fdebd2d98dc0 +SOURCE_SUM=c4996c2f413945bb131e7096751838ef49c5e9e40ce33b280f45ecd13e895274 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false From 9c7545471651aeb9c2dd0777e012f04bfcdeabc9 Mon Sep 17 00:00:00 2001 From: Kcchouette Date: Fri, 17 May 2019 23:27:23 +0200 Subject: [PATCH 29/30] Update upgrade command --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 701726f..3fd26ba 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ From the command-line: ## Upgrade From the command-line: -`sudo yunohost app upgrade Gitea -u https://framagit.org/YunoHost-Apps/gitea_ynh gitea` +`sudo yunohost app upgrade gitea -u https://framagit.org/YunoHost-Apps/gitea_ynh` ## Notes on SSH usage If you want to use Gitea with ssh and be able to pull/push with you ssh key, your ssh daemon must be properly configured to use private/public keys. Here is a sample configuration of `/etc/ssh/sshd_config` that works with Gitea: @@ -52,4 +52,4 @@ Any issue is welcome here : https://framagit.org/YunoHost-Apps/gitea_ynh/issues Gitea is published under the MIT License: https://github.com/go-gitea/gitea/blob/master/LICENSE -This package is published under the MIT License. +This package is published under the MIT License. \ No newline at end of file From e678aa521ac511b30f6f2df429ff3290a1c6aa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 29 May 2019 22:17:29 +0200 Subject: [PATCH 30/30] Update to gitea v1.8.2 --- conf/source/arm.src | 4 ++-- conf/source/armv7.src | 4 ++-- conf/source/i386.src | 4 ++-- conf/source/x86-64.src | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/source/arm.src b/conf/source/arm.src index 6187fd0..9d17643 100644 --- a/conf/source/arm.src +++ b/conf/source/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-arm-6 -SOURCE_SUM=c4996c2f413945bb131e7096751838ef49c5e9e40ce33b280f45ecd13e895274 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.2/gitea-1.8.2-linux-arm-6 +SOURCE_SUM=38ab6c0ac42e87370238c2482432420ff509b5a03d964712a984d4d603bb4c97 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/armv7.src b/conf/source/armv7.src index 2fe7b3b..faf17e7 100644 --- a/conf/source/armv7.src +++ b/conf/source/armv7.src @@ -1,8 +1,8 @@ # The armv7 build is brocken # See : https://github.com/go-gitea/gitea/issues/6700 # Use temporary the armv6 binary -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-arm-6 -SOURCE_SUM=c4996c2f413945bb131e7096751838ef49c5e9e40ce33b280f45ecd13e895274 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.2/gitea-1.8.2-linux-arm-6 +SOURCE_SUM=38ab6c0ac42e87370238c2482432420ff509b5a03d964712a984d4d603bb4c97 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/i386.src b/conf/source/i386.src index 285cfe6..fa9a6e6 100644 --- a/conf/source/i386.src +++ b/conf/source/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-386 -SOURCE_SUM=6fad1b9eede60e270d845ad962b61520af1673e7f7c6a1422c29e32947019409 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.2/gitea-1.8.2-linux-386 +SOURCE_SUM=762ab39855958f61165a1332a34d2a227f527acdc3bf60aa91c5a3e4e4e906ce SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false diff --git a/conf/source/x86-64.src b/conf/source/x86-64.src index 2d54d0b..329b91f 100644 --- a/conf/source/x86-64.src +++ b/conf/source/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.1/gitea-1.8.1-linux-amd64 -SOURCE_SUM=cc985b7947cdd50cb47a68bbb51e3a8519d0d2710a9696255928ae9912dca598 +SOURCE_URL=https://github.com/go-gitea/gitea/releases/download/v1.8.2/gitea-1.8.2-linux-amd64 +SOURCE_SUM=a843f2fe526b62ad1e698b80f6193d8c42a3920b35542de014af44d1eb998141 SOURCE_SUM_PRG=sha256sum SOURCE_FILENAME=gitea SOURCE_EXTRACT=false