Compare commits

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

331 commits

Author SHA1 Message Date
Alexandre Aubin
9a1cf68d98
Merge pull request #141 from YunoHost-Apps/testing
Testing
2024-08-07 15:17:05 +02:00
yunohost-bot
f1545592a8 Auto-update READMEs 2024-08-07 13:16:58 +00:00
Alexandre Aubin
e59b8f1417
Update manifest.toml: bump version 2024-08-07 15:16:54 +02:00
Alexandre Aubin
d291edbc72
wtf... 2024-08-07 15:15:51 +02:00
Kayou
6566e1ce4f
Merge pull request #140 from YunoHost-Apps/testing
Testing
2024-07-29 16:35:04 +02:00
yunohost-bot
991cab74e4 Auto-update READMEs 2024-07-29 14:32:02 +00:00
Kayou
db825702a0
bump package 2024-07-29 16:31:58 +02:00
Kayou
477d98f4a6
do not remove old fpm config if phpversion was none 2024-07-29 16:31:40 +02:00
yunohost-bot
ea932c9763 Auto-update READMEs 2024-07-29 08:07:53 +00:00
Kayou
a41c46b182
Merge pull request #129 from YunoHost-Apps/testing
Testing
2024-07-29 10:07:46 +02:00
Kayou
89fbb93c76
fix restore script 2024-07-24 11:59:06 +02:00
Kayou
19f09d8569
Note to self - open your eyes BEFORE writing code 2024-07-24 10:14:09 +02:00
Kayou
db7dcbdd1b
fix change_url² 2024-07-23 17:43:36 +02:00
Kayou
eca97b65aa
fix change url 2024-07-23 16:36:00 +02:00
Kayou
7226257ce8
add all tests for custom_error_file_test 2024-07-23 14:04:28 +02:00
Kayou
df628b6cd1
add a test for custom_error_file 2024-07-23 14:01:30 +02:00
Kayou
f92817b922
add custom_error_file in the manifest, default to false 2024-07-23 13:57:51 +02:00
Kayou
55c0bbb594
fix indent 2024-07-23 13:52:14 +02:00
Kayou
cb465e8573
reenable ynh_delete_file_checksum of the nginx error conf file, let's wait the CI 2024-07-23 13:48:14 +02:00
Kayou
72ae3827de
Reinstall all the dependencies when changing php version² (remove php-fpm deps if phpversion is none) 2024-07-23 13:43:07 +02:00
yunohost-bot
f7e3c828ec Auto-update READMEs 2024-07-23 11:36:02 +00:00
Kayou
7d29233133
Merge pull request #138 from grenagit/master
Fix password change
2024-07-23 13:35:57 +02:00
yunohost-bot
81ecb8ba90 Auto-update READMEs 2024-07-03 16:09:59 +00:00
tituspijean
cefdd63e38
Typo 2024-07-03 18:09:55 +02:00
yunohost-bot
da1fc5e54b Auto-update READMEs 2024-06-24 10:13:24 +00:00
eric_G
c886821dcd
Merge branch 'master' into testing 2024-06-24 12:13:21 +02:00
Félix Piédallu
e4ff31c6c8 Update READMEs 2024-06-23 13:33:55 +02:00
Grena
0f47d1c6cb Add french translation of SFTP access into config panel 2024-06-05 10:46:55 +02:00
Grena
cab30de685 Fix password change 2024-06-05 10:30:49 +02:00
Alexandre Aubin
e16a41b7dd
Update change_url: zgrmblpfhonmgf 2024-05-09 16:34:08 +02:00
Alexandre Aubin
17aa532b66
Update backup: remove unecessary code for custom error page, the .d folder is already backuped/restored 2024-05-09 16:32:26 +02:00
yunohost-bot
0540f194c8 Auto-update READMEs 2024-05-09 08:59:44 +00:00
eric_G
fb03afacc7
Merge branch 'master' into testing 2024-05-09 10:59:40 +02:00
eric_G
baaa89c14a
Merge pull request #137 from YunoHost-Apps/php8.3
Php8.3 + better default version
2024-05-09 10:57:57 +02:00
lapineige
e51913303c
Update config_panel.toml : add php8.3 2024-05-07 16:58:16 +02:00
tituspijean
8213b4d9a3
Add more PHP tests 2024-05-07 16:54:53 +02:00
tituspijean
23535f094f
Bump default PHP version to 8.3
Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com>
2024-05-07 16:53:49 +02:00
yunohost-bot
22f48f479f Auto-update READMEs 2024-05-07 14:20:38 +00:00
lapineige
0ab0c6b302
bump version 2024-05-07 16:20:07 +02:00
lapineige
36738b45a1
add php8.3 + default to php8.1 2024-05-07 16:18:30 +02:00
yunohost-bot
1bb337ce18 Auto-update READMEs 2024-05-07 14:17:57 +00:00
yunohost-bot
0b62011418 Auto-update README 2024-03-29 07:14:29 +01:00
Alexandre Aubin
7d592faabe
Merge pull request #130 from fflorent/patch-1
Remove dependencies and reinstall them when changing php version
2024-01-22 17:36:48 +01:00
Alexandre Aubin
25ec30c166
Merge branch 'master' into testing 2023-11-10 01:06:08 +01:00
yunohost-bot
9defce59be Auto-update README 2023-10-31 14:24:24 +00:00
Florent
4801ff47a8 Reinstall all the dependencies when changing php version #131 2023-10-15 11:52:50 +02:00
Florent
365d2c7641 explicitly call ynh_remove_app_dependencies when changing phpversion 2023-10-15 11:52:50 +02:00
yunohost-bot
37d888f16a Auto-update README 2023-10-08 08:55:36 +00:00
Éric Gaspar
e4f955e2dc Update manifest.toml 2023-10-08 10:55:29 +02:00
eric_G
e51caa96f1
Merge pull request #128 from YunoHost-Apps/php-priority
Prioritize index.php over index.html
2023-10-08 10:54:23 +02:00
tituspijean
8087993534
Prioritize index.php over index.html 2023-10-08 10:49:57 +02:00
yunohost-bot
9b8d318fb6 Auto-update README 2023-10-08 08:47:38 +00:00
tituspijean
d91b1bc502
Merge pull request #119 from stilobique/master
Setup 404 error code
2023-10-08 10:47:32 +02:00
tituspijean
55190b8272
Improve error pages documentation 2023-10-08 10:40:01 +02:00
Aurelien Vaillant
060e15e365
Update config_panel.toml
Tweak the help message

Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com>
2023-09-27 23:27:41 +02:00
yunohost-bot
00b181c417 Auto-update README 2023-09-26 08:10:13 +00:00
Éric Gaspar
6ea232f503 Add PostgreSQL database 2023-09-26 10:10:08 +02:00
tituspijean
1a1784d669
Merge pull request #122 from YunoHost-Apps/testing
Testing | Improving databases: password fix and type selection
2023-09-15 16:13:13 +02:00
tituspijean
2e7f35d11b
Fix tests.toml, again? 2023-09-14 16:40:33 +02:00
Alexandre Aubin
a0a8d326d0
Merge pull request #124 from YunoHost-Apps/jinja-doc
Conditional block for POST_INSTALL.md
2023-08-31 23:29:54 +02:00
Alexandre Aubin
2e5a452b53
Merge branch 'testing' into jinja-doc 2023-08-31 20:46:50 +02:00
Alexandre Aubin
18c71da044
Bump yunohost requirement 2023-08-31 17:50:48 +02:00
Éric Gaspar
f65d02d7d0 Update manifest.toml 2023-08-27 22:12:59 +02:00
Aurelien Vaillant
66249120de Revert the default value, set to false 2023-08-21 15:50:54 +02:00
Aurelien Vaillant
c1c68f9463 Fix warning info with the change url script 2023-08-21 15:38:14 +02:00
Aurelien Vaillant
44f371dae6 WIP: Update the custom config file 2023-08-21 15:20:52 +02:00
Aurelien Vaillant
b6a23c7bc5 Wrong filename 2023-08-21 15:12:24 +02:00
Aurelien Vaillant
66626c71c7 Wrong backup path 2023-08-21 15:04:42 +02:00
Aurelien Vaillant
2c0b155c94 Change conditional expression 2023-08-21 15:02:29 +02:00
Aurelien Vaillant
9dbb8b1821 Fix warning message about the backup 2023-08-21 14:59:50 +02:00
Aurelien Vaillant
ee658ef966 Comment change url config 2023-08-21 13:32:40 +02:00
Aurelien Vaillant
c4c9581eab Generate backup about the custom error setup 2023-08-21 13:31:36 +02:00
Aurelien Vaillant
ad2673106c Update change_url script to update location path nginx error 2023-08-21 13:27:43 +02:00
Aurelien Vaillant
ac625f32d3 Change description info to be more accurate 2023-08-21 12:31:26 +02:00
Aurelien Vaillant
467aef4618 Update location path, fix about the sub-dir setting ; and change url 2023-08-18 16:32:42 +02:00
Aurelien Vaillant
c4cc60d93f Update location path, fix about the sub-dir setting 2023-08-18 14:29:42 +02:00
Aurelien Vaillant
0f008b68d2 Fix setting set about custom error code value 2023-08-18 11:23:39 +02:00
Aurelien Vaillant
7d919559a1 Variable type set 2023-08-18 11:19:17 +02:00
Aurelien Vaillant
1eb8d54769 init the custom error config 2023-08-18 11:10:25 +02:00
Aurelien Vaillant
791d7880e9 Fix the install script 2023-08-18 11:06:48 +02:00
Aurelien Vaillant
7b0b29cdcc Update install and upgrade script.
Clear old debug info.
2023-08-18 10:46:04 +02:00
Aurelien Vaillant
9d885a896a Set to true the default error code status used 2023-08-18 10:35:16 +02:00
Aurelien Vaillant
d7271b65af Update the nginx to be reload and not restart 2023-08-18 10:19:31 +02:00
Aurelien Vaillant
bcdf80162f Add information in the admin fr/en text 2023-08-18 10:12:23 +02:00
Aurelien Vaillant
db2876a58a Remove unused setup 2023-08-18 10:01:56 +02:00
Aurelien Vaillant
b578765b41 Fix location path error config 2023-08-18 09:55:41 +02:00
Aurelien Vaillant
c409b9d0e1 Clear debug message, and add a restart about Nginx service 2023-08-18 09:40:42 +02:00
Aurelien Vaillant
04338ac091 Restart Nginx with the config update 2023-08-18 09:19:41 +02:00
Aurelien Vaillant
10f3e8eabb Merge remote-tracking branch 'origin/master'
# Conflicts:
#	conf/nginx-code-error.conf
2023-08-17 19:37:27 +02:00
Aurelien Vaillant
08a58729a2 Change - once again - the nginx error build 2023-08-17 19:36:41 +02:00
Aurelien Vaillant
adf7f2ba83 Change - once again - the nginx error build 2023-08-17 19:33:37 +02:00
Aurelien Vaillant
a561b9c449 Try another way with the status code return 2023-08-17 19:10:47 +02:00
Aurelien Vaillant
5f1dfbd192 Wrong path construction with the nginx error code 2023-08-17 18:22:53 +02:00
Aurelien Vaillant
ea8278b48b Add the 403 error code build 2023-08-17 18:19:59 +02:00
Aurelien Vaillant
18041281e3 Update config with int comparaison 2023-08-17 18:13:41 +02:00
Aurelien Vaillant
8d4188382b Add debug info with the config file 2023-08-17 18:08:11 +02:00
Aurelien Vaillant
8c3b1e2161 Update config with the conditional state in the custom error file section 2023-08-17 18:04:47 +02:00
Aurelien Vaillant
9e6f1621b4 Clear the config panel file 2023-08-17 18:02:02 +02:00
Aurelien Vaillant
1b4c09bc1d Update the On/Off error code parameter
Revert nginx config
2023-08-17 17:56:51 +02:00
Aurelien Vaillant
42a5b89393 Test config script 2023-08-17 17:22:57 +02:00
Aurelien Vaillant
d51c90ffb9 Remove unused setting set 2023-08-17 17:18:55 +02:00
Aurelien Vaillant
e7b199e573 Remove old post-install info 2023-08-17 17:18:33 +02:00
Aurelien Vaillant
d025544131 On/Off nginx file 2023-08-17 17:01:36 +02:00
Aurelien Vaillant
632567c13f Change path declaration 2023-08-17 16:33:34 +02:00
Aurelien Vaillant
efc260135c Variable not declared 2023-08-17 16:30:25 +02:00
Aurelien Vaillant
beb6c7e399 Update nginx config
Fix config function
2023-08-17 16:20:51 +02:00
Aurelien Vaillant
1e5d23df24 Update the update script 2023-08-17 15:57:28 +02:00
Aurelien Vaillant
92c8673646 Tweak the description en/fr 2023-08-17 15:49:08 +02:00
tituspijean
8d39c98681
Fix tests.toml, again 2023-08-17 15:29:40 +02:00
Aurelien Vaillant
ab80419566 Write a short description info about the 404 errors setup 2023-08-17 15:01:51 +02:00
tituspijean
05b98eafba
Fix tests.toml 2023-08-17 12:41:11 +02:00
Aurelien Vaillant
f06a4f5ba9 Try another conditional test 2023-08-17 11:33:48 +02:00
Aurelien Vaillant
7b02f2817e Another test about the init variable 2023-08-17 11:25:18 +02:00
Aurelien Vaillant
8339439135 Fix bad variable allocation 2023-08-17 11:05:13 +02:00
tituspijean
fd0fe51048
Add password in tests 2023-08-16 22:48:31 +02:00
tituspijean
0ba29961e5
Fix jinja template
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-08-16 19:33:52 +02:00
Aurelien Vaillant
3396894985 Update config file 2023-08-16 19:29:01 +02:00
tituspijean
b6f86b2f4e
Jinja template for the POST_INSTALL doc 2023-08-16 19:28:52 +02:00
Aurelien Vaillant
c0688fc115 Add more debug info 2023-08-16 18:56:49 +02:00
Aurelien Vaillant
613e58e149 Change a set value 2023-08-16 18:49:45 +02:00
Aurelien Vaillant
9384644c80 Update upgrade script to fix the unbound variable error 2023-08-16 18:40:21 +02:00
Aurelien Vaillant
8fe710187a Update install/upgrade 2023-08-16 18:36:04 +02:00
tituspijean
5a6756a8c4
Enhance FR login documentation 2023-08-16 18:18:30 +02:00
Aurelien Vaillant
74526f2e53 Remove duplicate nginx config
Clear manifest data, option only available with the config panel
Try to setup the config panel
Set the version number
2023-08-16 18:16:57 +02:00
tituspijean
7a2eba44db
Enhance login documentation 2023-08-16 18:06:32 +02:00
tituspijean
ce93180771
Fix phpversion question type 2023-08-16 17:52:17 +02:00
tituspijean
4ebc7e27d5
Merge pull request #118 from YunoHost-Apps/enh-postgresql
Implement postgresql database choice
2023-08-16 17:40:40 +02:00
tituspijean
e3599fe60c
Improve POST_INSTALL documentation for databases 2023-08-16 17:37:36 +02:00
tituspijean
cf1e857017
Merge branch 'testing' into enh-postgresql 2023-08-16 17:15:42 +02:00
tituspijean
9e25b1d0a0
Merge pull request #121 from YunoHost-Apps/fix-db
Fix db_pwd
2023-08-16 17:13:48 +02:00
yunohost-bot
043c417a45 Auto-update README 2023-08-16 14:25:34 +00:00
tituspijean
347546ab04
Bump package version and display bugfix 2023-08-16 16:25:08 +02:00
tituspijean
494db3a91e
Actually use the generated db_pwd 2023-08-16 16:17:10 +02:00
--help
adb9f09d60 Change the upgrade config
Update the post-install documentation
2023-08-15 15:09:55 +02:00
--help
b863da7cff Update upgrade to set the code error 2023-08-13 10:47:43 +02:00
--help
8b30a536cb Try to setup the error code upgrade 2023-08-13 09:39:48 +02:00
--help
140562326e Try to config the 404.html file
Remove error page 50X
2023-08-13 09:08:31 +02:00
--help
718c0dbdd8 Fix path error_page 2023-08-12 17:58:39 +02:00
--help
4255b0a4bc Add code error 50X 2023-08-12 16:52:25 +02:00
--help
7083a50ec8 Update app version 2023-08-12 13:29:35 +02:00
--help
6095c6c21f Update default config about the http error 2023-08-12 13:21:59 +02:00
--help
7029f6eb85 Add error 404 code 2023-08-12 11:30:01 +02:00
Tagada
1d83be3e56
Update manifest.toml 2023-06-10 22:38:37 +02:00
Tagada
b5f4e50ff9 fix database: unbound variable 2023-05-28 22:16:28 +02:00
Tagada
810c3facfa i really can't type /o\ 2023-05-28 21:01:51 +02:00
Tagada
8657238c52 oops³ 2023-05-28 20:04:50 +02:00
Tagada
8cff6952cb opps² 2023-05-28 19:29:25 +02:00
Tagada
0f78b7f4b1 oops 2023-05-28 19:02:02 +02:00
Tagada
80f55d4feb Implement postgresql database choice 2023-05-28 18:43:16 +02:00
Éric Gaspar
bf5d3ed5d5
Merge pull request #116 from YunoHost-Apps/testing
Testing
2023-05-28 18:04:34 +02:00
yunohost-bot
03cc1fbd95 Auto-update README 2023-05-28 15:55:13 +00:00
Éric Gaspar
128e2eb732 Update manifest.toml 2023-05-28 17:55:07 +02:00
Éric Gaspar
a6a32531fa
Update doc/POST_INSTALL_fr.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:11:57 +02:00
Éric Gaspar
3065ca3c87
Update doc/POST_INSTALL_fr.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:11:46 +02:00
Éric Gaspar
2e4cc18d59
Update doc/POST_INSTALL.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:11:37 +02:00
yunohost-bot
2ddaa0c107 Auto-update README 2023-05-27 07:11:19 +00:00
Éric Gaspar
66d9816339
Update doc/DESCRIPTION_fr.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:11:16 +02:00
yunohost-bot
08bb8d278d Auto-update README 2023-05-27 07:10:53 +00:00
Éric Gaspar
fffa0b0e20
Update doc/DESCRIPTION.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:10:49 +02:00
Éric Gaspar
3c9c867e3a
Update doc/ADMIN_fr.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:10:36 +02:00
Éric Gaspar
69b8a22d19
Update doc/ADMIN_fr.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:10:23 +02:00
Éric Gaspar
e7c022d5f5
Update doc/ADMIN.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:10:08 +02:00
Éric Gaspar
9b0dddb821
Update doc/ADMIN.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:09:45 +02:00
Éric Gaspar
906013809d
Update doc/POST_INSTALL.md
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-27 09:09:19 +02:00
Éric Gaspar
c1f58d8805
Merge pull request #115 from YunoHost-Apps/version-2-#101
Version 2 #101
2023-05-08 14:49:19 +02:00
Éric Gaspar
f03e68f14c cleaning 2023-05-05 22:27:07 +02:00
Éric Gaspar
a2f3b95c19 remove SSH port 2023-05-05 21:35:57 +02:00
Éric Gaspar
6904852de5 Update install 2023-05-05 21:33:04 +02:00
Éric Gaspar
97a8e04339 Update manifest.toml 2023-05-05 15:46:29 +02:00
Éric Gaspar
9f7b30459b remove actions folder 2023-05-05 15:45:45 +02:00
Éric Gaspar
9e3097c524 fix 2023-05-05 15:44:39 +02:00
Éric Gaspar
b29eb643b2
Update scripts/upgrade
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
2023-05-05 15:44:22 +02:00
Éric Gaspar
109bc1aed8 Merge branch 'v2' into version-2-#101 2023-04-13 15:18:05 +02:00
Éric Gaspar
7de1bb0c3a remove visible password 2023-04-13 15:17:47 +02:00
Éric Gaspar
e280d90298 Update tests.toml 2023-04-13 11:59:53 +02:00
Éric Gaspar
d3b74fb36f Update tests.toml 2023-04-13 11:59:42 +02:00
Éric Gaspar
3055c9a149 Update ADMIN.md 2023-04-13 11:51:32 +02:00
Éric Gaspar
eace720c61 Update ADMIN_fr.md 2023-04-13 11:51:01 +02:00
Éric Gaspar
8a907c0c27 Merge branch 'version-2-#101' of https://github.com/YunoHost-Apps/my_webapp_ynh into version-2-#101 2023-04-13 11:50:35 +02:00
Éric Gaspar
427c8522dc add info on how to use SFTP #113 2023-04-13 11:50:30 +02:00
yunohost-bot
e634b772c3 Auto-update README 2023-04-13 09:11:36 +00:00
Éric Gaspar
47533880be #110 2023-04-13 11:11:30 +02:00
Éric Gaspar
0244a4408e Update manifest.toml 2023-04-13 10:50:51 +02:00
Éric Gaspar
32a9ff3771 cleaning 2023-04-13 09:48:58 +02:00
Éric Gaspar
c7103688a2 cleaning 2023-04-13 09:47:31 +02:00
Éric Gaspar
cc7808c378 cleaning 2023-04-13 09:42:10 +02:00
Éric Gaspar
f301a8b213 Create POST_INSTALL_fr.md 2023-04-13 09:31:36 +02:00
Éric Gaspar
aeb9ac274a cleaning 2023-04-13 09:24:51 +02:00
Éric Gaspar
ff5946f35a cleaning 2023-04-12 22:39:56 +02:00
Éric Gaspar
fc5dac0ef9 Update change_url 2023-04-12 22:38:43 +02:00
tituspijean
402abc21d5
Apply suggestions from code review 2023-04-12 21:22:38 +02:00
Éric Gaspar
67c99b38e7 cleaning 2023-04-12 21:06:33 +02:00
Éric Gaspar
6314f2bc26 fix 2023-04-12 20:59:50 +02:00
Éric Gaspar
e3ede5ca29 Update install 2023-04-12 20:56:12 +02:00
Éric Gaspar
c66196538c fix 2023-04-12 20:54:49 +02:00
Éric Gaspar
e2df6be87c cleaning 2023-04-12 20:42:46 +02:00
Éric Gaspar
5b38abe368 add DB info 2023-04-12 20:41:16 +02:00
Éric Gaspar
2ec2d5cfab remove send email 2023-04-12 20:02:39 +02:00
Éric Gaspar
857d049c7a Update install 2023-04-12 19:55:50 +02:00
Alexandre Aubin
aa54f690b4
manifest: make sure we have a non-empty list for apt deps 2023-04-05 16:20:36 +02:00
Éric Gaspar
2e525c68d4 Update manifest.toml 2023-04-05 12:37:35 +02:00
Éric Gaspar
94761c15d2 Update install 2023-03-28 21:59:12 +02:00
Éric Gaspar
60bc8fab64 Update tests.toml 2023-03-28 21:58:36 +02:00
yunohost-bot
6b39fca687 Auto-update README 2023-03-28 17:24:41 +00:00
Éric Gaspar
f78dfe4da8 Merge branch 'v2' of https://github.com/YunoHost-Apps/my_webapp_ynh into v2 2023-03-28 19:24:33 +02:00
Éric Gaspar
c545623331 Update DESCRIPTION_fr.md 2023-03-28 19:24:28 +02:00
yunohost-bot
b136cc2b3d Auto-update README 2023-03-28 17:23:45 +00:00
Éric Gaspar
8eec20a4ed Update DESCRIPTION.md 2023-03-28 19:23:38 +02:00
Éric Gaspar
65eb631903 Update config_panel.toml 2023-03-28 18:44:15 +02:00
Éric Gaspar
d4fa580701 Update manifest.toml 2023-03-28 18:41:04 +02:00
Éric Gaspar
0305cc08dc Update tests.toml 2023-03-28 18:39:26 +02:00
Éric Gaspar
bafc403789 Update manifest.toml 2023-03-28 18:38:47 +02:00
Éric Gaspar
28e96e88e2 Merge branch 'v2' of https://github.com/YunoHost-Apps/my_webapp_ynh into v2 2023-03-28 18:21:01 +02:00
Éric Gaspar
fb5e9c5436 Update manifest.toml 2023-03-28 18:20:55 +02:00
yunohost-bot
ba620f9fd1 Auto-update README 2023-03-28 16:09:42 +00:00
Éric Gaspar
1c3d35bf2b Merge branch 'testing' into v2 2023-03-28 18:09:35 +02:00
Éric Gaspar
58809e2b1e Update manifest.toml 2023-03-28 18:08:39 +02:00
Éric Gaspar
dafc95ba31 Cleaning 2023-03-03 09:41:27 +01:00
yunohost-bot
59e321b398 Auto-update README 2023-02-18 14:46:10 +00:00
Éric Gaspar
fb34d33319 Add ADMIN readme 2023-02-18 15:46:05 +01:00
yunohost-bot
5a0072e44c Auto-update README 2023-02-16 15:37:12 +00:00
Alexandre Aubin
d6604d0212
Forgot to bump version in last testing 2023-02-16 16:37:08 +01:00
Éric Gaspar
936f96e9d2
Merge pull request #106 from YunoHost-Apps/testing
Testing
2023-02-10 12:01:37 +01:00
Éric Gaspar
4aa09f073d Update tests.toml 2023-02-05 12:43:12 +01:00
Éric Gaspar
ca06ee4f07 Fix 2023-02-05 12:40:52 +01:00
Éric Gaspar
f91ad3ecbe Fix 2023-02-05 12:35:09 +01:00
Éric Gaspar
fac6118cce Fix 2023-02-05 12:29:41 +01:00
Éric Gaspar
d3695fe281 Update install 2023-02-05 12:28:17 +01:00
Éric Gaspar
a53a10d256 Update install 2023-02-05 12:17:35 +01:00
ericgaspar
52e14f82a7 Update tests.toml 2023-02-05 11:13:44 +01:00
ericgaspar
369bb90604 Update install 2023-02-05 08:09:24 +01:00
ericgaspar
caf5f74760 Update install 2023-02-05 08:08:58 +01:00
Éric Gaspar
8aba067dc2 Update install 2023-02-04 23:30:49 +01:00
Éric Gaspar
1b7d0b6ac0 Update upgrade 2023-02-04 23:16:56 +01:00
Éric Gaspar
b6e37aedae Update install 2023-02-04 23:16:22 +01:00
Éric Gaspar
6ec349098d Update tests.toml 2023-02-04 23:13:06 +01:00
Éric Gaspar
91a8d2aecf Merge branch 'v2' of https://github.com/YunoHost-Apps/my_webapp_ynh into v2 2023-02-04 21:53:25 +01:00
Éric Gaspar
26142cd20f Update tests.toml 2023-02-04 21:53:19 +01:00
yunohost-bot
82564c7929 Auto-update README 2023-02-04 20:30:40 +00:00
Éric Gaspar
99a41f5392 Remove files 2023-02-04 21:30:30 +01:00
Éric Gaspar
1c77b1a6f8 Update tests.toml 2023-02-04 21:28:07 +01:00
Éric Gaspar
ff58e1d00c Fix 2023-02-04 21:20:44 +01:00
Éric Gaspar
54d609c124 v2 2023-02-04 21:08:46 +01:00
Éric Gaspar
c2a3f0ec5b
Merge pull request #102 from YunoHost-Apps/extra_php-fpm
Extra php fpm
2023-01-28 18:01:28 +01:00
yunohost-bot
a1364bcf38 Auto-update README 2023-01-28 17:00:48 +00:00
Éric Gaspar
378a246772
Merge pull request #103 from YunoHost-Apps/new-PHP-version
New php version 8.1 and 8.2
2023-01-28 18:00:37 +01:00
Éric Gaspar
9ec2a51f39 Update install 2023-01-25 15:41:36 +01:00
Éric Gaspar
82a2315fc4 Update manifest.json 2023-01-25 15:35:49 +01:00
Éric Gaspar
5eebfc09e1 Update manifest.json 2023-01-25 15:35:35 +01:00
Éric Gaspar
eeca7a299e Update manifest.json 2023-01-25 15:35:13 +01:00
Éric Gaspar
c8f499b16c Update manifest.json 2023-01-25 13:54:28 +01:00
Éric Gaspar
1126d88ca6 Update manifest.json 2023-01-25 13:54:10 +01:00
Éric Gaspar
4877f8013c Update manifest.json 2023-01-25 13:53:16 +01:00
Éric Gaspar
563d0dadaa
Merge pull request #104 from YunoHost-Apps/fix-config-panel-install
Define PHP settings used by config panel to prevent the config panel from miserably crashing
2023-01-25 13:48:11 +01:00
Éric Gaspar
0627d061b7 Merge branch 'testing' into fix-config-panel-install 2023-01-25 13:03:52 +01:00
Éric Gaspar
f17d402b48 Merge branch 'testing' into extra_php-fpm 2023-01-25 13:03:05 +01:00
yunohost-bot
8e6bab756d Auto-update README 2023-01-25 12:03:02 +00:00
Éric Gaspar
31834487af Merge branch 'new-PHP-version' of https://github.com/YunoHost-Apps/my_webapp_ynh into new-PHP-version 2023-01-25 13:02:54 +01:00
Éric Gaspar
6bb034a440 add versions supported 2023-01-25 13:02:49 +01:00
yunohost-bot
b304babad5 Auto-update README 2023-01-25 12:01:22 +00:00
Éric Gaspar
64e5fae404 Merge branch 'testing' into new-PHP-version 2023-01-25 13:01:16 +01:00
yunohost-bot
b46bfc3c56 Auto-update README 2023-01-25 12:01:09 +00:00
Éric Gaspar
5e31710e26 Merge branch 'testing' of https://github.com/YunoHost-Apps/my_webapp_ynh into testing 2023-01-25 13:01:04 +01:00
Éric Gaspar
2b36952f22 Add translation 2023-01-25 13:00:59 +01:00
yunohost-bot
6b84c9daec Auto-update README 2023-01-25 11:59:20 +00:00
Éric Gaspar
43fa71c331 Merge branch 'master' into testing 2023-01-25 12:59:15 +01:00
yunohost-bot
f997d537a0 Auto-update README 2023-01-21 22:30:31 +00:00
Alexandre Aubin
70ed6bd954 Add upstream section to the manifest + doc folder to be able to autogenerate README 2023-01-21 23:22:59 +01:00
Alexandre Aubin
700c765839
Define PHP settings used by config panel to prevent the config panel from miserably crashing 2023-01-21 22:50:20 +01:00
Éric Gaspar
dca89aa5dc Merge branch 'testing' into extra_php-fpm 2023-01-20 20:01:19 +01:00
Éric Gaspar
49cab9e4b3 Merge branch 'testing' into new-PHP-version 2023-01-20 20:01:07 +01:00
Éric Gaspar
849d85b1c7 Fix linter 2023-01-20 20:00:27 +01:00
Éric Gaspar
45c0c4fa55 add max body size 2023-01-15 17:28:28 +01:00
Éric Gaspar
76805f12cc Add PHP8.1 and 8.2 2023-01-15 15:22:43 +01:00
Éric Gaspar
a912632f1d Merge branch 'testing' into extra_php-fpm 2023-01-15 15:18:59 +01:00
Éric Gaspar
c2efdcec6c Update extra_php-fpm.conf 2023-01-15 15:18:28 +01:00
Éric Gaspar
fb7ddb9296 set extra_php-fpm 2023-01-15 15:17:07 +01:00
Éric Gaspar
33b63ca97a
Merge pull request #98 from YunoHost-Apps/fix-php-config
Fix PHP config settings installation
2023-01-15 15:16:16 +01:00
Alexandre Aubin
ad2184d999
Bump version 2022-12-23 23:39:59 +01:00
Alexandre Aubin
fd1d6eaa20
Delete actions.toml 2022-12-23 23:39:36 +01:00
Alexandre Aubin
194c3b0d49
Update config 2022-12-23 23:37:22 +01:00
tituspijean
8fde9136ba
Fix PHP config settings installation 2022-11-30 13:33:51 +01:00
Éric Gaspar
802fc72a17
Merge pull request #94 from YunoHost-Apps/testing
Implement config panels v1.0
2022-09-23 19:32:14 +02:00
ericgaspar
addca0c163 Bump version 2022-09-23 19:31:40 +02:00
tituspijean
a43f92ac0d
Merge pull request #82 from Tagadda/fix-configpanel 2022-09-22 20:34:15 +02:00
Éric Gaspar
ec83a54c90
Merge pull request #91 from YunoHost-Apps/testing
Testing
2022-08-28 19:30:41 +02:00
Éric Gaspar
0681043382
Update manifest.json 2022-08-28 17:18:03 +02:00
Éric Gaspar
4fe44887fd
Update manifest.json 2022-08-28 17:17:09 +02:00
Éric Gaspar
ce21df3420
Merge branch 'master' into testing 2022-08-28 17:16:40 +02:00
Éric Gaspar
cec2f294a4
Merge pull request #90 from YunoHost-Apps/Add-php-mysql
Add php-mysql if the database is installed
2022-08-28 17:15:31 +02:00
Éric Gaspar
9dcf5d6758
Update restore 2022-08-28 14:18:40 +02:00
Éric Gaspar
4f25715b8c
Update upgrade 2022-08-28 14:14:24 +02:00
Éric Gaspar
5de029a40f
Update restore 2022-08-28 13:32:45 +02:00
Éric Gaspar
1a14e0bcdb
Update restore 2022-08-28 13:32:07 +02:00
Éric Gaspar
22f9c65f01
Add php-mysql if the database is installed 2022-08-28 13:26:45 +02:00
tituspijean
233829c50c
Make FPM usage and footprint visible only if PHP is enabled 2022-08-07 17:57:06 +02:00
tituspijean
38e6e12553
Implement FPM usage and footprint in config panel 2022-08-07 17:34:22 +02:00
tituspijean
ee6a4cf5f8
[fix] handling phpversion in config panel
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
Co-authored-by: ljf (zamentur) <zamentur@users.noreply.github.com>
2022-08-07 16:55:40 +02:00
Éric Gaspar
bf6dd496c4
Merge pull request #88 from YunoHost-Apps/testing
testing
2022-05-19 19:00:32 +02:00
ericgaspar
6e6ce7609c
Update manifest.json 2022-05-19 16:43:08 +02:00
Éric Gaspar
1f8959e555
Merge pull request #87 from YunoHost-Apps/app-name
Set app name logically
2022-05-19 16:16:29 +02:00
ericgaspar
1d8afa6ad6
Update config_panel.toml 2022-05-19 11:15:38 +02:00
ericgaspar
1dac37bbd2
Update manifest.json 2022-05-18 19:48:23 +02:00
Tagadda
612a87a4a8 comment 2022-02-27 19:31:15 +00:00
tituspijean
48ade2d402
Merge pull request #84 from YunoHost-Apps/testing
Fix directory permissions for SFTP chroot
2022-02-03 22:31:07 +01:00
tituspijean
f21d155bb4
Bump package version 2022-02-03 22:23:08 +01:00
tituspijean
149dc8e3bf
Merge pull request #83 from YunoHost-Apps/perms
Force chmod 750 to ensure SFTP chroot
2022-02-03 22:19:38 +01:00
tituspijean
e015e3310e
Force chmod 750 to ensure SFTP chroot 2022-02-03 22:14:15 +01:00
Tagadda
a7f4f0badf fix 2022-02-01 23:41:35 +00:00
Tagadda
325d0ac03a config: missing type 2022-02-01 18:36:24 +00:00
Tagadda
2231f5bb4f config: password should be defined even if empty 2022-02-01 18:36:10 +00:00
Tagadda
36c982d835 fix match 2022-02-01 16:51:40 +00:00
Tagadda
8c2943a6b0 oopsies /o\ 2022-01-31 15:50:16 +00:00
Tagadda
93532de252 oops 2022-01-31 15:33:59 +00:00
Tagadda
17534e2819 configpanel phpversion 2022-01-31 15:24:14 +00:00
Tagadda
071d38bfb1 configpanel update password test 2022-01-31 13:25:33 +00:00
Tagadda
9c22d79bcb oopsy 2022-01-31 13:25:11 +00:00
Tagadda
3c2b4bc2a7 configpanel update with_sftp 2022-01-31 12:58:18 +00:00
Tagadda
0617fcaab7 configpanel update for php 2022-01-31 12:27:39 +00:00
tituspijean
cc5b5ace5d
Merge pull request #80 from YunoHost-Apps/testing
Testing
2022-01-17 15:49:43 +01:00
Kay0u
f1fb0c9c08
Bump 2022-01-17 15:43:51 +01:00
Kay0u
61b3fd2e09
emergency patch the backup script when there is no php version 2022-01-17 15:43:38 +01:00
Alexandre Aubin
5b963e27fd
Remove unecessary stuff in README.md 2022-01-17 00:11:18 +01:00
Alexandre Aubin
bb45d2171f
Remove unecessary stuff in README.md 2022-01-17 00:10:19 +01:00
tituspijean
9d87ffd7e0
Merge pull request #78 from YunoHost-Apps/testing
Bump package version
2022-01-16 22:40:22 +01:00
tituspijean
6d1f661cf3
Bump package version 2022-01-15 21:28:56 +01:00
tituspijean
bbaf6427fd
Merge pull request #77 from YunoHost-Apps/testing
Testing
2022-01-15 18:18:42 +01:00
ericgaspar
14f2a9ac0f
Remove force usage of https 2022-01-13 11:41:27 +01:00
Alexandre Aubin
3c29978907
Merge pull request #67 from YunoHost-Apps/testing
Testing
2021-06-06 19:06:04 +02:00
Alexandre Aubin
a56a7ba378
Merge pull request #64 from YunoHost-Apps/testing
Testing: Use sftp.app group from 4.2 to manage sftp access, + fix permissions
2021-05-10 17:43:12 +02:00
yalh76
6f69960604
Merge pull request #62 from YunoHost-Apps/testing
Update maintainer
2021-04-28 20:11:59 +02:00
43 changed files with 1075 additions and 1858 deletions

9
ALL_README.md Normal file
View 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)

View file

@ -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)

View file

@ -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.
-->
[![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) # My Webapp for YunoHost
[![Install Custom Webapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=my_webapp)
*[Lire ce readme en français.](./README_fr.md)* [![Integration level](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Working status](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
> *This package allow you to install Custom Webapp quickly and simply on a YunoHost server. [![Install My Webapp with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
If you don't have YunoHost, please see [here](https://yunohost.org/install) to know how to install and enjoy it.*
*[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 ## Overview
This application allows you to easily install a custom Web application, This application allows you to easily install a custom Web application, providing files access with [SFTP](https://yunohost.org/en/filezilla).
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.
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 PHP-FPM version can also be selected among `none`, `7.4`, `8.0`, `8.1` and `8.2`.
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.
**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 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) To try the `testing` branch, please proceed like that:
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/my_webapp.svg)](https://ci-apps-arm.yunohost.org/ci/apps/my_webapp/)
## Limitations ```bash
## 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.
```
sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
or or
sudo yunohost app upgrade my_webapp -u 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
``` ```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

49
README_es.md Normal file
View file

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

49
README_eu.md Normal file
View 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
[![Integrazio maila](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Instalatu My Webapp YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[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>

View file

@ -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.
-->
[![Niveau d'intégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg) # My Webapp pour YunoHost
[![Installer Custom Webapp avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[Read this readme in english.](./README.md)* [![Niveau dintégration](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
> *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. [![Installer My Webapp avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/install) pour savoir comment l'installer et en profiter.*
## 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, > *Ce package vous permet dinstaller My Webapp rapidement et simplement sur un serveur YunoHost.*
fourni un accès aux fichiers avec [SFTP](https://yunohost.org/fr/filezilla). Elle peut également créer une base de données MySQL - > *Si vous navez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment linstaller et en profiter.*
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 7.3, 7.4, et 8.0. ## Vue densemble
**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 - Dépôt de code officiel de lapp: <https://github.com/YunoHost-Apps/my_webapp_ynh>
- YunoHost Store: <https://apps.yunohost.org/app/my_webapp>
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) - Signaler un bug: <https://github.com/YunoHost-Apps/my_webapp_ynh/issues>
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/my_webapp.svg)](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/
---
## Informations pour les développeurs ## 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 sudo yunohost app install https://github.com/YunoHost-Apps/my_webapp_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade my_webapp -u 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
``` ```
**Plus dinfos sur le packaging dapplications:** <https://yunohost.org/packaging_apps>

49
README_gl.md Normal file
View 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
[![Nivel de integración](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Instalar My Webapp con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[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
View file

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

47
README_it.md Normal file
View 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
[![Livello di integrazione](https://dash.yunohost.org/integration/my_webapp.svg)](https://dash.yunohost.org/appci/app/my_webapp) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![Installa My Webapp con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](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 dellapp: <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 questapp:** <https://yunohost.org/packaging_apps>

49
README_zh_Hans.md Normal file
View file

@ -0,0 +1,49 @@
<!--
注意:此 README 由 <https://github.com/YunoHost/apps/tree/master/tools/readme_generator> 自动生成
请勿手动编辑。
-->
# YunoHost 上的 My Webapp
[![集成程度](https://dash.yunohost.org/integration/my_webapp.svg)](https://ci-apps.yunohost.org/ci/apps/my_webapp/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/my_webapp.maintain.svg)
[![使用 YunoHost 安装 My Webapp](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=my_webapp)
*[阅读此 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>

View file

@ -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."

View file

@ -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

View 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
View 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

View file

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

10
conf/nginx-php.conf Normal file
View 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;
}

View file

@ -2,22 +2,18 @@
location __PATH__/ { location __PATH__/ {
# Path to source # Path to source
alias __FINALPATH__/www/; alias __INSTALL_DIR__/www/;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
# Default indexes and catch-all # Default indexes and catch-all
index index.html index.php; index index.php index.html;
try_files $uri $uri/ __PATH__/index.php?$args; try_files $uri $uri/ __PATH__/index.php?$args =404;
# Prevent useless logs # Prevent useless logs
location = __PATH__/favicon.ico { location = __PATH__/favicon.ico {
log_not_found off; log_not_found off;
access_log off; access_log off;
} }
location = __PATH__/robots.txt { location = __PATH__/robots.txt {
allow all; allow all;
log_not_found off; log_not_found off;
@ -29,6 +25,8 @@ location __PATH__/ {
deny all; deny all;
} }
include conf.d/__DOMAIN__.d/__APP__.d/*.conf;
# Include SSOWAT user panel. # Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc; include conf.d/yunohost_panel.conf.inc;
} }

View file

@ -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;
}

View file

@ -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

View file

@ -1,40 +1,74 @@
version = "0.1" version = "1.0"
name = "My webapp configuration panel"
[main] [main]
name = "My webapp configuration" name = "My Webapp configuration"
[main.sftp] [main.sftp]
name = "SFTP access" name.en = "SFTP access"
name.fr = "Accès SFTP"
[main.sftp.sftp] [main.sftp.with_sftp]
ask = "Do you need a SFTP access?" ask.en = "Do you need a SFTP access?"
ask.fr = "Avez-vous besoin d'un accès SFTP ?"
type = "boolean" type = "boolean"
default = true default = true
[main.sftp.password] [main.sftp.password]
ask = "Set a password for the SFTP access" ask.en = "Set a password for the SFTP access"
ask.fr = "Définir un mot de passe pour laccès SFTP"
type = "password" type = "password"
optional = true 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] [main.php_fpm_config]
name = "PHP-FPM configuration" name = "PHP-FPM configuration"
[main.php_fpm_config.footprint] [main.php_fpm_config.phpversion]
ask = "Memory footprint of the service?" ask = "PHP version"
choices = ["low", "medium", "high", "specific"] type = "select"
default = "low" choices = ["none", "7.4", "8.0", "8.1", "8.2", "8.3"]
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." 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?" ask = "Memory footprint of the service?"
type = "number" type = "number"
default = "0" 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." 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?" ask = "Expected usage of the service?"
type = "select"
choices = ["low", "medium", "high"] choices = ["low", "medium", "high"]
default = "low" 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." 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
View 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
View 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
View 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
View 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
View 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
View 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.

View 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.

View file

@ -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
View 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
"""

View file

@ -8,151 +8,10 @@
# EXPERIMENTAL HELPERS # 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 " " "\&#160;\&#160;" mail_to_send
ynh_replace_string "\t" "\&#160;\&#160;" 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 () { ynh_maintenance_mode_ON () {
# Load value of $path_url and $domain from the config if their not set # Load value of $path and $domain from the config if their not set
if [ -z $path_url ]; then if [ -z $path ]; then
path_url=$(ynh_app_setting_get $app path) path=$(ynh_app_setting_get $app path)
fi fi
if [ -z $domain ]; then if [ -z $domain ]; then
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
@ -182,10 +41,10 @@ ynh_maintenance_mode_ON () {
</html>" > "/var/www/html/maintenance.$app.html" </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. # 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 echo "# All request to the app will be redirected to ${path}_maintenance and fall on the maintenance notice
rewrite ^${path_url}/(.*)$ ${path_url}_maintenance/? redirect; rewrite ^${path}/(.*)$ ${path}_maintenance/? redirect;
# Use another location, to not be in conflict with the original config file # Use another location, to not be in conflict with the original config file
location ${path_url}_maintenance/ { location ${path}_maintenance/ {
alias /var/www/html/ ; alias /var/www/html/ ;
try_files maintenance.$app.html =503; 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. # 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: # 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. # 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. # 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. # 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 () { ynh_maintenance_mode_OFF () {
# Load value of $path_url and $domain from the config if their not set # Load value of $path and $domain from the config if their not set
if [ -z $path_url ]; then if [ -z $path ]; then
path_url=$(ynh_app_setting_get $app path) path=$(ynh_app_setting_get $app path)
fi fi
if [ -z $domain ]; then if [ -z $domain ]; then
domain=$(ynh_app_setting_get $app domain) domain=$(ynh_app_setting_get $app domain)
fi fi
# Rewrite the nginx config file to redirect from ${path_url}_maintenance to the real url of the app. # Rewrite the nginx config file to redirect from ${path}_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" echo "rewrite ^${path}_maintenance/(.*)$ ${path}/\$1 redirect;" > "/etc/nginx/conf.d/$domain.d/maintenance.$app.conf"
systemctl reload nginx systemctl reload nginx
# Sleep 4 seconds to let the browser reload the pages and redirect the user to the app. # 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 systemctl reload nginx
} }
#=================================================
# Create a changelog for an app after an upgrade from the file CHANGELOG.md. ynh_system_user_add_group() {
#
# 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 () {
# Declare an array to define the options of this helper. # Declare an array to define the options of this helper.
local legacy_args=foc local legacy_args=uhs
declare -Ar args_array=( [f]=format= [o]=output= [c]=changelog= ) local -A args_array=([u]=username= [g]=groups=)
local format local username
local output local groups
local changelog
# Manage arguments with getopts # Manage arguments with getopts
ynh_handle_getopts_args "$@" ynh_handle_getopts_args "$@"
format=${format:-markdown} groups="${groups:-}"
output=${output:-changelog}
changelog=${changelog:-../CHANGELOG.md}
local original_changelog="$changelog" local group
local temp_changelog="changelog_temp" for group in $groups; do
local final_changelog="$output" usermod -a -G "$group" "$username"
done
if [ ! -n "$original_changelog" ] }
then
echo "No changelog available..." > "$final_changelog"
echo "No changelog available..." > "${final_changelog}_lite" ynh_system_user_del_group() {
return 0 # Declare an array to define the options of this helper.
fi local legacy_args=uhs
local -A args_array=([u]=username= [g]=groups=)
local current_version=$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version") local username
local update_version=$(ynh_read_manifest --manifest="../manifest.json" --manifest_key="version") local groups
# Get the line of the version to update to into the changelog # Manage arguments with getopts
local update_version_line=$(grep --max-count=1 --line-number "^## \[$update_version" "$original_changelog" | cut -d':' -f1) ynh_handle_getopts_args "$@"
# If there's no entry for this version yet into the changelog groups="${groups:-}"
# Get the first available version
if [ -z "$update_version_line" ] local group
then for group in $groups; do
update_version_line=$(grep --max-count=1 --line-number "^##" "$original_changelog" | cut -d':' -f1) gpasswd -d "$username" "$group"
fi done
# 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
} }

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -9,27 +9,6 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # 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 # BACKUP THE APP MAIN DIR
#================================================= #=================================================
ynh_backup --src_path="$final_path" ynh_backup --src_path="$install_dir"
#================================================= #=================================================
# BACKUP THE NGINX CONFIGURATION # 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.conf"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.d"
#================================================= #=================================================
# BACKUP THE PHP-FPM CONFIGURATION # 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 # BACKUP THE MYSQL DATABASE
#================================================= #=================================================
if [ $with_mysql -eq 1 ] if [ $database != "none" ]
then then
ynh_print_info --message="Backing up the MySQL database..." ynh_print_info --message="Backing up the database..."
ynh_mysql_dump_db --database="$db_name" > db.sql
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 fi
#================================================= #=================================================

View file

@ -9,69 +9,29 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=5 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 # Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. # 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.conf"
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.d"
# restore it if the upgrade fails # restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#================================================= #=================================================
# ACTIVATE MAINTENANCE MODE # ACTIVATE MAINTENANCE MODE
#================================================= #=================================================
ynh_script_progression --message="Activating maintenance mode..."
path_url=$old_path path_url=$old_path
domain=$old_domain domain=$old_domain
ynh_maintenance_mode_ON 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 # STANDARD MODIFICATIONS
#================================================= #=================================================
@ -80,14 +40,7 @@ fi
ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2 ynh_script_progression --message="Updating NGINX web server configuration..." --weight=2
nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf
nginx_extra_conf_dir=/etc/nginx/conf.d/$old_domain.d/$app.d
# Prepare nginx.conf
if [ $phpversion != "none" ]
then
cp ../conf/nginx{_with_php,}.conf
else
cp ../conf/nginx{_no_php,}.conf
fi
# Change the path in the NGINX config file # Change the path in the NGINX config file
if [ $change_path -eq 1 ] if [ $change_path -eq 1 ]
@ -99,6 +52,12 @@ then
domain="$old_domain" domain="$old_domain"
path_url="$new_path" 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 # Create a dedicated NGINX config
ynh_add_nginx_config ynh_add_nginx_config
fi fi
@ -108,25 +67,32 @@ if [ $change_domain -eq 1 ]
then then
# Delete file checksum for the old conf file location # Delete file checksum for the old conf file location
ynh_delete_file_checksum --file="$nginx_conf_path" 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 # 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 fi
#=================================================
# GENERIC FINALISATION
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# DEACTIVE MAINTENANCE MODE # DEACTIVE MAINTENANCE MODE
#================================================= #=================================================
ynh_script_progression --message="Disabling maintenance mode..."
path_url=$old_path path_url=$old_path
domain=$old_domain domain=$old_domain

View file

@ -9,115 +9,176 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
ynh_abort_if_errors
#================================================= #=================================================
# RETRIEVE ARGUMENTS # 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 # SPECIFIC GETTERS FOR TOML SHORT KEY
#=================================================
# LOAD VALUES
#================================================= #=================================================
# Load the real value from the app config or elsewhere. get__fpm_footprint() {
# Then get the value from the form. # Free footprint value for php-fpm
# If the form has a value for a variable, take the value from the form, # Check if current_fpm_footprint is an integer
# Otherwise, keep the value from the app config. if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
then
echo "specific"
else
echo "$current_fpm_footprint"
fi
}
# with_sftp get__free_footprint() {
old_with_sftp="$(ynh_app_setting_get --app=$app --key=with_sftp)" # Free footprint value for php-fpm
with_sftp="${YNH_CONFIG_MAIN_SFTP_SFTP:-$old_with_sftp}" # Check if current_fpm_footprint is an integer
if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null
# sftp password then
is_password_exist=0 # If current_fpm_footprint is an integer, that's a numeric value for the footprint
password=$(ynh_app_setting_get --app=$app --key=password) echo "$current_fpm_footprint"
if [ -n "$password" ] else
then echo "0"
ynh_print_warn --message="A password already exist, it will not be replaced." fi
# 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"
} }
#================================================= #=================================================
# MODIFY THE CONFIGURATION # SPECIFIC VALIDATORS FOR TOML SHORT KEYS
#================================================= #=================================================
apply_config() { #=================================================
#================================================= # SPECIFIC SETTERS FOR TOML SHORT KEYS
# REMOVE OR ADD SFTP ACCESS #=================================================
#=================================================
if [ "$with_sftp" != "$old_with_sftp" ] set__password() {
if [ ! "$password" == "" ]
then then
yunohost app action run $app sftp --args with_sftp=$with_sftp ynh_app_setting_set --app=$app --key=password --value="$password"
# 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
fi fi
}
#================================================= set__fpm_footprint() {
# RECONFIGURE PHP-FPM if [ "$fpm_footprint" != "specific" ]
#=================================================
if [ "$fpm_usage" != "$old_fpm_usage" ] || [ "$fpm_footprint" != "$old_fpm_footprint" ]
then 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 fi
} }
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# SELECT THE ACTION FOLLOWING THE GIVEN ARGUMENT
#=================================================
case $1 in ynh_app_config_validate() {
show) show_config;; _ynh_app_config_validate
apply) apply_config;;
esac 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

View file

@ -9,78 +9,47 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # 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 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 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 # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS
#================================================= #=================================================
ynh_script_progression --message="Validating installation parameters..." --weight=2 ynh_script_progression --message="Validating installation parameters..." --weight=2
final_path=/var/www/$app [ $with_sftp -eq 0 ] || [ "$password" != "" ] || ynh_die --message="You need to set a password to enable SFTP"
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
#================================================= #=================================================
# STORE SETTINGS FROM MANIFEST # 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=password --value=$password
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
#================================================= #=================================================
# CREATE A MYSQL DATABASE # CREATE A MYSQL DATABASE
#================================================= #=================================================
if [ $with_mysql -eq 1 ] if [ $database != "none" ]; then
then ynh_script_progression --message="Creating a database..." --weight=2
ynh_script_progression --message="Creating a MySQL database..." --weight=2
db_name=$(ynh_sanitize_dbid --db_name=$app) 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_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 fi
#================================================= #=================================================
@ -88,16 +57,26 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Configuring NGINX web server..." --weight=2 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" ] if [ $phpversion != "none" ]
then then
cp ../conf/nginx{_with_php,}.conf ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
else YNH_PHP_VERSION="$phpversion"
cp ../conf/nginx{_no_php,}.conf
fi 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 # Create a dedicated NGINX config
ynh_add_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 # CREATE DEDICATED USER
@ -111,13 +90,12 @@ else
groups="" groups=""
fi 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 ] if [ $with_sftp -eq 1 ]
then then
# Add the password to this user # Add the password to this user
chpasswd <<< "${app}:${password}" chpasswd <<< "${app}:${password}"
ynh_app_setting_set --app=$app --key=password --value="$password"
fi fi
#================================================= #=================================================
@ -126,107 +104,43 @@ fi
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
mkdir -p "$final_path/www" mkdir -p "$install_dir/www"
if [ $with_sftp -eq 1 ] if [ $with_sftp -eq 1 ]
then then
ynh_add_config --template="../sources/www/index.html" --destination="$install_dir/www/index.html"
ynh_add_config --template="../sources/www/index.html" --destination="$final_path/www/index.html"
else else
# Copy files to the right place ynh_add_config --template="../sources/www/index_no_sftp.html" --destination="$install_dir/www/index.html"
cp "../sources/www/index_no_sftp.html" "$final_path/www/index.html"
fi fi
if [ $with_mysql -eq 1 ]; then chown -R $app:www-data "$install_dir"
# 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"
# Home directory of the user needs to be owned by root to allow # Home directory of the user needs to be owned by root to allow
# SFTP connections # SFTP connections
chown root:root "$final_path" chown root:root "$install_dir"
setfacl -m g:$app:r-x "$final_path" setfacl -m g:$app:r-x "$install_dir"
setfacl -m g:www-data:r-x "$final_path" setfacl -m g:www-data:r-x "$install_dir"
chmod o-rwx "$final_path" chmod 750 "$install_dir"
#================================================= #=================================================
# PHP-FPM CONFIGURATION # 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" ] if [ $phpversion != "none" ]
then then
ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 ynh_script_progression --message="Configuring PHP-FPM..." --weight=2
# Create a dedicatedPHP-FPM config # 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 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,42 +9,26 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # STANDARD REMOVE
#================================================= #=================================================
# REMOVE THE MYSQL DATABASE # REMOVE THE MYSQL DATABASE
#================================================= #=================================================
if [ $with_mysql -eq 1 ]; then if [ $database != "none" ]; then
ynh_script_progression --message="Removing the MySQL database..." --weight=2 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 # 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 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 # REMOVE NGINX CONFIGURATION
#================================================= #=================================================
@ -52,6 +36,7 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config # Remove the dedicated NGINX config
ynh_remove_nginx_config ynh_remove_nginx_config
ynh_secure_remove --file="/etc/nginx/conf.d/$domain.d/$app.d"
#================================================= #=================================================
# REMOVE PHP-FPM CONFIGURATION # REMOVE PHP-FPM CONFIGURATION
@ -61,20 +46,6 @@ ynh_script_progression --message="Removing PHP-FPM configuration..."
# Remove the dedicated PHP-FPM config # Remove the dedicated PHP-FPM config
ynh_remove_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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,66 +9,31 @@
source ../settings/scripts/_common.sh source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers 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 # 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.conf"
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.d"
#================================================= #=================================================
# RESTORE THE MYSQL DATABASE # RESTORE THE MYSQL DATABASE
#================================================= #=================================================
if [ $with_mysql -eq 1 ]; then if [ $database != "none" ]; then
ynh_script_progression --message="Restoring the MySQL database..." ynh_script_progression --message="Restoring the database..."
db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) db_name=$(ynh_app_setting_get --app=$app --key=db_name)
ynh_mysql_setup_db --db_user=$db_name --db_name=$db_name --db_pwd=$db_pwd db_user=$db_name
ynh_mysql_connect_as --user=$db_name --password=$db_pwd --database=$db_name < ./db.sql 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 fi
#================================================= #=================================================
@ -83,7 +48,7 @@ else
groups="" groups=""
fi 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" ] if [ -n "$password" ]
then then
@ -96,16 +61,16 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Restoring the app main directory..." 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 # 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 # Home directory of the user needs to be owned by root to allow
# SFTP connections # SFTP connections
chown root:root "$final_path" chown root:root "$install_dir"
setfacl -m g:$app:r-x "$final_path" setfacl -m g:$app:r-x "$install_dir"
setfacl -m g:www-data:r-x "$final_path" setfacl -m g:www-data:r-x "$install_dir"
chmod o-rwx "$final_path" chmod 750 "$install_dir"
#================================================= #=================================================
# RESTORE THE PHP-FPM CONFIGURATION # RESTORE THE PHP-FPM CONFIGURATION
@ -116,10 +81,6 @@ then
ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf"
fi fi
#=================================================
# SPECIFIC RESTORATION
#=================================================
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
@ -134,20 +95,6 @@ fi
ynh_systemd_action --service_name=nginx --action=reload 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -9,94 +9,71 @@
source _common.sh source _common.sh
source /usr/share/yunohost/helpers 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 # CHECK VERSION
#================================================= #=================================================
upgrade_type=$(ynh_check_app_version_changed) 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 # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..."
# If db_name doesn't exist, create it # If database doesn't exist, create it and remove with_mysql setting
if [ -z "$db_name" ]; then if [ -z "${database:-}" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app) if [ $with_mysql -eq 1 ]; then
ynh_app_setting_set --app=$app --key=db_name --value=$db_name database="mysql"
fi else
database="none"
fi
# If final_path doesn't exist, create it ynh_app_setting_set --app=$app --key=database --value=$database
if [ -z "$final_path" ]; then ynh_app_setting_delete --app=$app --key=with_mysql
final_path=/var/www/$app
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# If admin_mail_html doesn't exist, create it # 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 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 fi
# If fpm_footprint doesn't exist, create it # If fpm_footprint doesn't exist, create it
if [ -z "$fpm_footprint" ]; then if [ -z "${fpm_footprint:-}" ]; then
fpm_footprint=low fpm_footprint=low
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
fi 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 fpm_usage doesn't exist, create it
if [ -z "$fpm_usage" ]; then if [ -z "${fpm_usage:-}" ]; then
fpm_usage=low fpm_usage=low
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
fi fi
# If with_sftp doesn't exist, create it # If with_sftp doesn't exist, create it
if [ -z "$with_sftp" ]; then if [ -z "${with_sftp:-}" ]; then
with_sftp=1 with_sftp=1
ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp ynh_app_setting_set --app=$app --key=with_sftp --value=$with_sftp
fi 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 if [ -z "$phpversion" ]; then
phpversion=$YNH_PHP_VERSION phpversion=$YNH_DEFAULT_PHP_VERSION
ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion
fi 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 # Delete old user
if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ] if [ -n "$(ynh_app_setting_get --app=$app --key=user)" ]
then then
@ -105,49 +82,41 @@ then
ynh_app_setting_delete --app=$app --key=user ynh_app_setting_delete --app=$app --key=user
fi fi
# Cleaning legacy permissions # Ensure password is a setting even if empty, for the config panel
if ynh_legacy_permissions_exists; then ynh_app_setting_set --app=$app --key=password --value="$password"
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# ACTIVATE MAINTENANCE MODE # ACTIVATE MAINTENANCE MODE
#================================================= #=================================================
ynh_script_progression --message="Activating maintenance mode..."
ynh_maintenance_mode_ON 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 # NGINX CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2
# Prepare nginx.conf # 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" ] if [ $phpversion != "none" ]
then then
cp ../conf/nginx{_with_php,}.conf ynh_add_config --template="nginx-php.conf" --destination="$nginx_extra_conf_dir/php.conf"
else YNH_PHP_VERSION="$phpversion"
cp ../conf/nginx{_no_php,}.conf 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 fi
# Create a dedicated NGINX config # Create a dedicated NGINX config
ynh_add_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 # CREATE DEDICATED USER
@ -161,7 +130,7 @@ else
groups="" groups=""
fi 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" ] if [ -n "$password" ]
then then
@ -185,69 +154,26 @@ then
ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion
fi fi
#=================================================
# SPECIFIC UPGRADE
#=================================================
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # 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 # Home directory of the user needs to be owned by root to allow
# SFTP connections # SFTP connections
chown root:root "$final_path" chown root:root "$install_dir"
setfacl -m g:$app:r-x "$final_path" setfacl -m g:$app:r-x "$install_dir"
setfacl -m g:www-data:r-x "$final_path" setfacl -m g:www-data:r-x "$install_dir"
chmod o-rwx "$final_path" chmod 750 "$install_dir"
#=================================================
# RELOAD NGINX
#=================================================
ynh_script_progression --message="Reloading NGINX web server..."
ynh_systemd_action --service_name=nginx --action=reload
#================================================= #=================================================
# DEACTIVE MAINTENANCE MODE # DEACTIVE MAINTENANCE MODE
#================================================= #=================================================
ynh_script_progression --message="Disabling maintenance mode..."
ynh_maintenance_mode_OFF 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 # END OF SCRIPT
#================================================= #=================================================

View file

@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Custom Web App</title> <title>My Webapp</title>
</head> </head>
<body> <body>
<h1>It works!</h1> <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> <h2>Edit this site</h2>
<p> <p>
@ -20,9 +20,9 @@
<dt>Domain</dt> <dt>Domain</dt>
<dd>__DOMAIN__</dd> <dd>__DOMAIN__</dd>
<dt>Port</dt> <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> <dt>User</dt>
<dd>__APP__</dd> <dd>__ID__</dd>
<dt>Password</dt> <dt>Password</dt>
<dd><i>the one you set at installation</i></dd> <dd><i>the one you set at installation</i></dd>
</dl> </dl>

View file

@ -1,11 +1,11 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Custom Web App</title> <title>My Webapp</title>
</head> </head>
<body> <body>
<h1>It works!</h1> <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> <h2>Edit this site</h2>
<p> <p>

61
tests.toml Normal file
View 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"