From 5b38abe3683e49d983d6d3512cb089689ba40fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 12 Apr 2023 20:41:16 +0200 Subject: [PATCH] add DB info --- doc/POST_INSTALL.md | 4 ++++ scripts/install | 25 ++++++++++--------------- sources/www/index.html | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/doc/POST_INSTALL.md b/doc/POST_INSTALL.md index 9eef602..cf9449f 100644 --- a/doc/POST_INSTALL.md +++ b/doc/POST_INSTALL.md @@ -1,6 +1,10 @@ If you have requested a MYSQL database, please find information about this SQL database here. `__INSTALL_DIR__/db_access.txt` +Database user: __DB_USER__ +Database name: __DB_NAME__ +Password: __DB_PWD__ + You can connect to this repository by using SFTP with the following credentials. Domain: __DOMAIN__ Port: __SSH_PORT__ diff --git a/scripts/install b/scripts/install index 9dc73b6..27ebadb 100644 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,7 @@ source /usr/share/yunohost/helpers password=$YNH_APP_ARG_PASSWORD app_nb=$YNH_APP_INSTANCE_NUMBER phpversion=$YNH_APP_ARG_PHPVERSION +ssh_port=$(grep "^Port" /etc/ssh/sshd_config | awk '{print $2}') #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS @@ -30,6 +31,7 @@ ynh_script_progression --message="Validating installation parameters..." --weigh ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=password --value=$password +ynh_app_setting_set --app=$app --key=ssh_port --value=$ssh_port 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=phpversion --value=$phpversion @@ -104,14 +106,14 @@ else cp "../sources/www/index_no_sftp.html" "$install_dir/www/index.html" fi -if [ $with_mysql -eq 1 ]; then - # Store the database access - echo -e "# MySQL Database -name: ${db_name}\nuser: ${db_name}\npass: ${db_pwd}" > ../sources/db_access.txt - - # Copy files to the right place - cp -r "../sources/db_access.txt" "$install_dir/db_access.txt" -fi +#if [ $with_mysql -eq 1 ]; then +# # Store the database access +# echo -e "# MySQL Database +#name: ${db_name}\nuser: ${db_name}\npass: ${db_pwd}" > ../sources/db_access.txt +# +# # Copy files to the right place +# cp -r "../sources/db_access.txt" "$install_dir/db_access.txt" +#fi chown -R $app:www-data "$install_dir" # Home directory of the user needs to be owned by root to allow @@ -141,13 +143,6 @@ then ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion fi -#================================================= -# SSH PORT -#================================================= - -ssh_port=$(grep "^Port" /etc/ssh/sshd_config | awk '{print $2}') -ynh_app_setting_set --app=$app --key=ssh_port --value=$ssh_port - #================================================= # END OF SCRIPT #================================================= diff --git a/sources/www/index.html b/sources/www/index.html index 1942aed..0c0e79f 100644 --- a/sources/www/index.html +++ b/sources/www/index.html @@ -20,7 +20,7 @@