Compare commits

...
Sign in to create a new pull request.

29 commits

Author SHA1 Message Date
Alexandre Aubin
9a1cf68d98
Merge pull request #141 from YunoHost-Apps/testing
Testing
2024-08-07 15:17:05 +02:00
yunohost-bot
f1545592a8 Auto-update READMEs 2024-08-07 13:16:58 +00:00
Alexandre Aubin
e59b8f1417
Update manifest.toml: bump version 2024-08-07 15:16:54 +02:00
Alexandre Aubin
d291edbc72
wtf... 2024-08-07 15:15:51 +02:00
Kayou
6566e1ce4f
Merge pull request #140 from YunoHost-Apps/testing
Testing
2024-07-29 16:35:04 +02:00
yunohost-bot
991cab74e4 Auto-update READMEs 2024-07-29 14:32:02 +00:00
Kayou
db825702a0
bump package 2024-07-29 16:31:58 +02:00
Kayou
477d98f4a6
do not remove old fpm config if phpversion was none 2024-07-29 16:31:40 +02:00
yunohost-bot
ea932c9763 Auto-update READMEs 2024-07-29 08:07:53 +00:00
Kayou
a41c46b182
Merge pull request #129 from YunoHost-Apps/testing
Testing
2024-07-29 10:07:46 +02:00
Kayou
89fbb93c76
fix restore script 2024-07-24 11:59:06 +02:00
Kayou
19f09d8569
Note to self - open your eyes BEFORE writing code 2024-07-24 10:14:09 +02:00
Kayou
db7dcbdd1b
fix change_url² 2024-07-23 17:43:36 +02:00
Kayou
eca97b65aa
fix change url 2024-07-23 16:36:00 +02:00
Kayou
7226257ce8
add all tests for custom_error_file_test 2024-07-23 14:04:28 +02:00
Kayou
df628b6cd1
add a test for custom_error_file 2024-07-23 14:01:30 +02:00
Kayou
f92817b922
add custom_error_file in the manifest, default to false 2024-07-23 13:57:51 +02:00
Kayou
55c0bbb594
fix indent 2024-07-23 13:52:14 +02:00
Kayou
cb465e8573
reenable ynh_delete_file_checksum of the nginx error conf file, let's wait the CI 2024-07-23 13:48:14 +02:00
Kayou
72ae3827de
Reinstall all the dependencies when changing php version² (remove php-fpm deps if phpversion is none) 2024-07-23 13:43:07 +02:00
yunohost-bot
f7e3c828ec Auto-update READMEs 2024-07-23 11:36:02 +00:00
Kayou
7d29233133
Merge pull request #138 from grenagit/master
Fix password change
2024-07-23 13:35:57 +02:00
yunohost-bot
81ecb8ba90 Auto-update READMEs 2024-07-03 16:09:59 +00:00
tituspijean
cefdd63e38
Typo 2024-07-03 18:09:55 +02:00
yunohost-bot
da1fc5e54b Auto-update READMEs 2024-06-24 10:13:24 +00:00
eric_G
c886821dcd
Merge branch 'master' into testing 2024-06-24 12:13:21 +02:00
Félix Piédallu
e4ff31c6c8 Update READMEs 2024-06-23 13:33:55 +02:00
Grena
0f47d1c6cb Add french translation of SFTP access into config panel 2024-06-05 10:46:55 +02:00
Grena
cab30de685 Fix password change 2024-06-05 10:30:49 +02:00
18 changed files with 188 additions and 50 deletions

View file

@ -1,7 +1,9 @@
# All available README files by language
- [Read the README in English](README.md)
- [Lea el README en español](README_es.md)
- [Irakurri README euskaraz](README_eu.md)
- [Lire le README en français](README_fr.md)
- [Le o README en galego](README_gl.md)
- [Baca README dalam bahasa bahasa Indonesia](README_id.md)
- [阅读中文(简体)的 README](README_zh_Hans.md)

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# My Webapp for YunoHost
[![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Install My Webapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
@ -24,9 +24,10 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**Shipped version:** 1.0~ynh17
**Shipped version:** 1.0~ynh19
## Documentation and resources
- Upstream app code repository: <https://github.com/YunoHost-Apps/my_webapp_ynh>

49
README_es.md Normal file
View file

@ -0,0 +1,49 @@
<!--
Este archivo README esta generado automaticamente<https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
No se debe editar a mano.
-->
# My Webapp para Yunohost
[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Instalar My Webapp con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[Leer este README en otros idiomas.](./ALL_README.md)*
> *Este paquete le permite instalarMy Webapp rapidamente y simplement en un servidor YunoHost.*
> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.*
## Descripción general
This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla).
It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory.
PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`.
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**Versión actual:** 1.0~ynh19
## Documentaciones y recursos
- Repositorio del código fuente oficial de la aplicación : <https://github.com/YunoHost-Apps/my_webapp_ynh>
- Catálogo YunoHost: <https://apps.yunohost.org/app/my_webapp>
- Reportar un error: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
## Información para desarrolladores
Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing
Para probar la rama `testing`, sigue asÍ:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
o
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
```
**Mas informaciones sobre el empaquetado de aplicaciones:** <https://yunohost.org/packaging_apps>

View file

@ -5,7 +5,7 @@ EZ editatu eskuz.
# My Webapp YunoHost-erako
[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Instalatu My Webapp YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
@ -24,9 +24,10 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**Paketatutako bertsioa:** 1.0~ynh17
**Paketatutako bertsioa:** 1.0~ynh19
## Dokumentazioa eta baliabideak
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/YunoHost-Apps/my_webapp_ynh>

View file

@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main.
# My Webapp pour YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Niveau dintégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Installer My Webapp avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
@ -26,7 +26,7 @@ La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1
L'application vous permet aussi de gérer - si vous activez l'option dans le panneau de configuration - la gestion des erreurs 404, il vous suffit de créer un dossier `error` dans le répertoire racine `www` et d'y placer vos fichiers d'erreur `html`
**Version incluse:** 1.0~ynh17
**Version incluse:** 1.0~ynh19
## Documentations et ressources
- Dépôt de code officiel de lapp: <https://github.com/YunoHost-Apps/my_webapp_ynh>

View file

@ -5,7 +5,7 @@ NON debe editarse manualmente.
# My Webapp para YunoHost
[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Instalar My Webapp con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
@ -24,9 +24,10 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**Versión proporcionada:** 1.0~ynh17
**Versión proporcionada:** 1.0~ynh19
## Documentación e recursos
- Repositorio de orixe do código: <https://github.com/YunoHost-Apps/my_webapp_ynh>

49
README_id.md Normal file
View file

@ -0,0 +1,49 @@
<!--
N.B.: README ini dibuat secara otomatis oleh <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
Ini TIDAK boleh diedit dengan tangan.
-->
# My Webapp untuk YunoHost
[![Tingkat integrasi](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Pasang My Webapp dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)*
> *Paket ini memperbolehkan Anda untuk memasang My Webapp 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
This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla).
It can also create a MySQL or PostgreSQL database - which will be backed up and restored with your application. The connection details will be stored in the file `db_access.txt` located in the root directory.
PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`.
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**Versi terkirim:** 1.0~ynh19
## Dokumentasi dan sumber daya
- Depot kode aplikasi hulu: <https://github.com/YunoHost-Apps/my_webapp_ynh>
- Gudang YunoHost: <https://apps.yunohost.org/app/my_webapp>
- Laporkan bug: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
## Info developer
Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
Untuk mencoba branch `testing`, silakan dilanjutkan seperti:
```bash
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
atau
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
```
**Info lebih lanjut mengenai pemaketan aplikasi:** <https://yunohost.org/packaging_apps>

View file

@ -5,7 +5,7 @@
# YunoHost 上的 My Webapp
[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![使用 YunoHost 安装 My Webapp](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
@ -24,9 +24,10 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.
**分发版本:** 1.0~ynh17
**分发版本:** 1.0~ynh19
## 文档与资源
- 上游应用代码库: <https://github.com/YunoHost-Apps/my_webapp_ynh>

View file

@ -4,19 +4,23 @@ version = "1.0"
name = "My Webapp configuration"
[main.sftp]
name = "SFTP access"
name.en = "SFTP access"
name.fr = "Accès SFTP"
[main.sftp.with_sftp]
ask = "Do you need a SFTP access?"
ask.en = "Do you need a SFTP access?"
ask.fr = "Avez-vous besoin d'un accès SFTP ?"
type = "boolean"
default = true
[main.sftp.password]
ask = "Set a password for the SFTP access"
ask.en = "Set a password for the SFTP access"
ask.fr = "Définir un mot de passe pour laccès SFTP"
type = "password"
optional = true
visible = "with_sftp"
help = "If a password already exist, leave blank and it will not be replaced."
help.en = "If a password already exist, leave blank and it will not be replaced."
help.fr = "Si un mot de passe existe déjà, laissez vide et il ne sera pas remplacé."
[main.code_error]
name = "Html Custom error"

View file

@ -6,4 +6,4 @@ PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`
**Once installed, go to the chosen URL to know the user, domain and port you will have to use for the SFTP access.** The password is one you chosen during the installation. Under the Web directory, you will see a `www` folder which contains the public files served by this app. You can put all the files of your custom Web application inside.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an`error` folder in the `www` root directory, containing your custom `html` files.
You can also customize 404 errors - if you enable the option in the config panel. Simply create an `error` folder in the `www` root directory, containing your custom `html` files.

View file

@ -5,7 +5,7 @@ name = "My Webapp"
description.en = "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files"
description.fr = "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP"
version = "1.0~ynh17"
version = "1.0~ynh19"
maintainers = []
@ -59,6 +59,12 @@ ram.runtime = "50M"
choices = [ "none", "mysql", "postgresql" ]
default = "none"
[install.custom_error_file]
ask = "Activate the custom error file use"
type = "boolean"
default = false
help = "Once custom error enabled, you can add/create a custom `404.html` file in a directory `www/error`."
[resources]
[resources.system_user]

View file

@ -45,7 +45,7 @@ then
ynh_print_info --message="Backing up the database..."
if [ $database == "mysql" ]; then
ynh_mysql_dump_db --database="$db_name" > db.sql*
ynh_mysql_dump_db --database="$db_name" > db.sql
elif [ $database == "postgresql" ]; then
ynh_psql_dump_db --database="$db_name" > db.sql
fi

View file

@ -44,7 +44,6 @@ nginx_extra_conf_dir=/etc/nginx/conf.d/$old_domain.d/$app.d
# Change the path in the NGINX config file
if [ $change_path -eq 1 ]
ynh_print_info --message="Change the path in the Nginx config file"
then
# Make a backup of the original NGINX config file if modified
ynh_backup_if_checksum_is_different --file="$nginx_conf_path"
@ -59,7 +58,7 @@ then
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
fi
# Create a dedicated NGINX configssh
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
@ -69,7 +68,7 @@ then
# Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path"
ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf"
#ynh_delete_file_checksum --file="$nginx_extra_conf_dir/nginx-code-error.conf"
ynh_delete_file_checksum --file="$nginx_extra_conf_dir/error-code.conf"
path_url="$new_path"
domain="$old_domain"
@ -81,8 +80,14 @@ then
mv $nginx_extra_conf_dir /etc/nginx/conf.d/$new_domain.d/$app.d
# Store file checksum for the new config file location
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf"
#ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/nginx-code-error.conf"
if [ $phpversion != "none" ]
then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/php.conf"
fi
if [ $custom_error_file -eq 1 ]
then
ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.d/error-code.conf"
fi
fi
#=================================================

View file

@ -59,7 +59,7 @@ get__free_footprint() {
#=================================================
set__password() {
if [ "$password" == "" ]
if [ ! "$password" == "" ]
then
ynh_app_setting_set --app=$app --key=password --value="$password"
fi
@ -112,13 +112,21 @@ ynh_app_config_apply() {
if [ "${changed[phpversion]}" == "true" ]
then
ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}"
ynh_remove_fpm_config
if [ "${old[phpversion]}" != "none" ]
then
ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}"
ynh_remove_fpm_config
fi
ynh_remove_app_dependencies
YNH_PHP_VERSION=$phpversion
# ^ ynh_add_config replaces __PHPVERSION__ by __PHP_YNH_VERSION__...
ynh_app_setting_set --app=$app --key=phpversion --value="$phpversion"
database=$(ynh_app_setting_get --app=$app --key=database)
dependencies="$(ynh_read_manifest -k "resources.apt.packages")"
dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ")
ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash"
nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d"
mkdir -p "$nginx_extra_conf_dir"
if [ "$phpversion" == "none" ]
@ -127,10 +135,6 @@ ynh_app_config_apply() {
ynh_secure_remove --file="$nginx_extra_conf_dir/php.conf"
else
ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
database=$(ynh_app_setting_get --app=$app --key=database)
dependencies="$(ynh_read_manifest -k "resources.apt.packages")"
dependencies_from_raw_bash=$(eval "$(ynh_read_manifest -k "resources.apt.packages_from_raw_bash")" | tr "\n" " ")
ynh_install_app_dependencies "$dependencies $dependencies_from_raw_bash"
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
# ^ the helper takes care of ynh_app_setting_set the phpversion
fi
@ -150,27 +154,31 @@ ynh_app_config_apply() {
then
ynh_system_user_del_group --username=$app --groups="sftp.app"
fi
if [ "${changed[password]}" == "true" ] && [ ! "$password" == "" ]
then
chpasswd <<< "${app}:${password}"
fi
if [ "${changed[custom_error_file]}" == "true" ]
then
CUSTOM_ERROR_FILE=$custom_error_file
nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d"
CUSTOM_ERROR_FILE=$custom_error_file
nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d"
if [ $custom_error_file -eq 1 ]
then
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
elif [ $custom_error_file -eq 0 ]
then
ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf"
fi
ynh_systemd_action --service_name=nginx --action=reload
if [ $custom_error_file -eq 1 ]
then
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
elif [ $custom_error_file -eq 0 ]
then
ynh_secure_remove --file="$nginx_extra_conf_dir/error-code.conf"
fi
ynh_systemd_action --service_name=nginx --action=reload
fi
if [ "$phpversion" != "none" ]
then
ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint
fi
}
ynh_app_config_run $1

View file

@ -67,9 +67,11 @@ then
YNH_PHP_VERSION="$phpversion"
fi
# Add the custom error build with the application
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
ynh_app_setting_set --app=$app --key=custom_error_file --value="true"
if [ $custom_error_file -eq 1 ]
then
# Add the custom error build with the application
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
fi
# Create a dedicated NGINX config

View file

@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
#=================================================
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.d/"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.d"
#=================================================
# RESTORE THE MYSQL DATABASE

View file

@ -70,7 +70,7 @@ fi
# If custom_error_file doesn't exist, create it.
if [ -z "${custom_error_file:-}" ]; then
custom_error_file=1
custom_error_file=0
ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file
fi

View file

@ -7,6 +7,7 @@ test_format = 1.0
# -------------------------------
args.with_sftp = "1"
args.custom_error_file = "0"
args.password = "SuperDuper_StrongPassw0rd"
args.database = "none"
args.phpversion = "8.3"
@ -33,7 +34,6 @@ test_format = 1.0
[none_test]
only = ["install.subdir", "backup_restore", "upgrade" ]
args.phpversion = "none"
[mysql_test]
@ -50,3 +50,12 @@ test_format = 1.0
only = ["install.subdir", "backup_restore", "upgrade" ]
args.database = "postgresql"
[custom_error_file_test]
args.custom_error_file = "1"
test_upgrade_from.bf5d3ed.name = "1.0~ynh14"
test_upgrade_from.bf5d3ed.args.with_mysql = "0"
test_upgrade_from.bf5d3ed.args.domain = "sub.domain.tld"
test_upgrade_from.bf5d3ed.args.path = "/"
test_upgrade_from.bf5d3ed.args.password = "SuperDuper_StrongPassw0rd"