mirror of
https://github.com/YunoHost-Apps/cryptpad_ynh.git
synced 2024-09-03 18:26:14 +02:00
Merge branch 'master' into testing
This commit is contained in:
commit
36b96b6428
2 changed files with 24 additions and 13 deletions
|
@ -103,7 +103,7 @@ ynh_add_nginx_config
|
|||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config
|
||||
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "/etc/systemd/system/$app.service"
|
||||
ynh_replace_string "__NODEJS__" "$nodejs_version" "/etc/systemd/system/$app.service"
|
||||
ynh_replace_string "__ENV_PATH__" "$PATH" "/etc/systemd/system/$app.service"
|
||||
ynh_replace_string "__NODE__" "$nodejs_path" "/etc/systemd/system/$app.service"
|
||||
systemctl daemon-reload
|
||||
|
@ -124,20 +124,31 @@ chown admin: -R $install_log
|
|||
#=================================================
|
||||
|
||||
# Copy default configuration file
|
||||
mv "../conf/config.js" "$final_path/config.js"
|
||||
ynh_replace_string "_domain = 'http://localhost:3000/'" "_domain = 'https://$domain$path_url'" "$final_path/config.js"
|
||||
mv "../conf/config.js" "$final_path/config/config.js"
|
||||
ynh_replace_string "_domain = 'http://localhost:3000/'" "_domain = 'https://$domain$path_url'" "$final_path/config/config.js"
|
||||
# Set service port
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config.js"
|
||||
ynh_replace_string "__PORT__" "$porti" "$final_path/config.js"
|
||||
ynh_replace_string "__PORT__" "$port" "$final_path/config/config.js"
|
||||
ynh_replace_string "__PORTI__" "$porti" "$final_path/config/config.js"
|
||||
|
||||
# Tune CSP to allow for YunoHost tile
|
||||
#ynh_replace_string "\"script-src 'self'\"" "\"script-src 'self' 'unsafe-eval'\"" "$final_path/config.js"
|
||||
# Remove donate button
|
||||
ynh_replace_string "removeDonateButton: false" "removeDonateButton: true" "$final_path/config.js"
|
||||
ynh_replace_string "removeDonateButton: false" "removeDonateButton: true" "$final_path/config/config.js"
|
||||
# Disable analytics unsolicited communications
|
||||
ynh_replace_string "__ADMIN_EMAIL_" "$admin_email" "$final_path/config.js"
|
||||
cp $final_path/config.js $final_path/config.example
|
||||
ynh_replace_string "__ADMIN_EMAIL_" "$admin_email" "$final_path/config/config.js"
|
||||
# Store file checksum to detected user modifications on upgrade
|
||||
ynh_store_file_checksum "$final_path/config.js"
|
||||
ynh_store_file_checksum "$final_path/config/config.js"
|
||||
|
||||
#=================================================
|
||||
# INSTALL CRYPTPAD
|
||||
#=================================================
|
||||
|
||||
script_dir="$PWD"
|
||||
pushd "$final_path"
|
||||
npm install --allow-root
|
||||
npm install -g bower --allow-root
|
||||
bower install --allow-root
|
||||
popd
|
||||
|
||||
#=================================================
|
||||
# INSTALL CRYPTPAD
|
||||
|
|
|
@ -39,7 +39,7 @@ port=$(ynh_app_setting_get "$app" port)
|
|||
if [ -f "/etc/yunohost/apps/$app/scripts/backup" ] ; then
|
||||
ynh_backup_before_upgrade # Backup the current version of the app
|
||||
ynh_clean_setup () {
|
||||
ynh_backup_after_failed_upgrade
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
ynh_abort_if_errors # Stop script if an error is detected
|
||||
fi
|
||||
|
@ -80,16 +80,16 @@ sudo chmod 755 $final_path -R
|
|||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
#=================================================
|
||||
|
||||
ynh_nginx_config
|
||||
ynh_add_nginx_config
|
||||
|
||||
#=================================================
|
||||
# ADD SYSTEMD SERVICE
|
||||
#=================================================
|
||||
|
||||
ynh_replace_string "__NODE__" "$nodejs_path" "../conf/systemd.service"
|
||||
ynh_replace_string "__NODEJS__" "$nodejs_use_version" "../conf/systemd.service"
|
||||
ynh_replace_string "__NODEJS__" "$nodejs_version" "../conf/systemd.service"
|
||||
ynh_replace_string "__ENV_PATH__" "$PATH" "../conf/systemd.service"
|
||||
ynh_systemd_config
|
||||
ynh_add_systemd_config
|
||||
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue