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

Merge pull request #19 from YunoHost-Apps/fix-upgrade

Fix upgrade
This commit is contained in:
yalh76 2022-03-29 20:05:29 +02:00 committed by GitHub
commit 9c15075ae6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 30 deletions

View file

@ -140,36 +140,6 @@ pushd $final_path
npm install --save --production @osjs/pam-auth
popd
#=================================================
# Add Authentication through Mysql Database
#=================================================
#pushd $final_path
#$ynh_npm install --save --production @osjs/database-auth
#$ynh_npm install --save mysql
#$ynh_node osjs config:set --name=authenticator --value=database
#$ynh_node osjs config:set --name=server.modules.auth.database.driver --value=mysql
#$ynh_node osjs config:set --name=server.modules.auth.database.mysql.host --value=localhost
#$ynh_node osjs config:set --name=server.modules.auth.database.mysql.user --value=$db_name
#$ynh_node osjs config:set --name=server.modules.auth.database.mysql.password --value=$db_pwd
#$ynh_node osjs config:set --name=server.modules.auth.database.mysql.database --value=$db_name
#$ynh_node osjs config:set --name=client.ReloadOnShutdown --value=true
#popd
#$ynh_node osjs build:config
#=================================================
# Add the first user
#=================================================
##$ynh_node bin/add-user.js add $admin_name admin
#$ynh_node bin/add-user.js pwd $admin_name <<< $admin_pass
#mkdir vfs/home/$admin_name
#=================================================
# Configure init script
#=================================================
ynh_replace_string --match_string="8000" --replace_string="$port" --target_file="$final_path/src/server/config.js"
chown -R $app:$app "$final_path"

View file

@ -106,6 +106,21 @@ ynh_install_nodejs --nodejs_version=$nodejs_version
#=================================================
# SPECIFIC UPGRADE
#=================================================
# UPDATE A CONFIG FILE
#=================================================
ynh_script_progression --message="Updating a configuration file..."
ynh_add_config --template="../conf/client.config.js" --destination="$final_path/src/client/config.js"
chmod 400 "$final_path/src/client/config.js"
chown $app:$app "$final_path/src/client/config.js"
ynh_add_config --template="../conf/server.index.js" --destination="$final_path/src/server/index.js"
chmod 400 "$final_path/src/server/index.js"
chown $app:$app "$final_path/src/server/index.js"
#=================================================
# BUILD APP
#=================================================
@ -119,6 +134,10 @@ pushd $final_path
npm install --save --production @osjs/pam-auth
popd
ynh_replace_string --match_string="8000" --replace_string="$port" --target_file="$final_path/src/server/config.js"
chown -R $app:$app "$final_path"
#=================================================
# SETUP SYSTEMD
#=================================================