From 975b2a7f18323575547a415663c7e00688390289 Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 2 Sep 2024 14:47:01 +0200 Subject: [PATCH] Testing (#61) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [autopatch] Automatic patch attempt for helpers 2.1 (#60) * [autopatch] Automatic patch attempt for helpers 2.1 * cleaning --------- Co-authored-by: Yunohost-Bot <> Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Auto-update READMEs * Update manifest.toml * Auto-update READMEs * Update DESCRIPTION_fr.md * Auto-update READMEs --------- Co-authored-by: YunoHost Bot Co-authored-by: yunohost-bot --- .gitignore | 2 + ALL_README.md | 2 + README.md | 4 +- README_es.md | 4 +- README_eu.md | 4 +- README_fr.md | 5 +- README_gl.md | 4 +- README_id.md | 61 +++++++++++++++++++++++ README_ru.md | 61 +++++++++++++++++++++++ README_zh_Hans.md | 4 +- conf/extra_php-fpm.conf | 4 -- conf/nginx.conf | 2 +- config_panel.toml.example | 19 ------- doc/.DS_Store | Bin 6148 -> 0 bytes doc/DESCRIPTION_fr.md | 1 + manifest.toml | 6 ++- scripts/_common.sh | 14 +----- scripts/backup | 27 +++------- scripts/change_url | 12 ++--- scripts/config | 102 -------------------------------------- scripts/install | 31 ++++-------- scripts/remove | 16 ++---- scripts/restore | 31 ++++-------- scripts/upgrade | 33 +++--------- 24 files changed, 185 insertions(+), 264 deletions(-) create mode 100644 README_id.md create mode 100644 README_ru.md delete mode 100644 conf/extra_php-fpm.conf delete mode 100644 config_panel.toml.example delete mode 100644 doc/.DS_Store delete mode 100644 scripts/config diff --git a/.gitignore b/.gitignore index d38c149..0f5a9f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.swp *~ +*.sw[op] +.DS_Store 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 1f90aaa..d2d350f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # myTinyTodo for YunoHost -[![Integration level](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![Working status](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Working status](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![Install myTinyTodo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -30,7 +30,7 @@ Simple way to manage your todo lists. - Password protection -**Shipped version:** 1.8.1~ynh1 +**Shipped version:** 1.8.1~ynh2 **Demo:** diff --git a/README_es.md b/README_es.md index 93a4225..e0dd7a8 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # myTinyTodo para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![Instalar myTinyTodo con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -30,7 +30,7 @@ Simple way to manage your todo lists. - Password protection -**Versión actual:** 1.8.1~ynh1 +**Versión actual:** 1.8.1~ynh2 **Demo:** diff --git a/README_eu.md b/README_eu.md index 1b0c304..3aec940 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # myTinyTodo YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![Instalatu myTinyTodo YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -30,7 +30,7 @@ Simple way to manage your todo lists. - Password protection -**Paketatutako bertsioa:** 1.8.1~ynh1 +**Paketatutako bertsioa:** 1.8.1~ynh2 **Demoa:** diff --git a/README_fr.md b/README_fr.md index a823612..cf06d69 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # myTinyTodo pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![Installer myTinyTodo avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -17,6 +17,7 @@ Il NE doit PAS être modifié à la main. ## Vue d’ensemble myTinyTodo permet de Gérer efficacement vos listes de tâches. + ### Caractéristiques - Plusieurs listes @@ -29,7 +30,7 @@ myTinyTodo permet de Gérer efficacement vos listes de tâches. - Mot de passe de protection -**Version incluse :** 1.8.1~ynh1 +**Version incluse :** 1.8.1~ynh2 **Démo :** diff --git a/README_gl.md b/README_gl.md index 3dd95bc..ef99c4b 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # myTinyTodo para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![Instalar myTinyTodo con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -30,7 +30,7 @@ Simple way to manage your todo lists. - Password protection -**Versión proporcionada:** 1.8.1~ynh1 +**Versión proporcionada:** 1.8.1~ynh2 **Demo:** diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..4c7d6c2 --- /dev/null +++ b/README_id.md @@ -0,0 +1,61 @@ + + +# myTinyTodo untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) + +[![Pasang myTinyTodo dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang myTinyTodo 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 + +Simple way to manage your todo lists. + +### Features + +- Multiple lists +- Task notes +- Tags (and tag cloud) +- Due dates +- Priority (-1, 0, +1, +2) +- Different sortings including sort by drag-and-drop +- Search +- Password protection + + +**Versi terkirim:** 1.8.1~ynh2 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada myTinyTodo](./doc/screenshots/shot-v14b1.png) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Dokumentasi admin resmi: +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/mytinytodo_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/mytinytodo_ynh/tree/testing --debug +atau +sudo yunohost app upgrade mytinytodo -u https://github.com/YunoHost-Apps/mytinytodo_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..cc6e682 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,61 @@ + + +# myTinyTodo для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) + +[![Установите myTinyTodo с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить myTinyTodo быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Simple way to manage your todo lists. + +### Features + +- Multiple lists +- Task notes +- Tags (and tag cloud) +- Due dates +- Priority (-1, 0, +1, +2) +- Different sortings including sort by drag-and-drop +- Search +- Password protection + + +**Поставляемая версия:** 1.8.1~ynh2 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана myTinyTodo](./doc/screenshots/shot-v14b1.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/mytinytodo_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/mytinytodo_ynh/tree/testing --debug +или +sudo yunohost app upgrade mytinytodo -u https://github.com/YunoHost-Apps/mytinytodo_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 8c08de5..c611900 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 myTinyTodo -[![集成程度](https://dash.yunohost.org/integration/mytinytodo.svg)](https://dash.yunohost.org/appci/app/mytinytodo) ![工作状态](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/mytinytodo.svg)](https://ci-apps.yunohost.org/ci/apps/mytinytodo/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/mytinytodo.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/mytinytodo.maintain.svg) [![使用 YunoHost 安装 myTinyTodo](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=mytinytodo) @@ -30,7 +30,7 @@ Simple way to manage your todo lists. - Password protection -**分发版本:** 1.8.1~ynh1 +**分发版本:** 1.8.1~ynh2 **演示:** 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/nginx.conf b/conf/nginx.conf index e5f74d4..f7cfcea 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -12,7 +12,7 @@ location __PATH__/ { try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - 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; diff --git a/config_panel.toml.example b/config_panel.toml.example deleted file mode 100644 index 28b6445..0000000 --- a/config_panel.toml.example +++ /dev/null @@ -1,19 +0,0 @@ -version = "1.0" - -[main] -name = "myTinyTodo configuration" - - [main.config] - name = "Configuration Options" - - [main.config.title] - ask = "Set title" - type = "string" - help = "Specify a title for your todolist." - bind = "title:__INSTALL_DIR__/config.php" - - [main.config.set_password] - ask = "Set password" - type = "password" - help = "Specify password here to protect your tasks from modification, or leave empty that everyone could read/write todolist." - bind = "password:__INSTALL_DIR__/config.php" diff --git a/doc/.DS_Store b/doc/.DS_Store deleted file mode 100644 index 30e5aa1e6134f879f04d204862e250ead8ee500b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK!EV$r5FKw9h}#OK5{FjeV2ML7dsx_(UZbVuRH=wm^w7dKAr>1cva2N9J*-xW z_y9ftt}XmW;UoBw-aBJ^LDkZ0MJrDMm9seT(Gb&^T&MoeLU3TxK8R()lbSn_%zNlnI`2yp4G#Bsdfr^D%D=Oo7A#Aq~Lw6 z3kqFFky zq2EX9ZxfQBO=k&0;V^R8Si~L_W>XPuDsx8+X4BCxTwLU^v1rqQnUS%M8=1Ki3Nxdl zUzl)UkwxEn20R1T8CbBlA?^P=H=qBnC;2=^gL=TGp5im6P#xroM3|s*i-eo=j diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 85410ec..ac48099 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,4 +1,5 @@ myTinyTodo permet de Gérer efficacement vos listes de tâches. + ### Caractéristiques - Plusieurs listes diff --git a/manifest.toml b/manifest.toml index 4c5d270..80e6540 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "myTinyTodo" description.en = "Open source to-do list script" description.fr = "Gestionnaire de todo list" -version = "1.8.1~ynh1" +version = "1.8.1~ynh2" maintainers = ["plabuse"] @@ -17,7 +17,8 @@ admindoc = "https://www.mytinytodo.net/faq.php" code = "https://github.com/maxpozdeev/mytinytodo" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.29" +helpers_version = "2.1" architectures = "all" multi_instance = false @@ -54,6 +55,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index b787593..28ab41e 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,46 +1,33 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - 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 OF THE MAIN DIR OF THE APP #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP OF 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 THE MYSQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info "Backing up 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/change_url b/scripts/change_url index 7ecec61..2678882 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,22 +1,16 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source /usr/share/yunohost/helpers #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/config b/scripts/config deleted file mode 100644 index b9e79f8..0000000 --- a/scripts/config +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -# In simple cases, you don't need a config script. - -# With a simple config_panel.toml, you can write in the app settings, in the -# upstream config file or replace complete files (logo ...) and restart services. - -# The config scripts allows you to go further, to handle specific cases -# (validation of several interdependent fields, specific getter/setter for a value, -# display dynamic informations or choices, pre-loading of config type .cube... ). - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -final_path=$(ynh_app_setting_get $app final_path) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -get__amount() { - # Here we can imagine to have an API call to stripe to know the amount of donation during a month - local amount = 200 - - # It's possible to change some properties of the question by overriding it: - if [ $amount -gt 100 ] - then - cat << EOF -style: success -value: $amount -ask: - en: A lot of donation this month: **$amount €** -EOF - else - cat << EOF -style: danger -value: $amount -ask: - en: Not so much donation this month: $amount € -EOF - fi -} - -get__prices() { - local prices = "$(grep "DONATION\['" "$final_path/settings.py" | sed -r "s@^DONATION\['([^']*)'\]\['([^']*)'\] = '([^']*)'@\1/\2/\3@g" | sed -z 's/\n/,/g;s/,$/\n/')" - if [ "$prices" == "," ]; - then - # Return YNH_NULL if you prefer to not return a value at all. - echo YNH_NULL - else - echo $prices - fi -} - - -#================================================= -# SPECIFIC VALIDATORS FOR TOML SHORT KEYS -#================================================= -validate__publishable_key() { - - # We can imagine here we test if the key is really a publisheable key - (is_secret_key $publishable_key) && - echo 'This key seems to be a secret key' -} - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= -set__prices() { - - #--------------------------------------------- - # IMPORTANT: setter are trigger only if a change is detected - #--------------------------------------------- - for price in $(echo $prices | sed "s/,/ /"); do - frequency=$(echo $price | cut -d/ -f1) - currency=$(echo $price | cut -d/ -f2) - price_id=$(echo $price | cut -d/ -f3) - sed "d/DONATION\['$frequency'\]\['$currency'\]" "$final_path/settings.py" - - echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py" - done - - #--------------------------------------------- - # IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too - #--------------------------------------------- - ynh_app_setting_set $app prices $prices -} - -#================================================= -# GENERIC FINALIZATION -#================================================= -ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 17bb11f..2533374 100644 --- a/scripts/install +++ b/scripts/install @@ -1,56 +1,43 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # CREATE A MYSQL DATABASE #================================================= -ynh_script_progression --message="Creating a MySQL database..." --weight=2 +ynh_script_progression "Creating a MySQL database..." -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ../conf/sql/mytinytodo.sql +ynh_mysql_db_shell < ../conf/sql/mytinytodo.sql #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=3 +ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 +ynh_script_progression "Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # MODIFY A CONFIG FILE #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." salt=$(ynh_string_random --length=16) -ynh_add_config --template="config.php" --destination="$install_dir/config.php" - -chmod 640 "$install_dir/config.php" -chown $app:$app "$install_dir/config.php" +ynh_config_add --template="config.php" --destination="$install_dir/config.php" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 61db822..2528648 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,27 +1,19 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing NGINX web server configuration..." -# Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_config_remove_phpfpm #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index df14dba..3a59f61 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,47 +1,36 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=2 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_restore "$install_dir" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Reconfiguring PHP-FPM..." --weight=2 +ynh_script_progression "Reconfiguring PHP-FPM..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_db_shell < ./db.sql -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=2 +ynh_script_progression "Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=php$php_version-fpm --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 7a20787..eb9dcab 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,48 +1,27 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=2 +ynh_setup_source --dest_dir="$install_dir" --keep="db config.php" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="db config.php" -fi - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +ynh_script_progression "Upgrading PHP-FPM configuration..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm -# Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"