diff --git a/README.md b/README.md index 5f9eaed..2f4be89 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Wallabag for YunoHost -[![Integration level](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Working status](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![Working status](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Install Wallabag with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html). -**Shipped version:** 2.5.4~ynh3 +**Shipped version:** 2.5.4~ynh4 **Demo:** diff --git a/README_es.md b/README_es.md index 968ab78..08f5b13 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Wallabag para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Instalar Wallabag con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html). -**Versión actual:** 2.5.4~ynh3 +**Versión actual:** 2.5.4~ynh4 **Demo:** diff --git a/README_eu.md b/README_eu.md index 07dee23..a2cc594 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Wallabag YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Instalatu Wallabag YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html). -**Paketatutako bertsioa:** 2.5.4~ynh3 +**Paketatutako bertsioa:** 2.5.4~ynh4 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 898967b..2ba83eb 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Wallabag pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Installer Wallabag avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ Sont disponibles une interface web, des add-ons pour navigateurs (Firefox/Chrome La mise à niveau depuis le paquet YunoHost de [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) demande une opération manuelle, c'est pourquoi un nouveau paquet est fournit. Pour le processus de migration, merci de vous référer à [la documentation officiel de Wallabag](https://doc.wallabag.org/fr/user/import/wallabagv1.html). -**Version incluse :** 2.5.4~ynh3 +**Version incluse :** 2.5.4~ynh4 **Démo :** diff --git a/README_gl.md b/README_gl.md index 60cdef2..05a8409 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Wallabag para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![Instalar Wallabag con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html). -**Versión proporcionada:** 2.5.4~ynh3 +**Versión proporcionada:** 2.5.4~ynh4 **Demo:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index cdd221c..b4f6c5b 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Wallabag -[![集成程度](https://dash.yunohost.org/integration/wallabag2.svg)](https://dash.yunohost.org/appci/app/wallabag2) ![工作状态](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/wallabag2.svg)](https://ci-apps.yunohost.org/ci/apps/wallabag2/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/wallabag2.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/wallabag2.maintain.svg) [![使用 YunoHost 安装 Wallabag](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=wallabag2) @@ -22,7 +22,7 @@ It provides a web interface, browser (Firefox/Chrome/Opera) add-ons, mobile apps Upgrade from the YunoHost [Wallabag v1](https://github.com/YunoHost-Apps/wallabag_ynh) app requires a manual operation. That's why it's provided as a new package. For the migration process, please refer to the [Wallabag official documentation](https://doc.wallabag.org/en/user/import/wallabagv1.html). -**分发版本:** 2.5.4~ynh3 +**分发版本:** 2.5.4~ynh4 **演示:** diff --git a/conf/parameters.yml b/conf/parameters.yml new file mode 100644 index 0000000..5cc47fb --- /dev/null +++ b/conf/parameters.yml @@ -0,0 +1,74 @@ +# This file is a "template" of what your parameters.yml file should look like +parameters: + # Uncomment these settings or manually update your parameters.yml + # to use docker-compose + # + # database_driver: %env.database_driver% + # database_host: %env.database_host% + # database_port: %env.database_port% + # database_name: %env.database_name% + # database_user: %env.database_user% + # database_password: %env.database_password% + + database_driver: pdo_mysql + database_host: 127.0.0.1 + database_port: ~ + database_name: __DB_NAME__ + database_user: __DB_USER__ + database_password: __DB_PWD__ + # For SQLite, database_path should be "%kernel.project_dir%/data/db/wallabag.sqlite" + database_path: null + database_table_prefix: null + database_socket: null + # with PostgreSQL and SQLite, you must set "utf8" + database_charset: utf8mb4 + + domain_name: https://__DOMAIN____PATH__ + server_name: "Your wallabag instance" + + mailer_transport: smtp + mailer_user: ~ + mailer_password: ~ + mailer_host: 127.0.0.1 + mailer_port: false + mailer_encryption: ~ + mailer_auth_mode: ~ + + locale: en + + # A secret key that's used to generate certain security-related tokens + secret: __DESKEY__ + + # two factor stuff + twofactor_auth: true + twofactor_sender: no-reply@wallabag.org + + # fosuser stuff + fosuser_registration: false + fosuser_confirmation: true + + # how long the access token should live in seconds for the API + fos_oauth_server_access_token_lifetime: 3600 + # how long the refresh token should life in seconds for the API + fos_oauth_server_refresh_token_lifetime: 1209600 + + from_email: no-reply@wallabag.org + + rss_limit: 50 + + # RabbitMQ processing + rabbitmq_host: localhost + rabbitmq_port: 5672 + rabbitmq_user: guest + rabbitmq_password: guest + rabbitmq_prefetch_count: 10 + + # Redis processing + redis_scheme: tcp + redis_host: localhost + redis_port: 6379 + redis_path: null + redis_password: null + + # sentry logging + sentry_dsn: ~ diff --git a/hooks/post_user_create b/hooks/post_user_create index 44fba5b..e15237a 100644 --- a/hooks/post_user_create +++ b/hooks/post_user_create @@ -1,5 +1,8 @@ #!/bin/bash +# Source YunoHost helpers +source /usr/share/yunohost/helpers + app="__APP__" user="__APP__" install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) @@ -9,9 +12,6 @@ phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) username=$1 user_email=$2 -# Source YunoHost helpers -source /usr/share/yunohost/helpers - # Generate a random password user_pass=$(ynh_string_random) diff --git a/hooks/post_user_delete b/hooks/post_user_delete index ebf27c4..b181ac1 100644 --- a/hooks/post_user_delete +++ b/hooks/post_user_delete @@ -1,5 +1,8 @@ #!/bin/bash +# Source YunoHost helpers +source /usr/share/yunohost/helpers + app="__APP__" user="__APP__" install_dir=$(ynh_app_setting_get --app="$app" --key=install_dir) diff --git a/manifest.toml b/manifest.toml index b4f08d6..3521977 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Wallabag" description.en = "Save and classify articles. Read them later" description.fr = "Enregistrez et classez les articles. Lisez-les plus tard" -version = "2.5.4~ynh3" +version = "2.5.4~ynh4" maintainers = ["lapineige"] @@ -63,18 +63,18 @@ ram.runtime = "50M" [resources.apt] packages = [ "mariadb-server", - "php7.4-cli", - "php7.4-curl", - "php7.4-gd", - "php7.4-gettext", - "php7.4-intl", - "php7.4-json", - "php7.4-ldap", - "php7.4-mbstring", - "php7.4-mysql", - "php7.4-redis", - "php7.4-tidy", - "php7.4-xml", + "php8.2-cli", + "php8.2-curl", + "php8.2-gd", + "php8.2-gettext", + "php8.2-intl", + "php8.2-json", + "php8.2-ldap", + "php8.2-mbstring", + "php8.2-mysql", + "php8.2-redis", + "php8.2-tidy", + "php8.2-xml", ] [resources.database] diff --git a/scripts/_common.sh b/scripts/_common.sh index 7760641..9934791 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,11 @@ # COMMON VARIABLES #================================================= -wb_conf="$install_dir/app/config/parameters.yml" +# Define a function to execute commands with `php_exec` +php_exec() { + (cd "$install_dir" && ynh_exec_as "$app" \ + php${phpversion} "$install_dir/bin/console" --no-interaction --env=prod "$@") +} #================================================= # PERSONAL HELPERS diff --git a/scripts/change_url b/scripts/change_url index ae6fd3f..05e3046 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -24,7 +24,7 @@ ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name <<< "UPDATE internal_setting SET value = 'https://$new_domain$new_path' WHERE name = 'wallabag_url'" # Change domain name in parameters.yml -ynh_replace_string --target_file="$wb_conf" --match_string="domain_name: .*" --replace_string="domain_name: https://$new_domain$new_path" +ynh_replace_string --target_file="$install_dir/app/config/parameters.yml" --match_string="domain_name: .*" --replace_string="domain_name: https://$new_domain$new_path" # If "Download images locally" option has been enabled in Internal Settings download_images_enabled=$(ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ diff --git a/scripts/install b/scripts/install index 21f3764..fc4b7cb 100644 --- a/scripts/install +++ b/scripts/install @@ -40,36 +40,24 @@ fi #================================================= ynh_script_progression --message="Adding $app's configuration files..." --weight=1 -# Copy and set Wallabag dist configuration -cp "$install_dir/app/config/parameters.yml.dist" "$wb_conf" +ynh_add_config --template="parameters.yml" --destination="$install_dir/app/config/parameters.yml" -ynh_replace_string --target_file="$wb_conf" --match_string="fosuser_registration: true" --replace_string="fosuser_registration: false" -ynh_replace_string --target_file="$wb_conf" --match_string="database_name: wallabag" --replace_string="database_name: $db_name" -ynh_replace_string --target_file="$wb_conf" --match_string="database_user: root" --replace_string="database_user: $db_user" -ynh_replace_string --target_file="$wb_conf" --match_string="database_password: ~" --replace_string="database_password: $db_pwd" -ynh_replace_string --target_file="$wb_conf" --match_string="database_table_prefix: wallabag_" --replace_string="database_table_prefix: null" -ynh_replace_string --target_file="$wb_conf" --match_string="secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" --replace_string="secret: $deskey" -ynh_replace_string --target_file="$wb_conf" --match_string="domain_name: https://your-wallabag-url-instance.com" --replace_string="domain_name: https://$domain$path" - -chmod 600 "$wb_conf" -chown -R "$app:www-data" "$install_dir" - -# Alias for php-cli execution command -php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod) +chmod 600 "$install_dir/app/config/parameters.yml" +chown "$app:$app" "$install_dir/app/config/parameters.yml" # Install dependencies and Wallabag -ynh_exec_warn_less ynh_exec_as "$app" "${php_exec[@]}" wallabag:install +php_exec wallabag:install # Add users to Wallabag for username in $(ynh_user_list); do user_email=$(ynh_user_get_info --username="$username" --key=mail) # We don't care about that thanks to LDAP user_pass=$(ynh_string_random) - ynh_exec_as "$app" "${php_exec[@]}" fos:user:create "$username" "$user_email" "$user_pass" + php_exec fos:user:create "$username" "$user_email" "$user_pass" done # Set admin user -ynh_exec_as "$app" "${php_exec[@]}" fos:user:promote --super "$admin" +php_exec fos:user:promote --super "$admin" # Configure Wallabag instance URL ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ diff --git a/scripts/restore b/scripts/restore index d9fc61c..dd1c787 100644 --- a/scripts/restore +++ b/scripts/restore @@ -23,8 +23,6 @@ if [ -e "$install_dir/var/cache/prod/appProdProjectContainer.php" ]; then chmod 700 "$install_dir/var/cache/prod/appProdProjectContainer.php" fi -chmod 600 "$wb_conf" - #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 605472d..e040482 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,11 +7,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= -# ynh_script_progression --message="Ensuring downward compatibility..." - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -37,26 +32,9 @@ fi #================================================= ynh_script_progression --message="Reconfiguring $app..." --weight=1 -# Copy and set Wallabag dist configuration -cp "$install_dir/app/config/parameters.yml.dist" "$wb_conf" - -ynh_replace_string --target_file="$wb_conf" --match_string="fosuser_registration: true" --replace_string="fosuser_registration: false" -ynh_replace_string --target_file="$wb_conf" --match_string="database_name: wallabag" --replace_string="database_name: $db_name" -ynh_replace_string --target_file="$wb_conf" --match_string="database_user: root" --replace_string="database_user: $db_user" -ynh_replace_string --target_file="$wb_conf" --match_string="database_password: ~" --replace_string="database_password: $db_pwd" -ynh_replace_string --target_file="$wb_conf" --match_string="database_table_prefix: wallabag_" --replace_string="database_table_prefix: null" -ynh_replace_string --target_file="$wb_conf" --match_string="secret: ovmpmAWXRCabNlMgzlzFXDYmCFfzGv" --replace_string="secret: $deskey" -ynh_replace_string --target_file="$wb_conf" --match_string="domain_name: https://your-wallabag-url-instance.com" --replace_string="domain_name: https://$domain$path" - -chmod 600 "$wb_conf" -chown -R "$app:www-data" "$install_dir" - -# Alias for php-cli execution command -php_exec=("php$phpversion" "$install_dir/bin/console" --no-interaction --env=prod) - # Upgrade database and clear the cache -ynh_exec_as "$app" "${php_exec[@]}" doctrine:migrations:migrate -ynh_exec_as "$app" "${php_exec[@]}" cache:clear +php_exec doctrine:migrations:migrate +php_exec cache:clear # Configure Wallabag instance URL ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \