1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/osjs_ynh.git synced 2024-09-03 19:56:11 +02:00

Merge remote-tracking branch 'origin/testing' into example

This commit is contained in:
yalh76 2022-03-26 01:36:42 +01:00
commit b936710305
3 changed files with 56 additions and 4 deletions

View file

@ -1,4 +1,8 @@
# os.js_ynh
A desktop you have access through a web interface.
## État: WORKING ONLY FOR TEST
## Description
OS.js is a webdesktop written in nodejs. It allows you to have everything in the cloud, that is to say, your documents, your applications... and you can decide to make it private. Everything is stored and you can find them again each time you connect to it.
## État: WORKING
Backup is in experimental state for this app. Same for restore and upgrade. Be careful.

View file

@ -455,14 +455,26 @@ ynh_send_readme_to_admin() {
local mail_subject="☁️🆈🅽🅷☁️: \`$app\` was just installed!"
local mail_message="This is an automated message from your beloved YunoHost server.
Specific information for the application $app.
$app_message
---
Automatic diagnosis data from YunoHost
$(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')"
# 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
# Send the email to the recipients
echo "$mail_message" | mail -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients"
}
#=================================================

View file

@ -23,6 +23,8 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC
path_url=$YNH_APP_ARG_PATH
admin_user=$YNH_APP_ARG_ADMIN_USER
admin_pass=$YNH_APP_ARG_ADMIN_PASS
app=$YNH_APP_INSTANCE_NAME
@ -47,6 +49,8 @@ ynh_webpath_register $app $domain $path_url
ynh_app_setting_set $app domain $domain
ynh_app_setting_set $app is_public $is_public
ynh_app_setting_set $app admin_user $admin_user
ynh_app_setting_set $app admin_pass $admin_pass
#=================================================
# STANDARD MODIFICATIONS
@ -60,6 +64,16 @@ port=$(ynh_find_port 8000)
yunohost firewall allow --no-upnp TCP $port 2>&1
ynh_app_setting_set $app port $port
#=================================================
# CREATE A MYSQL DATABASE
#=================================================
# If your app uses a MySQL database, you can use these lines to bootstrap
# a database, an associated user and save the password in app settings
db_name=$(ynh_sanitize_dbid $app)
ynh_app_setting_set $app db_name $db_name
ynh_mysql_setup_db $db_name $db_name
#=================================================
# INSTALL NODEJS
#=================================================
@ -132,7 +146,29 @@ npm run package:discover
popd
#=================================================
# Set right on directory and configure init script
# Add Authentication through Mysql Database
#=================================================
node osjs config:set --name=authenticator --value=database
node osjs config:set --name=server.modules.auth.database.driver --value=mysql
node osjs config:set --name=server.modules.auth.database.mysql.host --value=localhost
node osjs config:set --name=server.modules.auth.database.mysql.user --value=$db_name
node osjs config:set --name=server.modules.auth.database.mysql.password --value=$db_pwd
node osjs config:set --name=server.modules.auth.database.mysql.database --value=$db_name
node osjs config:set --name=client.ReloadOnShutdown --value=true
node osjs build:config
#=================================================
# Add the first user
#=================================================
node bin/add-user.js add $admin_name admin
node bin/add-user.js pwd $admin_name <<< $admin_pass
mkdir vfs/home/$admin_name
#=================================================
# Configure init script
#=================================================
ynh_replace_string "8000" "$port" "$final_path/src/server/config.js"