1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/my_webapp_ynh.git synced 2024-09-03 19:46:26 +02:00

Merge pull request #129 from YunoHost-Apps/testing

Testing
This commit is contained in:
Kayou 2024-07-29 10:07:46 +02:00 committed by GitHub
commit a41c46b182
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 215 additions and 40 deletions

View file

@ -5,4 +5,5 @@
- [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)
@ -18,14 +18,16 @@ It shall NOT be edited by hand.
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 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.
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.
**Shipped version:** 1.0~ynh15
**Shipped version:** 1.0~ynh17
## Documentation and resources
- Upstream app code repository: <https://github.com/YunoHost-Apps/my_webapp_ynh>

View file

@ -5,7 +5,7 @@ No se debe editar a mano.
# 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 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)
[![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)
@ -18,14 +18,16 @@ No se debe editar a mano.
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 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.
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~ynh15
**Versión actual:** 1.0~ynh17
## Documentaciones y recursos
- Repositorio del código fuente oficial de la aplicación : <https://github.com/YunoHost-Apps/my_webapp_ynh>

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)
@ -18,14 +18,16 @@ EZ editatu eskuz.
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 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.
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.
**Paketatutako bertsioa:** 1.0~ynh15
**Paketatutako bertsioa:** 1.0~ynh17
## 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)
@ -18,14 +18,15 @@ Il NE doit PAS être modifié à la main.
Cette application vous permet d'installer facilement une application vide personnalisée, fourni un accès aux fichiers avec [SFTP](https://yunohost.org/fr/filezilla).
Elle peut également créer une base de données MySQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine.
Elle peut également créer une base de données MySQL ou PostgreSQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine.
La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`.
**Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur.
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~ynh15
**Version incluse:** 1.0~ynh17
## 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)
@ -18,14 +18,16 @@ NON debe editarse manualmente.
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 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.
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 proporcionada:** 1.0~ynh15
**Versión proporcionada:** 1.0~ynh17
## 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~ynh17
## Dokumentasi dan sumber daya
- Repositori 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)
@ -18,14 +18,16 @@
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 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.
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.
**分发版本:** 1.0~ynh15
**分发版本:** 1.0~ynh17
## 文档与资源
- 上游应用代码库: <https://github.com/YunoHost-Apps/my_webapp_ynh>

View file

@ -0,0 +1,7 @@
# Build error access
error_page 403 __PATH__/error/403.html;
error_page 404 __PATH__/error/404.html;
location ^~ __PATH__/error/ {
internal;
}

View file

@ -5,8 +5,8 @@ location __PATH__/ {
alias __INSTALL_DIR__/www/;
# Default indexes and catch-all
index index.html index.php;
try_files $uri $uri/ __PATH__/index.php?$args;
index index.php index.html;
try_files $uri $uri/ __PATH__/index.php?$args =404;
# Prevent useless logs
location = __PATH__/favicon.ico {

View file

@ -4,19 +4,32 @@ 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"
[main.code_error.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`."
[main.php_fpm_config]
name = "PHP-FPM configuration"
@ -24,7 +37,7 @@ name = "My Webapp configuration"
[main.php_fpm_config.phpversion]
ask = "PHP version"
type = "select"
choices = ["none", "7.4", "8.0", "8.1", "8.2"]
choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"]
default = "none"
[main.php_fpm_config.fpm_footprint]

View file

@ -26,6 +26,10 @@ The `php` command will point to the PHP version installed for the app.
Once logged in, 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.
### 403 and 404 error handling
The web server configuration supports http error handling `403` and `404` (access denied and resource not found). Create an `error` folder at `__INSTALL_DIR__/www/error`, and put your `403.html` and `404.html` files in there.
### Customizing the nginx configuration
If you want to add tweak the nginx configuration for this app, it is recommended to edit `/etc/nginx/conf.d/__DOMAIN__.d/__ID__.d/WHATEVER_NAME.conf` (ensure that the file has the `.conf` extension) and reload the nginx after making sure that the configuration is valid using `nginx -t`.

View file

@ -26,6 +26,10 @@ La commande `php` pointera vers la version de PHP installée pour l'app.
Après vous être connecté, sous le répertoire Web vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur.
### Gestion des erreurs 403 et 404
La configuration du serveur web prend en charge la gestion des erreurs http `403` et `404` (accès refusé et ressource non trouvée). Ajoutez un dossier `error` à l'emplacement `__INSTALL_DIR__/www/error`, puis ajoutez-y vos fichiers `403.html` et `404.html`.
### Personnaliser la configuration nginx
Si vous souhaitez ajuster la configuration nginx pour cette app, il est recommandé d'éditer `/etc/nginx/conf.d/__DOMAIN__.d/__ID__.d/WHATEVER_NAME.conf` (assurez-vous que le fichier a l'extension `.conf`) puis rechargez nginx après vous être assuré que la configuration est valide à l'aide de `nginx -t`.

View file

@ -1,7 +1,9 @@
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 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.
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.

View file

@ -1,7 +1,9 @@
Cette application vous permet d'installer facilement une application vide personnalisée, fourni un accès aux fichiers avec [SFTP](https://yunohost.org/fr/filezilla).
Elle peut également créer une base de données MySQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine.
Elle peut également créer une base de données MySQL ou PostgreSQL - qui sera sauvegardée et restaurée avec votre application. Les détails de connexion seront stockés dans le fichier `db_accesss.txt` situé dans le répertoire racine.
La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`.
**Une fois installé, rendez-vous sur l'URL choisie pour connaître l'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.** Le mot de passe est celui que vous avez choisi lors de l'installation. Sous le répertoire Web, vous verrez un dossier `www` qui contient les fichiers publics servis par cette application. Vous pouvez mettre tous les fichiers de votre application Web personnalisée à l'intérieur.
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`

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~ynh15"
version = "1.0~ynh17"
maintainers = []
@ -49,8 +49,8 @@ ram.runtime = "50M"
ask.en = "Choose a PHP version you want to use for your app"
ask.fr = "Choisissez une version PHP que vous souhaitez utiliser pour votre application"
type = "select"
choices = ["none", "7.4", "8.0", "8.1", "8.2"]
default = "8.0"
choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"]
default = "8.3"
[install.database]
ask.en = "Do you need a database?"
@ -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

@ -52,6 +52,12 @@ then
domain="$old_domain"
path_url="$new_path"
# Update custom error file path if needed
if [ $custom_error_file -eq 1 ]
then
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
fi
# Create a dedicated NGINX config
ynh_add_nginx_config
fi
@ -62,6 +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/error-code.conf"
path_url="$new_path"
domain="$old_domain"
@ -73,7 +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
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
@ -114,11 +114,16 @@ ynh_app_config_apply() {
then
ynh_app_setting_set --app=$app --key=phpversion --value="${old[phpversion]}"
ynh_remove_fpm_config
# ^ the helper includes ynh_remove_app_dependencies
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,7 +132,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"
ynh_install_app_dependencies "php${phpversion}-fpm"
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
# ^ the helper takes care of ynh_app_setting_set the phpversion
fi
@ -148,6 +152,26 @@ ynh_app_config_apply() {
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"
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

View file

@ -67,6 +67,13 @@ then
YNH_PHP_VERSION="$phpversion"
fi
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
ynh_add_nginx_config
ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf"

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

@ -68,6 +68,12 @@ if [ -z "$phpversion" ]; then
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
fi
# If custom_error_file doesn't exist, create it.
if [ -z "${custom_error_file:-}" ]; then
custom_error_file=0
ynh_app_setting_set --app=$app --key=custom_error_file --value=$custom_error_file
fi
# Delete old user
if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ]
then
@ -102,6 +108,12 @@ then
YNH_PHP_VERSION="$phpversion"
fi
# Add the config error code
if [ $custom_error_file -eq 1 ]
then
ynh_add_config --template="nginx-code-error.conf" --destination="$nginx_extra_conf_dir/error-code.conf"
fi
# Create a dedicated NGINX config
ynh_add_nginx_config
ynh_add_config --template="example-custom-nginx-config.conf" --destination="$nginx_extra_conf_dir/sample.conf"

View file

@ -7,9 +7,10 @@ test_format = 1.0
# -------------------------------
args.with_sftp = "1"
args.custom_error_file = "0"
args.password = "SuperDuper_StrongPassw0rd"
args.database = "none"
args.phpversion = "8.0"
args.phpversion = "8.3"
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"
@ -21,9 +22,18 @@ test_format = 1.0
only = ["install.subdir", "backup_restore", "upgrade" ]
args.phpversion = "8.0"
[none_test]
[81_test]
only = ["install.subdir", "backup_restore", "upgrade" ]
args.phpversion = "8.1"
[82_test]
only = ["install.subdir", "backup_restore", "upgrade" ]
args.phpversion = "8.2"
[none_test]
args.phpversion = "none"
[mysql_test]
@ -40,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"