mirror of
https://github.com/YunoHost-Apps/tinyfilemanager_ynh.git
synced 2024-09-03 20:36:01 +02:00
commit
0ee1750af6
21 changed files with 206 additions and 271 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
*~
|
||||
*.sw[op]
|
||||
.DS_Store
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -5,7 +5,7 @@ It shall NOT be edited by hand.
|
|||
|
||||
# Tiny File Manager for YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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:** <https://tinyfilemanager.github.io/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: <https://tinyfilemanager.github.io/>
|
||||
- Official user documentation: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Official admin documentation: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Upstream app code repository: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- YunoHost Store: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
|
@ -5,7 +5,7 @@ No se debe editar a mano.
|
|||
|
||||
# Tiny File Manager para Yunohost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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:** <https://tinyfilemanager.github.io/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: <https://tinyfilemanager.github.io/>
|
||||
- Documentación usuario oficial: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Documentación administrador oficial: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Repositorio del código fuente oficial de la aplicación : <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Catálogo YunoHost: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
|
@ -5,7 +5,7 @@ EZ editatu eskuz.
|
|||
|
||||
# Tiny File Manager YunoHost-erako
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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:** <https://tinyfilemanager.github.io/demo/>
|
||||
|
||||
|
@ -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: <https://tinyfilemanager.github.io/>
|
||||
- Erabiltzaileen dokumentazio ofiziala: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Administratzaileen dokumentazio ofiziala: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- YunoHost Denda: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
|
@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.
|
|||
|
||||
# Tiny File Manager pour YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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 :** <https://tinyfilemanager.github.io/demo/>
|
||||
|
||||
|
@ -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 : <https://tinyfilemanager.github.io/>
|
||||
- Documentation officielle utilisateur : <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Documentation officielle de l’admin : <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Dépôt de code officiel de l’app : <https://github.com/prasathmani/tinyfilemanager>
|
||||
- YunoHost Store : <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
|
@ -5,7 +5,7 @@ NON debe editarse manualmente.
|
|||
|
||||
# Tiny File Manager para YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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:** <https://tinyfilemanager.github.io/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: <https://tinyfilemanager.github.io/>
|
||||
- Documentación oficial para usuarias: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Documentación oficial para admin: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Repositorio de orixe do código: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Tenda YunoHost: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
68
README_id.md
Normal file
68
README_id.md
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!--
|
||||
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
Ini TIDAK boleh diedit dengan tangan.
|
||||
-->
|
||||
|
||||
# Tiny File Manager untuk YunoHost
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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:** <https://tinyfilemanager.github.io/demo/>
|
||||
|
||||
## Tangkapan Layar
|
||||
|
||||

|
||||
|
||||
## Dokumentasi dan sumber daya
|
||||
|
||||
- Website aplikasi resmi: <https://tinyfilemanager.github.io/>
|
||||
- Dokumentasi admin resmi: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Depot kode aplikasi hulu: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Gudang YunoHost: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
- Laporkan bug: <https://github.com/YunoHost-Apps/tinyfilemanager_ynh/issues>
|
||||
|
||||
## 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:** <https://yunohost.org/packaging_apps>
|
68
README_ru.md
Normal file
68
README_ru.md
Normal file
|
@ -0,0 +1,68 @@
|
|||
<!--
|
||||
Важно: этот README был автоматически сгенерирован <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
Он НЕ ДОЛЖЕН редактироваться вручную.
|
||||
-->
|
||||
|
||||
# Tiny File Manager для YunoHost
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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
|
||||
|
||||
**Демо-версия:** <https://tinyfilemanager.github.io/demo/>
|
||||
|
||||
## Снимки экрана
|
||||
|
||||

|
||||
|
||||
## Документация и ресурсы
|
||||
|
||||
- Официальный веб-сайт приложения: <https://tinyfilemanager.github.io/>
|
||||
- Официальная документация администратора: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- Репозиторий кода главной ветки приложения: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- Магазин YunoHost: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
- Сообщите об ошибке: <https://github.com/YunoHost-Apps/tinyfilemanager_ynh/issues>
|
||||
|
||||
## Информация для разработчиков
|
||||
|
||||
Пришлите Ваш запрос на слияние в [ветку `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
|
||||
```
|
||||
|
||||
**Больше информации о пакетировании приложений:** <https://yunohost.org/packaging_apps>
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
# YunoHost 上的 Tiny File Manager
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/tinyfilemanager)  
|
||||
[](https://ci-apps.yunohost.org/ci/apps/tinyfilemanager/)  
|
||||
|
||||
[](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
|
||||
|
||||
**演示:** <https://tinyfilemanager.github.io/demo/>
|
||||
|
||||
|
@ -48,7 +48,6 @@ TinyFileManager is web based file manager and it is a simple, fast and small fil
|
|||
## 文档与资源
|
||||
|
||||
- 官方应用网站: <https://tinyfilemanager.github.io/>
|
||||
- 官方用户文档: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- 官方管理文档: <https://github.com/prasathmani/tinyfilemanager/wiki>
|
||||
- 上游应用代码库: <https://github.com/prasathmani/tinyfilemanager>
|
||||
- YunoHost 商店: <https://apps.yunohost.org/app/tinyfilemanager>
|
||||
|
|
|
@ -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
|
|
@ -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;
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -1,17 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# FUTURE OFFICIAL HELPERS
|
||||
# COMMON VARIABLES AND CUSTOM HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -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)."
|
||||
|
|
|
@ -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"
|
||||
|
|
102
scripts/config
102
scripts/config
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue