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

add DB info

This commit is contained in:
Éric Gaspar 2023-04-12 20:41:16 +02:00
parent 2ec2d5cfab
commit 5b38abe368
3 changed files with 15 additions and 16 deletions

View file

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

View file

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

View file

@ -20,7 +20,7 @@
<dt>Domain</dt>
<dd>__DOMAIN__</dd>
<dt>Port</dt>
<dd>22 (or the port you defined <a href="https://yunohost.org/security">if you changed the SSH port</a>)</dd>
<dd>__SSH_PORT__</dd>
<dt>User</dt>
<dd>__APP__</dd>
<dt>Password</dt>