Compare commits
331 commits
new_config
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
9a1cf68d98 | ||
|
f1545592a8 | ||
|
e59b8f1417 | ||
|
d291edbc72 | ||
|
6566e1ce4f | ||
|
991cab74e4 | ||
|
db825702a0 | ||
|
477d98f4a6 | ||
|
ea932c9763 | ||
|
a41c46b182 | ||
|
89fbb93c76 | ||
|
19f09d8569 | ||
|
db7dcbdd1b | ||
|
eca97b65aa | ||
|
7226257ce8 | ||
|
df628b6cd1 | ||
|
f92817b922 | ||
|
55c0bbb594 | ||
|
cb465e8573 | ||
|
72ae3827de | ||
|
f7e3c828ec | ||
|
7d29233133 | ||
|
81ecb8ba90 | ||
|
cefdd63e38 | ||
|
da1fc5e54b | ||
|
c886821dcd | ||
|
e4ff31c6c8 | ||
|
0f47d1c6cb | ||
|
cab30de685 | ||
|
e16a41b7dd | ||
|
17aa532b66 | ||
|
0540f194c8 | ||
|
fb03afacc7 | ||
|
baaa89c14a | ||
|
e51913303c | ||
|
8213b4d9a3 | ||
|
23535f094f | ||
|
22f48f479f | ||
|
0ab0c6b302 | ||
|
36738b45a1 | ||
|
1bb337ce18 | ||
|
0b62011418 | ||
|
7d592faabe | ||
|
25ec30c166 | ||
|
9defce59be | ||
|
4801ff47a8 | ||
|
365d2c7641 | ||
|
37d888f16a | ||
|
e4f955e2dc | ||
|
e51caa96f1 | ||
|
8087993534 | ||
|
9b8d318fb6 | ||
|
d91b1bc502 | ||
|
55190b8272 | ||
|
060e15e365 | ||
|
00b181c417 | ||
|
6ea232f503 | ||
|
1a1784d669 | ||
|
2e7f35d11b | ||
|
a0a8d326d0 | ||
|
2e5a452b53 | ||
|
18c71da044 | ||
|
f65d02d7d0 | ||
|
66249120de | ||
|
c1c68f9463 | ||
|
44f371dae6 | ||
|
b6a23c7bc5 | ||
|
66626c71c7 | ||
|
2c0b155c94 | ||
|
9dbb8b1821 | ||
|
ee658ef966 | ||
|
c4c9581eab | ||
|
ad2673106c | ||
|
ac625f32d3 | ||
|
467aef4618 | ||
|
c4cc60d93f | ||
|
0f008b68d2 | ||
|
7d919559a1 | ||
|
1eb8d54769 | ||
|
791d7880e9 | ||
|
7b0b29cdcc | ||
|
9d885a896a | ||
|
d7271b65af | ||
|
bcdf80162f | ||
|
db2876a58a | ||
|
b578765b41 | ||
|
c409b9d0e1 | ||
|
04338ac091 | ||
|
10f3e8eabb | ||
|
08a58729a2 | ||
|
adf7f2ba83 | ||
|
a561b9c449 | ||
|
5f1dfbd192 | ||
|
ea8278b48b | ||
|
18041281e3 | ||
|
8d4188382b | ||
|
8c3b1e2161 | ||
|
9e6f1621b4 | ||
|
1b4c09bc1d | ||
|
42a5b89393 | ||
|
d51c90ffb9 | ||
|
e7b199e573 | ||
|
d025544131 | ||
|
632567c13f | ||
|
efc260135c | ||
|
beb6c7e399 | ||
|
1e5d23df24 | ||
|
92c8673646 | ||
|
8d39c98681 | ||
|
ab80419566 | ||
|
05b98eafba | ||
|
f06a4f5ba9 | ||
|
7b02f2817e | ||
|
8339439135 | ||
|
fd0fe51048 | ||
|
0ba29961e5 | ||
|
3396894985 | ||
|
b6f86b2f4e | ||
|
c0688fc115 | ||
|
613e58e149 | ||
|
9384644c80 | ||
|
8fe710187a | ||
|
5a6756a8c4 | ||
|
74526f2e53 | ||
|
7a2eba44db | ||
|
ce93180771 | ||
|
4ebc7e27d5 | ||
|
e3599fe60c | ||
|
cf1e857017 | ||
|
9e25b1d0a0 | ||
|
043c417a45 | ||
|
347546ab04 | ||
|
494db3a91e | ||
|
adb9f09d60 | ||
|
b863da7cff | ||
|
8b30a536cb | ||
|
140562326e | ||
|
718c0dbdd8 | ||
|
4255b0a4bc | ||
|
7083a50ec8 | ||
|
6095c6c21f | ||
|
7029f6eb85 | ||
|
1d83be3e56 | ||
|
b5f4e50ff9 | ||
|
810c3facfa | ||
|
8657238c52 | ||
|
8cff6952cb | ||
|
0f78b7f4b1 | ||
|
80f55d4feb | ||
|
bf5d3ed5d5 | ||
|
03cc1fbd95 | ||
|
128e2eb732 | ||
|
a6a32531fa | ||
|
3065ca3c87 | ||
|
2e4cc18d59 | ||
|
2ddaa0c107 | ||
|
66d9816339 | ||
|
08bb8d278d | ||
|
fffa0b0e20 | ||
|
3c9c867e3a | ||
|
69b8a22d19 | ||
|
e7c022d5f5 | ||
|
9b0dddb821 | ||
|
906013809d | ||
|
c1f58d8805 | ||
|
f03e68f14c | ||
|
a2f3b95c19 | ||
|
6904852de5 | ||
|
97a8e04339 | ||
|
9f7b30459b | ||
|
9e3097c524 | ||
|
b29eb643b2 | ||
|
109bc1aed8 | ||
|
7de1bb0c3a | ||
|
e280d90298 | ||
|
d3b74fb36f | ||
|
3055c9a149 | ||
|
eace720c61 | ||
|
8a907c0c27 | ||
|
427c8522dc | ||
|
e634b772c3 | ||
|
47533880be | ||
|
0244a4408e | ||
|
32a9ff3771 | ||
|
c7103688a2 | ||
|
cc7808c378 | ||
|
f301a8b213 | ||
|
aeb9ac274a | ||
|
ff5946f35a | ||
|
fc5dac0ef9 | ||
|
402abc21d5 | ||
|
67c99b38e7 | ||
|
6314f2bc26 | ||
|
e3ede5ca29 | ||
|
c66196538c | ||
|
e2df6be87c | ||
|
5b38abe368 | ||
|
2ec2d5cfab | ||
|
857d049c7a | ||
|
aa54f690b4 | ||
|
2e525c68d4 | ||
|
94761c15d2 | ||
|
60bc8fab64 | ||
|
6b39fca687 | ||
|
f78dfe4da8 | ||
|
c545623331 | ||
|
b136cc2b3d | ||
|
8eec20a4ed | ||
|
65eb631903 | ||
|
d4fa580701 | ||
|
0305cc08dc | ||
|
bafc403789 | ||
|
28e96e88e2 | ||
|
fb5e9c5436 | ||
|
ba620f9fd1 | ||
|
1c3d35bf2b | ||
|
58809e2b1e | ||
|
dafc95ba31 | ||
|
59e321b398 | ||
|
fb34d33319 | ||
|
5a0072e44c | ||
|
d6604d0212 | ||
|
936f96e9d2 | ||
|
4aa09f073d | ||
|
ca06ee4f07 | ||
|
f91ad3ecbe | ||
|
fac6118cce | ||
|
d3695fe281 | ||
|
a53a10d256 | ||
|
52e14f82a7 | ||
|
369bb90604 | ||
|
caf5f74760 | ||
|
8aba067dc2 | ||
|
1b7d0b6ac0 | ||
|
b6e37aedae | ||
|
6ec349098d | ||
|
91a8d2aecf | ||
|
26142cd20f | ||
|
82564c7929 | ||
|
99a41f5392 | ||
|
1c77b1a6f8 | ||
|
ff58e1d00c | ||
|
54d609c124 | ||
|
c2a3f0ec5b | ||
|
a1364bcf38 | ||
|
378a246772 | ||
|
9ec2a51f39 | ||
|
82a2315fc4 | ||
|
5eebfc09e1 | ||
|
eeca7a299e | ||
|
c8f499b16c | ||
|
1126d88ca6 | ||
|
4877f8013c | ||
|
563d0dadaa | ||
|
0627d061b7 | ||
|
f17d402b48 | ||
|
8e6bab756d | ||
|
31834487af | ||
|
6bb034a440 | ||
|
b304babad5 | ||
|
64e5fae404 | ||
|
b46bfc3c56 | ||
|
5e31710e26 | ||
|
2b36952f22 | ||
|
6b84c9daec | ||
|
43fa71c331 | ||
|
f997d537a0 | ||
|
70ed6bd954 | ||
|
700c765839 | ||
|
dca89aa5dc | ||
|
49cab9e4b3 | ||
|
849d85b1c7 | ||
|
45c0c4fa55 | ||
|
76805f12cc | ||
|
a912632f1d | ||
|
c2efdcec6c | ||
|
fb7ddb9296 | ||
|
33b63ca97a | ||
|
ad2184d999 | ||
|
fd1d6eaa20 | ||
|
194c3b0d49 | ||
|
8fde9136ba | ||
|
802fc72a17 | ||
|
addca0c163 | ||
|
a43f92ac0d | ||
|
ec83a54c90 | ||
|
0681043382 | ||
|
4fe44887fd | ||
|
ce21df3420 | ||
|
cec2f294a4 | ||
|
9dcf5d6758 | ||
|
4f25715b8c | ||
|
5de029a40f | ||
|
1a14e0bcdb | ||
|
22f9c65f01 | ||
|
233829c50c | ||
|
38e6e12553 | ||
|
ee6a4cf5f8 | ||
|
bf6dd496c4 | ||
|
6e6ce7609c | ||
|
1f8959e555 | ||
|
1d8afa6ad6 | ||
|
1dac37bbd2 | ||
|
612a87a4a8 | ||
|
48ade2d402 | ||
|
f21d155bb4 | ||
|
149dc8e3bf | ||
|
e015e3310e | ||
|
a7f4f0badf | ||
|
325d0ac03a | ||
|
2231f5bb4f | ||
|
36c982d835 | ||
|
8c2943a6b0 | ||
|
93532de252 | ||
|
17534e2819 | ||
|
071d38bfb1 | ||
|
9c22d79bcb | ||
|
3c2b4bc2a7 | ||
|
0617fcaab7 | ||
|
cc5b5ace5d | ||
|
f1fb0c9c08 | ||
|
61b3fd2e09 | ||
|
5b963e27fd | ||
|
bb45d2171f | ||
|
9d87ffd7e0 | ||
|
6d1f661cf3 | ||
|
bbaf6427fd | ||
|
14f2a9ac0f | ||
|
3c29978907 | ||
|
a56a7ba378 | ||
|
6f69960604 |
43 changed files with 1075 additions and 1858 deletions
9
ALL_README.md
Normal file
9
ALL_README.md
Normal file
|
@ -0,0 +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)
|
44
CHANGELOG.md
44
CHANGELOG.md
|
@ -1,44 +0,0 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
## [1.0~ynh4](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/60) - 2021-04-23
|
||||
|
||||
#### Added
|
||||
* [Add a README_fr](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/60/commits/c84b7d4e97f00e2c7de10d949891cf660f1d8459)
|
||||
|
||||
#### Changed
|
||||
* [Use php7.3](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/60/commits/b324c78780110e8eae05da47f8f151c1d50bf3c7)
|
||||
* [New permissions](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/60/commits/a5cc8741477a0f37ffd1b84e08bb3dec8af34a46)
|
||||
# [Normalization from example_ynh](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/60/commits/a5cc8741477a0f37ffd1b84e08bb3dec8af34a46)
|
||||
|
||||
## [1.0~ynh3](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42) - 2020-01-01
|
||||
|
||||
#### Added
|
||||
* [Add a changelog](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42/commits/60710bb18e1a4b7a3614e55d23e059af91969ea4)
|
||||
* [Actions and config-panel](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42/commits/56e40ac3a10e89a106418695268dec271a04ebb2)
|
||||
|
||||
#### Changed
|
||||
* [use scalable phpfpm](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42/commits/6e33fd4c24f9f83bc1378b05aba20d7da3dcb406)
|
||||
* [Optionnal sftp](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42/commits/f2e31fa4924c9985233e574c2c2f318eb3579996)
|
||||
- [Various upgrades](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/42/commits/5ee2886daa40de744139bfee1390703ba958bd30)
|
||||
|
||||
## [1.0~ynh2](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/39) - 2019-05-26
|
||||
|
||||
#### Changed
|
||||
- [Normalization from example_ynh](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/39/commits/cccc014552bf85fc682d1fc59e1b9c67ad8ec6f8)
|
||||
|
||||
|
||||
## [1.0~ynh1](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/34) - 2019-03-22
|
||||
|
||||
#### Added
|
||||
- [Add progression with ynh_print_info](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/34/commits/8c2f9fa5c7a6ab90ebbbee4eb4b82ed2be6ee292)
|
||||
|
||||
#### Changed
|
||||
- [Normalization from example_ynh](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/34/commits/034e5fc83c8515d2a7781548600ab82b44c8611b)
|
||||
- [Use php7](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/34/commits/0f0bef3b8ca06d8f36f3de90c3502c529a6bc280)
|
||||
|
||||
|
||||
## [1.0](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/31) - 2019-03-13
|
||||
|
||||
#### Changed
|
||||
- [Apply example_ynh](https://github.com/YunoHost-Apps/my_webapp_ynh/pull/31)
|
77
README.md
77
README.md
|
@ -1,70 +1,49 @@
|
|||
# Custom Webapp for YunoHost
|
||||
<!--
|
||||
N.B.: This README was automatically generated by <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
It shall NOT be edited by hand.
|
||||
-->
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/my_webapp)  
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
# My Webapp for YunoHost
|
||||
|
||||
*[Lire ce readme en français.](./README_fr.md)*
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
> *This package allow you to install Custom Webapp quickly and simply on a YunoHost server.
|
||||
If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.*
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
*[Read this README in other languages.](./ALL_README.md)*
|
||||
|
||||
> *This package allows you to install My Webapp quickly and simply on a YunoHost server.*
|
||||
> *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.*
|
||||
|
||||
## Overview
|
||||
|
||||
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_accesss.txt` located in the root
|
||||
directory.
|
||||
This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla).
|
||||
|
||||
PHP-FPM version can also be selected among 7.3, 7.4, and 8.0.
|
||||
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.
|
||||
|
||||
**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.
|
||||
PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`.
|
||||
|
||||
**Shipped version:** 1.0
|
||||
**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.
|
||||
|
||||
## Configuration
|
||||
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.
|
||||
|
||||
## Documentation
|
||||
|
||||
* YunoHost documentation: https://yunohost.org/en/app_my_webapp
|
||||
**Shipped version:** 1.0~ynh19
|
||||
## Documentation and resources
|
||||
|
||||
## YunoHost specific features
|
||||
- Upstream app code repository: <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- YunoHost Store: <https://apps.yunohost.org/app/my_webapp>
|
||||
- Report a bug: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
#### Multi-users support
|
||||
## Developer info
|
||||
|
||||
#### Supported architectures
|
||||
Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/my_webapp/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/my_webapp/)
|
||||
To try the `testing` branch, please proceed like that:
|
||||
|
||||
## Limitations
|
||||
|
||||
## Additional information
|
||||
|
||||
#### SFTP port
|
||||
|
||||
You may have change the SSH port as described in this section:
|
||||
[Modify the SSH port](https://yunohost.org/en/security#modify-the-ssh-port);
|
||||
then you should use this port to update your website with SFTP.
|
||||
|
||||
## Links
|
||||
|
||||
* Report a bug: https://github.com/YunoHost-Apps/my_webapp_ynh/issues
|
||||
* YunoHost website: https://yunohost.org/
|
||||
|
||||
---
|
||||
|
||||
## Developers info
|
||||
|
||||
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
To try the testing branch, please proceed like that.
|
||||
```
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
or
|
||||
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>
|
||||
|
|
49
README_es.md
Normal file
49
README_es.md
Normal 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
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
[](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>
|
49
README_eu.md
Normal file
49
README_eu.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!--
|
||||
Ohart ongi: README hau automatikoki sortu da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>ri esker
|
||||
EZ editatu eskuz.
|
||||
-->
|
||||
|
||||
# My Webapp YunoHost-erako
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)*
|
||||
|
||||
> *Pakete honek My Webapp YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.*
|
||||
> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.*
|
||||
|
||||
## Aurreikuspena
|
||||
|
||||
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.
|
||||
|
||||
|
||||
**Paketatutako bertsioa:** 1.0~ynh19
|
||||
## Dokumentazioa eta baliabideak
|
||||
|
||||
- Jatorrizko aplikazioaren kode-gordailua: <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- YunoHost Denda: <https://apps.yunohost.org/app/my_webapp>
|
||||
- Eman errore baten berri: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
## Garatzaileentzako informazioa
|
||||
|
||||
Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
`testing` abarra probatzeko, ondorengoa egin:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
edo
|
||||
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Informazio gehiago aplikazioaren paketatzeari buruz:** <https://yunohost.org/packaging_apps>
|
69
README_fr.md
69
README_fr.md
|
@ -1,63 +1,48 @@
|
|||
# Application vide avec accès SFTP au répertoire Web personnalisé pour YunoHost
|
||||
<!--
|
||||
Nota bene : ce README est automatiquement généré par <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
Il NE doit PAS être modifié à la main.
|
||||
-->
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/my_webapp)  
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
# My Webapp pour YunoHost
|
||||
|
||||
*[Read this readme in english.](./README.md)*
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
> *Ce package vous permet d'installer une Application vide avec accès SFTP au répertoire Web personnalisé rapidement et simplement sur un serveur YunoHost.
|
||||
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/install) pour savoir comment l'installer et en profiter.*
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
## Vue d'ensemble
|
||||
*[Lire le README dans d'autres langues.](./ALL_README.md)*
|
||||
|
||||
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.
|
||||
> *Ce package vous permet d’installer My Webapp rapidement et simplement sur un serveur YunoHost.*
|
||||
> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.*
|
||||
|
||||
La version de PHP-FPM peut aussi être choisie, parmi 7.3, 7.4, et 8.0.
|
||||
## Vue d’ensemble
|
||||
|
||||
**Version incluse :** 1.0
|
||||
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).
|
||||
|
||||
## Configuration
|
||||
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.
|
||||
|
||||
## Documentation
|
||||
La version de PHP-FPM peut aussi être choisie, parmi `none`, `7.4`, `8.0`, `8.1` et `8.2`.
|
||||
|
||||
* Documentation YunoHost : https://yunohost.org/fr/app_my_webapp
|
||||
**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.
|
||||
|
||||
## Caractéristiques spécifiques YunoHost
|
||||
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`
|
||||
|
||||
#### Support multi-utilisateurs
|
||||
**Version incluse :** 1.0~ynh19
|
||||
## Documentations et ressources
|
||||
|
||||
#### Architectures supportées
|
||||
|
||||
* x86-64 - [](https://ci-apps.yunohost.org/ci/apps/my_webapp/)
|
||||
* ARMv8-A - [](https://ci-apps-arm.yunohost.org/ci/apps/my_webapp/)
|
||||
|
||||
## Limitations
|
||||
|
||||
## Informations additionnelles
|
||||
|
||||
#### Port SFTP
|
||||
|
||||
Vous avez peut-être changé le port SSH comme décrit dans cette section :
|
||||
[Modifier le port SSH](https://yunohost.org/fr/security#modify-the-ssh-port) ;
|
||||
alors vous devriez utiliser ce port pour mettre à jour votre site Web avec SFTP.
|
||||
|
||||
## Liens
|
||||
|
||||
* Signaler un bug : https://github.com/YunoHost-Apps/my_webapp_ynh/issues
|
||||
* Site web YunoHost : https://yunohost.org/
|
||||
|
||||
---
|
||||
- Dépôt de code officiel de l’app : <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- YunoHost Store : <https://apps.yunohost.org/app/my_webapp>
|
||||
- Signaler un bug : <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
## Informations pour les développeurs
|
||||
|
||||
Merci de faire vos pull request dans la [branche testing](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
Pour essayer la branche testing, procédez comme suit.
|
||||
```
|
||||
Pour essayer la branche `testing`, procédez comme suit :
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
ou
|
||||
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Plus d’infos sur le packaging d’applications :** <https://yunohost.org/packaging_apps>
|
||||
|
|
49
README_gl.md
Normal file
49
README_gl.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!--
|
||||
NOTA: Este README foi creado automáticamente por <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
NON debe editarse manualmente.
|
||||
-->
|
||||
|
||||
# My Webapp para YunoHost
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
*[Le este README en outros idiomas.](./ALL_README.md)*
|
||||
|
||||
> *Este paquete permíteche instalar My Webapp de xeito rápido e doado nun servidor YunoHost.*
|
||||
> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.*
|
||||
|
||||
## Vista xeral
|
||||
|
||||
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 proporcionada:** 1.0~ynh19
|
||||
## Documentación e recursos
|
||||
|
||||
- Repositorio de orixe do código: <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- Tenda YunoHost: <https://apps.yunohost.org/app/my_webapp>
|
||||
- Informar dun problema: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
## Info de desenvolvemento
|
||||
|
||||
Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
Para probar a rama `testing`, procede deste xeito:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
ou
|
||||
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**Máis info sobre o empaquetado da app:** <https://yunohost.org/packaging_apps>
|
49
README_id.md
Normal file
49
README_id.md
Normal 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
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
[](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>
|
47
README_it.md
Normal file
47
README_it.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
<!--
|
||||
N.B.: Questo README è stato automaticamente generato da <https://github.com/YunoHost/apps/tree/master/tools/readme_generator>
|
||||
NON DEVE essere modificato manualmente.
|
||||
-->
|
||||
|
||||
# My Webapp per YunoHost
|
||||
|
||||
[](https://dash.yunohost.org/appci/app/my_webapp)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
*[Leggi questo README in altre lingue.](./ALL_README.md)*
|
||||
|
||||
> *Questo pacchetto ti permette di installare My Webapp su un server YunoHost in modo semplice e veloce.*
|
||||
> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.*
|
||||
|
||||
## Panoramica
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
**Versione pubblicata:** 1.0~ynh15
|
||||
## Documentazione e risorse
|
||||
|
||||
- Repository upstream del codice dell’app: <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- Store di YunoHost: <https://apps.yunohost.org/app/my_webapp>
|
||||
- Segnala un problema: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
## Informazioni per sviluppatori
|
||||
|
||||
Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing).
|
||||
|
||||
Per provare la branch di `testing`, si prega di procedere in questo modo:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
**Maggiori informazioni riguardo il pacchetto di quest’app:** <https://yunohost.org/packaging_apps>
|
49
README_zh_Hans.md
Normal file
49
README_zh_Hans.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
<!--
|
||||
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
|
||||
请勿手动编辑。
|
||||
-->
|
||||
|
||||
# YunoHost 上的 My Webapp
|
||||
|
||||
[](https://ci-apps.yunohost.org/ci/apps/my_webapp/)  
|
||||
|
||||
[](https://install-app.yunohost.org/?app=my_webapp)
|
||||
|
||||
*[阅读此 README 的其它语言版本。](./ALL_README.md)*
|
||||
|
||||
> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 My Webapp。*
|
||||
> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。*
|
||||
|
||||
## 概况
|
||||
|
||||
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.
|
||||
|
||||
|
||||
**分发版本:** 1.0~ynh19
|
||||
## 文档与资源
|
||||
|
||||
- 上游应用代码库: <https://github.com/YunoHost-Apps/my_webapp_ynh>
|
||||
- YunoHost 商店: <https://apps.yunohost.org/app/my_webapp>
|
||||
- 报告 bug: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
|
||||
|
||||
## 开发者信息
|
||||
|
||||
请向 [`testing` 分支](https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing) 发送拉取请求。
|
||||
|
||||
如要尝试 `testing` 分支,请这样操作:
|
||||
|
||||
```bash
|
||||
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
或
|
||||
sudo yunohost app upgrade my_webapp -u https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
|
||||
```
|
||||
|
||||
**有关应用打包的更多信息:** <https://yunohost.org/packaging_apps>
|
32
actions.toml
32
actions.toml
|
@ -1,32 +0,0 @@
|
|||
[sftp]
|
||||
name = "Enable or disable the sftp access"
|
||||
command = "/bin/bash scripts/actions/sftp"
|
||||
# user = "root" # optional
|
||||
# cwd = "/" # optional
|
||||
# accepted_return_codes = [0, 1, 2, 3] # optional
|
||||
accepted_return_codes = [0]
|
||||
description = "Enable or disable the sftp access."
|
||||
|
||||
[sftp.arguments]
|
||||
[sftp.arguments.with_sftp]
|
||||
type = "boolean"
|
||||
ask = "Do you need a SFTP access?"
|
||||
default = true
|
||||
|
||||
[create_database]
|
||||
name = "Create a database"
|
||||
command = "/bin/bash scripts/actions/create_database"
|
||||
# user = "root" # optional
|
||||
# cwd = "/" # optional
|
||||
# accepted_return_codes = [0, 1, 2, 3] # optional
|
||||
accepted_return_codes = [0]
|
||||
description = "Create a database or replace a previous one."
|
||||
|
||||
[remove_database]
|
||||
name = "Remove a database"
|
||||
command = "/bin/bash scripts/actions/remove_database"
|
||||
# user = "root" # optional
|
||||
# cwd = "/" # optional
|
||||
# accepted_return_codes = [0, 1, 2, 3] # optional
|
||||
accepted_return_codes = [0]
|
||||
description = "Remove the current database."
|
|
@ -1,94 +0,0 @@
|
|||
;; Test complet
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=1
|
||||
password="myreallystrengthpassword"
|
||||
is_public=1
|
||||
phpversion="7.3"
|
||||
with_mysql=1
|
||||
; Checks
|
||||
pkg_linter=1
|
||||
setup_sub_dir=1
|
||||
setup_root=1
|
||||
setup_nourl=0
|
||||
setup_private=1
|
||||
setup_public=1
|
||||
upgrade=1
|
||||
upgrade=1 from_commit=a050e55533ae7bbb63fce44fd1508ad78b8a645c
|
||||
backup_restore=1
|
||||
multi_instance=1
|
||||
port_already_use=0
|
||||
change_url=1
|
||||
;; Test without sftp
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=0
|
||||
password=""
|
||||
is_public=1
|
||||
phpversion="7.3"
|
||||
with_mysql=1
|
||||
; Checks
|
||||
setup_sub_dir=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
;; Test without mysql
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=1
|
||||
password="myreallystrengthpassword"
|
||||
is_public=1
|
||||
phpversion="7.3"
|
||||
with_mysql=0
|
||||
; Checks
|
||||
setup_sub_dir=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
;; Test without PHP
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=0
|
||||
password="myreallystrengthpassword"
|
||||
is_public=1
|
||||
phpversion="none"
|
||||
with_mysql=0
|
||||
; Checks
|
||||
setup_sub_dir=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
;; Test with PHP7.4
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=0
|
||||
password="myreallystrengthpassword"
|
||||
is_public=1
|
||||
phpversion="7.4"
|
||||
with_mysql=0
|
||||
; Checks
|
||||
setup_sub_dir=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
;; Test with PHP8.0
|
||||
; Manifest
|
||||
domain="domain.tld"
|
||||
path="/path"
|
||||
with_sftp=0
|
||||
password="myreallystrengthpassword"
|
||||
is_public=1
|
||||
phpversion="8.0"
|
||||
with_mysql=0
|
||||
; Checks
|
||||
setup_sub_dir=1
|
||||
upgrade=1
|
||||
backup_restore=1
|
||||
;;; Options
|
||||
Email=
|
||||
Notification=change
|
||||
;;; Upgrade options
|
||||
; commit=a050e55533ae7bbb63fce44fd1508ad78b8a645c
|
||||
name=May 26, 2019
|
||||
manifest_arg=domain=DOMAIN&path=PATH&password=myreallystrengthpassword&is_public=1&with_mysql=1
|
2
conf/example-custom-nginx-config.conf
Normal file
2
conf/example-custom-nginx-config.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file
|
||||
#client_max_body_size 1G;
|
6
conf/extra_php-fpm.conf
Normal file
6
conf/extra_php-fpm.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
; Additional php.ini defines, specific to this pool of workers.
|
||||
|
||||
php_value[upload_max_filesize] = 500M
|
||||
php_value[post_max_size] = 500M
|
||||
php_value[default_charset] = UTF-8
|
||||
php_value[always_populate_raw_post_data] = -1
|
7
conf/nginx-code-error.conf
Normal file
7
conf/nginx-code-error.conf
Normal 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;
|
||||
}
|
10
conf/nginx-php.conf
Normal file
10
conf/nginx-php.conf
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Execute and serve PHP files
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
}
|
|
@ -2,22 +2,18 @@
|
|||
location __PATH__/ {
|
||||
|
||||
# Path to source
|
||||
alias __FINALPATH__/www/;
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
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 {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location = __PATH__/robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
|
@ -29,6 +25,8 @@ location __PATH__/ {
|
|||
deny all;
|
||||
}
|
||||
|
||||
include conf.d/__DOMAIN__.d/__APP__.d/*.conf;
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent;
|
||||
location __PATH__/ {
|
||||
|
||||
# Path to source
|
||||
alias __FINALPATH__/www/;
|
||||
|
||||
# Force usage of https
|
||||
if ($scheme = http) {
|
||||
rewrite ^ https://$server_name$request_uri? permanent;
|
||||
}
|
||||
|
||||
# Default indexes and catch-all
|
||||
index index.html index.php;
|
||||
try_files $uri $uri/ __PATH__/index.php?$args;
|
||||
|
||||
# Prevent useless logs
|
||||
location = __PATH__/favicon.ico {
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
location = __PATH__/robots.txt {
|
||||
allow all;
|
||||
log_not_found off;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# Deny access to hidden files and directories
|
||||
location ~ ^__PATH__/(.+/|)\.(?!well-known\/) {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# Execute and serve PHP files
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param REMOTE_USER $remote_user;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param SCRIPT_FILENAME $request_filename;
|
||||
}
|
||||
|
||||
# Include SSOWAT user panel.
|
||||
include conf.d/yunohost_panel.conf.inc;
|
||||
}
|
|
@ -1,435 +0,0 @@
|
|||
; Start a new pool named 'www'.
|
||||
; the variable $pool can be used in any directive and will be replaced by the
|
||||
; pool name ('www' here)
|
||||
[__NAMETOCHANGE__]
|
||||
|
||||
; Per pool prefix
|
||||
; It only applies on the following directives:
|
||||
; - 'access.log'
|
||||
; - 'slowlog'
|
||||
; - 'listen' (unixsocket)
|
||||
; - 'chroot'
|
||||
; - 'chdir'
|
||||
; - 'php_values'
|
||||
; - 'php_admin_values'
|
||||
; When not set, the global prefix (or /usr) applies instead.
|
||||
; Note: This directive can also be relative to the global prefix.
|
||||
; Default Value: none
|
||||
;prefix = /path/to/pools/$pool
|
||||
|
||||
; Unix user/group of processes
|
||||
; Note: The user is mandatory. If the group is not set, the default user's group
|
||||
; will be used.
|
||||
user = __USER__
|
||||
group = __USER__
|
||||
|
||||
; The address on which to accept FastCGI requests.
|
||||
; Valid syntaxes are:
|
||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on
|
||||
; a specific port;
|
||||
; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
|
||||
; a specific port;
|
||||
; 'port' - to listen on a TCP socket to all addresses
|
||||
; (IPv6 and IPv4-mapped) on a specific port;
|
||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||
; Note: This value is mandatory.
|
||||
listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock
|
||||
|
||||
; Set listen(2) backlog.
|
||||
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
|
||||
;listen.backlog = 511
|
||||
|
||||
; Set permissions for unix socket, if one is used. In Linux, read/write
|
||||
; permissions must be set in order to allow connections from a web server. Many
|
||||
; BSD-derived systems allow connections regardless of permissions.
|
||||
; Default Values: user and group are set as the running user
|
||||
; mode is set to 0660
|
||||
listen.owner = www-data
|
||||
listen.group = www-data
|
||||
;listen.mode = 0660
|
||||
; When POSIX Access Control Lists are supported you can set them using
|
||||
; these options, value is a comma separated list of user/group names.
|
||||
; When set, listen.owner and listen.group are ignored
|
||||
;listen.acl_users =
|
||||
;listen.acl_groups =
|
||||
|
||||
; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect.
|
||||
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
|
||||
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
|
||||
; must be separated by a comma. If this value is left blank, connections will be
|
||||
; accepted from any ip address.
|
||||
; Default Value: any
|
||||
;listen.allowed_clients = 127.0.0.1
|
||||
|
||||
; Specify the nice(2) priority to apply to the pool processes (only if set)
|
||||
; The value can vary from -19 (highest priority) to 20 (lower priority)
|
||||
; Note: - It will only work if the FPM master process is launched as root
|
||||
; - The pool processes will inherit the master process priority
|
||||
; unless it specified otherwise
|
||||
; Default Value: no set
|
||||
; process.priority = -19
|
||||
|
||||
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
|
||||
; or group is differrent than the master process user. It allows to create process
|
||||
; core dump and ptrace the process for the pool user.
|
||||
; Default Value: no
|
||||
; process.dumpable = yes
|
||||
|
||||
; Choose how the process manager will control the number of child processes.
|
||||
; Possible Values:
|
||||
; static - a fixed number (pm.max_children) of child processes;
|
||||
; dynamic - the number of child processes are set dynamically based on the
|
||||
; following directives. With this process management, there will be
|
||||
; always at least 1 children.
|
||||
; pm.max_children - the maximum number of children that can
|
||||
; be alive at the same time.
|
||||
; pm.start_servers - the number of children created on startup.
|
||||
; pm.min_spare_servers - the minimum number of children in 'idle'
|
||||
; state (waiting to process). If the number
|
||||
; of 'idle' processes is less than this
|
||||
; number then some children will be created.
|
||||
; pm.max_spare_servers - the maximum number of children in 'idle'
|
||||
; state (waiting to process). If the number
|
||||
; of 'idle' processes is greater than this
|
||||
; number then some children will be killed.
|
||||
; ondemand - no children are created at startup. Children will be forked when
|
||||
; new requests will connect. The following parameter are used:
|
||||
; pm.max_children - the maximum number of children that
|
||||
; can be alive at the same time.
|
||||
; pm.process_idle_timeout - The number of seconds after which
|
||||
; an idle process will be killed.
|
||||
; Note: This value is mandatory.
|
||||
pm = dynamic
|
||||
|
||||
; The number of child processes to be created when pm is set to 'static' and the
|
||||
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
|
||||
; This value sets the limit on the number of simultaneous requests that will be
|
||||
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
||||
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
||||
; CGI. The below defaults are based on a server without much resources. Don't
|
||||
; forget to tweak pm.* to fit your needs.
|
||||
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
||||
; Note: This value is mandatory.
|
||||
pm.max_children = 5
|
||||
|
||||
; The number of child processes created on startup.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||
pm.start_servers = 2
|
||||
|
||||
; The desired minimum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.min_spare_servers = 1
|
||||
|
||||
; The desired maximum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
; The number of seconds after which an idle process will be killed.
|
||||
; Note: Used only when pm is set to 'ondemand'
|
||||
; Default Value: 10s
|
||||
;pm.process_idle_timeout = 10s;
|
||||
|
||||
; The number of requests each child process should execute before respawning.
|
||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
||||
; Default Value: 0
|
||||
;pm.max_requests = 500
|
||||
|
||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
||||
; recognized as a status page. It shows the following informations:
|
||||
; pool - the name of the pool;
|
||||
; process manager - static, dynamic or ondemand;
|
||||
; start time - the date and time FPM has started;
|
||||
; start since - number of seconds since FPM has started;
|
||||
; accepted conn - the number of request accepted by the pool;
|
||||
; listen queue - the number of request in the queue of pending
|
||||
; connections (see backlog in listen(2));
|
||||
; max listen queue - the maximum number of requests in the queue
|
||||
; of pending connections since FPM has started;
|
||||
; listen queue len - the size of the socket queue of pending connections;
|
||||
; idle processes - the number of idle processes;
|
||||
; active processes - the number of active processes;
|
||||
; total processes - the number of idle + active processes;
|
||||
; max active processes - the maximum number of active processes since FPM
|
||||
; has started;
|
||||
; max children reached - number of times, the process limit has been reached,
|
||||
; when pm tries to start more children (works only for
|
||||
; pm 'dynamic' and 'ondemand');
|
||||
; Value are updated in real time.
|
||||
; Example output:
|
||||
; pool: www
|
||||
; process manager: static
|
||||
; start time: 01/Jul/2011:17:53:49 +0200
|
||||
; start since: 62636
|
||||
; accepted conn: 190460
|
||||
; listen queue: 0
|
||||
; max listen queue: 1
|
||||
; listen queue len: 42
|
||||
; idle processes: 4
|
||||
; active processes: 11
|
||||
; total processes: 15
|
||||
; max active processes: 12
|
||||
; max children reached: 0
|
||||
;
|
||||
; By default the status page output is formatted as text/plain. Passing either
|
||||
; 'html', 'xml' or 'json' in the query string will return the corresponding
|
||||
; output syntax. Example:
|
||||
; http://www.foo.bar/status
|
||||
; http://www.foo.bar/status?json
|
||||
; http://www.foo.bar/status?html
|
||||
; http://www.foo.bar/status?xml
|
||||
;
|
||||
; By default the status page only outputs short status. Passing 'full' in the
|
||||
; query string will also return status for each pool process.
|
||||
; Example:
|
||||
; http://www.foo.bar/status?full
|
||||
; http://www.foo.bar/status?json&full
|
||||
; http://www.foo.bar/status?html&full
|
||||
; http://www.foo.bar/status?xml&full
|
||||
; The Full status returns for each process:
|
||||
; pid - the PID of the process;
|
||||
; state - the state of the process (Idle, Running, ...);
|
||||
; start time - the date and time the process has started;
|
||||
; start since - the number of seconds since the process has started;
|
||||
; requests - the number of requests the process has served;
|
||||
; request duration - the duration in µs of the requests;
|
||||
; request method - the request method (GET, POST, ...);
|
||||
; request URI - the request URI with the query string;
|
||||
; content length - the content length of the request (only with POST);
|
||||
; user - the user (PHP_AUTH_USER) (or '-' if not set);
|
||||
; script - the main script called (or '-' if not set);
|
||||
; last request cpu - the %cpu the last request consumed
|
||||
; it's always 0 if the process is not in Idle state
|
||||
; because CPU calculation is done when the request
|
||||
; processing has terminated;
|
||||
; last request memory - the max amount of memory the last request consumed
|
||||
; it's always 0 if the process is not in Idle state
|
||||
; because memory calculation is done when the request
|
||||
; processing has terminated;
|
||||
; If the process is in Idle state, then informations are related to the
|
||||
; last request the process has served. Otherwise informations are related to
|
||||
; the current request being served.
|
||||
; Example output:
|
||||
; ************************
|
||||
; pid: 31330
|
||||
; state: Running
|
||||
; start time: 01/Jul/2011:17:53:49 +0200
|
||||
; start since: 63087
|
||||
; requests: 12808
|
||||
; request duration: 1250261
|
||||
; request method: GET
|
||||
; request URI: /test_mem.php?N=10000
|
||||
; content length: 0
|
||||
; user: -
|
||||
; script: /home/fat/web/docs/php/test_mem.php
|
||||
; last request cpu: 0.00
|
||||
; last request memory: 0
|
||||
;
|
||||
; Note: There is a real-time FPM status monitoring sample web page available
|
||||
; It's available in: /usr/share/php/7.0/fpm/status.html
|
||||
;
|
||||
; Note: The value must start with a leading slash (/). The value can be
|
||||
; anything, but it may not be a good idea to use the .php extension or it
|
||||
; may conflict with a real PHP file.
|
||||
; Default Value: not set
|
||||
;pm.status_path = /status
|
||||
|
||||
; The ping URI to call the monitoring page of FPM. If this value is not set, no
|
||||
; URI will be recognized as a ping page. This could be used to test from outside
|
||||
; that FPM is alive and responding, or to
|
||||
; - create a graph of FPM availability (rrd or such);
|
||||
; - remove a server from a group if it is not responding (load balancing);
|
||||
; - trigger alerts for the operating team (24/7).
|
||||
; Note: The value must start with a leading slash (/). The value can be
|
||||
; anything, but it may not be a good idea to use the .php extension or it
|
||||
; may conflict with a real PHP file.
|
||||
; Default Value: not set
|
||||
;ping.path = /ping
|
||||
|
||||
; This directive may be used to customize the response of a ping request. The
|
||||
; response is formatted as text/plain with a 200 response code.
|
||||
; Default Value: pong
|
||||
;ping.response = pong
|
||||
|
||||
; The access log file
|
||||
; Default: not set
|
||||
;access.log = log/$pool.access.log
|
||||
|
||||
; The access log format.
|
||||
; The following syntax is allowed
|
||||
; %%: the '%' character
|
||||
; %C: %CPU used by the request
|
||||
; it can accept the following format:
|
||||
; - %{user}C for user CPU only
|
||||
; - %{system}C for system CPU only
|
||||
; - %{total}C for user + system CPU (default)
|
||||
; %d: time taken to serve the request
|
||||
; it can accept the following format:
|
||||
; - %{seconds}d (default)
|
||||
; - %{miliseconds}d
|
||||
; - %{mili}d
|
||||
; - %{microseconds}d
|
||||
; - %{micro}d
|
||||
; %e: an environment variable (same as $_ENV or $_SERVER)
|
||||
; it must be associated with embraces to specify the name of the env
|
||||
; variable. Some exemples:
|
||||
; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
|
||||
; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
|
||||
; %f: script filename
|
||||
; %l: content-length of the request (for POST request only)
|
||||
; %m: request method
|
||||
; %M: peak of memory allocated by PHP
|
||||
; it can accept the following format:
|
||||
; - %{bytes}M (default)
|
||||
; - %{kilobytes}M
|
||||
; - %{kilo}M
|
||||
; - %{megabytes}M
|
||||
; - %{mega}M
|
||||
; %n: pool name
|
||||
; %o: output header
|
||||
; it must be associated with embraces to specify the name of the header:
|
||||
; - %{Content-Type}o
|
||||
; - %{X-Powered-By}o
|
||||
; - %{Transfert-Encoding}o
|
||||
; - ....
|
||||
; %p: PID of the child that serviced the request
|
||||
; %P: PID of the parent of the child that serviced the request
|
||||
; %q: the query string
|
||||
; %Q: the '?' character if query string exists
|
||||
; %r: the request URI (without the query string, see %q and %Q)
|
||||
; %R: remote IP address
|
||||
; %s: status (response code)
|
||||
; %t: server time the request was received
|
||||
; it can accept a strftime(3) format:
|
||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
||||
; %T: time the log has been written (the request has finished)
|
||||
; it can accept a strftime(3) format:
|
||||
; %d/%b/%Y:%H:%M:%S %z (default)
|
||||
; The strftime(3) format must be encapsuled in a %{<strftime_format>}t tag
|
||||
; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t
|
||||
; %u: remote user
|
||||
;
|
||||
; Default: "%R - %u %t \"%m %r\" %s"
|
||||
;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
|
||||
|
||||
; The log file for slow requests
|
||||
; Default Value: not set
|
||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
||||
;slowlog = log/$pool.log.slow
|
||||
|
||||
; The timeout for serving a single request after which a PHP backtrace will be
|
||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
||||
; Default Value: 0
|
||||
;request_slowlog_timeout = 0
|
||||
|
||||
; The timeout for serving a single request after which the worker process will
|
||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
||||
; does not stop script execution for some reason. A value of '0' means 'off'.
|
||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
||||
; Default Value: 0
|
||||
request_terminate_timeout = 1d
|
||||
|
||||
; Set open file descriptor rlimit.
|
||||
; Default Value: system defined value
|
||||
;rlimit_files = 1024
|
||||
|
||||
; Set max core size rlimit.
|
||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
||||
; Default Value: system defined value
|
||||
;rlimit_core = 0
|
||||
|
||||
; Chroot to this directory at the start. This value must be defined as an
|
||||
; absolute path. When this value is not set, chroot is not used.
|
||||
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
|
||||
; of its subdirectories. If the pool prefix is not set, the global prefix
|
||||
; will be used instead.
|
||||
; Note: chrooting is a great security feature and should be used whenever
|
||||
; possible. However, all PHP paths will be relative to the chroot
|
||||
; (error_log, sessions.save_path, ...).
|
||||
; Default Value: not set
|
||||
;chroot =
|
||||
|
||||
; Chdir to this directory at the start.
|
||||
; Note: relative path can be used.
|
||||
; Default Value: current directory or / when chroot
|
||||
chdir = __FINALPATH__
|
||||
|
||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
||||
; Note: on highloaded environement, this can cause some delay in the page
|
||||
; process time (several ms).
|
||||
; Default Value: no
|
||||
;catch_workers_output = yes
|
||||
|
||||
; Clear environment in FPM workers
|
||||
; Prevents arbitrary environment variables from reaching FPM worker processes
|
||||
; by clearing the environment in workers before env vars specified in this
|
||||
; pool configuration are added.
|
||||
; Setting to "no" will make all environment variables available to PHP code
|
||||
; via getenv(), $_ENV and $_SERVER.
|
||||
; Default Value: yes
|
||||
;clear_env = no
|
||||
|
||||
; Limits the extensions of the main script FPM will allow to parse. This can
|
||||
; prevent configuration mistakes on the web server side. You should only limit
|
||||
; FPM to .php extensions to prevent malicious users to use other extensions to
|
||||
; execute php code.
|
||||
; Note: set an empty value to allow all extensions.
|
||||
; Default Value: .php
|
||||
;security.limit_extensions = .php .php3 .php4 .php5 .php7
|
||||
|
||||
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
|
||||
; the current environment.
|
||||
; Default Value: clean env
|
||||
;env[HOSTNAME] = $HOSTNAME
|
||||
;env[PATH] = /usr/local/bin:/usr/bin:/bin
|
||||
;env[TMP] = /tmp
|
||||
;env[TMPDIR] = /tmp
|
||||
;env[TEMP] = /tmp
|
||||
|
||||
; Additional php.ini defines, specific to this pool of workers. These settings
|
||||
; overwrite the values previously defined in the php.ini. The directives are the
|
||||
; same as the PHP SAPI:
|
||||
; php_value/php_flag - you can set classic ini defines which can
|
||||
; be overwritten from PHP call 'ini_set'.
|
||||
; php_admin_value/php_admin_flag - these directives won't be overwritten by
|
||||
; PHP call 'ini_set'
|
||||
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
|
||||
|
||||
; Defining 'extension' will load the corresponding shared extension from
|
||||
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
|
||||
; overwrite previously defined php.ini values, but will append the new value
|
||||
; instead.
|
||||
|
||||
; Note: path INI options can be relative and will be expanded with the prefix
|
||||
; (pool, global or /usr)
|
||||
|
||||
; Default Value: nothing is defined by default except the values in php.ini and
|
||||
; specified at startup with the -d argument
|
||||
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
|
||||
;php_flag[display_errors] = off
|
||||
;php_admin_value[error_log] = /var/log/fpm-php.www.log
|
||||
;php_admin_flag[log_errors] = on
|
||||
;php_admin_value[memory_limit] = 32M
|
||||
|
||||
; Common values to change to increase file upload limit
|
||||
; php_admin_value[upload_max_filesize] = 50M
|
||||
; php_admin_value[post_max_size] = 50M
|
||||
; php_admin_flag[mail.add_x_header] = Off
|
||||
|
||||
; Other common parameters
|
||||
; php_admin_value[max_execution_time] = 600
|
||||
; php_admin_value[max_input_time] = 300
|
||||
; php_admin_value[memory_limit] = 256M
|
||||
; php_admin_flag[short_open_tag] = On
|
||||
|
||||
php_value[upload_max_filesize] = 1G
|
||||
php_value[post_max_size] = 1G
|
||||
php_value[default_charset] = UTF-8
|
||||
php_value[always_populate_raw_post_data] = -1
|
|
@ -1,40 +1,74 @@
|
|||
version = "0.1"
|
||||
name = "My webapp configuration panel"
|
||||
version = "1.0"
|
||||
|
||||
[main]
|
||||
name = "My webapp configuration"
|
||||
name = "My Webapp configuration"
|
||||
|
||||
[main.sftp]
|
||||
name = "SFTP access"
|
||||
name.en = "SFTP access"
|
||||
name.fr = "Accès SFTP"
|
||||
|
||||
[main.sftp.sftp]
|
||||
ask = "Do you need a SFTP access?"
|
||||
[main.sftp.with_sftp]
|
||||
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 l’accès SFTP"
|
||||
type = "password"
|
||||
optional = true
|
||||
help = "If a password already exist, it will not be replaced."
|
||||
visible = "with_sftp"
|
||||
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"
|
||||
|
||||
[main.php_fpm_config.footprint]
|
||||
ask = "Memory footprint of the service?"
|
||||
choices = ["low", "medium", "high", "specific"]
|
||||
default = "low"
|
||||
help = "low <= 20Mb per pool. medium between 20Mb and 40Mb per pool. high > 40Mb per pool.<br>Use specific to set a value with the following option."
|
||||
[main.php_fpm_config.phpversion]
|
||||
ask = "PHP version"
|
||||
type = "select"
|
||||
choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"]
|
||||
default = "none"
|
||||
|
||||
[main.php_fpm_config.free_footprint]
|
||||
[main.php_fpm_config.fpm_footprint]
|
||||
visible = "phpversion != 'none'"
|
||||
ask = "Memory footprint of the service?"
|
||||
type = "select"
|
||||
choices.low = "Low, <= 20Mb per pool"
|
||||
choices.medium = "Medium, between 20Mb and 40Mb per pool"
|
||||
choices.high = "High, > 40Mb per pool"
|
||||
choices.specific = "Use specific value"
|
||||
default = "low"
|
||||
|
||||
[main.php_fpm_config.fpm_free_footprint]
|
||||
visible = "fpm_footprint == 'specific' && phpversion != 'none'"
|
||||
ask = "Memory footprint of the service?"
|
||||
type = "number"
|
||||
default = "0"
|
||||
help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values."
|
||||
|
||||
[main.php_fpm_config.usage]
|
||||
[main.php_fpm_config.fpm_usage]
|
||||
visible = "phpversion != 'none'"
|
||||
ask = "Expected usage of the service?"
|
||||
type = "select"
|
||||
choices = ["low", "medium", "high"]
|
||||
default = "low"
|
||||
help = "low: Personal usage, behind the sso. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.<br>medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.<br>high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding."
|
||||
|
||||
# TODO: Add protected_path as tags, which are created as permission "label (path)", so admin can protect a specific path
|
||||
# [main.permissions]
|
||||
# [main.permissions.proteced_path]
|
||||
# ask = "Protected path"
|
||||
# help = "A permission will be created so you can restrict the access to a subpath of the web app."
|
||||
# type = "tags"
|
||||
|
||||
|
|
35
doc/ADMIN.md
Normal file
35
doc/ADMIN.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
This app is simply a blank web app skeleton : you are expected to add you own content (HTML, CSS, PHP, ...) inside `__INSTALL_DIR__/www/`. One way to do so is by using SFTP.
|
||||
|
||||
### Login using SFTP
|
||||
|
||||
Once installed, go to the chosen URL to know the username, domain and port you will have to use for the SFTP access.
|
||||
|
||||
- Host: `__DOMAIN__`
|
||||
- Username: `__ID__`
|
||||
- Password: password chosen during installation
|
||||
- Port: 22 (unless you changed the SSH port)
|
||||
|
||||
To connect, you'll need an SFTP app such as [Filezilla](https://filezilla-project.org/) for Windows, Mac or Linux. You can also use your default file manager on [Mac](https://support.apple.com/guide/mac-help/connect-mac-shared-computers-servers-mchlp1140/mac) or Linux.
|
||||
|
||||
#### Forgot your SFTP password?
|
||||
|
||||
If you forgot your SFTP password, you can change it in YunoHost's webadmin interface in `Apps > My webapp > My Webapp configuration`.
|
||||
You can also check there that SFTP is enabled.
|
||||
|
||||
### Login using the command line
|
||||
|
||||
Starting YunoHost v11.1.21, you can run `sudo yunohost app shell __APP__` in the command line interface to log in as your app user.
|
||||
|
||||
The `php` command will point to the PHP version installed for the app.
|
||||
|
||||
### Adding or editing files
|
||||
|
||||
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`.
|
35
doc/ADMIN_fr.md
Normal file
35
doc/ADMIN_fr.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
Cette app est uniquement un squelette : il vous appartient d'ajouter vos propre pages HTML, CSS, PHP, ... à l'intérieur de `__INSTALL_DIR__/www/`. Une manière de procéder est d'utiliser SFTP.
|
||||
|
||||
### Connexion avec SFTP
|
||||
|
||||
Une fois installée, rendez-vous sur l'URL choisie pour connaître le nom d'utilisateur, le domaine et le port que vous devrez utiliser pour l'accès SFTP.
|
||||
|
||||
- Hôte: `__DOMAIN__`
|
||||
- Nom d'utilisateur: `__ID__`
|
||||
- Mot de passe: mot de passe défini lors de l'installation
|
||||
- Port: 22 (à moins que vous ayez changé le port SSH)
|
||||
|
||||
Pour vous connecter, vous devrez utiliser une application SFTP tel que [Filezilla](https://filezilla-project.org/) pour Windows, Mac ou Linux. Vous pouvez aussi directement utiliser votre gestionnaire de fichiers sous Linux ou [Mac](https://support.apple.com/guide/mac-help/connect-mac-shared-computers-servers-mchlp1140/mac).
|
||||
|
||||
#### Oubli du mot de passe SFTP
|
||||
|
||||
Si vous avez oublié votre mot de passe SFTP, vous pouvez le changer dans la webadmin de Yunohost dans `Applications > Votre webapp > My Webapp configuration`.
|
||||
Vous pourrez aussi vérifier que SFTP est activé pour votre app.
|
||||
|
||||
### Connexion par le terminal
|
||||
|
||||
A partir de YunoHost v11.1.21, vous pouvez lancer `sudo yunohost app shell __APP__` dans un terminal pour vous connecter en tant que l'utilisateur gérant l'app.
|
||||
|
||||
La commande `php` pointera vers la version de PHP installée pour l'app.
|
||||
|
||||
### Ajouter ou modifier les fichiers
|
||||
|
||||
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`.
|
9
doc/DESCRIPTION.md
Normal file
9
doc/DESCRIPTION.md
Normal file
|
@ -0,0 +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 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.
|
9
doc/DESCRIPTION_fr.md
Normal file
9
doc/DESCRIPTION_fr.md
Normal file
|
@ -0,0 +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 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`
|
12
doc/POST_INSTALL.md
Normal file
12
doc/POST_INSTALL.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% if database != 'none' %}
|
||||
|
||||
Here are information to log into the database:
|
||||
|
||||
- Type: __DATABASE__
|
||||
- Database user: __DB_USER__
|
||||
- Database name: __DB_NAME__
|
||||
- Password: __DB_PWD__
|
||||
|
||||
{% endif %}
|
||||
|
||||
The admin documentation below contains information on how to connect using SFTP to edit the website content.
|
12
doc/POST_INSTALL_fr.md
Normal file
12
doc/POST_INSTALL_fr.md
Normal file
|
@ -0,0 +1,12 @@
|
|||
{% if database != 'none' %}
|
||||
|
||||
Voici les informations pour se connecter à la base de donnée:
|
||||
|
||||
- Type : __DATABASE__
|
||||
- Utilisateur de la base de données : __DB_USER__
|
||||
- Nom de la base de données : __DB_NAME__
|
||||
- Mot de passe : __DB_PWD__
|
||||
|
||||
{% endif %}
|
||||
|
||||
La documentation ci-dessous contient les informations pour se connecter en SSH et modifier le contenu du site web.
|
4
doc/PRE_UPGRADE.d/1.0~ynh15.md
Normal file
4
doc/PRE_UPGRADE.d/1.0~ynh15.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
If you experienced issues with the displayed database password before, sorry for the inconvenience!
|
||||
|
||||
- New installations of the app fix the bug.
|
||||
- If you want to keep using your current instance, you can use PhpMyAdmin to change the __APP__ user's password.
|
|
@ -1,81 +0,0 @@
|
|||
{
|
||||
"id": "my_webapp",
|
||||
"name": "Custom Webapp",
|
||||
"packaging_format": 1,
|
||||
"description": {
|
||||
"en": "Custom Web app with SFTP access to serve static (HTML, CSS, JS) and PHP files",
|
||||
"fr": "Application Web personnalisée avec accès SFTP pour servir des fichiers statiques (HTML, CSS, JS) et PHP"
|
||||
},
|
||||
"version": "1.0~ynh5",
|
||||
"url": "https://github.com/YunoHost-Apps/my_webapp_ynh",
|
||||
"license": "GPL-3.0-only",
|
||||
"maintainer": {
|
||||
"name": "",
|
||||
"email": ""
|
||||
},
|
||||
"previous_maintainers": [{
|
||||
"name": "Maniack Crudelis",
|
||||
"email": "maniackc_dev@crudelis.fr"
|
||||
}],
|
||||
"requirements": {
|
||||
"yunohost": ">= 4.3.3"
|
||||
},
|
||||
"multi_instance": true,
|
||||
"services": [
|
||||
"nginx",
|
||||
"php7.3-fpm",
|
||||
"mysql"
|
||||
],
|
||||
"arguments": {
|
||||
"install" : [
|
||||
{
|
||||
"name": "domain",
|
||||
"type": "domain"
|
||||
},
|
||||
{
|
||||
"name": "path",
|
||||
"type": "path",
|
||||
"example": "/site",
|
||||
"default": "/site"
|
||||
},
|
||||
{
|
||||
"name": "with_sftp",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Do you need a SFTP access?",
|
||||
"fr": "Avez-vous besoin d'un accès SFTP ?"
|
||||
},
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "password",
|
||||
"type": "password",
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"name": "is_public",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
{
|
||||
"name": "phpversion",
|
||||
"type": "string",
|
||||
"ask": {
|
||||
"en": "Choose a PHP version you want to use for your app",
|
||||
"fr": "Choisissez une version PHP que vous souhaitez utiliser pour votre application"
|
||||
},
|
||||
"choices" : ["none", "7.3", "7.4", "8.0"],
|
||||
"default" : "7.3"
|
||||
},
|
||||
{
|
||||
"name": "with_mysql",
|
||||
"type": "boolean",
|
||||
"ask": {
|
||||
"en": "Do you need a MySQL database?",
|
||||
"fr": "Avez-vous besoin d'une base de données MySQL ?"
|
||||
},
|
||||
"default": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
96
manifest.toml
Normal file
96
manifest.toml
Normal file
|
@ -0,0 +1,96 @@
|
|||
packaging_format = 2
|
||||
|
||||
id = "my_webapp"
|
||||
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~ynh19"
|
||||
|
||||
maintainers = []
|
||||
|
||||
[upstream]
|
||||
license = "GPL-3.0-only"
|
||||
code = "https://github.com/YunoHost-Apps/my_webapp_ynh"
|
||||
|
||||
[integration]
|
||||
yunohost = ">= 11.2.4"
|
||||
architectures = "all"
|
||||
multi_instance = true
|
||||
ldap = "not_relevant"
|
||||
sso = "not_relevant"
|
||||
disk = "50M"
|
||||
ram.build = "50M"
|
||||
ram.runtime = "50M"
|
||||
|
||||
[install]
|
||||
[install.domain]
|
||||
type = "domain"
|
||||
|
||||
[install.path]
|
||||
type = "path"
|
||||
default = "/site"
|
||||
|
||||
[install.with_sftp]
|
||||
ask.en = "Do you need a SFTP access?"
|
||||
ask.fr = "Avez-vous besoin d'un accès SFTP ?"
|
||||
type = "boolean"
|
||||
default = true
|
||||
|
||||
[install.password]
|
||||
type = "password"
|
||||
optional = true
|
||||
|
||||
[install.init_main_permission]
|
||||
type = "group"
|
||||
default = "visitors"
|
||||
|
||||
[install.phpversion]
|
||||
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", "8.3"]
|
||||
default = "8.3"
|
||||
|
||||
[install.database]
|
||||
ask.en = "Do you need a database?"
|
||||
ask.fr = "Avez-vous besoin d'une base de données ?"
|
||||
type = "select"
|
||||
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]
|
||||
|
||||
[resources.install_dir]
|
||||
|
||||
[resources.permissions]
|
||||
main.url = "/"
|
||||
|
||||
[resources.apt]
|
||||
packages = "nginx" # Kind of "dummy" value to be sure to have a non-empty dep list
|
||||
packages_from_raw_bash = """
|
||||
if [[ "$database" == "mysql" ]]; then
|
||||
echo "mariadb-server"
|
||||
|
||||
if [[ "$phpversion" != none ]]; then
|
||||
echo "php${phpversion}-mysql"
|
||||
fi
|
||||
elif [[ "$database" == "postgresql" ]]; then
|
||||
echo "postgresql postgresql-contrib"
|
||||
|
||||
if [[ "$phpversion" != none ]]; then
|
||||
echo "php${phpversion}-pgsql"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$phpversion" != none ]]; then
|
||||
echo "php${phpversion}-fpm"
|
||||
fi
|
||||
"""
|
|
@ -8,151 +8,10 @@
|
|||
# EXPERIMENTAL HELPERS
|
||||
#=================================================
|
||||
|
||||
# Send an email to inform the administrator
|
||||
#
|
||||
# usage: ynh_send_readme_to_admin --app_message=app_message [--recipients=recipients] [--type=type]
|
||||
# | arg: -m --app_message= - The file with the content to send to the administrator.
|
||||
# | arg: -r, --recipients= - The recipients of this email. Use spaces to separate multiples recipients. - default: root
|
||||
# example: "root admin@domain"
|
||||
# If you give the name of a YunoHost user, ynh_send_readme_to_admin will find its email adress for you
|
||||
# example: "root admin@domain user1 user2"
|
||||
# | arg: -t, --type= - Type of mail, could be 'backup', 'change_url', 'install', 'remove', 'restore', 'upgrade'
|
||||
ynh_send_readme_to_admin() {
|
||||
# Declare an array to define the options of this helper.
|
||||
declare -Ar args_array=( [m]=app_message= [r]=recipients= [t]=type= )
|
||||
local app_message
|
||||
local recipients
|
||||
local type
|
||||
# Manage arguments with getopts
|
||||
|
||||
ynh_handle_getopts_args "$@"
|
||||
app_message="${app_message:-}"
|
||||
recipients="${recipients:-root}"
|
||||
type="${type:-install}"
|
||||
|
||||
# Get the value of admin_mail_html
|
||||
admin_mail_html=$(ynh_app_setting_get $app admin_mail_html)
|
||||
admin_mail_html="${admin_mail_html:-0}"
|
||||
|
||||
# Retrieve the email of users
|
||||
find_mails () {
|
||||
local list_mails="$1"
|
||||
local mail
|
||||
local recipients=" "
|
||||
# Read each mail in argument
|
||||
for mail in $list_mails
|
||||
do
|
||||
# Keep root or a real email address as it is
|
||||
if [ "$mail" = "root" ] || echo "$mail" | grep --quiet "@"
|
||||
then
|
||||
recipients="$recipients $mail"
|
||||
else
|
||||
# But replace an user name without a domain after by its email
|
||||
if mail=$(ynh_user_get_info "$mail" "mail" 2> /dev/null)
|
||||
then
|
||||
recipients="$recipients $mail"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "$recipients"
|
||||
}
|
||||
recipients=$(find_mails "$recipients")
|
||||
|
||||
# Subject base
|
||||
local mail_subject="☁️🆈🅽🅷☁️: \`$app\`"
|
||||
|
||||
# Adapt the subject according to the type of mail required.
|
||||
if [ "$type" = "backup" ]; then
|
||||
mail_subject="$mail_subject has just been backup."
|
||||
elif [ "$type" = "change_url" ]; then
|
||||
mail_subject="$mail_subject has just been moved to a new URL!"
|
||||
elif [ "$type" = "remove" ]; then
|
||||
mail_subject="$mail_subject has just been removed!"
|
||||
elif [ "$type" = "restore" ]; then
|
||||
mail_subject="$mail_subject has just been restored!"
|
||||
elif [ "$type" = "upgrade" ]; then
|
||||
mail_subject="$mail_subject has just been upgraded!"
|
||||
else # install
|
||||
mail_subject="$mail_subject has just been installed!"
|
||||
fi
|
||||
|
||||
local mail_message="This is an automated message from your beloved YunoHost server.
|
||||
|
||||
Specific information for the application $app.
|
||||
|
||||
$(if [ -n "$app_message" ]
|
||||
then
|
||||
cat "$app_message"
|
||||
else
|
||||
echo "...No specific information..."
|
||||
fi)
|
||||
|
||||
---
|
||||
Automatic diagnosis data from YunoHost
|
||||
|
||||
__PRE_TAG1__$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')__PRE_TAG2__"
|
||||
|
||||
# Store the message into a file for further modifications.
|
||||
echo "$mail_message" > mail_to_send
|
||||
|
||||
# If a html email is required. Apply html tags to the message.
|
||||
if [ "$admin_mail_html" -eq 1 ]
|
||||
then
|
||||
# Insert 'br' tags at each ending of lines.
|
||||
ynh_replace_string "$" "<br>" mail_to_send
|
||||
|
||||
# Insert starting HTML tags
|
||||
sed --in-place '1s@^@<!DOCTYPE html>\n<html>\n<head></head>\n<body>\n@' mail_to_send
|
||||
|
||||
# Keep tabulations
|
||||
ynh_replace_string " " "\ \ " mail_to_send
|
||||
ynh_replace_string "\t" "\ \ " mail_to_send
|
||||
|
||||
# Insert url links tags
|
||||
ynh_replace_string "__URL_TAG1__\(.*\)__URL_TAG2__\(.*\)__URL_TAG3__" "<a href=\"\2\">\1</a>" mail_to_send
|
||||
|
||||
# Insert pre tags
|
||||
ynh_replace_string "__PRE_TAG1__" "<pre>" mail_to_send
|
||||
ynh_replace_string "__PRE_TAG2__" "<\pre>" mail_to_send
|
||||
|
||||
# Insert finishing HTML tags
|
||||
echo -e "\n</body>\n</html>" >> mail_to_send
|
||||
|
||||
# Otherwise, remove tags to keep a plain text.
|
||||
else
|
||||
# Remove URL tags
|
||||
ynh_replace_string "__URL_TAG[1,3]__" "" mail_to_send
|
||||
ynh_replace_string "__URL_TAG2__" ": " mail_to_send
|
||||
|
||||
# Remove PRE tags
|
||||
ynh_replace_string "__PRE_TAG[1-2]__" "" mail_to_send
|
||||
fi
|
||||
|
||||
# Define binary to use for mail command
|
||||
if [ -e /usr/bin/bsd-mailx ]
|
||||
then
|
||||
local mail_bin=/usr/bin/bsd-mailx
|
||||
else
|
||||
local mail_bin=/usr/bin/mail.mailutils
|
||||
fi
|
||||
|
||||
if [ "$admin_mail_html" -eq 1 ]
|
||||
then
|
||||
content_type="text/html"
|
||||
else
|
||||
content_type="text/plain"
|
||||
fi
|
||||
|
||||
# Send the email to the recipients
|
||||
cat mail_to_send | $mail_bin -a "Content-Type: $content_type; charset=UTF-8" -s "$mail_subject" "$recipients"
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
||||
ynh_maintenance_mode_ON () {
|
||||
# Load value of $path_url and $domain from the config if their not set
|
||||
if [ -z $path_url ]; then
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
# Load value of $path and $domain from the config if their not set
|
||||
if [ -z $path ]; then
|
||||
path=$(ynh_app_setting_get $app path)
|
||||
fi
|
||||
if [ -z $domain ]; then
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
|
@ -182,10 +41,10 @@ ynh_maintenance_mode_ON () {
|
|||
</html>" > "/var/www/html/maintenance.$app.html"
|
||||
|
||||
# Create a new nginx config file to redirect all access to the app to the maintenance notice instead.
|
||||
echo "# All request to the app will be redirected to ${path_url}_maintenance and fall on the maintenance notice
|
||||
rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/? redirect;
|
||||
echo "# All request to the app will be redirected to ${path}_maintenance and fall on the maintenance notice
|
||||
rewrite ^${path}/(.*)$ ${path}_maintenance/? redirect;
|
||||
# Use another location, to not be in conflict with the original config file
|
||||
location ${path_url}_maintenance/ {
|
||||
location ${path}_maintenance/ {
|
||||
alias /var/www/html/ ;
|
||||
|
||||
try_files maintenance.$app.html =503;
|
||||
|
@ -196,7 +55,7 @@ include conf.d/yunohost_panel.conf.inc;
|
|||
|
||||
# The current config file will redirect all requests to the root of the app.
|
||||
# To keep the full path, we can use the following rewrite rule:
|
||||
# rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/\$1? redirect;
|
||||
# rewrite ^${path}/(.*)$ ${path}_maintenance/\$1? redirect;
|
||||
# The difference will be in the $1 at the end, which keep the following queries.
|
||||
# But, if it works perfectly for a html request, there's an issue with any php files.
|
||||
# This files are treated as simple files, and will be downloaded by the browser.
|
||||
|
@ -206,16 +65,16 @@ include conf.d/yunohost_panel.conf.inc;
|
|||
}
|
||||
|
||||
ynh_maintenance_mode_OFF () {
|
||||
# Load value of $path_url and $domain from the config if their not set
|
||||
if [ -z $path_url ]; then
|
||||
path_url=$(ynh_app_setting_get $app path)
|
||||
# Load value of $path and $domain from the config if their not set
|
||||
if [ -z $path ]; then
|
||||
path=$(ynh_app_setting_get $app path)
|
||||
fi
|
||||
if [ -z $domain ]; then
|
||||
domain=$(ynh_app_setting_get $app domain)
|
||||
fi
|
||||
|
||||
# Rewrite the nginx config file to redirect from ${path_url}_maintenance to the real url of the app.
|
||||
echo "rewrite ^${path_url}_maintenance/(.*)$ ${path_url}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
|
||||
# Rewrite the nginx config file to redirect from ${path}_maintenance to the real url of the app.
|
||||
echo "rewrite ^${path}_maintenance/(.*)$ ${path}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
|
||||
systemctl reload nginx
|
||||
|
||||
# Sleep 4 seconds to let the browser reload the pages and redirect the user to the app.
|
||||
|
@ -228,140 +87,38 @@ ynh_maintenance_mode_OFF () {
|
|||
systemctl reload nginx
|
||||
}
|
||||
|
||||
#=================================================
|
||||
|
||||
# Create a changelog for an app after an upgrade from the file CHANGELOG.md.
|
||||
#
|
||||
# usage: ynh_app_changelog [--format=markdown/html/plain] [--output=changelog_file] --changelog=changelog_source]
|
||||
# | arg: -f --format= - Format in which the changelog will be printed
|
||||
# markdown: Default format.
|
||||
# html: Turn urls into html format.
|
||||
# plain: Plain text changelog
|
||||
# | arg: -o --output= - Output file for the changelog file (Default ./changelog)
|
||||
# | arg: -c --changelog= - CHANGELOG.md source (Default ../CHANGELOG.md)
|
||||
#
|
||||
# The changelog is printed into the file ./changelog and ./changelog_lite
|
||||
ynh_app_changelog () {
|
||||
ynh_system_user_add_group() {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=foc
|
||||
declare -Ar args_array=( [f]=format= [o]=output= [c]=changelog= )
|
||||
local format
|
||||
local output
|
||||
local changelog
|
||||
local legacy_args=uhs
|
||||
local -A args_array=([u]=username= [g]=groups=)
|
||||
local username
|
||||
local groups
|
||||
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
format=${format:-markdown}
|
||||
output=${output:-changelog}
|
||||
changelog=${changelog:-../CHANGELOG.md}
|
||||
groups="${groups:-}"
|
||||
|
||||
local original_changelog="$changelog"
|
||||
local temp_changelog="changelog_temp"
|
||||
local final_changelog="$output"
|
||||
|
||||
if [ ! -n "$original_changelog" ]
|
||||
then
|
||||
echo "No changelog available..." > "$final_changelog"
|
||||
echo "No changelog available..." > "${final_changelog}_lite"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version")
|
||||
local update_version=$(ynh_read_manifest --manifest="../manifest.json" --manifest_key="version")
|
||||
|
||||
# Get the line of the version to update to into the changelog
|
||||
local update_version_line=$(grep --max-count=1 --line-number "^## \[$update_version" "$original_changelog" | cut -d':' -f1)
|
||||
# If there's no entry for this version yet into the changelog
|
||||
# Get the first available version
|
||||
if [ -z "$update_version_line" ]
|
||||
then
|
||||
update_version_line=$(grep --max-count=1 --line-number "^##" "$original_changelog" | cut -d':' -f1)
|
||||
fi
|
||||
|
||||
# Get the length of the complete changelog.
|
||||
local changelog_length=$(wc --lines "$original_changelog" | awk '{print $1}')
|
||||
# Cut the file before the version to update to.
|
||||
tail --lines=$(( $changelog_length - $update_version_line + 1 )) "$original_changelog" > "$temp_changelog"
|
||||
|
||||
# Get the length of the troncated changelog.
|
||||
changelog_length=$(wc --lines "$temp_changelog" | awk '{print $1}')
|
||||
# Get the line of the current version into the changelog
|
||||
# Keep only the last line found
|
||||
local current_version_line=$(grep --line-number "^## \[$current_version" "$temp_changelog" | cut -d':' -f1 | tail --lines=1)
|
||||
# If there's no entry for this version into the changelog
|
||||
# Get the last available version
|
||||
if [ -z "$current_version_line" ]
|
||||
then
|
||||
current_version_line=$(grep --line-number "^##" "$original_changelog" | cut -d':' -f1 | tail --lines=1)
|
||||
fi
|
||||
# Cut the file before the current version.
|
||||
# Then grep the previous version into the changelog to get the line number of the previous version
|
||||
local previous_version_line=$(tail --lines=$(( $changelog_length - $current_version_line )) \
|
||||
"$temp_changelog" | grep --max-count=1 --line-number "^## " | cut -d':' -f1)
|
||||
# If there's no previous version into the changelog
|
||||
# Go until the end of the changelog
|
||||
if [ -z "$previous_version_line" ]
|
||||
then
|
||||
previous_version_line=$changelog_length
|
||||
fi
|
||||
|
||||
# Cut the file after the previous version to keep only the changelog between the current version and the version to update to.
|
||||
head --lines=$(( $current_version_line + $previous_version_line - 1 )) "$temp_changelog" | tee "$final_changelog"
|
||||
|
||||
if [ "$format" = "html" ]
|
||||
then
|
||||
# Replace markdown links by html links
|
||||
ynh_replace_string --match_string="\[\(.*\)\](\(.*\)))" --replace_string="<a href=\"\2\">\1</a>)" --target_file="$final_changelog"
|
||||
ynh_replace_string --match_string="\[\(.*\)\](\(.*\))" --replace_string="<a href=\"\2\">\1</a>" --target_file="$final_changelog"
|
||||
elif [ "$format" = "plain" ]
|
||||
then
|
||||
# Change title format.
|
||||
ynh_replace_string --match_string="^##.*\[\(.*\)\](\(.*\)) - \(.*\)$" --replace_string="## \1 (\3) - \2" --target_file="$final_changelog"
|
||||
# Change modifications lines format.
|
||||
ynh_replace_string --match_string="^\([-*]\).*\[\(.*\)\]\(.*\)" --replace_string="\1 \2 \3" --target_file="$final_changelog"
|
||||
fi
|
||||
# else markdown. As the file is already in markdown, nothing to do.
|
||||
|
||||
# Keep only important changes into the changelog
|
||||
# Remove all minor changes
|
||||
sed '/^-/d' "$final_changelog" > "${final_changelog}_lite"
|
||||
# Remove all blank lines (to keep a clear workspace)
|
||||
sed --in-place '/^$/d' "${final_changelog}_lite"
|
||||
# Add a blank line at the end
|
||||
echo "" >> "${final_changelog}_lite"
|
||||
|
||||
# Clean titles if there's no significative changes
|
||||
local line
|
||||
local previous_line=""
|
||||
while read line <&3
|
||||
do
|
||||
if [ -n "$previous_line" ]
|
||||
then
|
||||
# Remove the line if it's a title or a blank line, and the previous one was a title as well.
|
||||
if ( [ "${line:0:1}" = "#" ] || [ ${#line} -eq 0 ] ) && [ "${previous_line:0:1}" = "#" ]
|
||||
then
|
||||
ynh_replace_special_string --match_string="${previous_line//[/.}" --replace_string="" --target_file="${final_changelog}_lite"
|
||||
fi
|
||||
fi
|
||||
previous_line="$line"
|
||||
done 3< "${final_changelog}_lite"
|
||||
|
||||
# Remove all blank lines again
|
||||
sed --in-place '/^$/d' "${final_changelog}_lite"
|
||||
|
||||
# Restore changelog format with blank lines
|
||||
ynh_replace_string --match_string="^##.*" --replace_string="\n\n&\n" --target_file="${final_changelog}_lite"
|
||||
# Remove the 2 first blank lines
|
||||
sed --in-place '1,2d' "${final_changelog}_lite"
|
||||
# Add a blank line at the end
|
||||
echo "" >> "${final_changelog}_lite"
|
||||
|
||||
# If changelog are empty, add an info
|
||||
if [ $(wc --words "$final_changelog" | awk '{print $1}') -eq 0 ]
|
||||
then
|
||||
echo "No changes from the changelog..." > "$final_changelog"
|
||||
fi
|
||||
if [ $(wc --words "${final_changelog}_lite" | awk '{print $1}') -eq 0 ]
|
||||
then
|
||||
echo "No significative changes from the changelog..." > "${final_changelog}_lite"
|
||||
fi
|
||||
local group
|
||||
for group in $groups; do
|
||||
usermod -a -G "$group" "$username"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
ynh_system_user_del_group() {
|
||||
# Declare an array to define the options of this helper.
|
||||
local legacy_args=uhs
|
||||
local -A args_array=([u]=username= [g]=groups=)
|
||||
local username
|
||||
local groups
|
||||
|
||||
# Manage arguments with getopts
|
||||
ynh_handle_getopts_args "$@"
|
||||
groups="${groups:-}"
|
||||
|
||||
local group
|
||||
for group in $groups; do
|
||||
gpasswd -d "$username" "$group"
|
||||
done
|
||||
}
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||
|
||||
#=================================================
|
||||
# CHECK IF ARGUMENTS ARE CORRECT
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# CHECK IF AN ACTION HAS TO BE DONE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC ACTION
|
||||
#=================================================
|
||||
# REMOVE THE PREVIOUS DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the previous database..." --weight=6
|
||||
|
||||
if [ $with_mysql -eq 1 ]
|
||||
then
|
||||
yunohost app action run $app remove_database
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE A NEW DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Creating a new database..." --weight=4
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
|
||||
# Reuse the previous password if existing
|
||||
db_pwd=$(grep "pass:" "$final_path/db_access.txt" | cut -d' ' -f2 2> /dev/null)
|
||||
|
||||
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
|
||||
|
||||
echo -e "# MySQL Database
|
||||
name: ${db_name}\nuser: ${db_name}\npass: ${db_pwd}" > "$final_path/db_access.txt"
|
||||
|
||||
# Update the config of the app
|
||||
ynh_app_setting_set --app=$app --key=with_mysql --value=1
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Execution completed" --last
|
|
@ -1,50 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
|
||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||
|
||||
#=================================================
|
||||
# CHECK IF ARGUMENTS ARE CORRECT
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# CHECK IF AN ACTION HAS TO BE DONE
|
||||
#=================================================
|
||||
|
||||
if [ $with_mysql -eq 0 ]
|
||||
then
|
||||
ynh_die --message="There's no database to remove." --ret_code=0
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC ACTION
|
||||
#=================================================
|
||||
# REMOVE THE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the database..." --weight=9
|
||||
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
ynh_mysql_remove_db --db_user=$db_name --db_name=$db_name
|
||||
|
||||
# Update the config of the app
|
||||
ynh_app_setting_set --app=$app --key=with_mysql --value=0
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Execution completed" --last
|
|
@ -1,63 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
#=================================================
|
||||
# GENERIC STARTING
|
||||
#=================================================
|
||||
# IMPORT GENERIC HELPERS
|
||||
#=================================================
|
||||
|
||||
source scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||
|
||||
with_sftp=${YNH_ACTION_WITH_SFTP}
|
||||
|
||||
#=================================================
|
||||
# CHECK IF ARGUMENTS ARE CORRECT
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# CHECK IF AN ACTION HAS TO BE DONE
|
||||
#=================================================
|
||||
|
||||
with_sftp_old=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
|
||||
if [ $with_sftp -eq $with_sftp_old ]
|
||||
then
|
||||
ynh_die --message="with_sftp is already set as $with_sftp." --ret_code=0
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC ACTION
|
||||
#=================================================
|
||||
# MOVE TO PUBLIC OR PRIVATE
|
||||
#=================================================
|
||||
|
||||
if [ $with_sftp -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Configuring SSH to add a SFTP access..." --weight=3
|
||||
|
||||
ynh_add_config --template="conf/ssh_regenconf_hook" --destination="/usr/share/yunohost/hooks/conf_regen/90-ssh_$app"
|
||||
|
||||
else
|
||||
ynh_script_progression --message="Removing the custom ssh config for the SFTP access..." --weight=3
|
||||
|
||||
# Remove regen-conf hook
|
||||
ynh_secure_remove --file="/usr/share/yunohost/hooks/conf_regen/90-ssh_$app"
|
||||
fi
|
||||
|
||||
yunohost tools regen-conf ssh
|
||||
|
||||
# Update the config of the app
|
||||
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Execution completed" --last
|
|
@ -9,27 +9,6 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_print_info --message="Loading installation settings..."
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
#=================================================
|
||||
|
@ -39,28 +18,37 @@ ynh_print_info --message="Declaring files to be backed up..."
|
|||
# BACKUP THE APP MAIN DIR
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="$final_path"
|
||||
ynh_backup --src_path="$install_dir"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d"
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
ynh_backup --src_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# BACKUP THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
||||
if [ $with_mysql -eq 1 ]
|
||||
if [ $database != "none" ]
|
||||
then
|
||||
ynh_print_info --message="Backing up the MySQL database..."
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
ynh_print_info --message="Backing up the database..."
|
||||
|
||||
if [ $database == "mysql" ]; then
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
elif [ $database == "postgresql" ]; then
|
||||
ynh_psql_dump_db --database="$db_name" > db.sql
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
|
|
@ -9,69 +9,29 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
old_domain=$YNH_APP_OLD_DOMAIN
|
||||
old_path=$YNH_APP_OLD_PATH
|
||||
|
||||
new_domain=$YNH_APP_NEW_DOMAIN
|
||||
new_path=$YNH_APP_NEW_PATH
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..."
|
||||
|
||||
# Needed for helper "ynh_add_nginx_config"
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=5
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.d"
|
||||
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Activating maintenance mode..."
|
||||
|
||||
path_url=$old_path
|
||||
domain=$old_domain
|
||||
ynh_maintenance_mode_ON
|
||||
|
||||
#=================================================
|
||||
# CHECK WHICH PARTS SHOULD BE CHANGED
|
||||
#=================================================
|
||||
|
||||
change_domain=0
|
||||
if [ "$old_domain" != "$new_domain" ]
|
||||
then
|
||||
change_domain=1
|
||||
fi
|
||||
|
||||
change_path=0
|
||||
if [ "$old_path" != "$new_path" ]
|
||||
then
|
||||
change_path=1
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
|
@ -80,14 +40,7 @@ fi
|
|||
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
|
||||
|
||||
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
|
||||
|
||||
# Prepare nginx.conf
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
cp ../conf/nginx{_with_php,}.conf
|
||||
else
|
||||
cp ../conf/nginx{_no_php,}.conf
|
||||
fi
|
||||
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 ]
|
||||
|
@ -99,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
|
||||
|
@ -108,25 +67,32 @@ if [ $change_domain -eq 1 ]
|
|||
then
|
||||
# Delete file checksum for the old conf file location
|
||||
ynh_delete_file_checksum --file="$nginx_conf_path"
|
||||
mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf
|
||||
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"
|
||||
ynh_remove_nginx_config
|
||||
|
||||
domain="$new_domain"
|
||||
ynh_add_nginx_config
|
||||
|
||||
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.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
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALISATION
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# DEACTIVE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling maintenance mode..."
|
||||
|
||||
path_url=$old_path
|
||||
domain=$old_domain
|
||||
|
|
233
scripts/config
233
scripts/config
|
@ -9,115 +9,176 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS
|
||||
#=================================================
|
||||
|
||||
app=${YNH_APP_INSTANCE_NAME:-$YNH_APP_ID}
|
||||
install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path=$(ynh_app_setting_get --app=$app --key=path)
|
||||
|
||||
current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC CODE
|
||||
#=================================================
|
||||
# LOAD VALUES
|
||||
# SPECIFIC GETTERS FOR TOML SHORT KEY
|
||||
#=================================================
|
||||
|
||||
# Load the real value from the app config or elsewhere.
|
||||
# Then get the value from the form.
|
||||
# If the form has a value for a variable, take the value from the form,
|
||||
# Otherwise, keep the value from the app config.
|
||||
get__fpm_footprint() {
|
||||
# Free footprint value for php-fpm
|
||||
# Check if current_fpm_footprint is an integer
|
||||
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
||||
then
|
||||
echo "specific"
|
||||
else
|
||||
echo "$current_fpm_footprint"
|
||||
fi
|
||||
}
|
||||
|
||||
# with_sftp
|
||||
old_with_sftp="$(ynh_app_setting_get --app=$app --key=with_sftp)"
|
||||
with_sftp="${YNH_CONFIG_MAIN_SFTP_SFTP:-$old_with_sftp}"
|
||||
|
||||
# sftp password
|
||||
is_password_exist=0
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
if [ -n "$password" ]
|
||||
then
|
||||
ynh_print_warn --message="A password already exist, it will not be replaced."
|
||||
# If a password already exist, unset the variable password and to not change it.
|
||||
unset password
|
||||
is_password_exist=1
|
||||
else
|
||||
# Otherwise, get the new password
|
||||
password="$YNH_CONFIG_MAIN_SFTP_PASSWORD"
|
||||
fi
|
||||
|
||||
|
||||
# Footprint for PHP-FPM
|
||||
old_fpm_footprint="$(ynh_app_setting_get --app=$app --key=fpm_footprint)"
|
||||
fpm_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT:-$old_fpm_footprint}"
|
||||
|
||||
# Free footprint value for PHP-FPM
|
||||
# Check if fpm_footprint is an integer
|
||||
if [ "$fpm_footprint" -eq "$fpm_footprint" ] 2> /dev/null
|
||||
then
|
||||
# If fpm_footprint is an integer, that's a numeric value for the footprint
|
||||
old_free_footprint=$fpm_footprint
|
||||
else
|
||||
old_free_footprint=0
|
||||
fi
|
||||
free_footprint="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT:-$old_free_footprint}"
|
||||
|
||||
# Usage for PHP-FPM
|
||||
old_fpm_usage="$(ynh_app_setting_get --app=$app --key=fpm_usage)"
|
||||
fpm_usage="${YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE:-$old_fpm_usage}"
|
||||
|
||||
#=================================================
|
||||
# SHOW_CONFIG FUNCTION FOR 'SHOW' COMMAND
|
||||
#=================================================
|
||||
|
||||
show_config() {
|
||||
# here you are supposed to read some config file/database/other then print the values
|
||||
# ynh_return "YNH_CONFIG_${PANEL_ID}_${SECTION_ID}_${OPTION_ID}=value"
|
||||
ynh_return "YNH_CONFIG_MAIN_SFTP_SFTP=$with_sftp"
|
||||
# ynh_return "YNH_CONFIG_MAIN_SFTP_PASSWORD=$password"
|
||||
|
||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FOOTPRINT=$fpm_footprint"
|
||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_FREE_FOOTPRINT=$free_footprint"
|
||||
ynh_return "YNH_CONFIG_MAIN_PHP_FPM_CONFIG_USAGE=$fpm_usage"
|
||||
get__free_footprint() {
|
||||
# Free footprint value for php-fpm
|
||||
# Check if current_fpm_footprint is an integer
|
||||
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
|
||||
then
|
||||
# If current_fpm_footprint is an integer, that's a numeric value for the footprint
|
||||
echo "$current_fpm_footprint"
|
||||
else
|
||||
echo "0"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# MODIFY THE CONFIGURATION
|
||||
# SPECIFIC VALIDATORS FOR TOML SHORT KEYS
|
||||
#=================================================
|
||||
|
||||
apply_config() {
|
||||
#=================================================
|
||||
# REMOVE OR ADD SFTP ACCESS
|
||||
#=================================================
|
||||
#=================================================
|
||||
# SPECIFIC SETTERS FOR TOML SHORT KEYS
|
||||
#=================================================
|
||||
|
||||
if [ "$with_sftp" != "$old_with_sftp" ]
|
||||
set__password() {
|
||||
if [ ! "$password" == "" ]
|
||||
then
|
||||
yunohost app action run $app sftp --args with_sftp=$with_sftp
|
||||
|
||||
# Change the password only if none was already set for the user
|
||||
if [ $is_password_exist -eq 0 ] && [ $with_sftp -eq 1 ]
|
||||
then
|
||||
# Add the password to the user
|
||||
chpasswd <<< "${app}:${password}"
|
||||
ynh_app_setting_set --app=$app --key=password --value="$password"
|
||||
fi
|
||||
ynh_app_setting_set --app=$app --key=password --value="$password"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# RECONFIGURE PHP-FPM
|
||||
#=================================================
|
||||
|
||||
if [ "$fpm_usage" != "$old_fpm_usage" ] || [ "$fpm_footprint" != "$old_fpm_footprint" ]
|
||||
set__fpm_footprint() {
|
||||
if [ "$fpm_footprint" != "specific" ]
|
||||
then
|
||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint"
|
||||
fi
|
||||
}
|
||||
|
||||
set__fpm_free_footprint() {
|
||||
if [ "$fpm_footprint" = "specific" ]
|
||||
then
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint"
|
||||
fi
|
||||
}
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT
|
||||
#=================================================
|
||||
|
||||
case $1 in
|
||||
show) show_config;;
|
||||
apply) apply_config;;
|
||||
esac
|
||||
ynh_app_config_validate() {
|
||||
_ynh_app_config_validate
|
||||
|
||||
if [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 1 ] && [ "$password" == "" ]
|
||||
then
|
||||
ynh_die --message="You need to set a password to enable SFTP"
|
||||
fi
|
||||
|
||||
if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then
|
||||
# If fpm_footprint is set to 'specific', use $fpm_free_footprint value.
|
||||
if [ "$fpm_footprint" = "specific" ]
|
||||
then
|
||||
fpm_footprint=$fpm_free_footprint
|
||||
fi
|
||||
|
||||
if [ "$fpm_footprint" == "0" ]
|
||||
then
|
||||
ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below."
|
||||
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
ynh_app_config_apply() {
|
||||
_ynh_app_config_apply
|
||||
|
||||
if [ "${changed[phpversion]}" == "true" ]
|
||||
then
|
||||
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" ]
|
||||
then
|
||||
ynh_delete_file_checksum --file="$nginx_extra_conf_dir/php.conf"
|
||||
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_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
|
||||
# ^ the helper takes care of ynh_app_setting_set the phpversion
|
||||
fi
|
||||
|
||||
ynh_add_nginx_config
|
||||
fi
|
||||
|
||||
if [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 1 ]
|
||||
then
|
||||
ynh_system_user_add_group --username=$app --groups="sftp.app"
|
||||
|
||||
if [ ! "$password" == "" ]
|
||||
then
|
||||
chpasswd <<< "${app}:${password}"
|
||||
fi
|
||||
elif [ "${changed[with_sftp]}" == "true" ] && [ $with_sftp -eq 0 ]
|
||||
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"
|
||||
|
||||
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
|
||||
|
|
182
scripts/install
182
scripts/install
|
@ -9,78 +9,47 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# RETRIEVE ARGUMENTS FROM THE MANIFEST
|
||||
#=================================================
|
||||
|
||||
domain=$YNH_APP_ARG_DOMAIN
|
||||
path_url=$YNH_APP_ARG_PATH
|
||||
with_sftp=$YNH_APP_ARG_WITH_SFTP
|
||||
password=$YNH_APP_ARG_PASSWORD
|
||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||
phpversion=$YNH_APP_ARG_PHPVERSION
|
||||
|
||||
with_mysql=$YNH_APP_ARG_WITH_MYSQL
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
app_nb=$YNH_APP_INSTANCE_NUMBER
|
||||
ssh_port=$(grep "^Port" /etc/ssh/sshd_config | awk '{print $2}')
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating installation parameters..." --weight=2
|
||||
|
||||
final_path=/var/www/$app
|
||||
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
|
||||
|
||||
# Register (book) web path
|
||||
ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
|
||||
[ $with_sftp -eq 0 ] || [ "$password" != "" ] || ynh_die --message="You need to set a password to enable SFTP"
|
||||
|
||||
#=================================================
|
||||
# STORE SETTINGS FROM MANIFEST
|
||||
#=================================================
|
||||
ynh_script_progression --message="Storing installation settings..."
|
||||
ynh_script_progression --message="Storing installation settings..." --weight=1
|
||||
|
||||
ynh_app_setting_set --app=$app --key=domain --value=$domain
|
||||
ynh_app_setting_set --app=$app --key=path --value=$path_url
|
||||
ynh_app_setting_set --app=$app --key=with_mysql --value=$with_mysql
|
||||
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
|
||||
|
||||
ynh_app_setting_set --app=$app --key=admin_mail_html --value=1
|
||||
|
||||
#=================================================
|
||||
# STANDARD MODIFICATIONS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=2
|
||||
|
||||
ynh_install_app_dependencies "php${phpversion}-fpm"
|
||||
fi
|
||||
ynh_app_setting_set --app=$app --key=password --value=$password
|
||||
|
||||
#=================================================
|
||||
# CREATE A MYSQL DATABASE
|
||||
#=================================================
|
||||
|
||||
if [ $with_mysql -eq 1 ]
|
||||
then
|
||||
ynh_script_progression --message="Creating a MySQL database..." --weight=2
|
||||
if [ $database != "none" ]; then
|
||||
ynh_script_progression --message="Creating a database..." --weight=2
|
||||
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
db_user=$db_name
|
||||
db_pwd=$(ynh_string_random --length=30)
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name
|
||||
ynh_app_setting_set --app=$app --key=db_user --value=$db_user
|
||||
ynh_app_setting_set --app=$app --key=db_pwd --value=$db_pwd
|
||||
|
||||
if [ $database == "mysql" ]; then
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
elif [ $database == "postgresql" ]; then
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -88,16 +57,26 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Configuring NGINX web server..." --weight=2
|
||||
|
||||
# Prepare nginx.conf
|
||||
nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d"
|
||||
mkdir -p "$nginx_extra_conf_dir"
|
||||
|
||||
# Prepare nginx extra conf
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
cp ../conf/nginx{_with_php,}.conf
|
||||
else
|
||||
cp ../conf/nginx{_no_php,}.conf
|
||||
ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -111,13 +90,12 @@ else
|
|||
groups=""
|
||||
fi
|
||||
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path" --groups="$groups"
|
||||
ynh_system_user_create --username=$app --home_dir="$install_dir" --groups="$groups"
|
||||
|
||||
if [ $with_sftp -eq 1 ]
|
||||
then
|
||||
# Add the password to this user
|
||||
chpasswd <<< "${app}:${password}"
|
||||
ynh_app_setting_set --app=$app --key=password --value="$password"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -126,107 +104,43 @@ fi
|
|||
# MODIFY A CONFIG FILE
|
||||
#=================================================
|
||||
|
||||
mkdir -p "$final_path/www"
|
||||
mkdir -p "$install_dir/www"
|
||||
|
||||
if [ $with_sftp -eq 1 ]
|
||||
then
|
||||
|
||||
ynh_add_config --template="../sources/www/index.html" --destination="$final_path/www/index.html"
|
||||
|
||||
ynh_add_config --template="../sources/www/index.html" --destination="$install_dir/www/index.html"
|
||||
else
|
||||
# Copy files to the right place
|
||||
cp "../sources/www/index_no_sftp.html" "$final_path/www/index.html"
|
||||
ynh_add_config --template="../sources/www/index_no_sftp.html" --destination="$install_dir/www/index.html"
|
||||
fi
|
||||
|
||||
if [ $with_mysql -eq 1 ]; then
|
||||
# Store the database access
|
||||
echo -e "# MySQL Database
|
||||
name: ${db_name}\nuser: ${db_name}\npass: ${db_pwd}" > ../sources/db_access.txt
|
||||
|
||||
# Copy files to the right place
|
||||
cp -r "../sources/db_access.txt" "$final_path/db_access.txt"
|
||||
fi
|
||||
|
||||
chown -R $app:www-data "$final_path"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
# Home directory of the user needs to be owned by root to allow
|
||||
# SFTP connections
|
||||
chown root:root "$final_path"
|
||||
setfacl -m g:$app:r-x "$final_path"
|
||||
setfacl -m g:www-data:r-x "$final_path"
|
||||
chmod o-rwx "$final_path"
|
||||
chown root:root "$install_dir"
|
||||
setfacl -m g:$app:r-x "$install_dir"
|
||||
setfacl -m g:www-data:r-x "$install_dir"
|
||||
chmod 750 "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# PHP-FPM CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
fpm_footprint="low"
|
||||
fpm_free_footprint=0
|
||||
fpm_usage="low"
|
||||
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
|
||||
|
||||
# Create a dedicatedPHP-FPM config
|
||||
ynh_add_fpm_config --usage=low --footprint=low --phpversion=$phpversion
|
||||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SETUP SSOWAT
|
||||
#=================================================
|
||||
ynh_script_progression --message="Configuring permissions..."
|
||||
|
||||
# Make app public if necessary
|
||||
if [ $is_public -eq 1 ]
|
||||
then
|
||||
ynh_permission_update --permission="main" --add="visitors"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
||||
# Get main domain and buid the url of the admin panel of the app.
|
||||
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
|
||||
|
||||
if [ $with_mysql -eq 1 ]
|
||||
then
|
||||
sql_infos="
|
||||
You've asked for a database, please find here the information about this SQL database.
|
||||
$(cat "$final_path/db_access.txt")
|
||||
"
|
||||
else
|
||||
sql_infos=""
|
||||
fi
|
||||
|
||||
if [ $with_sftp -eq 1 ]
|
||||
then
|
||||
sftp_infos="You can connect to this repository by using SFTP with the following credentials.
|
||||
Domain: $domain
|
||||
Port: $(grep "^Port" /etc/ssh/sshd_config | awk '{print $2}')
|
||||
User: $app
|
||||
Password: The one you set at installation."
|
||||
else
|
||||
sftp_infos=""
|
||||
fi
|
||||
|
||||
echo "This app is simply a blank web app container. You have to put your own app inside.
|
||||
$sql_infos
|
||||
Please put your files into this directory: $final_path/www/
|
||||
$sftp_infos
|
||||
|
||||
You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
|
||||
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
|
||||
|
||||
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/my_webapp_ynh__URL_TAG3__." > mail_to_send
|
||||
|
||||
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients=root --type=install
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -9,42 +9,26 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
|
||||
#=================================================
|
||||
# STANDARD REMOVE
|
||||
#=================================================
|
||||
# REMOVE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
||||
if [ $with_mysql -eq 1 ]; then
|
||||
ynh_script_progression --message="Removing the MySQL database..." --weight=2
|
||||
if [ $database != "none" ]; then
|
||||
ynh_script_progression --message="Removing the database..." --weight=2
|
||||
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
|
||||
# Remove a database if it exists, along with the associated user
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
if [ $database == "mysql" ]; then
|
||||
ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
elif [ $database == "postgresql" ]; then
|
||||
ynh_psql_remove_db --db_user=$db_user --db_name=$db_name
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# REMOVE APP MAIN DIR
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing app main directory..."
|
||||
|
||||
# Remove the app directory securely
|
||||
ynh_secure_remove --file="$final_path"
|
||||
|
||||
#=================================================
|
||||
# REMOVE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
@ -52,6 +36,7 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
|
|||
|
||||
# Remove the dedicated NGINX config
|
||||
ynh_remove_nginx_config
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d"
|
||||
|
||||
#=================================================
|
||||
# REMOVE PHP-FPM CONFIGURATION
|
||||
|
@ -61,20 +46,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..."
|
|||
# Remove the dedicated PHP-FPM config
|
||||
ynh_remove_fpm_config
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC REMOVE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# REMOVE DEDICATED USER
|
||||
#=================================================
|
||||
ynh_script_progression --message="Removing the dedicated system user..."
|
||||
|
||||
# Delete a system user
|
||||
ynh_system_user_delete --username=$app
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -9,66 +9,31 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# MANAGE SCRIPT FAILURE
|
||||
#=================================================
|
||||
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading settings..." --weight=2
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
#=================================================
|
||||
ynh_script_progression --message="Validating restoration parameters..." --weight=2
|
||||
|
||||
test ! -d $final_path \
|
||||
|| ynh_die --message="There is already a directory: $final_path "
|
||||
|
||||
#=================================================
|
||||
# STANDARD RESTORATION STEPS
|
||||
#=================================================
|
||||
# REINSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
ynh_script_progression --message="Reinstalling dependencies..." --weight=2
|
||||
|
||||
ynh_install_app_dependencies "php${phpversion}-fpm"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE MYSQL DATABASE
|
||||
#=================================================
|
||||
|
||||
if [ $with_mysql -eq 1 ]; then
|
||||
ynh_script_progression --message="Restoring the MySQL database..."
|
||||
if [ $database != "none" ]; then
|
||||
ynh_script_progression --message="Restoring the database..."
|
||||
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd)
|
||||
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
db_user=$db_name
|
||||
db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd)
|
||||
|
||||
if [ $database == "mysql" ]; then
|
||||
ynh_mysql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
elif [ $database == "postgresql" ]; then
|
||||
ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd
|
||||
ynh_psql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql
|
||||
fi
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
|
@ -83,7 +48,7 @@ else
|
|||
groups=""
|
||||
fi
|
||||
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path" --groups="$groups"
|
||||
ynh_system_user_create --username=$app --home_dir="$install_dir" --groups="$groups"
|
||||
|
||||
if [ -n "$password" ]
|
||||
then
|
||||
|
@ -96,16 +61,16 @@ fi
|
|||
#=================================================
|
||||
ynh_script_progression --message="Restoring the app main directory..."
|
||||
|
||||
ynh_restore_file --origin_path="$final_path"
|
||||
ynh_restore_file --origin_path="$install_dir"
|
||||
|
||||
# Restore permissions on app files
|
||||
chown -R $app:www-data "$final_path"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
# Home directory of the user needs to be owned by root to allow
|
||||
# SFTP connections
|
||||
chown root:root "$final_path"
|
||||
setfacl -m g:$app:r-x "$final_path"
|
||||
setfacl -m g:www-data:r-x "$final_path"
|
||||
chmod o-rwx "$final_path"
|
||||
chown root:root "$install_dir"
|
||||
setfacl -m g:$app:r-x "$install_dir"
|
||||
setfacl -m g:www-data:r-x "$install_dir"
|
||||
chmod 750 "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# RESTORE THE PHP-FPM CONFIGURATION
|
||||
|
@ -116,10 +81,6 @@ then
|
|||
ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC RESTORATION
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
|
@ -134,20 +95,6 @@ fi
|
|||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
||||
# Get main domain and buid the url of the admin panel of the app.
|
||||
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
|
||||
|
||||
echo "You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
|
||||
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
|
||||
|
||||
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/my_webapp_ynh__URL_TAG3__." > mail_to_send
|
||||
|
||||
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients=root --type=restore
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
174
scripts/upgrade
174
scripts/upgrade
|
@ -9,94 +9,71 @@
|
|||
source _common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
#=================================================
|
||||
# LOAD SETTINGS
|
||||
#=================================================
|
||||
ynh_script_progression --message="Loading installation settings..." --weight=2
|
||||
|
||||
app=$YNH_APP_INSTANCE_NAME
|
||||
|
||||
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
||||
path_url=$(ynh_app_setting_get --app=$app --key=path)
|
||||
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
||||
db_name=$(ynh_app_setting_get --app=$app --key=db_name)
|
||||
with_mysql=$(ynh_app_setting_get --app=$app --key=with_mysql)
|
||||
with_sftp=$(ynh_app_setting_get --app=$app --key=with_sftp)
|
||||
password=$(ynh_app_setting_get --app=$app --key=password)
|
||||
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
|
||||
|
||||
admin_mail_html=$(ynh_app_setting_get --app=$app --key=admin_mail_html)
|
||||
|
||||
fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint)
|
||||
fpm_usage=$(ynh_app_setting_get --app=$app --key=fpm_usage)
|
||||
|
||||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ENSURE DOWNWARD COMPATIBILITY
|
||||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
|
||||
# If db_name doesn't exist, create it
|
||||
if [ -z "$db_name" ]; then
|
||||
db_name=$(ynh_sanitize_dbid --db_name=$app)
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
# If database doesn't exist, create it and remove with_mysql setting
|
||||
if [ -z "${database:-}" ]; then
|
||||
if [ $with_mysql -eq 1 ]; then
|
||||
database="mysql"
|
||||
else
|
||||
database="none"
|
||||
fi
|
||||
|
||||
# If final_path doesn't exist, create it
|
||||
if [ -z "$final_path" ]; then
|
||||
final_path=/var/www/$app
|
||||
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
|
||||
ynh_app_setting_set --app=$app --key=database --value=$database
|
||||
ynh_app_setting_delete --app=$app --key=with_mysql
|
||||
fi
|
||||
|
||||
# If admin_mail_html doesn't exist, create it
|
||||
if [ -z "$admin_mail_html" ]; then
|
||||
if [ -z "${admin_mail_html:-}" ]; then
|
||||
admin_mail_html=1
|
||||
ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
|
||||
ynh_app_setting_set --app=$app --key=admin_mail_html --value=$admin_mail_html
|
||||
fi
|
||||
|
||||
# If fpm_footprint doesn't exist, create it
|
||||
if [ -z "$fpm_footprint" ]; then
|
||||
if [ -z "${fpm_footprint:-}" ]; then
|
||||
fpm_footprint=low
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||
fi
|
||||
|
||||
# If fpm_free_footprint doesn't exist, create it
|
||||
if [ -z "${fpm_free_footprint:-}" ]; then
|
||||
fpm_free_footprint=0
|
||||
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
fi
|
||||
|
||||
# If fpm_usage doesn't exist, create it
|
||||
if [ -z "$fpm_usage" ]; then
|
||||
if [ -z "${fpm_usage:-}" ]; then
|
||||
fpm_usage=low
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
fi
|
||||
|
||||
# If with_sftp doesn't exist, create it
|
||||
if [ -z "$with_sftp" ]; then
|
||||
if [ -z "${with_sftp:-}" ]; then
|
||||
with_sftp=1
|
||||
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
|
||||
fi
|
||||
|
||||
# If phpversion doesn't exist, create it
|
||||
# If phpversion doesn't exist, create it. We assume it is the default system one.
|
||||
if [ -z "$phpversion" ]; then
|
||||
phpversion=$YNH_PHP_VERSION
|
||||
phpversion=$YNH_DEFAULT_PHP_VERSION
|
||||
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
|
||||
|
@ -105,49 +82,41 @@ then
|
|||
ynh_app_setting_delete --app=$app --key=user
|
||||
fi
|
||||
|
||||
# Cleaning legacy permissions
|
||||
if ynh_legacy_permissions_exists; then
|
||||
ynh_legacy_permissions_delete_all
|
||||
|
||||
ynh_app_setting_delete --app=$app --key=is_public
|
||||
fi
|
||||
# Ensure password is a setting even if empty, for the config panel
|
||||
ynh_app_setting_set --app=$app --key=password --value="$password"
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Activating maintenance mode..."
|
||||
|
||||
ynh_maintenance_mode_ON
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
# INSTALL DEPENDENCIES
|
||||
#=================================================
|
||||
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
ynh_script_progression --message="Installing dependencies..." --weight=2
|
||||
|
||||
ynh_install_app_dependencies "php${phpversion}-fpm"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# NGINX CONFIGURATION
|
||||
#=================================================
|
||||
|
||||
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
|
||||
|
||||
# Prepare nginx.conf
|
||||
nginx_extra_conf_dir="/etc/nginx/conf.d/$domain.d/$app.d"
|
||||
|
||||
mkdir -p "$nginx_extra_conf_dir"
|
||||
|
||||
# Prepare nginx extra conf
|
||||
if [ $phpversion != "none" ]
|
||||
then
|
||||
cp ../conf/nginx{_with_php,}.conf
|
||||
else
|
||||
cp ../conf/nginx{_no_php,}.conf
|
||||
ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
|
||||
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"
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
|
@ -161,7 +130,7 @@ else
|
|||
groups=""
|
||||
fi
|
||||
|
||||
ynh_system_user_create --username=$app --home_dir="$final_path" --groups="$groups"
|
||||
ynh_system_user_create --username=$app --home_dir="$install_dir" --groups="$groups"
|
||||
|
||||
if [ -n "$password" ]
|
||||
then
|
||||
|
@ -185,69 +154,26 @@ then
|
|||
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# SPECIFIC UPGRADE
|
||||
#=================================================
|
||||
|
||||
#=================================================
|
||||
# GENERIC FINALIZATION
|
||||
#=================================================
|
||||
# SECURE FILES AND DIRECTORIES
|
||||
#=================================================
|
||||
|
||||
chown -R $app:www-data "$final_path"
|
||||
chown -R $app:www-data "$install_dir"
|
||||
# Home directory of the user needs to be owned by root to allow
|
||||
# SFTP connections
|
||||
chown root:root "$final_path"
|
||||
setfacl -m g:$app:r-x "$final_path"
|
||||
setfacl -m g:www-data:r-x "$final_path"
|
||||
chmod o-rwx "$final_path"
|
||||
|
||||
#=================================================
|
||||
# RELOAD NGINX
|
||||
#=================================================
|
||||
ynh_script_progression --message="Reloading NGINX web server..."
|
||||
|
||||
ynh_systemd_action --service_name=nginx --action=reload
|
||||
chown root:root "$install_dir"
|
||||
setfacl -m g:$app:r-x "$install_dir"
|
||||
setfacl -m g:www-data:r-x "$install_dir"
|
||||
chmod 750 "$install_dir"
|
||||
|
||||
#=================================================
|
||||
# DEACTIVE MAINTENANCE MODE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Disabling maintenance mode..."
|
||||
|
||||
ynh_maintenance_mode_OFF
|
||||
|
||||
#=================================================
|
||||
# SEND A README FOR THE ADMIN
|
||||
#=================================================
|
||||
|
||||
# Get main domain and buid the url of the admin panel of the app.
|
||||
admin_panel="https://$(grep portal_domain /etc/ssowat/conf.json | cut -d'"' -f4)/yunohost/admin/#/apps/$app"
|
||||
|
||||
# Build the changelog
|
||||
# Get the value of admin_mail_html
|
||||
admin_mail_html=$(ynh_app_setting_get $app admin_mail_html)
|
||||
admin_mail_html="${admin_mail_html:-0}"
|
||||
# If a html email is required. Apply html to the changelog.
|
||||
if [ "$admin_mail_html" -eq 1 ]; then
|
||||
format=html
|
||||
else
|
||||
format=plain
|
||||
fi
|
||||
ynh_app_changelog --format=$format
|
||||
|
||||
echo "You can configure this app easily by using the experimental __URL_TAG1__config-panel feature__URL_TAG2__$admin_panel/config-panel__URL_TAG3__.
|
||||
You can also find some specific actions for this app by using the experimental __URL_TAG1__action feature__URL_TAG2__$admin_panel/actions__URL_TAG3__.
|
||||
|
||||
If you're facing an issue or want to improve this app, please open a new issue in this __URL_TAG1__project__URL_TAG2__https://github.com/YunoHost-Apps/my_webapp_ynh__URL_TAG3__.
|
||||
|
||||
---
|
||||
|
||||
Changelog since your last upgrade:
|
||||
$(cat changelog)" > mail_to_send
|
||||
|
||||
ynh_send_readme_to_admin --app_message="mail_to_send" --recipients=root --type=upgrade
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Custom Web App</title>
|
||||
<title>My Webapp</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>It works!</h1>
|
||||
<p>Congratulation, you have just installed your custom web app.</p>
|
||||
<p>Congratulation, you have just installed My Webapp.</p>
|
||||
|
||||
<h2>Edit this site</h2>
|
||||
<p>
|
||||
|
@ -20,9 +20,9 @@
|
|||
<dt>Domain</dt>
|
||||
<dd>__DOMAIN__</dd>
|
||||
<dt>Port</dt>
|
||||
<dd>22 (or the port you defined <a href="https://yunohost.org/security">if you changed the SSH port</a>)</dd>
|
||||
<dd>__SSH_PORT__</dd>
|
||||
<dt>User</dt>
|
||||
<dd>__APP__</dd>
|
||||
<dd>__ID__</dd>
|
||||
<dt>Password</dt>
|
||||
<dd><i>the one you set at installation</i></dd>
|
||||
</dl>
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Custom Web App</title>
|
||||
<title>My Webapp</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>It works!</h1>
|
||||
<p>Congratulation, you have just installed your custom web app.</p>
|
||||
<p>Congratulation, you have just installed My Webapp.</p>
|
||||
|
||||
<h2>Edit this site</h2>
|
||||
<p>
|
||||
|
|
61
tests.toml
Normal file
61
tests.toml
Normal file
|
@ -0,0 +1,61 @@
|
|||
test_format = 1.0
|
||||
|
||||
[default]
|
||||
|
||||
# -------------------------------
|
||||
# Default args to use for install
|
||||
# -------------------------------
|
||||
|
||||
args.with_sftp = "1"
|
||||
args.custom_error_file = "0"
|
||||
args.password = "SuperDuper_StrongPassw0rd"
|
||||
args.database = "none"
|
||||
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"
|
||||
test_upgrade_from.bf5d3ed.args.path = "/"
|
||||
test_upgrade_from.bf5d3ed.args.password = "SuperDuper_StrongPassw0rd"
|
||||
|
||||
[80_test]
|
||||
|
||||
only = ["install.subdir", "backup_restore", "upgrade" ]
|
||||
args.phpversion = "8.0"
|
||||
|
||||
[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]
|
||||
|
||||
only = ["install.subdir", "backup_restore", "upgrade", "upgrade.bf5d3ed" ]
|
||||
args.database = "mysql"
|
||||
test_upgrade_from.bf5d3ed.name = "1.0~ynh14"
|
||||
test_upgrade_from.bf5d3ed.args.with_mysql = "1"
|
||||
test_upgrade_from.bf5d3ed.args.domain = "sub.domain.tld"
|
||||
test_upgrade_from.bf5d3ed.args.path = "/"
|
||||
test_upgrade_from.bf5d3ed.args.password = "SuperDuper_StrongPassw0rd"
|
||||
|
||||
[postgresql_test]
|
||||
|
||||
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"
|
Loading…
Add table
Reference in a new issue