From 64ee8dee3d3602fed4eff2394f0206f51d6e313e Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 18:12:08 +0200 Subject: [PATCH 1/8] Rebase CI to alpine --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 89c43d7..3e001c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,7 @@ -image: python:3.5-jessie +image: python:3.5-alpine test: script: - - apt-get update - - apt-get install git + - apk update + - apk add git - git clone https://github.com/YunoHost/package_linter - - python package_linter/package_linter.py . \ No newline at end of file + - python package_linter/package_linter.py . From b17dddcc715875d3d093ff12b4ed0b13d5baddb5 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 18:19:00 +0200 Subject: [PATCH 2/8] Add binary support to setup_source --- scripts/_common.sh | 128 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 0e4e28c..d206fb1 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -79,3 +79,131 @@ set_permission() { chmod u=rwX,g=rX,o= "/home/$app" chmod u=rwX,g=rX,o= "/var/log/$app" } + +# Download, check integrity, uncompress and patch the source from app.src +# +# The file conf/app.src need to contains: +# +# SOURCE_URL=Address to download the app archive +# SOURCE_SUM=Control sum +# # (Optional) Program to check the integrity (sha256sum, md5sum...) +# # default: sha256 +# SOURCE_SUM_PRG=sha256 +# # (Optional) Archive format +# # default: tar.gz +# SOURCE_FORMAT=tar.gz +# # (Optional) Put false if sources are directly in the archive root +# # default: true +# SOURCE_IN_SUBDIR=false +# # (Optionnal) Name of the local archive (offline setup support) +# # default: ${src_id}.${src_format} +# SOURCE_FILENAME=example.tar.gz +# # (Optional) If it set as false don't extract the source. +# # (Useful to get a debian package or a python wheel.) +# # default: true +# SOURCE_EXTRACT=(true|false) +# +# Details: +# This helper downloads sources from SOURCE_URL if there is no local source +# archive in /opt/yunohost-apps-src/APP_ID/SOURCE_FILENAME +# +# Next, it checks the integrity with "SOURCE_SUM_PRG -c --status" command. +# +# If it's ok, the source archive will be uncompressed in $dest_dir. If the +# SOURCE_IN_SUBDIR is true, the first level directory of the archive will be +# removed. +# +# Finally, patches named sources/patches/${src_id}-*.patch and extra files in +# sources/extra_files/$src_id will be applied to dest_dir +# +# +# usage: ynh_setup_source dest_dir [source_id] +# | arg: dest_dir - Directory where to setup sources +# | arg: source_id - Name of the app, if the package contains more than one app +ynh_setup_source () { + local dest_dir=$1 + local src_id=${2:-app} # If the argument is not given, source_id equals "app" + + # Load value from configuration file (see above for a small doc about this file + # format) + local src_url=$(grep 'SOURCE_URL=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_sum=$(grep 'SOURCE_SUM=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_sumprg=$(grep 'SOURCE_SUM_PRG=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_format=$(grep 'SOURCE_FORMAT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_extract=$(grep 'SOURCE_EXTRACT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_in_subdir=$(grep 'SOURCE_IN_SUBDIR=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_filename=$(grep 'SOURCE_FILENAME=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + + # Default value + src_sumprg=${src_sumprg:-sha256sum} + src_in_subdir=${src_in_subdir:-true} + src_format=${src_format:-tar.gz} + src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]') + src_extract=${src_extract:-true} + if [ "$src_filename" = "" ] ; then + src_filename="${src_id}.${src_format}" + fi + local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}" + + if test -e "$local_src" + then # Use the local source file if it is present + cp $local_src $src_filename + else # If not, download the source + wget -nv -O $src_filename $src_url + fi + + # Check the control sum + echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \ + || ynh_die "Corrupt source" + + # Extract source into the app dir + mkdir -p "$dest_dir" + + if ! "$src_extract" + then + mv $src_filename $dest_dir + elif [ "$src_format" = "zip" ] + then + # Zip format + # Using of a temp directory, because unzip doesn't manage --strip-components + if $src_in_subdir ; then + local tmp_dir=$(mktemp -d) + unzip -quo $src_filename -d "$tmp_dir" + cp -a $tmp_dir/*/. "$dest_dir" + ynh_secure_remove "$tmp_dir" + else + unzip -quo $src_filename -d "$dest_dir" + fi + else + local strip="" + if $src_in_subdir ; then + strip="--strip-components 1" + fi + if [[ "$src_format" =~ ^tar.gz|tar.bz2|tar.xz$ ]] ; then + tar -xf $src_filename -C "$dest_dir" $strip + fi + if [[ "$src_format" = "bin" ]] ; then + chmod +x $src_filename + else + ynh_die "Archive format unrecognized." + fi + fi + + # Apply patches + if (( $(find $YNH_CWD/../sources/patches/ -type f -name "${src_id}-*.patch" 2> /dev/null | wc -l) > "0" )); then + local old_dir=$(pwd) + (cd "$dest_dir" \ + && for p in $YNH_CWD/../sources/patches/${src_id}-*.patch; do \ + patch -p1 < $p; done) \ + || ynh_die "Unable to apply patches" + cd $old_dir + fi + + # Add supplementary files + if test -e "$YNH_CWD/../sources/extra_files/${src_id}"; then + cp -a $YNH_CWD/../sources/extra_files/$src_id/. "$dest_dir" + fi +} + + + From 5442a33a0715ec8f79cd77291caa52b66052f71e Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 18:48:19 +0200 Subject: [PATCH 3/8] [fix] https://framagit.org/YunoHost-Apps/gitea_ynh/issues/15 --- conf/app.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/app.ini b/conf/app.ini index 93e2d2c..96503e7 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -33,8 +33,8 @@ ENABLE_NOTIFY_MAIL = true DISABLE_REGISTRATION = true ENABLE_CAPTCHA = false REQUIRE_SIGNIN_VIEW = false -ENABLE_REVERSE_PROXY_AUTHENTICATION = true -ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = true +ENABLE_REVERSE_PROXY_AUTHENTICATION = false +ENABLE_REVERSE_PROXY_AUTO_REGISTERATION = false [picture] AVATAR_UPLOAD_PATH = __DATA_PATH__/avatars [attachment] From a05347903423b0bdb8af245410462488bb835887 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 19:26:20 +0200 Subject: [PATCH 4/8] [fix] new helper --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index d206fb1..038e646 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -183,7 +183,7 @@ ynh_setup_source () { tar -xf $src_filename -C "$dest_dir" $strip fi if [[ "$src_format" = "bin" ]] ; then - chmod +x $src_filename + mv $src_filename $app else ynh_die "Archive format unrecognized." fi From c871f0085384b76984155fef28093bbf5e6def29 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 22:34:01 +0200 Subject: [PATCH 5/8] [enh] New source management system --- conf/arm.src | 5 +++-- conf/i386.src | 5 +++-- conf/x86-64.src | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/conf/arm.src b/conf/arm.src index b7b3ab5..74e7a68 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,10 +1,11 @@ -SOURCE_URL=https://dl.gitea.io/gitea/1.4.2/gitea-1.4.2-linux-arm-6 -SOURCE_SUM=b6064e06ce1158600fe41bb5c3747d0ed46e3d9a345e4f08758390d67d4e6d5e +SOURCE_URL=https://rafi59.codelib.re/git/attachments/94e2d077-3b5c-46c2-8a5b-6163f0675df5 +SOURCE_SUM=232f91737438562362b9443727a849cbe0b111284258c1add170dc6327715c77 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum # (Optional) Archive format # default: tar.gz +SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true SOURCE_IN_SUBDIR=true diff --git a/conf/i386.src b/conf/i386.src index 875bf70..8066ad2 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,10 +1,11 @@ -SOURCE_URL=https://dl.gitea.io/gitea/1.4.2/gitea-1.4.2-linux-386 -SOURCE_SUM=41df8e27b740af7d3eb4e563c744208102927aa8d2ad98bd4be5f97380ba1c81 +SOURCE_URL=https://rafi59.codelib.re/git/attachments/07f43b21-cf3e-4d5b-9262-415399255f4f +SOURCE_SUM=ee997cc8511e70c7a4454fe4ea353a85c2f04baeb41a96c7acc7c78e9ee4db9f # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum # (Optional) Archive format # default: tar.gz +SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true SOURCE_IN_SUBDIR=true diff --git a/conf/x86-64.src b/conf/x86-64.src index ba22d58..8b6ab51 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,11 +1,11 @@ -SOURCE_URL=https://dl.gitea.io/gitea/1.4.2/gitea-1.4.2-linux-amd64 -SOURCE_SUM=c843d462b5edb0d64572b148a0e814e41d069d196c3b3ee491449225e1c39d7d +SOURCE_URL=https://rafi59.codelib.re/git/attachments/5707d3d4-ece9-4724-8055-892bd89de3bb +SOURCE_SUM=2917570f3f43e36daf6f473223630d31fdf81e36b12baeeb4b8c49b1240ed413 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum # (Optional) Archive format # default: tar.gz -SOURCE_FORMAT=bin +SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true SOURCE_IN_SUBDIR=true From 335d0cc4ffe54b785585576ce16e006b65c481d6 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Thu, 14 Jun 2018 22:37:49 +0200 Subject: [PATCH 6/8] [fix] Remove modified ynh_setup_source --- scripts/_common.sh | 125 --------------------------------------------- 1 file changed, 125 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 038e646..9b05fdd 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -80,130 +80,5 @@ set_permission() { chmod u=rwX,g=rX,o= "/var/log/$app" } -# Download, check integrity, uncompress and patch the source from app.src -# -# The file conf/app.src need to contains: -# -# SOURCE_URL=Address to download the app archive -# SOURCE_SUM=Control sum -# # (Optional) Program to check the integrity (sha256sum, md5sum...) -# # default: sha256 -# SOURCE_SUM_PRG=sha256 -# # (Optional) Archive format -# # default: tar.gz -# SOURCE_FORMAT=tar.gz -# # (Optional) Put false if sources are directly in the archive root -# # default: true -# SOURCE_IN_SUBDIR=false -# # (Optionnal) Name of the local archive (offline setup support) -# # default: ${src_id}.${src_format} -# SOURCE_FILENAME=example.tar.gz -# # (Optional) If it set as false don't extract the source. -# # (Useful to get a debian package or a python wheel.) -# # default: true -# SOURCE_EXTRACT=(true|false) -# -# Details: -# This helper downloads sources from SOURCE_URL if there is no local source -# archive in /opt/yunohost-apps-src/APP_ID/SOURCE_FILENAME -# -# Next, it checks the integrity with "SOURCE_SUM_PRG -c --status" command. -# -# If it's ok, the source archive will be uncompressed in $dest_dir. If the -# SOURCE_IN_SUBDIR is true, the first level directory of the archive will be -# removed. -# -# Finally, patches named sources/patches/${src_id}-*.patch and extra files in -# sources/extra_files/$src_id will be applied to dest_dir -# -# -# usage: ynh_setup_source dest_dir [source_id] -# | arg: dest_dir - Directory where to setup sources -# | arg: source_id - Name of the app, if the package contains more than one app -ynh_setup_source () { - local dest_dir=$1 - local src_id=${2:-app} # If the argument is not given, source_id equals "app" - - # Load value from configuration file (see above for a small doc about this file - # format) - local src_url=$(grep 'SOURCE_URL=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_sum=$(grep 'SOURCE_SUM=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_sumprg=$(grep 'SOURCE_SUM_PRG=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_format=$(grep 'SOURCE_FORMAT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_extract=$(grep 'SOURCE_EXTRACT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_in_subdir=$(grep 'SOURCE_IN_SUBDIR=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - local src_filename=$(grep 'SOURCE_FILENAME=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) - - # Default value - src_sumprg=${src_sumprg:-sha256sum} - src_in_subdir=${src_in_subdir:-true} - src_format=${src_format:-tar.gz} - src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]') - src_extract=${src_extract:-true} - if [ "$src_filename" = "" ] ; then - src_filename="${src_id}.${src_format}" - fi - local local_src="/opt/yunohost-apps-src/${YNH_APP_ID}/${src_filename}" - - if test -e "$local_src" - then # Use the local source file if it is present - cp $local_src $src_filename - else # If not, download the source - wget -nv -O $src_filename $src_url - fi - - # Check the control sum - echo "${src_sum} ${src_filename}" | ${src_sumprg} -c --status \ - || ynh_die "Corrupt source" - - # Extract source into the app dir - mkdir -p "$dest_dir" - - if ! "$src_extract" - then - mv $src_filename $dest_dir - elif [ "$src_format" = "zip" ] - then - # Zip format - # Using of a temp directory, because unzip doesn't manage --strip-components - if $src_in_subdir ; then - local tmp_dir=$(mktemp -d) - unzip -quo $src_filename -d "$tmp_dir" - cp -a $tmp_dir/*/. "$dest_dir" - ynh_secure_remove "$tmp_dir" - else - unzip -quo $src_filename -d "$dest_dir" - fi - else - local strip="" - if $src_in_subdir ; then - strip="--strip-components 1" - fi - if [[ "$src_format" =~ ^tar.gz|tar.bz2|tar.xz$ ]] ; then - tar -xf $src_filename -C "$dest_dir" $strip - fi - if [[ "$src_format" = "bin" ]] ; then - mv $src_filename $app - else - ynh_die "Archive format unrecognized." - fi - fi - - # Apply patches - if (( $(find $YNH_CWD/../sources/patches/ -type f -name "${src_id}-*.patch" 2> /dev/null | wc -l) > "0" )); then - local old_dir=$(pwd) - (cd "$dest_dir" \ - && for p in $YNH_CWD/../sources/patches/${src_id}-*.patch; do \ - patch -p1 < $p; done) \ - || ynh_die "Unable to apply patches" - cd $old_dir - fi - - # Add supplementary files - if test -e "$YNH_CWD/../sources/extra_files/${src_id}"; then - cp -a $YNH_CWD/../sources/extra_files/$src_id/. "$dest_dir" - fi -} - From c3699ac99467c23e4f130f7ba6171bdbf2d2dbc8 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Fri, 15 Jun 2018 11:48:24 +0200 Subject: [PATCH 7/8] Use false for SOURCE_IN_SUBDIR --- conf/arm.src | 2 +- conf/i386.src | 2 +- conf/x86-64.src | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/arm.src b/conf/arm.src index 74e7a68..0d1f81f 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -8,4 +8,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true -SOURCE_IN_SUBDIR=true +SOURCE_IN_SUBDIR=false diff --git a/conf/i386.src b/conf/i386.src index 8066ad2..c0e2725 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -8,4 +8,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true -SOURCE_IN_SUBDIR=true +SOURCE_IN_SUBDIR=false diff --git a/conf/x86-64.src b/conf/x86-64.src index 8b6ab51..43cce92 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -8,4 +8,4 @@ SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=zip # (Optional) Put false if sources are directly in the archive root # default: true -SOURCE_IN_SUBDIR=true +SOURCE_IN_SUBDIR=false From ec92a25172f11476349ab57e8a07e8467ca7d0f0 Mon Sep 17 00:00:00 2001 From: Rafi59 Date: Fri, 15 Jun 2018 22:08:34 +0200 Subject: [PATCH 8/8] [fix] All scripts --- check_process | 12 +----------- conf/arm.src | 4 ++-- conf/i386.src | 4 ++-- conf/x86-64.src | 4 ++-- scripts/change_url | 6 +++--- scripts/install | 3 ++- scripts/restore | 5 +++-- scripts/upgrade | 26 ++++++++++++++------------ 8 files changed, 29 insertions(+), 35 deletions(-) diff --git a/check_process b/check_process index 713665d..0e7e4b7 100644 --- a/check_process +++ b/check_process @@ -12,9 +12,6 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=1 from_commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab - upgrade=1 from_commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 - upgrade=1 from_commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 backup_restore=1 multi_instance=1 incorrect_path=0 @@ -31,11 +28,4 @@ Level 7=auto Level 8=0 Level 9=0 - Level 10=0 -;;; Upgrade options - ; commit=aa075b2051ffad7b0b6fef3a9c767376d5bdbfab - name=Before multi_instance and refactoring - ; commit=1cbec051e1171de5a8ed1e850eb4fb3506114da5 - name=From V0.10.18 - ; commit=5a706ed246392c1ce39c47a648cb93e2996e80d3 - name=The oldest package + Level 10=0 \ No newline at end of file diff --git a/conf/arm.src b/conf/arm.src index 0d1f81f..c9430dd 100644 --- a/conf/arm.src +++ b/conf/arm.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://rafi59.codelib.re/git/attachments/94e2d077-3b5c-46c2-8a5b-6163f0675df5 -SOURCE_SUM=232f91737438562362b9443727a849cbe0b111284258c1add170dc6327715c77 +SOURCE_URL=https://rafi59.codelib.re/git/attachments/e147665b-5547-4401-bb90-3f8f2eacdb30 +SOURCE_SUM=951fe16e5aacf578d39fb0da0b9c0b0d93cadb27fd733b3838a12964ca9669b7 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/i386.src b/conf/i386.src index c0e2725..57d8a3f 100644 --- a/conf/i386.src +++ b/conf/i386.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://rafi59.codelib.re/git/attachments/07f43b21-cf3e-4d5b-9262-415399255f4f -SOURCE_SUM=ee997cc8511e70c7a4454fe4ea353a85c2f04baeb41a96c7acc7c78e9ee4db9f +SOURCE_URL=https://rafi59.codelib.re/git/attachments/9ac42714-14fb-4ab6-ad84-d91e51777070 +SOURCE_SUM=68103f9dc86abf379717ac754f30b44b0512ac60906e12839dcd1b580012ebfb # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/conf/x86-64.src b/conf/x86-64.src index 43cce92..b528e6f 100644 --- a/conf/x86-64.src +++ b/conf/x86-64.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://rafi59.codelib.re/git/attachments/5707d3d4-ece9-4724-8055-892bd89de3bb -SOURCE_SUM=2917570f3f43e36daf6f473223630d31fdf81e36b12baeeb4b8c49b1240ed413 +SOURCE_URL=https://rafi59.codelib.re/git/attachments/c54bf3d7-1837-4129-82f7-1ea1aee48cf2 +SOURCE_SUM=2f914fe40a5d337e29ddcd69dd97cba60c1373f5bcece0d4fecff86b0705eb58 # (Optional) Program to check the integrity (sha256sum, md5sum...) # default: sha256 SOURCE_SUM_PRG=sha256sum diff --git a/scripts/change_url b/scripts/change_url index 46ad532..8cda492 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -69,9 +69,9 @@ fi config_nginx -# Update gogs config -config_gogs +# Update gitea config +config_gitea # RELOAD services -ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" sleep 1 \ No newline at end of file diff --git a/scripts/install b/scripts/install index a821a32..9fee527 100644 --- a/scripts/install +++ b/scripts/install @@ -112,4 +112,5 @@ ynh_use_logrotate "/var/log/$app" # Reload services # ynh_check_starting "Serving [::]:$port with pid" "/var/log/$app/gitea.log" -systemctl restart gitea +sleep 20 +systemctl start gitea diff --git a/scripts/restore b/scripts/restore index c9aaf05..c3c06f5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,9 +58,10 @@ set_permission # Configure logrotate ynh_use_logrotate "/var/log/$app" -# Add Gogs to YunoHost's monitored services +# Add gitea to YunoHost's monitored services yunohost service add "$app" --log /var/log/"$app"/"$app".log # Reload services systemctl reload nginx.service -# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +sleep 20 +systemctl start gitea \ No newline at end of file diff --git a/scripts/upgrade b/scripts/upgrade index 1044149..54b53b6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -52,28 +52,28 @@ then fi # handle upgrade from old package installation -# this test that /etc/gogs exist since this was used in the old package +# 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/gogs" ] +if [ -d "/etc/gitea" ] then # create needed directories if not already created create_dir # move repositories to new dir old_repo_path=$(ynh_app_setting_get "$app" repopath) - mv "${old_repo_path:-/home/yunohost.app/gogs}"/* "$REPO_PATH" || true # Avoid if the directory is empty + 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/gogs - ynh_secure_remove /etc/gogs - ynh_secure_remove /opt/gogs_src + ynh_secure_remove /opt/gitea + ynh_secure_remove /etc/gitea + ynh_secure_remove /opt/gitea_src # create needed directories if not already created create_dir fi # end of old package upgrade -# test if user gogs is locked because of an old installation of the package. +# 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 @@ -85,13 +85,13 @@ fi #================================================= # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove "/opt/gogs/templates" +ynh_secure_remove "/opt/gitea/templates" -# Install Gogs +# Install gitea ynh_setup_source $final_path $architecture -# Configure gogs with app.ini file -config_gogs +# Configure gitea with app.ini file +config_gitea # Configure init script ynh_add_systemd_config @@ -107,4 +107,6 @@ config_nginx set_permission # Reload services -# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gogs.log" +# ynh_check_starting "INFO] Listen: http://0.0.0.0:" "/var/log/$app/gitea.log" +sleep 20 +systemctl restart gitea