From a0490d0c0406e731e8713d5c70e9b463adaea5bd Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 22 Jun 2024 22:45:37 +0000 Subject: [PATCH 01/10] Auto-update READMEs --- ALL_README.md | 1 + README_es.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 README_es.md diff --git a/ALL_README.md b/ALL_README.md index a01b345..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,7 @@ # All available README files by language - [Read the README in English](README.md) +- [Lea el README en español](README_es.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..4d10180 --- /dev/null +++ b/README_es.md @@ -0,0 +1,48 @@ + + +# Streams para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) + +[![Instalar Streams con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarStreams rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +The [streams repository](https://codeberg.org/streams/streams/) lets you install fediverse-connected websites with powerful and innovative features such as decentralized/nomadic identity, permissions framework, and much more (see [FEATURES](doc/FEATURES.md)). + +Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. + + +**Versión actual:** 24.05.10~ynh1 + +## Capturas + +![Captura de Streams](./doc/screenshots/example.png) + +## Documentaciones y recursos + +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/streams_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +o +sudo yunohost app upgrade streams -u https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** From 390b8019474aa8dec9e8f716748dc35f71465fde Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 03:03:46 +0200 Subject: [PATCH 02/10] [autopatch] Automatic patch attempt for helpers 2.1 --- conf/cronjobs | 2 +- conf/extra_php-fpm.conf | 4 -- conf/htconfig.sample.php | 2 +- conf/nginx.conf | 2 +- manifest.toml | 4 +- scripts/_common.sh | 16 +----- scripts/backup | 33 +++++------- scripts/config | 51 ++++++++---------- scripts/install | 100 ++++++++++++++++------------------ scripts/remove | 22 +++----- scripts/restore | 49 +++++++---------- scripts/upgrade | 113 +++++++++++++++++---------------------- 12 files changed, 163 insertions(+), 235 deletions(-) delete mode 100644 conf/extra_php-fpm.conf diff --git a/conf/cronjobs b/conf/cronjobs index 79d98e2..3dd3c45 100644 --- a/conf/cronjobs +++ b/conf/cronjobs @@ -1,4 +1,4 @@ # Run poller periodically to update your website -*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ -f Code/Daemon/Run.php Cron > /dev/null 2>&1 +*/10 * * * * __APP__ /usr/bin/php__PHP_VERSION__ -f Code/Daemon/Run.php Cron > /dev/null 2>&1 # Daily software update job 30 05 * * * root /bin/bash __DATA_DIR__/daily-update.sh >> __DATA_DIR__/daily-updates.log 2>&1 diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 14c8d27..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M \ No newline at end of file diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index e2e9ebe..4af080b 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -109,7 +109,7 @@ App::$config['system']['max_import_size'] = 200000; // Location of PHP command line processor -App::$config['system']['php_path'] = '/usr/bin/php__PHPVERSION__'; +App::$config['system']['php_path'] = '/usr/bin/php__PHP_VERSION__'; // Configure how we communicate with directory servers. // Deprecated. Please do not change. diff --git a/conf/nginx.conf b/conf/nginx.conf index f5d2b44..1fdac22 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,7 +16,7 @@ location __PATH__/ { location ~* \.php$ { try_files $uri =404; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; diff --git a/manifest.toml b/manifest.toml index 92663b6..98f8191 100644 --- a/manifest.toml +++ b/manifest.toml @@ -14,7 +14,8 @@ license = "Unlicense" code = "https://codeberg.org/streams/streams" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = false @@ -51,6 +52,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.data_dir] diff --git a/scripts/_common.sh b/scripts/_common.sh index ea5fe64..519f979 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,22 +1,10 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= # PHP APP SPECIFIC #================================================= -YNH_COMPOSER_VERSION="2.5.8" +composer_version="2.5.8" YNH_PHP_VERSION="8.2" - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index b1c66e8..7bea1e1 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,44 +1,35 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# 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..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= -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" #================================================= # SPECIFIC BACKUP @@ -46,24 +37,24 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" # BACKUP LOGROTATE #================================================= -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP CRON JOBS #================================================= -ynh_backup --src_path="/etc/cron.d/$app" -ynh_backup --src_path="$data_dir" +ynh_backup "/etc/cron.d/$app" +ynh_backup "$data_dir" #================================================= # BACKUP THE DATABASE #================================================= -ynh_print_info --message="Backup of the MySQL database..." +ynh_print_info "Backup of the MySQL database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +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/config b/scripts/config index bf78e56..4fe4408 100644 --- a/scripts/config +++ b/scripts/config @@ -1,22 +1,16 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS #================================================= -phpversion="$YNH_PHP_VERSION" -current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) +php_version="$YNH_PHP_VERSION" +current_fpm_footprint=$(ynh_app_setting_get --key=fpm_footprint) #================================================= # SPECIFIC GETTERS FOR TOML SHORT KEY @@ -24,7 +18,7 @@ current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) get__git_branch_mode() { # Git branch mode status - git_branch_mode_status="$(cd "$install_dir" && sudo -u $app git branch --show-current)" 2> /dev/null + git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as_app git branch --show-current)" 2> /dev/null if echo $git_branch_mode_status | grep -q "release" then echo "0" @@ -32,7 +26,7 @@ get__git_branch_mode() { then echo "1" else - ynh_print_err --message="Not using \"release\" or \"dev\" branch, please handle this in command line" + ynh_print_warn "Not using \"release\" or \"dev\" branch, please handle this in command line" exit 0 fi } @@ -64,7 +58,6 @@ get__free_footprint() { # SPECIFIC SETTERS FOR TOML SHORT KEYS #================================================= - set__git_branch_mode() { if [ "$git_branch_mode" -eq "0" ] then @@ -73,52 +66,50 @@ set__git_branch_mode() { then # If git_branch was set to 0, switch to "release" branch ynh_print_info "Switching to \"release\" branch" - (cd "$install_dir" && ynh_exec_as "$app" git checkout release) + (cd "$install_dir" && ynh_exec_as_app git checkout release) ynh_print_info "Full update of the website" (cd /home/yunohost.app/"$app" && bash daily-update.sh >> daily-updates.log 2>&1) else - ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" + ynh_die "\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" exit 1 fi elif [ "$git_branch_mode" -eq "1" ]; then # If git_branch was set to 1, switch to "dev" branch - (cd "$install_dir" && ynh_exec_as "$app" git checkout dev) + (cd "$install_dir" && ynh_exec_as_app git checkout dev) ynh_print_info "Switching to \"dev\" branch" fi - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" + ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" } -set__fpm_footprint() { - if [ "$fpm_footprint" != "specific" ] +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | set__fpm_footprint() { +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" != "specific" ] then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint" +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value="$fpm_footprint" fi } -set__fpm_free_footprint() { - if [ "$fpm_footprint" = "specific" ] +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | set__fpm_free_footprint() { +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" = "specific" ] then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value="$fpm_free_footprint" fi } -#================================================= -# GENERIC FINALIZATION #================================================= ynh_app_config_validate() { _ynh_app_config_validate if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then - # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. - if [ "$fpm_footprint" = "specific" ] +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" = "specific" ] then - fpm_footprint=$fpm_free_footprint +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_footprint=$fpm_free_footprint fi - if [ "$fpm_footprint" == "0" ] +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" == "0" ] then - ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." + ynh_print_warn "When selecting 'specific', you have to set a footprint value into the field below." exit 0 fi @@ -128,7 +119,7 @@ ynh_app_config_validate() { ynh_app_config_apply() { _ynh_app_config_apply - ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint + ynh_config_add_phpfpm } ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 6ad146d..52ea764 100755 --- 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 @@ -16,80 +10,80 @@ source /usr/share/yunohost/helpers email=$(ynh_user_get_info --username=$admin --key=mail) upload="256M" random_string="$(ynh_string_random --length=48)" -fpm_footprint="medium" -fpm_free_footprint=0 -fpm_usage="medium" +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | fpm_footprint="medium" +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_free_footprint=0 +#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | fpm_usage="medium" git_branch_mode="0" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 +ynh_script_progression "Storing installation settings..." -ynh_app_setting_set --app=$app --key=email --value=$email -ynh_app_setting_set --app=$app --key=upload --value=$upload -ynh_app_setting_set --app=$app --key=random_string --value=$random_string -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" +ynh_app_setting_set --key=email --value=$email +ynh_app_setting_set --key=upload --value=$upload +ynh_app_setting_set --key=random_string --value=$random_string +#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint +#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint +#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage +ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" #================================================= # CREATE A DATABASE #================================================= -ynh_script_progression --message="Creating a database..." --weight=2 +ynh_script_progression "Creating a database..." -ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ +ynh_mysql_db_shell \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +ynh_script_progression "Setting up source files..." mkdir -p "$install_dir" -chown -R $app:www-data "$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:www-data "$install_dir" # Download, check integrity, uncompress and patch the source from GitHub -ynh_exec_as $app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet +ynh_exec_as_app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet git config --system --add safe.directory $install_dir touch "$install_dir/php.log" mkdir -p "$install_dir/store" mkdir -p "$install_dir/cache/smarty3" -chmod -R o-rwx "$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 o-rwx "$install_dir" chmod -R 775 $install_dir/store $install_dir/cache #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression "Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # COMPOSER #================================================= -ynh_script_progression --message="Pulling in external libraries with Composer..." +ynh_script_progression "Pulling in external libraries with Composer..." -ynh_install_composer --workdir="$install_dir" -chown -R $app:www-data "$install_dir" +ynh_composer_install +ynh_composer_exec install --no-dev +#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:www-data "$install_dir" #================================================= # ADDONS #================================================= -ynh_script_progression --message="Installing addons..." +ynh_script_progression "Installing addons..." pushd $install_dir - ynh_exec_as $app git config pull.rebase false - ynh_exec_as $app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons + ynh_exec_as_app git config pull.rebase false + ynh_exec_as_app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons cd /var/www/$app/extend/addon/zaddons - ynh_exec_as $app git config pull.rebase false + ynh_exec_as_app git config pull.rebase false popd #================================================= @@ -97,14 +91,14 @@ popd #================================================= # PROVISION DATABASE #================================================= -ynh_script_progression --message="Provisionning database..." --weight=1 +ynh_script_progression "Provisionning database..." -ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_mysql.sql +ynh_mysql_db_shell < $install_dir/install/schema_mysql.sql #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." timezone=$( /dev/null +git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as_app git branch --show-current)" 2> /dev/null if echo $git_branch_mode_status | grep -q "release" then git_branch_mode="0" - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" + ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" elif echo $git_branch_mode_status | grep -q "dev" then git_branch_mode="1" - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" + ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" else - ynh_print_err --message="You need to use \"release\" or \"dev\" branch, please handle this in command line" + ynh_print_warn "You need to use \"release\" or \"dev\" branch, please handle this in command line" exit 0 fi @@ -66,9 +52,10 @@ fi # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# 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_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression "Upgrading source files..." # First we save what we need to keep mv $install_dir/store $data_dir/ @@ -76,111 +63,107 @@ then mv $install_dir/php.log $data_dir/ # Then we remove the previous install - ynh_secure_remove $install_dir + ynh_safe_rm $install_dir # We make the install cloning the repo mkdir -p "$install_dir" - chown -R $app:www-data "$install_dir" - - ynh_exec_as $app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet + #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:www-data "$install_dir" + ynh_exec_as_app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet git config --system --add safe.directory $install_dir - ynh_app_setting_get --app=$app --key=git_branch_mode + ynh_app_setting_get --key=git_branch_mode if [[ -n $git_branch_mode ]] && [ "$git_branch_mode" -eq "1" ] then ynh_print_info "Switching to \"dev\" branch" - (cd "$install_dir" && ynh_exec_as $app git checkout dev) - fi + (cd "$install_dir" && ynh_exec_as_app git checkout dev) + fi # We restore what we previously saved mv $data_dir/store $install_dir/ mv $data_dir/cache $install_dir/ mv $data_dir/php.log $install_dir/ - chmod -R o-rwx "$install_dir" - chown -R $app:www-data "$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 o-rwx "$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:www-data "$install_dir" chmod -R 775 $install_dir/store $install_dir/cache fi #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression "Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # COMPOSER #================================================= -ynh_script_progression --message="Pulling in external libraries with Composer..." +ynh_script_progression "Pulling in external libraries with Composer..." -ynh_install_composer -chown -R $app:www-data "$install_dir" +ynh_composer_install +ynh_composer_exec install --no-dev +#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:www-data "$install_dir" #================================================= # ADDONS #================================================= -ynh_script_progression --message="Installing addons..." +ynh_script_progression "Installing addons..." pushd $install_dir - ynh_exec_as $app git config pull.rebase false - ynh_exec_as $app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons + ynh_exec_as_app git config pull.rebase false + ynh_exec_as_app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons cd /var/www/$app/extend/addon/zaddons - ynh_exec_as $app git config pull.rebase false + ynh_exec_as_app git config pull.rebase false popd -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression "Updating configuration..." timezone=$( Date: Mon, 2 Sep 2024 19:41:31 +0000 Subject: [PATCH 03/10] Auto-update READMEs --- ALL_README.md | 2 ++ README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_ru.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 2 +- 9 files changed, 104 insertions(+), 6 deletions(-) create mode 100644 README_id.md create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,6 @@ - [Irakurri README euskaraz](README_eu.md) - [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) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index a417337..47eff4d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Streams for YunoHost -[![Integration level](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Working status](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Working status](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Install Streams with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) diff --git a/README_es.md b/README_es.md index 4d10180..fd9791c 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Streams para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalar Streams con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) diff --git a/README_eu.md b/README_eu.md index ea17769..994f29a 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Streams YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalatu Streams YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) diff --git a/README_fr.md b/README_fr.md index e862d60..a66dee4 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Streams pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Installer Streams avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) diff --git a/README_gl.md b/README_gl.md index 1a05d66..ff4e81d 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Streams para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalar Streams con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..246f6a1 --- /dev/null +++ b/README_id.md @@ -0,0 +1,48 @@ + + +# Streams untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) + +[![Pasang Streams dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Streams secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +The [streams repository](https://codeberg.org/streams/streams/) lets you install fediverse-connected websites with powerful and innovative features such as decentralized/nomadic identity, permissions framework, and much more (see [FEATURES](doc/FEATURES.md)). + +Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. + + +**Versi terkirim:** 24.05.10~ynh1 + +## Tangkapan Layar + +![Tangkapan Layar pada Streams](./doc/screenshots/example.png) + +## Dokumentasi dan sumber daya + +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/streams_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +atau +sudo yunohost app upgrade streams -u https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..34e2d3d --- /dev/null +++ b/README_ru.md @@ -0,0 +1,48 @@ + + +# Streams для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) + +[![Установите Streams с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Streams быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +The [streams repository](https://codeberg.org/streams/streams/) lets you install fediverse-connected websites with powerful and innovative features such as decentralized/nomadic identity, permissions framework, and much more (see [FEATURES](doc/FEATURES.md)). + +Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. + + +**Поставляемая версия:** 24.05.10~ynh1 + +## Снимки экрана + +![Снимок экрана Streams](./doc/screenshots/example.png) + +## Документация и ресурсы + +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/streams_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +или +sudo yunohost app upgrade streams -u https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 4c4bc27..e929ed6 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Streams -[![集成程度](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![工作状态](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![使用 YunoHost 安装 Streams](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) From c0a801acf4c307844f885fcfe9dac63b61990b44 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Mon, 2 Sep 2024 22:02:47 +0200 Subject: [PATCH 04/10] Try to solve some testing errors --- conf/cronjobs | 5 +-- conf/daily-update.sh | 17 -------- manifest.toml | 17 +++++++- scripts/_common.sh | 4 +- scripts/config | 97 -------------------------------------------- scripts/install | 50 +++++------------------ scripts/remove | 3 -- scripts/restore | 4 +- scripts/upgrade | 29 +------------ 9 files changed, 32 insertions(+), 194 deletions(-) delete mode 100644 conf/daily-update.sh diff --git a/conf/cronjobs b/conf/cronjobs index 3dd3c45..a41a623 100644 --- a/conf/cronjobs +++ b/conf/cronjobs @@ -1,4 +1,3 @@ # Run poller periodically to update your website -*/10 * * * * __APP__ /usr/bin/php__PHP_VERSION__ -f Code/Daemon/Run.php Cron > /dev/null 2>&1 -# Daily software update job -30 05 * * * root /bin/bash __DATA_DIR__/daily-update.sh >> __DATA_DIR__/daily-updates.log 2>&1 +*/10 * * * * __APP__ /usr/bin/php__PHP_VERSION__ -f src/Daemon/Run.php Cron > /dev/null 2>&1 + diff --git a/conf/daily-update.sh b/conf/daily-update.sh deleted file mode 100644 index fff1714..0000000 --- a/conf/daily-update.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# -echo " " -echo "+++ $(date) +++" -echo " " -git_branch="$(cd /var/www/__APP__ && sudo -u __APP__ \ - git branch --show-current)" 2> /dev/null -if echo $git_branch | grep -q "release" -then - echo "$(date) - Updating website..." - (cd /var/www/__APP__ ; sudo -u __APP__ util/udall) -else - echo "$(date) - Updating release branch code..." - (cd /var/www/__APP__ ; sudo -u __APP__ git fetch origin release:release) -fi -echo "$(date) - Daily update finished." - diff --git a/manifest.toml b/manifest.toml index 98f8191..ec4ea65 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Streams" description.en = "Open source fediverse server" description.fr = "Serveur fediverse open source" -version = "24.05.10~ynh1" +version = "24.8.27~ynh1" maintainers = ["Papa Dragon"] @@ -47,6 +47,19 @@ ram.runtime = "50M" [resources] + [resources.sources] + [resources.sources.main] + url = "https://codeberg.org/streams/streams/archive/v24.8.27.tar.gz" + sha256 = "61bc0e0cb088c2644bcc4993f41af449d111a394e559eede75204b504b5fcbbb" + autoupdate.strategy = "latest_forgejo_tag" + autoupdate.version_regex = "^v(.*)$" + + [resources.sources.addons] + url = "https://codeberg.org/streams/streams-addons/archive/47ce10d5f6e855186d10f2373dc7bbe385454cce.tar.gz" + sha256 = "ddea62f2c745ccb29f291813e0a8a24b122c9eba67539fd3a792862c6653b134" + autoupdate.strategy = "latest_forgejo_commit" + autoupdate.upstream = "https://codeberg.org/streams/streams-addons" + [resources.ports] [resources.system_user] @@ -60,7 +73,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "php8.2-mbstring, php8.2-cli, php8.2-imagick, php8.2-xml, php8.2-zip, php8.2-curl, php8.2-ldap, php8.2-gd, mariadb-server, php8.2-mysql php8.2-gmp" + packages = "php8.3-mbstring, php8.3-cli, php8.3-imagick, php8.3-xml, php8.3-zip, php8.3-curl, php8.3-ldap, php8.3-gd, mariadb-server, php8.3-mysql php8.3-gmp" [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 519f979..1134a1b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,5 +6,5 @@ # PHP APP SPECIFIC #================================================= -composer_version="2.5.8" -YNH_PHP_VERSION="8.2" +composer_version="2.7.8" +YNH_PHP_VERSION="8.3" diff --git a/scripts/config b/scripts/config index 4fe4408..42973b1 100644 --- a/scripts/config +++ b/scripts/config @@ -3,123 +3,26 @@ source _common.sh source /usr/share/yunohost/helpers -#REMOVEME? ynh_abort_if_errors - #================================================= # RETRIEVE ARGUMENTS #================================================= php_version="$YNH_PHP_VERSION" -current_fpm_footprint=$(ynh_app_setting_get --key=fpm_footprint) #================================================= # SPECIFIC GETTERS FOR TOML SHORT KEY #================================================= -get__git_branch_mode() { - # Git branch mode status - git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as_app git branch --show-current)" 2> /dev/null - if echo $git_branch_mode_status | grep -q "release" - then - echo "0" - elif echo $git_branch_mode_status | grep -q "dev" - then - echo "1" - else - ynh_print_warn "Not using \"release\" or \"dev\" branch, please handle this in command line" - exit 0 - fi -} - -get__fpm_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - echo "specific" - else - echo "$current_fpm_footprint" - fi -} - -get__free_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - # If current_fpm_footprint is an integer, that's a numeric value for the footprint - echo "$current_fpm_footprint" - else - echo "0" - fi -} - #================================================= # SPECIFIC SETTERS FOR TOML SHORT KEYS #================================================= -set__git_branch_mode() { - if [ "$git_branch_mode" -eq "0" ] - then - # We allow switch back to "release" only if the branch is ahead of "dev" - if [ -z "$(cd "$install_dir" && git log --oneline release..dev)" ] - then - # If git_branch was set to 0, switch to "release" branch - ynh_print_info "Switching to \"release\" branch" - (cd "$install_dir" && ynh_exec_as_app git checkout release) - ynh_print_info "Full update of the website" - (cd /home/yunohost.app/"$app" && bash daily-update.sh >> daily-updates.log 2>&1) - else - ynh_die "\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" - exit 1 - fi - elif [ "$git_branch_mode" -eq "1" ]; then - # If git_branch was set to 1, switch to "dev" branch - (cd "$install_dir" && ynh_exec_as_app git checkout dev) - ynh_print_info "Switching to \"dev\" branch" - fi - ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" -} - -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | set__fpm_footprint() { -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" != "specific" ] - then -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value="$fpm_footprint" - fi -} - -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | set__fpm_free_footprint() { -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" = "specific" ] - then -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value="$fpm_free_footprint" - fi -} - -#================================================= - ynh_app_config_validate() { _ynh_app_config_validate - - if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" = "specific" ] - then -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_footprint=$fpm_free_footprint - fi - -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ "$fpm_footprint" == "0" ] - then - ynh_print_warn "When selecting 'specific', you have to set a footprint value into the field below." - - exit 0 - fi - fi } ynh_app_config_apply() { _ynh_app_config_apply - - ynh_config_add_phpfpm } ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 52ea764..725b29e 100755 --- a/scripts/install +++ b/scripts/install @@ -10,23 +10,14 @@ source /usr/share/yunohost/helpers email=$(ynh_user_get_info --username=$admin --key=mail) upload="256M" random_string="$(ynh_string_random --length=48)" -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | fpm_footprint="medium" -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | fpm_free_footprint=0 -#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | fpm_usage="medium" -git_branch_mode="0" #================================================= # STORE SETTINGS FROM MANIFEST #================================================= ynh_script_progression "Storing installation settings..." - ynh_app_setting_set --key=email --value=$email ynh_app_setting_set --key=upload --value=$upload ynh_app_setting_set --key=random_string --value=$random_string -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint -#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage -ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" #================================================= # CREATE A DATABASE @@ -41,18 +32,14 @@ ynh_mysql_db_shell \ #================================================= ynh_script_progression "Setting up source files..." -mkdir -p "$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:www-data "$install_dir" # Download, check integrity, uncompress and patch the source from GitHub -ynh_exec_as_app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet -git config --system --add safe.directory $install_dir +ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" -touch "$install_dir/php.log" -mkdir -p "$install_dir/store" -mkdir -p "$install_dir/cache/smarty3" +ynh_exec_as_app mkdir -p "$install_dir/store" +ynh_exec_as_app mkdir -p "$install_dir/cache/smarty3" -#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 o-rwx "$install_dir" -chmod -R 775 $install_dir/store $install_dir/cache +ynh_exec_as_app chmod -R 775 $install_dir/store $install_dir/cache #================================================= # PHP-FPM CONFIGURATION @@ -73,18 +60,7 @@ ynh_script_progression "Pulling in external libraries with Composer..." ynh_composer_install ynh_composer_exec install --no-dev -#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:www-data "$install_dir" -#================================================= -# ADDONS -#================================================= -ynh_script_progression "Installing addons..." - -pushd $install_dir - ynh_exec_as_app git config pull.rebase false - ynh_exec_as_app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons - cd /var/www/$app/extend/addon/zaddons - ynh_exec_as_app git config pull.rebase false -popd +chown -R $app:www-data "$install_dir" #================================================= # SPECIFIC SETUP @@ -113,9 +89,6 @@ ynh_config_add --template="htconfig.sample.php" --destination="$install_dir/.htc ynh_store_file_checksum $install_dir/.htconfig.php -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/.htconfig.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/.htconfig.php" - ynh_exec_as_app touch $data_dir/extra_conf.php #================================================= @@ -125,11 +98,6 @@ ynh_script_progression "Setuping cron job..." # Set up cron job ynh_config_add --template="cronjobs" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" -# Add daily update script -ynh_config_add --template="daily-update.sh" --destination="/home/yunohost.app/$app/daily-update.sh" -chown root: "/home/yunohost.app/$app/daily-update.sh" #================================================= # SETUP LOGROTATE @@ -145,10 +113,12 @@ ynh_config_add_logrotate "$install_dir/php.log" ynh_script_progression "Configuring Fail2Ban..." # Create a dedicated Fail2Ban config -ynh_config_add_fail2ban --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" +ynh_config_add_fail2ban --logpath="/var/log/$app/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" +ynh_exec_as_app touch "/var/log/$app/php.log" #================================================= # END OF SCRIPT #================================================= - +ls -ld /var/www/$app +namei -l /var/www/streams/index.php ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index e6e3b99..ea8bd5c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -23,9 +23,6 @@ ynh_config_remove_fail2ban # Remove a cron file ynh_safe_rm "/etc/cron.d/$app" -# Remove daily updates logfile -ynh_safe_rm "$data_dir/daily-updates.log" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index fd8d6c9..9d4f088 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,8 +11,6 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$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 o-rwx "$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:www-data "$install_dir" #================================================= # RESTORE THE DATABASE #================================================= @@ -20,7 +18,7 @@ ynh_script_progression "Restoring MySQL database..." ynh_mysql_db_shell \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" -ynh_mysql_db_shell < "./db.sql"" +ynh_mysql_db_shell < "./db.sql" #================================================= # RESTORE FAIL2BAN CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 272a128..ef3e090 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,24 +15,6 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= ynh_script_progression "Ensuring downward compatibility..." -# If fpm_footprint doesn't exist, create it -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | if [ -z "$fpm_footprint" ]; then - fpm_footprint=low -#REMOVEME? Everything about fpm_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_footprint --value=$fpm_footprint -fi - -# If fpm_free_footprint doesn't exist, create it -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | if [ -z "$fpm_free_footprint" ]; then - fpm_free_footprint=0 -#REMOVEME? Everything about fpm_free_footprint is removed in helpers2.1... | ynh_app_setting_set --key=fpm_free_footprint --value=$fpm_free_footprint -fi - -# If fpm_usage doesn't exist, create it -#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | if [ -z "$fpm_usage" ]; then - fpm_usage=low -#REMOVEME? Everything about fpm_usage is removed in helpers2.1... | ynh_app_setting_set --key=fpm_usage --value=$fpm_usage -fi - # Make sure that git_branch_mode exists with relevant value git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as_app git branch --show-current)" 2> /dev/null if echo $git_branch_mode_status | grep -q "release" @@ -67,7 +49,7 @@ then # We make the install cloning the repo mkdir -p "$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:www-data "$install_dir" + chown -R $app:www-data "$install_dir" ynh_exec_as_app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet git config --system --add safe.directory $install_dir @@ -83,8 +65,6 @@ then mv $data_dir/cache $install_dir/ mv $data_dir/php.log $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 o-rwx "$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:www-data "$install_dir" chmod -R 775 $install_dir/store $install_dir/cache fi @@ -107,7 +87,6 @@ ynh_script_progression "Pulling in external libraries with Composer..." ynh_composer_install ynh_composer_exec install --no-dev -#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:www-data "$install_dir" #================================================= # ADDONS #================================================= @@ -130,9 +109,6 @@ max_imported_follow=10 ynh_config_add --template="htconfig.sample.php" --destination="$install_dir/.htconfig.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 600 "$install_dir/.htconfig.php" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:$app "$install_dir/.htconfig.php" - if [ ! -f $data_dir/extra_conf.php ] then ynh_exec_as_app touch $data_dir/extra_conf.php @@ -145,8 +121,7 @@ ynh_script_progression "Setuping cron job..." # Set up cron job ynh_config_add --template="cronjobs" --destination="/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown root: "/etc/cron.d/$app" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 644 "/etc/cron.d/$app" + # Add daily update script ynh_config_add --template="daily-update.sh" --destination="/home/yunohost.app/$app/daily-update.sh" chown root: "/home/yunohost.app/$app/daily-update.sh" From 9e2c66fa56cf033751a33afe75f11e832f512d11 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Mon, 2 Sep 2024 23:58:29 +0200 Subject: [PATCH 05/10] Trying to fix 403 error --- scripts/install | 7 +++---- scripts/upgrade | 54 ++++++------------------------------------------- 2 files changed, 9 insertions(+), 52 deletions(-) diff --git a/scripts/install b/scripts/install index 725b29e..0734e67 100755 --- a/scripts/install +++ b/scripts/install @@ -105,7 +105,8 @@ ynh_config_add --template="cronjobs" --destination="/etc/cron.d/$app" ynh_script_progression "Configuring log rotation..." # Use logrotate to manage application logfile(s) -ynh_config_add_logrotate "$install_dir/php.log" +ynh_config_add_logrotate "/var/log/$app/php.log" +ynh_exec_as_app touch "/var/log/$app/php.log" #================================================= # SETUP FAIL2BAN @@ -114,11 +115,9 @@ ynh_script_progression "Configuring Fail2Ban..." # Create a dedicated Fail2Ban config ynh_config_add_fail2ban --logpath="/var/log/$app/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" -ynh_exec_as_app touch "/var/log/$app/php.log" #================================================= # END OF SCRIPT #================================================= -ls -ld /var/www/$app -namei -l /var/www/streams/index.php + ynh_script_progression "Installation of $app completed" diff --git a/scripts/upgrade b/scripts/upgrade index ef3e090..92dfc64 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -15,21 +15,6 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= ynh_script_progression "Ensuring downward compatibility..." -# Make sure that git_branch_mode exists with relevant value -git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as_app git branch --show-current)" 2> /dev/null -if echo $git_branch_mode_status | grep -q "release" -then - git_branch_mode="0" - ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" -elif echo $git_branch_mode_status | grep -q "dev" -then - git_branch_mode="1" - ynh_app_setting_set --key=git_branch_mode --value="$git_branch_mode" -else - ynh_print_warn "You need to use \"release\" or \"dev\" branch, please handle this in command line" - exit 0 -fi - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -42,30 +27,18 @@ then # First we save what we need to keep mv $install_dir/store $data_dir/ mv $install_dir/cache $data_dir/ - mv $install_dir/php.log $data_dir/ # Then we remove the previous install ynh_safe_rm $install_dir - # We make the install cloning the repo - mkdir -p "$install_dir" - chown -R $app:www-data "$install_dir" - ynh_exec_as_app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet - git config --system --add safe.directory $install_dir - - ynh_app_setting_get --key=git_branch_mode - if [[ -n $git_branch_mode ]] && [ "$git_branch_mode" -eq "1" ] - then - ynh_print_info "Switching to \"dev\" branch" - (cd "$install_dir" && ynh_exec_as_app git checkout dev) - fi + ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" # We restore what we previously saved mv $data_dir/store $install_dir/ mv $data_dir/cache $install_dir/ - mv $data_dir/php.log $install_dir/ - chmod -R 775 $install_dir/store $install_dir/cache + ynh_exec_as_app chmod -R 775 $install_dir/store $install_dir/cache fi #================================================= @@ -87,18 +60,6 @@ ynh_script_progression "Pulling in external libraries with Composer..." ynh_composer_install ynh_composer_exec install --no-dev -#================================================= -# ADDONS -#================================================= -ynh_script_progression "Installing addons..." - -pushd $install_dir - ynh_exec_as_app git config pull.rebase false - ynh_exec_as_app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons - cd /var/www/$app/extend/addon/zaddons - ynh_exec_as_app git config pull.rebase false -popd - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -122,20 +83,17 @@ ynh_script_progression "Setuping cron job..." # Set up cron job ynh_config_add --template="cronjobs" --destination="/etc/cron.d/$app" -# Add daily update script -ynh_config_add --template="daily-update.sh" --destination="/home/yunohost.app/$app/daily-update.sh" -chown root: "/home/yunohost.app/$app/daily-update.sh" - #================================================= # SETUP LOGROTATE #================================================= ynh_script_progression "Upgrading logrotate configuration..." # Use logrotate to manage app-specific logfile(s) -ynh_config_add_logrotate "$install_dir/php.log" +ynh_config_add_logrotate "/var/log/$app/php.log" +ynh_exec_as_app touch "/var/log/$app/php.log" # Create a dedicated Fail2Ban config -ynh_config_add_fail2ban --logpath="$install_dir/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" +ynh_config_add_fail2ban --logpath="/var/log/$app/php.log" --failregex="^.*auth\.php.*failed login attempt.*from IP .*$" #================================================= # END OF SCRIPT From d6b0eae2fd490f7a35456d8d8ee9d19f82437c4d Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 2 Sep 2024 22:01:38 +0000 Subject: [PATCH 06/10] Auto-update READMEs --- README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 2 +- README_ru.md | 2 +- README_zh_Hans.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 47eff4d..11444ce 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Shipped version:** 24.05.10~ynh1 +**Shipped version:** 24.8.27~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index fd9791c..c1102f7 100644 --- a/README_es.md +++ b/README_es.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Versión actual:** 24.05.10~ynh1 +**Versión actual:** 24.8.27~ynh1 ## Capturas diff --git a/README_eu.md b/README_eu.md index 994f29a..b8cd40d 100644 --- a/README_eu.md +++ b/README_eu.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Paketatutako bertsioa:** 24.05.10~ynh1 +**Paketatutako bertsioa:** 24.8.27~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index a66dee4..a77fd9e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -21,7 +21,7 @@ Le [dépôt streams](https://codeberg.org/streams/streams/) vous permet d'instal Vos sites web seront compatibles avec **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** et bien d'autres encore. -**Version incluse :** 24.05.10~ynh1 +**Version incluse :** 24.8.27~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index ff4e81d..c5bd64a 100644 --- a/README_gl.md +++ b/README_gl.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Versión proporcionada:** 24.05.10~ynh1 +**Versión proporcionada:** 24.8.27~ynh1 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md index 246f6a1..0dd0173 100644 --- a/README_id.md +++ b/README_id.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Versi terkirim:** 24.05.10~ynh1 +**Versi terkirim:** 24.8.27~ynh1 ## Tangkapan Layar diff --git a/README_ru.md b/README_ru.md index 34e2d3d..2ba091e 100644 --- a/README_ru.md +++ b/README_ru.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Поставляемая версия:** 24.05.10~ynh1 +**Поставляемая версия:** 24.8.27~ynh1 ## Снимки экрана diff --git a/README_zh_Hans.md b/README_zh_Hans.md index e929ed6..ceb6e3e 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**分发版本:** 24.05.10~ynh1 +**分发版本:** 24.8.27~ynh1 ## 截图 From 3c21ec3d0f977fddc90f96d56756ca6074b41e1d Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Tue, 3 Sep 2024 00:54:58 +0200 Subject: [PATCH 07/10] Empty config_panel.toml --- config_panel.toml | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/config_panel.toml b/config_panel.toml index b2b4906..e9dc008 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -4,45 +4,3 @@ version = "1.0" name.en = "Streams configuration" name.fr = "Configuration de Streams" - [main.php_fpm_config] - name.en = "PHP-FPM configuration" - name.fr = "Configuration de PHP-FPM" - - [main.php_fpm_config.fpm_footprint] - ask.en = "Memory footprint" - ask.fr = "Empreinte mémoire" - type = "select" - choices = ["low", "medium", "high", "specific"] - default = "medium" - help.en = "low: <= 20Mb per pool
medium: Between 20Mb and 40Mb per pool
high: 40Mb per pool
specific : Use specific value" - help.fr = "low: <= 20Mb par pool
medium: Entre 20Mb et 40Mb par pool
high: 40Mb par pool
specific : Utiliser une valeur personnalisée" - - [main.php_fpm_config.fpm_free_footprint] - visible = "fpm_footprint == 'specific'" - ask.en = "Memory footprint of the service?" - ask.fr = "Empreinte mémoire du service?" - type = "number" - default = "0" - help.en = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - help.fr = "Champ libre pour spécifier exactement l'empreinte mémoire en Mb si vous ne souhaitez pas utiliser l'une des trois valeurs précédentes." - - [main.php_fpm_config.fpm_usage] - ask.en = "Expected usage" - ask.fr = "Utilisation prévue" - type = "select" - choices = ["low", "medium", "high"] - default = "medium" - help.en = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.
medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.
high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding." - help.fr = "low : Utilisation personnelle, derrière le SSO. Pas d'empreinte RAM en cas de non-utilisation, mais l'impact sur le processeur peut être élevé si de nombreux utilisateurs utilisent le service.
medium : Faible utilisation, peu d'utilisateurs et/ou service pas nécessairement accessible au public. Faible empreinte RAM, empreinte moyenne sur le processeur en cas d'utilisation.
high : Utilisation soutenue, site web fréquemment visité. L'empreinte RAM est élevée, mais l'utilisation du processeur est moindre et le service répond rapidement." - - [main.git_branch_mode] - name.en = "Developer Mode" - name.fr = "Mode Développeur" - - [main.git_branch_mode.git_branch_mode] - ask.en = "Switch to 'dev' branch" - ask.fr = "Basculer sur la branche 'dev'" - type = "boolean" - default = "0" - help.en = "This option should only be used if you're either a professional software developer or a certified lunatic (or both).

You can only return to the 'release' branch if it is ahead of the 'dev' branch.

If authorised, the switch to the 'release' branch will be immediately followed by a global update of the site - via the util/udall command.

You must be able to use the command line to solve any problems you may encounter after using this option.

If you haven't understood any of the above lines DON'T USE THIS OPTION!!!" - help.fr = "Cette option ne devrait être utilisée que si vous êtes un développeur de logiciels professionnel ou une personne passablement déraisonnable (ou les deux à la fois)

Vous ne pourrez revenir à la branche 'release' que si celle-ci est en avance sur la branche 'dev'.

Si elle est autorisée, la bascule vers la branche 'release' sera immédiatement suivie d'une mise à jour globale du site - via la commande util/udall.

Vous devez impérativement être capable d'utiliser la ligne de commande pour résoudre tout problème que vous pourriez rencontrer après avoir utilisé cette option.

Si vous n'avez rien compris aux lignes ci-dessus N'UTILISEZ PAS CETTE OPTION!!!" From 6a588b7433bf7e6ad340b6b6a97f9c34aecab4b2 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Tue, 3 Sep 2024 01:04:10 +0200 Subject: [PATCH 08/10] Remove config panel related files --- config_panel.toml | 6 ------ scripts/config | 28 ---------------------------- 2 files changed, 34 deletions(-) delete mode 100644 config_panel.toml delete mode 100644 scripts/config diff --git a/config_panel.toml b/config_panel.toml deleted file mode 100644 index e9dc008..0000000 --- a/config_panel.toml +++ /dev/null @@ -1,6 +0,0 @@ -version = "1.0" - -[main] -name.en = "Streams configuration" -name.fr = "Configuration de Streams" - diff --git a/scripts/config b/scripts/config deleted file mode 100644 index 42973b1..0000000 --- a/scripts/config +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -source _common.sh -source /usr/share/yunohost/helpers - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -php_version="$YNH_PHP_VERSION" - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= - -ynh_app_config_validate() { - _ynh_app_config_validate -} - -ynh_app_config_apply() { - _ynh_app_config_apply -} - -ynh_app_config_run $1 From 0897b5163035b43d5176ca7e51108ed955f132df Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Tue, 3 Sep 2024 01:14:42 +0200 Subject: [PATCH 09/10] Update install: simplify / clarify minor stuff --- scripts/install | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index 0734e67..f851eb8 100755 --- a/scripts/install +++ b/scripts/install @@ -4,25 +4,18 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST +# INITIALIZE SETTINGS #================================================= +ynh_script_progression "Initialize installation settings..." -email=$(ynh_user_get_info --username=$admin --key=mail) -upload="256M" -random_string="$(ynh_string_random --length=48)" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression "Storing installation settings..." -ynh_app_setting_set --key=email --value=$email -ynh_app_setting_set --key=upload --value=$upload -ynh_app_setting_set --key=random_string --value=$random_string +ynh_app_setting_set_default --key=email --value=$(ynh_user_get_info --username=$admin --key=mail) +ynh_app_setting_set_default --key=upload --value="256M" +ynh_app_setting_set_default --key=random_string --value="$(ynh_string_random --length=48)" #================================================= # CREATE A DATABASE #================================================= -ynh_script_progression "Creating a database..." +ynh_script_progression "Tweak database character set..." ynh_mysql_db_shell \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" From c311e9762c39a27cc4eba4962d78ea234cf676a1 Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Tue, 3 Sep 2024 11:38:52 +0200 Subject: [PATCH 10/10] cleanup finished --- scripts/backup | 4 ++-- scripts/install | 2 -- scripts/restore | 4 ++-- scripts/upgrade | 15 ++++++++------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/scripts/backup b/scripts/backup index 7bea1e1..7531796 100644 --- a/scripts/backup +++ b/scripts/backup @@ -7,10 +7,11 @@ source /usr/share/yunohost/helpers ynh_print_info "Declaring files to be backed up..." #================================================= -# BACKUP THE APP MAIN DIR +# BACKUP THE APP MAIN DIR & DATA DIR #================================================= ynh_backup "$install_dir" +ynh_backup "$data_dir" #================================================= # BACKUP THE NGINX CONFIGURATION @@ -44,7 +45,6 @@ ynh_backup "/etc/logrotate.d/$app" #================================================= ynh_backup "/etc/cron.d/$app" -ynh_backup "$data_dir" #================================================= # BACKUP THE DATABASE diff --git a/scripts/install b/scripts/install index f851eb8..dbca065 100755 --- a/scripts/install +++ b/scripts/install @@ -53,8 +53,6 @@ ynh_script_progression "Pulling in external libraries with Composer..." ynh_composer_install ynh_composer_exec install --no-dev -chown -R $app:www-data "$install_dir" - #================================================= # SPECIFIC SETUP #================================================= diff --git a/scripts/restore b/scripts/restore index 9d4f088..d429835 100644 --- a/scripts/restore +++ b/scripts/restore @@ -5,11 +5,12 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= -# RESTORE THE APP MAIN DIR +# RESTORE THE APP MAIN DIR & DATA DIR #================================================= ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" +ynh_restore "$data_dir" #================================================= # RESTORE THE DATABASE @@ -33,7 +34,6 @@ ynh_systemctl --action=restart --service=fail2ban # RESTORE CRON JOBS #================================================= ynh_restore "/etc/cron.d/$app" -ynh_restore "$data_dir" #================================================= # RESTORE LOGROTATE diff --git a/scripts/upgrade b/scripts/upgrade index 92dfc64..8c26617 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -24,9 +24,12 @@ if ynh_app_upstream_version_changed then ynh_script_progression "Upgrading source files..." - # First we save what we need to keep - mv $install_dir/store $data_dir/ - mv $install_dir/cache $data_dir/ + # Move data to the data_dir if it's still in install_dir + if [ ! -d "$data_dir/store" ] + then + ynh_exec_as_app mv $install_dir/store $data_dir/ + ynh_exec_as_app mv $install_dir/cache $data_dir/ + fi # Then we remove the previous install ynh_safe_rm $install_dir @@ -35,10 +38,8 @@ then ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" # We restore what we previously saved - mv $data_dir/store $install_dir/ - mv $data_dir/cache $install_dir/ - - ynh_exec_as_app chmod -R 775 $install_dir/store $install_dir/cache + ynh_exec_as_app ln -s $data_dir/store $install_dir/ + ynh_exec_as_app ln -s $data_dir/cache $install_dir/ fi #=================================================