From 9b0181e9ca97a48ab17074174ceb03c11b6f4d7e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 10 Oct 2024 03:41:31 +0200 Subject: [PATCH 1/9] Upgrade sources - `main` v1.22.3: https://github.com/go-gitea/gitea/releases/tag/v1.22.3 --- manifest.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8e4a547..0850819 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Gitea" description.en = "Lightweight Git forge" description.fr = "Forge Git légère" -version = "1.22.2~ynh1" +version = "1.22.3~ynh1" maintainers = ["Josué Tille"] # previous_maintainers = [ @@ -67,14 +67,14 @@ ram.runtime = "100M" extract = false rename = "gitea" - armhf.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.2/gitea-1.22.2-linux-arm-6" - armhf.sha256 = "ae73c658c827acb25c510d5925e6f92f4f6eac935d847f0682ec9061f39f66d5" - arm64.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.2/gitea-1.22.2-linux-arm64" - arm64.sha256 = "a4df27d2cb9339bdea96cd51f694cdf2d2bd7301d38f4906ad3611a033537bae" - i386.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.2/gitea-1.22.2-linux-386" - i386.sha256 = "bd9e352ef9fce7797cd5a71b9f451c61f707d90a2c4192aa3e71090758c00b73" - amd64.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.2/gitea-1.22.2-linux-amd64" - amd64.sha256 = "310d7dfa48680f3eaa5fe2998ca7a8a1f707518c1772b64d85fb3b9e197188d3" + armhf.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.3/gitea-1.22.3-linux-arm-6" + armhf.sha256 = "28c92642acd87544b9bff9b1c333325abd3993659839f27d438a7ba9ae85ff6e" + arm64.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.3/gitea-1.22.3-linux-arm64" + arm64.sha256 = "0d957ca51317be75788a7d286193fb550463c432518fb4b2dd05c19df3910b22" + i386.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.3/gitea-1.22.3-linux-386" + i386.sha256 = "7bb4715606f66c6a1f42af53a1d9b61b684d8ab92258b423852b1d1b66487166" + amd64.url = "https://github.com/go-gitea/gitea/releases/download/v1.22.3/gitea-1.22.3-linux-amd64" + amd64.sha256 = "a720ff937912a6eb6c0cacf6ebcdd774deed5197cd945ecc34f5744cb5c517e8" autoupdate.strategy = "latest_github_release" autoupdate.asset.armhf = "^gitea-.*-linux-arm-6$" From 9e748220af95d1e3d9882effbd2c4cd805246e84 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 10 Oct 2024 03:41:33 +0200 Subject: [PATCH 2/9] Auto-update READMEs --- ALL_README.md | 1 + README.md | 2 +- README_es.md | 4 ++-- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 2 +- README_nl.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_ru.md | 2 +- README_zh_Hans.md | 2 +- 10 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 README_nl.md diff --git a/ALL_README.md b/ALL_README.md index e3c80d2..df3708b 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -6,5 +6,6 @@ - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) - [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Lees de README in het Nederlands](README_nl.md) - [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index b05881d..68d00c4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Shipped version:** 1.22.2~ynh1 +**Shipped version:** 1.22.3~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index ac5d16d..e30130a 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Versión actual:** 1.22.2~ynh1 +**Versión actual:** 1.22.3~ynh1 ## Capturas @@ -35,7 +35,7 @@ Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to ## Información para desarrolladores -Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/gitea_ynh/tree/testing +Por favor enviar sus correcciones a la [rama `testing`](https://github.com/YunoHost-Apps/gitea_ynh/tree/testing). Para probar la rama `testing`, sigue asÍ: diff --git a/README_eu.md b/README_eu.md index b3c06ae..83f83e9 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Paketatutako bertsioa:** 1.22.2~ynh1 +**Paketatutako bertsioa:** 1.22.3~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index 942e804..6284c7c 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Version incluse :** 1.22.2~ynh1 +**Version incluse :** 1.22.3~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index fa9795c..0cda76c 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Versión proporcionada:** 1.22.2~ynh1 +**Versión proporcionada:** 1.22.3~ynh1 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index 091d073..87f837d 100644 --- a/README_id.md +++ b/README_id.md @@ -19,7 +19,7 @@ Ini TIDAK boleh diedit dengan tangan. Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Versi terkirim:** 1.22.2~ynh1 +**Versi terkirim:** 1.22.3~ynh1 ## Tangkapan Layar diff --git a/README_nl.md b/README_nl.md new file mode 100644 index 0000000..e590419 --- /dev/null +++ b/README_nl.md @@ -0,0 +1,48 @@ + + +# Gitea voor Yunohost + +[![Integratieniveau](https://dash.yunohost.org/integration/gitea.svg)](https://ci-apps.yunohost.org/ci/apps/gitea/) ![Mate van functioneren](https://ci-apps.yunohost.org/ci/badges/gitea.status.svg) ![Onderhoudsstatus](https://ci-apps.yunohost.org/ci/badges/gitea.maintain.svg) + +[![Gitea met Yunohost installeren](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gitea) + +*[Deze README in een andere taal lezen.](./ALL_README.md)* + +> *Met dit pakket kun je Gitea snel en eenvoudig op een YunoHost-server installeren.* +> *Als je nog geen YunoHost hebt, lees dan [de installatiehandleiding](https://yunohost.org/install), om te zien hoe je 'm installeert.* + +## Overzicht + +Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. + + +**Geleverde versie:** 1.22.3~ynh1 + +## Schermafdrukken + +![Schermafdrukken van Gitea](./doc/screenshots/screenshot.png) + +## Documentatie en bronnen + +- Officiele website van de app: +- Officiele beheerdersdocumentatie: +- Upstream app codedepot: +- YunoHost-store: +- Meld een bug: + +## Ontwikkelaarsinformatie + +Stuur je pull request alsjeblieft naar de [`testing`-branch](https://github.com/YunoHost-Apps/gitea_ynh/tree/testing). + +Om de `testing`-branch uit te proberen, ga als volgt te werk: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug +of +sudo yunohost app upgrade gitea -u https://github.com/YunoHost-Apps/gitea_ynh/tree/testing --debug +``` + +**Verdere informatie over app-packaging:** diff --git a/README_ru.md b/README_ru.md index ec81256..2b5bd80 100644 --- a/README_ru.md +++ b/README_ru.md @@ -19,7 +19,7 @@ Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**Поставляемая версия:** 1.22.2~ynh1 +**Поставляемая версия:** 1.22.3~ynh1 ## Снимки экрана diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 4122732..b218d7a 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ Gitea is a fork of Gogs a self-hosted Git service written in Go. Alternative to GitHub. -**分发版本:** 1.22.2~ynh1 +**分发版本:** 1.22.3~ynh1 ## 截图 From a9647ffbf10cc6450b2df8fcf8acf1f85c131786 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 30 Aug 2024 22:57:28 +0200 Subject: [PATCH 3/9] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 3 +- scripts/_common.sh | 8 ++-- scripts/backup | 30 +++++++-------- scripts/change_url | 28 +++++--------- scripts/install | 60 +++++++++++++----------------- scripts/remove | 16 ++++---- scripts/restore | 24 ++++++------ scripts/upgrade | 91 ++++++++++++++++++++++------------------------ 8 files changed, 116 insertions(+), 144 deletions(-) diff --git a/manifest.toml b/manifest.toml index 0850819..7ff93b3 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,8 @@ cpe = "cpe:2.3:a:gitea:gitea" fund = "https://opencollective.com/gitea" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = [ "amd64", "i386", diff --git a/scripts/_common.sh b/scripts/_common.sh index 281512f..01c734a 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,8 +10,8 @@ ssh_port="$(yunohost settings get security.ssh.ssh_port)" #================================================= _set_permissions() { - chown -R "$app:$app" "$install_dir" - chmod -R u=rwX,g=rX,o= "$install_dir" + #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "$install_dir" + #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "$install_dir" chmod +x "$install_dir/gitea" chown -R "$app:$app" "$data_dir" @@ -22,6 +22,6 @@ _set_permissions() { -exec chmod u=rwX,g=rX,o= {} \; chmod -R u=rwX,g=,o= "$data_dir/.ssh" - chown -R "$app:$app" "/var/log/$app" - chmod -R u=rwX,g=rX,o= "/var/log/$app" + #REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "/var/log/$app" + #REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "/var/log/$app" } diff --git a/scripts/backup b/scripts/backup index b413ff1..076f7b9 100644 --- a/scripts/backup +++ b/scripts/backup @@ -8,41 +8,37 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers - if systemctl is-active "$app".service --quiet; then - ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'" + ynh_print_warn "It's hightly recommended to make your backup when the service is stopped. Please stop $app service with this command before to run the backup 'systemctl stop $app.service'" fi -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message='Declaring files to be backed up...' +ynh_print_info 'Declaring files to be backed up...' # Copy the app source files -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" # Copy the data files -ynh_backup --src_path="$data_dir" --is_big=1 +ynh_backup "$data_dir" # Copy the conf files -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +ynh_backup "/etc/fail2ban/jail.d/$app.conf" +ynh_backup "/etc/fail2ban/filter.d/$app.conf" -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" -ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app.service" # Backup logs -ynh_backup --src_path="/var/log/$app" +ynh_backup "/var/log/$app" # Dump the database -ynh_print_info --message="Backing up the MySQL database" -ynh_mysql_dump_db "$db_name" > ./db.sql +ynh_print_info "Backing up the MySQL database" +ynh_mysql_dump_db > ./db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index ba0d493..eab41bc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,51 +1,41 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name="$app" --action=stop +ynh_systemctl --service="$app" --action=stop #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # SPECIFIC MODIFICATIONS #================================================= # Setup gitea.ini #================================================= -ynh_script_progression --message="Updating gitea configuration..." +ynh_script_progression "Updating gitea configuration..." -ynh_add_config --template="app.ini" --destination="$install_dir/custom/conf/app.ini" +ynh_config_add --template="app.ini" --destination="$install_dir/custom/conf/app.ini" _set_permissions -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting gitea services..." --weight=3 +ynh_script_progression "Starting gitea services..." -ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line" +ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 5ea75e6..701d7c1 100644 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -15,7 +9,7 @@ source /usr/share/yunohost/helpers # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message='Creating base directory...' +ynh_script_progression 'Creating base directory...' if [ -n "$(ls -A "$data_dir")" ]; then old_data_dir_path="${data_dir}_$(date '+%Y%m%d.%H%M%S')" @@ -34,45 +28,45 @@ mkdir -p "$data_dir/repositories" mkdir -p "$data_dir/data/avatars" mkdir -p "$data_dir/data/attachments" -ynh_script_progression --message='Installing sources files and data directories...' --weight=10 +ynh_script_progression 'Installing sources files and data directories...' # Setup source ynh_setup_source --dest_dir="$install_dir" _set_permissions -ynh_script_progression --message="Configuring application, step 1/2..." +ynh_script_progression "Configuring application, step 1/2..." -internal_token="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)" -secret_key="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)" -lfs_jwt_secret="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)" -jwt_secret="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)" +internal_token="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" +secret_key="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" +lfs_jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" +jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" -ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token" -ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key" -ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret" -ynh_app_setting_set --app="$app" --key=jwt_secret --value="$jwt_secret" +ynh_app_setting_set --key=internal_token --value="$internal_token" +ynh_app_setting_set --key=secret_key --value="$secret_key" +ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" +ynh_app_setting_set --key=jwt_secret --value="$jwt_secret" -ynh_add_config --template='app.ini' --destination="$install_dir/custom/conf/app.ini" +ynh_config_add --template='app.ini' --destination="$install_dir/custom/conf/app.ini" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." # Create a dedicated NGINX config using the conf/nginx.conf template -ynh_add_nginx_config +ynh_config_add_nginx # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd # Add gitea to YunoHost's monitored services yunohost service add "$app" --log="/var/log/$app/gitea.log" # Configure logrotate -ynh_use_logrotate --logfile="/var/log/$app" +ynh_config_add_logrotate "/var/log/$app" # Create a dedicated Fail2Ban config -ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex='.*Failed authentication attempt for .* from ' --max_retry=5 +ynh_config_add_fail2ban --logpath="/var/log/$app/gitea.log" --failregex='.*Failed authentication attempt for .* from ' #================================================= # APP INITIAL CONFIGURATION @@ -80,30 +74,28 @@ ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex='.*Faile # ADD A CONFIGURATION #================================================= -ynh_script_progression --message='Configuring application, step 2/2...' +ynh_script_progression 'Configuring application, step 2/2...' _set_permissions # Start gitea for building mysql tables -ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line" +ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" # Add ldap config -ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./login_source.sql -ynh_replace_string --match_string=__GROUP_TEAM_MAP__ --replace_string='""' --target_file=./login_source.sql -ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./login_source.sql +ynh_replace --match=__APP__ --replace="$app" --file=./login_source.sql +ynh_replace --match=__GROUP_TEAM_MAP__ --replace='""' --file=./login_source.sql +ynh_mysql_db_shell < ./login_source.sql # Stop the service to restart it just afterwards -ynh_systemd_action --service_name="$app" --action='stop' --log_path="/var/log/$app/gitea.log" +ynh_systemctl --service="$app" --action='stop' --log_path="/var/log/$app/gitea.log" -#================================================= -# GENERIC FINALIZATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message='Starting gitea services...' --weight=3 +ynh_script_progression 'Starting gitea services...' -ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line" +ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 907642d..d9d49e8 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,24 +10,24 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." -if ynh_exec_warn_less yunohost service status "$app" >/dev/null +if ynh_hide_warnings yunohost service status "$app" >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --weight=1 + ynh_script_progression "Removing $app service integration..." yunohost service remove "$app" fi -ynh_remove_systemd_config +ynh_config_remove_systemd -ynh_remove_nginx_config +ynh_config_remove_nginx -ynh_remove_logrotate +ynh_config_remove_logrotate -ynh_remove_fail2ban_config +ynh_config_remove_fail2ban #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 32211bb..d17e01b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,21 +11,21 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app files..." --weight=1 -ynh_restore +ynh_script_progression "Restoring the app files..." +ynh_restore_everything _set_permissions #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 +ynh_script_progression "Restoring the MySQL database..." -ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql +ynh_mysql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." systemctl daemon-reload systemctl enable "$app".service --quiet @@ -33,23 +33,21 @@ systemctl enable "$app".service --quiet yunohost service add "$app" --log="/var/log/$app/gitea.log" # SETUP FAIL2BAN -ynh_script_progression --message="Configuring fail2ban..." -ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from " --max_retry=5 +ynh_script_progression "Configuring fail2ban..." +ynh_config_add_fail2ban --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from " -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 +ynh_script_progression "Reloading NGINX web server and $app's service..." # Typically you only have either $app or php-fpm but not both at the same time... -ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line" +ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 0d3cfa0..c70aaf0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,36 +1,26 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -upgrade_type="$(ynh_check_app_version_changed)" - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message='Ensuring downward compatibility...' --weight=1 +ynh_script_progression 'Ensuring downward compatibility...' -if ynh_compare_current_package_version --comparison=lt --version="1.6.4~ynh1"; then +if ynh_app_upgrading_from_version_before 1.6.4~ynh1; then message="Upgrade from $YNH_APP_CURRENT_VERSION was dropped. You need to run this, then upgrade to the latest version: sudo yunohost app upgrade $app -u https://github.com/YunoHost-Apps/gitea_ynh/commit/a9ceb157032ae2290e944c1d0a255451ff2d133d" ynh_print_info "$message" - ynh_die --message="$message" --ret_code=1 + ynh_die "$message" --ret_code=1 fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message='Stopping a systemd service...' --weight=1 +ynh_script_progression 'Stopping $app's systemd service...' -ynh_systemd_action --service_name="$app" --action=stop +ynh_systemctl --service="$app" --action=stop #================================================= # MIGRATION STEP 1 (migrate path from packagin v1) @@ -40,7 +30,7 @@ ynh_systemd_action --service_name="$app" --action=stop if [ -d "/opt/$app" ]; then # This is the package version of the manifestv2 mv -t "$install_dir/" "/opt/$app/"* - ynh_secure_remove --file="/opt/$app" + ynh_safe_rm "/opt/$app" fi # Move data directory @@ -53,45 +43,50 @@ if [ ~"$app" != "$data_dir" ]; then usermod --home "$data_dir" "$app" fi -if [ "$upgrade_type" == UPGRADE_APP ]; then - ynh_setup_source --dest_dir="$install_dir" --source_id=main --full_replace=1 --keep=custom +# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed +if ynh_app_upstream_version_changed; then + ynh_setup_source --dest_dir="$install_dir" --source_id=main --full_replace --keep=custom fi #================================================= # MIGRATION STEP 2 (Set undefined Vars) #================================================= -ynh_script_progression --message='Migrating missing settings...' +ynh_script_progression 'Migrating missing settings...' # Must set permission before to call gitea command -chown -R "$app:$app" "$install_dir" -chmod -R u=rwX,g=rX,o= "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "$install_dir" chmod +x "$install_dir/gitea" +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=internal_token --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" if [[ -z "${internal_token:-}" ]]; then - internal_token="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret INTERNAL_TOKEN)" - ynh_app_setting_set --app="$app" --key=internal_token --value="$internal_token" + internal_token="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" + ynh_app_setting_set --key=internal_token --value="$internal_token" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=secret_key --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" if [[ -z "${secret_key:-}" ]]; then - secret_key="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret SECRET_KEY)" - ynh_app_setting_set --app="$app" --key=secret_key --value="$secret_key" + secret_key="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" + ynh_app_setting_set --key=secret_key --value="$secret_key" fi if [[ -n "${lfs_key:-}" ]]; then lfs_jwt_secret="$lfs_key" - ynh_app_setting_delete --app="$app" --key=lfs_key - ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret" + ynh_app_setting_delete --key=lfs_key + ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=lfs_jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" if [[ -z "${lfs_jwt_secret:-}" ]]; then - lfs_jwt_secret="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)" - ynh_app_setting_set --app="$app" --key=lfs_jwt_secret --value="$lfs_jwt_secret" + lfs_jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" + ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" fi +# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" if [[ -z "${jwt_secret:-}" ]]; then - jwt_secret="$(ynh_exec_as "$app" "$install_dir/gitea" generate secret JWT_SECRET)" - ynh_app_setting_set --app="$app" --key=jwt_secret --value="$jwt_secret" + jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" + ynh_app_setting_set --key=jwt_secret --value="$jwt_secret" fi #================================================= @@ -99,22 +94,22 @@ fi #================================================= list_param_sql="$(yunohost user list --output-as json | jq -c '.users | keys' | sed 's|\[|\(|' | sed 's|\]|\)|')" -ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./fix_user_db_for_local_users.sql -ynh_replace_string --match_string=__USER_LIST__ --replace_string="$list_param_sql" --target_file=./fix_user_db_for_local_users.sql -ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./fix_user_db_for_local_users.sql +ynh_replace --match=__APP__ --replace="$app" --file=./fix_user_db_for_local_users.sql +ynh_replace --match=__USER_LIST__ --replace="$list_param_sql" --file=./fix_user_db_for_local_users.sql +ynh_mysql_db_shell < ./fix_user_db_for_local_users.sql #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message='Updating configuration files...' --weight=1 +ynh_script_progression 'Updating configuration files...' # Clean template to fix issue : https://github.com/gogits/gogs/issues/4585 -ynh_secure_remove --file="$install_dir/templates" +ynh_safe_rm "$install_dir/templates" # Configure gitea with app.ini file -ynh_add_config --template=app.ini --destination="$install_dir/custom/conf/app.ini" +ynh_config_add --template=app.ini --destination="$install_dir/custom/conf/app.ini" -ynh_script_progression --message='Setting permissions...' +ynh_script_progression 'Setting permissions...' _set_permissions # Update ldap config @@ -124,33 +119,33 @@ _set_permissions group_team_map_config=$(mysql --user="$db_user" --password="$db_pwd" --batch --raw "$db_name" <<< 'SELECT `cfg` FROM `'$app'`.`login_source` WHERE `id`=1;' \ | tail -n+2 | jq '.GroupTeamMap') sed -i 's|__GROUP_TEAM_MAP__|'"${group_team_map_config//\\/\\\\\\\\}"'|g' ./login_source.sql -ynh_replace_string --match_string=__APP__ --replace_string="$app" --target_file=./login_source.sql -ynh_mysql_connect_as "$db_user" "$db_pwd" "$db_name" < ./login_source.sql +ynh_replace --match=__APP__ --replace="$app" --file=./login_source.sql +ynh_mysql_db_shell < ./login_source.sql #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add "$app" --log="/var/log/$app/gitea.log" -ynh_use_logrotate --non-append +ynh_config_add_logrotate -ynh_add_fail2ban_config --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from " --max_retry=5 +ynh_config_add_fail2ban --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from " #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message='Starting a systemd service...' --weight=1 +ynh_script_progression 'Starting $app's systemd service...' -ynh_systemd_action --service_name="$app" --action=start --log_path="/var/log/$app/gitea.log" --line_match="$systemd_match_start_line" +ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" From 73da923b79a660fd0f7fa0ea7620e291008b10f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 31 Aug 2024 09:56:13 +0200 Subject: [PATCH 4/9] Cleanup after auto patch --- manifest.toml | 1 - scripts/_common.sh | 14 +++++++++----- scripts/backup | 2 -- scripts/install | 10 +--------- scripts/restore | 3 +++ scripts/upgrade | 38 ++++++-------------------------------- 6 files changed, 19 insertions(+), 49 deletions(-) diff --git a/manifest.toml b/manifest.toml index 7ff93b3..c3395f6 100644 --- a/manifest.toml +++ b/manifest.toml @@ -89,7 +89,6 @@ ram.runtime = "100M" allow_email = true [resources.install_dir] - dir = "/opt/yunohost/__APP__" [resources.data_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index 01c734a..2e37883 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -10,8 +10,8 @@ ssh_port="$(yunohost settings get security.ssh.ssh_port)" #================================================= _set_permissions() { - #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "$install_dir" - #REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "$install_dir" + chown -R "$app:$app" "$install_dir" + chmod -R u=rwX,g=rX,o= "$install_dir" chmod +x "$install_dir/gitea" chown -R "$app:$app" "$data_dir" @@ -21,7 +21,11 @@ _set_permissions() { -exec chown "$app:$app" {} \; \ -exec chmod u=rwX,g=rX,o= {} \; chmod -R u=rwX,g=,o= "$data_dir/.ssh" - - #REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "/var/log/$app" - #REMOVEME? Assuming ynh_config_add_logrotate is called, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "/var/log/$app" +} + +set_settings_default() { + ynh_app_setting_set_default --key=internal_token --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" + ynh_app_setting_set_default --key=secret_key --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" + ynh_app_setting_set_default --key=lfs_jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" + ynh_app_setting_set_default --key=jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" } diff --git a/scripts/backup b/scripts/backup index 076f7b9..4037275 100644 --- a/scripts/backup +++ b/scripts/backup @@ -26,8 +26,6 @@ ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup "/etc/fail2ban/jail.d/$app.conf" ynh_backup "/etc/fail2ban/filter.d/$app.conf" -ynh_backup "/etc/logrotate.d/$app" - ynh_backup "/etc/systemd/system/$app.service" # Backup logs diff --git a/scripts/install b/scripts/install index 701d7c1..a4de46a 100644 --- a/scripts/install +++ b/scripts/install @@ -36,15 +36,7 @@ _set_permissions ynh_script_progression "Configuring application, step 1/2..." -internal_token="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" -secret_key="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" -lfs_jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" -jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" - -ynh_app_setting_set --key=internal_token --value="$internal_token" -ynh_app_setting_set --key=secret_key --value="$secret_key" -ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" -ynh_app_setting_set --key=jwt_secret --value="$jwt_secret" +set_settings_default ynh_config_add --template='app.ini' --destination="$install_dir/custom/conf/app.ini" diff --git a/scripts/restore b/scripts/restore index d17e01b..4bed372 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,6 +36,9 @@ yunohost service add "$app" --log="/var/log/$app/gitea.log" ynh_script_progression "Configuring fail2ban..." ynh_config_add_fail2ban --logpath="/var/log/$app/gitea.log" --failregex=".*Failed authentication attempt for .* from " +mkdir -p /var/log/"$app" +ynh_config_add_logrotate + #================================================= # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c70aaf0..eb0989c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,7 +18,7 @@ fi #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression 'Stopping $app's systemd service...' +ynh_script_progression "Stopping $app's systemd service..." ynh_systemctl --service="$app" --action=stop @@ -43,10 +43,7 @@ if [ ~"$app" != "$data_dir" ]; then usermod --home "$data_dir" "$app" fi -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed; then - ynh_setup_source --dest_dir="$install_dir" --source_id=main --full_replace --keep=custom -fi +ynh_setup_source --dest_dir="$install_dir" --source_id=main --full_replace --keep=custom #================================================= # MIGRATION STEP 2 (Set undefined Vars) @@ -55,40 +52,17 @@ fi ynh_script_progression 'Migrating missing settings...' # Must set permission before to call gitea command -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:$app" "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R u=rwX,g=rX,o= "$install_dir" +chown -R "$app:$app" "$install_dir" +chmod -R u=rwX,g=rX,o= "$install_dir" chmod +x "$install_dir/gitea" -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=internal_token --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" -if [[ -z "${internal_token:-}" ]]; then - internal_token="$(ynh_exec_as_app "$install_dir/gitea" generate secret INTERNAL_TOKEN)" - ynh_app_setting_set --key=internal_token --value="$internal_token" -fi - -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=secret_key --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" -if [[ -z "${secret_key:-}" ]]; then - secret_key="$(ynh_exec_as_app "$install_dir/gitea" generate secret SECRET_KEY)" - ynh_app_setting_set --key=secret_key --value="$secret_key" -fi - +set_settings_default if [[ -n "${lfs_key:-}" ]]; then lfs_jwt_secret="$lfs_key" ynh_app_setting_delete --key=lfs_key ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" fi -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=lfs_jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" -if [[ -z "${lfs_jwt_secret:-}" ]]; then - lfs_jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" - ynh_app_setting_set --key=lfs_jwt_secret --value="$lfs_jwt_secret" -fi - -# FIXMEhelpers2.1: maybe replace with: ynh_app_setting_set_default --key=jwt_secret --value="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" -if [[ -z "${jwt_secret:-}" ]]; then - jwt_secret="$(ynh_exec_as_app "$install_dir/gitea" generate secret JWT_SECRET)" - ynh_app_setting_set --key=jwt_secret --value="$jwt_secret" -fi - #================================================= # MIGRATION STEP Fix regression linked to 77c3678 and #76 #================================================= @@ -140,7 +114,7 @@ ynh_config_add_fail2ban --logpath="/var/log/$app/gitea.log" --failregex=".*Faile #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression 'Starting $app's systemd service...' +ynh_script_progression "Starting $app's systemd service..." ynh_systemctl --service="$app" --action=start --log_path="/var/log/$app/gitea.log" --wait_until="$systemd_match_start_line" From bd2a9372581cbcaaf1dde600dfd2dbee08079ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 31 Aug 2024 09:58:22 +0200 Subject: [PATCH 5/9] Add warining about config edition --- conf/app.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conf/app.ini b/conf/app.ini index 24a2065..ca1f529 100644 --- a/conf/app.ini +++ b/conf/app.ini @@ -1,3 +1,5 @@ +; WARNING: Don't edit this file. All change will be removed after each app upgrade + ;https://github.com/go-gitea/gitea/blob/release/v1.20/custom/conf/app.example.ini APP_NAME = Gitea RUN_USER = __APP__ From b9a9d4f895af4d3712c9a90afd1d5664a540fd51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sat, 31 Aug 2024 10:22:11 +0200 Subject: [PATCH 6/9] Add new test --- tests.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests.toml b/tests.toml index be8538d..fcf32bf 100644 --- a/tests.toml +++ b/tests.toml @@ -18,3 +18,5 @@ test_format = 1.0 test_upgrade_from.67d5bc5dc57d8f8793551d7e07c10e8b9d4fe038.args.admin = "package_checker" test_upgrade_from.67d5bc5dc57d8f8793551d7e07c10e8b9d4fe038.args.path = "/" test_upgrade_from.67d5bc5dc57d8f8793551d7e07c10e8b9d4fe038.args.domain = "domain.tld" + + test_upgrade_from.9f68c61d65babd9ab91a0425e55616f05b547ced.name = "Before helper 2.1" From a23147b3d6c8663f0fafb7e7c945366cc6d77413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 1 Sep 2024 23:12:43 +0200 Subject: [PATCH 7/9] Update requirement --- manifest.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index c3395f6..64094b4 100644 --- a/manifest.toml +++ b/manifest.toml @@ -23,7 +23,7 @@ cpe = "cpe:2.3:a:gitea:gitea" fund = "https://opencollective.com/gitea" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.30" helpers_version = "2.1" architectures = [ "amd64", @@ -89,8 +89,12 @@ ram.runtime = "100M" allow_email = true [resources.install_dir] + owner = "__APP__:rwx" + group = "__APP__:r-x" [resources.data_dir] + owner = "__APP__:rwx" + group = "__APP__:r-x" [resources.permissions] main.url = "/" From adf8b82b680734c5001c497a87621aefef0db29e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Sun, 1 Sep 2024 23:12:51 +0200 Subject: [PATCH 8/9] Fix missing permission --- scripts/_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 2e37883..cbef3c3 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -15,6 +15,7 @@ _set_permissions() { chmod +x "$install_dir/gitea" chown -R "$app:$app" "$data_dir" + chmod u=rwx,g=rx,o= "$data_dir" find "$data_dir" \( \! -perm -o= \ -o \! -user "$app" \ -o \! -group "$app" \) \ From 6022813c6fa6cf9f52940092ff86357fe1b02aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Tue, 8 Oct 2024 22:31:28 +0200 Subject: [PATCH 9/9] fix issue for git over http on bookworm --- scripts/install | 2 ++ scripts/upgrade | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/install b/scripts/install index a4de46a..8a79d98 100644 --- a/scripts/install +++ b/scripts/install @@ -3,6 +3,8 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set --key=protect_against_basic_auth_spoofing --value=false + #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index eb0989c..c476e46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,6 +3,8 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set --key=protect_against_basic_auth_spoofing --value=false + #================================================= # ENSURE DOWNWARD COMPATIBILITY #=================================================