diff --git a/.gitignore b/.gitignore index 783a4ae..8f144f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ *.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 036e561..c652225 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Tiny File Manager for YunoHost -[![Integration level](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![Working status](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Working status](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![Install Tiny File Manager with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**Shipped version:** 2.5.3~ynh2 +**Shipped version:** 2.5.3~ynh3 **Demo:** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## Documentation and resources - Official app website: -- Official user documentation: - Official admin documentation: - Upstream app code repository: - YunoHost Store: diff --git a/README_es.md b/README_es.md index 5763515..b77eea8 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Tiny File Manager para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![Instalar Tiny File Manager con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**Versión actual:** 2.5.3~ynh2 +**Versión actual:** 2.5.3~ynh3 **Demo:** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## Documentaciones y recursos - Sitio web oficial: -- Documentación usuario oficial: - Documentación administrador oficial: - Repositorio del código fuente oficial de la aplicación : - Catálogo YunoHost: diff --git a/README_eu.md b/README_eu.md index c99335c..8962093 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Tiny File Manager YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![Instalatu Tiny File Manager YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**Paketatutako bertsioa:** 2.5.3~ynh2 +**Paketatutako bertsioa:** 2.5.3~ynh3 **Demoa:** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## Dokumentazioa eta baliabideak - Aplikazioaren webgune ofiziala: -- Erabiltzaileen dokumentazio ofiziala: - Administratzaileen dokumentazio ofiziala: - Jatorrizko aplikazioaren kode-gordailua: - YunoHost Denda: diff --git a/README_fr.md b/README_fr.md index f34f8f3..63b36c2 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Tiny File Manager pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![Installer Tiny File Manager avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**Version incluse :** 2.5.3~ynh2 +**Version incluse :** 2.5.3~ynh3 **Démo :** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## Documentations et ressources - Site officiel de l’app : -- Documentation officielle utilisateur : - Documentation officielle de l’admin : - Dépôt de code officiel de l’app : - YunoHost Store : diff --git a/README_gl.md b/README_gl.md index 9523445..f56ac07 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Tiny File Manager para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![Instalar Tiny File Manager con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**Versión proporcionada:** 2.5.3~ynh2 +**Versión proporcionada:** 2.5.3~ynh3 **Demo:** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## Documentación e recursos - Web oficial da app: -- Documentación oficial para usuarias: - Documentación oficial para admin: - Repositorio de orixe do código: - Tenda YunoHost: diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..d199f86 --- /dev/null +++ b/README_id.md @@ -0,0 +1,68 @@ + + +# Tiny File Manager untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) + +[![Pasang Tiny File Manager dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Tiny File Manager 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 + +# Tiny File Manager + +TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes. + +### Features + +- :iphone: Mobile friendly view for touch devices +- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files +- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter +- :file_folder: Ability to create folders and files +- :gift: Ability to compress, extract files (`zip`, `tar`) +- :sunglasses: Support user permissions - based on session and each user root folder mapping +- :floppy_disk: Copy direct file URL +- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style +- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer +- :zap: Backup files and IP blacklist and whitelist +- :mag_right: Search - Search and filter files using `datatable js` +- :file_folder: Exclude folders and files from listing + + + +**Versi terkirim:** 2.5.3~ynh3 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Tiny File Manager](./doc/screenshots/screenshot.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/tinyfilemanager_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/tinyfilemanager_ynh/tree/testing --debug +atau +sudo yunohost app upgrade tinyfilemanager -u https://github.com/YunoHost-Apps/tinyfilemanager_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..1cae2aa --- /dev/null +++ b/README_ru.md @@ -0,0 +1,68 @@ + + +# Tiny File Manager для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) + +[![Установите Tiny File Manager с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Tiny File Manager быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +# Tiny File Manager + +TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes. + +### Features + +- :iphone: Mobile friendly view for touch devices +- :information_source: Basic features likes Create, Delete, Modify, View, Quick Preview, Download, Copy and Move files +- :arrow_double_up: Ajax Upload, Ability to drag & drop, upload from URL, multiple files upload with file extensions filter +- :file_folder: Ability to create folders and files +- :gift: Ability to compress, extract files (`zip`, `tar`) +- :sunglasses: Support user permissions - based on session and each user root folder mapping +- :floppy_disk: Copy direct file URL +- :pencil2: Cloud9 IDE - Syntax highlighting for over `150+` languages, Over `35+` themes with your favorite programming style +- :page_facing_up: Google/Microsoft doc viewer helps you preview `PDF/DOC/XLS/PPT/etc`. 25 MB can be previewed with the Google Drive viewer +- :zap: Backup files and IP blacklist and whitelist +- :mag_right: Search - Search and filter files using `datatable js` +- :file_folder: Exclude folders and files from listing + + + +**Поставляемая версия:** 2.5.3~ynh3 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Tiny File Manager](./doc/screenshots/screenshot.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/tinyfilemanager_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/tinyfilemanager_ynh/tree/testing --debug +или +sudo yunohost app upgrade tinyfilemanager -u https://github.com/YunoHost-Apps/tinyfilemanager_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 1af920e..48f15a4 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Tiny File Manager -[![集成程度](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://dash.yunohost.org/appci/app/tinyfilemanager) ![工作状态](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/tinyfilemanager.svg)](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/tinyfilemanager.maintain.svg) [![使用 YunoHost 安装 Tiny File Manager](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=tinyfilemanager) @@ -37,7 +37,7 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil -**分发版本:** 2.5.3~ynh2 +**分发版本:** 2.5.3~ynh3 **演示:** @@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil ## 文档与资源 - 官方应用网站: -- 官方用户文档: - 官方管理文档: - 上游应用代码库: - YunoHost 商店: diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 43f8232..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] = 10G -php_admin_value[post_max_size] = 10G diff --git a/conf/nginx.conf b/conf/nginx.conf index c52a08d..579ad7d 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/manifest.toml b/manifest.toml index af27846..6d7509a 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Tiny File Manager" description.en = "Web based file manager" description.fr = "Gestionnaire de fichiers simple" -version = "2.5.3~ynh2" +version = "2.5.3~ynh3" maintainers = ["Jarod5001"] @@ -14,11 +14,11 @@ license = "GPL-3.0" website = "https://tinyfilemanager.github.io/" demo = "https://tinyfilemanager.github.io/demo/" admindoc = "https://github.com/prasathmani/tinyfilemanager/wiki" -userdoc = "https://github.com/prasathmani/tinyfilemanager" code = "https://github.com/prasathmani/tinyfilemanager" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.29" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = false @@ -48,6 +48,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 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 62ffbee..a0da375 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,46 +1,32 @@ #!/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 DATA DIR #================================================= -ynh_backup --src_path="$data_dir" --is_big +ynh_backup "$data_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM 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" #================================================= # 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 5396ff8..39d37fc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,23 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +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" --time --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 300cd90..e97fbca 100755 --- a/scripts/install +++ b/scripts/install @@ -1,58 +1,43 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set --key=php_upload_max_filesize --value=10G + #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= timezone="$(cat /etc/timezone)" -# passhash=php hash.php $password #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 +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" - -# rename tinyfilemanager to index mv $install_dir/tinyfilemanager.php $install_dir/index.php #================================================= -# PHP-FPM CONFIGURATION +# APP INITIAL CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression "Adding $app's configuration files..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config - -# Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add --template="config.php" --destination="$install_dir/config.php" #================================================= -# ADD A CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." -ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" +ynh_config_add_phpfpm -chmod 600 "$install_dir/config.php" -chown $app:$app "$install_dir/config.php" +ynh_config_add_nginx #================================================= # 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..ee9c6ec 100755 --- 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 +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." -# 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 ab3393f..190bc83 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/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 @@ -13,43 +7,38 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 +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 DATA DIRECTORY #================================================= -ynh_script_progression --message="Restoring the data directory..." --weight=1 +ynh_script_progression "Restoring the data directory..." -ynh_restore_file --origin_path="$data_dir" --not_mandatory +ynh_restore "$data_dir" chown -R $app:www-data "$data_dir" #================================================= -# RESTORE THE PHP-FPM CONFIGURATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -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" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +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 13b42a6..9d00ea5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,68 +1,41 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set_default --key=php_upload_max_filesize --value=10G + #================================================= # LOAD SETTINGS #================================================= timezone="$(cat /etc/timezone)" -#================================================= -# 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=1 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" -fi - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_setup_source --dest_dir="$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.php" --destination="$install_dir/config.php" +ynh_script_progression "Updating $app's configuration files..." -chmod 600 "$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="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"