2014-08-26 00:49:46 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# INSTALL DEPENDENCIES
|
|
|
|
#=================================================
|
2023-03-27 18:48:41 +02:00
|
|
|
ynh_script_progression --message="Installing dependencies..." --weight=20
|
2019-08-07 15:13:10 +02:00
|
|
|
|
2020-11-03 14:16:38 +01:00
|
|
|
# Install Nodejs
|
|
|
|
ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
|
|
|
|
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
|
|
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
|
|
|
#=================================================
|
2021-04-20 22:34:59 +02:00
|
|
|
ynh_script_progression --message="Setting up source files..." --weight=2
|
2019-08-07 15:13:10 +02:00
|
|
|
|
2021-04-20 22:34:59 +02:00
|
|
|
# Download, check integrity, uncompress and patch the source from app.src
|
2023-03-27 18:43:59 +02:00
|
|
|
ynh_setup_source --dest_dir=$install_dir
|
2019-08-07 15:13:10 +02:00
|
|
|
|
2023-03-27 18:43:59 +02:00
|
|
|
chmod -R o-rwx "$install_dir"
|
|
|
|
chown -R $app:www-data "$install_dir"
|
|
|
|
chmod +x $install_dir/bin/runSafe.sh
|
2021-06-01 11:59:24 +02:00
|
|
|
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
2023-04-02 22:08:59 +02:00
|
|
|
# SYSTEM CONFIGURATION
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
2023-04-02 22:08:59 +02:00
|
|
|
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
|
2017-06-27 13:34:52 +02:00
|
|
|
|
2020-11-03 14:16:38 +01:00
|
|
|
# Create a dedicated NGINX config
|
2017-09-08 20:48:32 +02:00
|
|
|
ynh_add_nginx_config
|
2017-06-27 13:34:52 +02:00
|
|
|
|
2023-04-02 22:08:59 +02:00
|
|
|
env_path="$PATH"
|
|
|
|
ynh_add_systemd_config
|
|
|
|
|
|
|
|
yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log"
|
|
|
|
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
2019-08-07 15:13:10 +02:00
|
|
|
# INSTALL ETHERCALC
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
2020-11-03 14:55:47 +01:00
|
|
|
ynh_script_progression --message="Building EtherCalc... (this will take some time and resources!)" --weight=24
|
2017-06-27 13:44:49 +02:00
|
|
|
|
2023-03-27 18:43:59 +02:00
|
|
|
pushd "$install_dir"
|
2020-11-03 14:16:38 +01:00
|
|
|
ynh_use_nodejs
|
2021-04-20 21:43:18 +02:00
|
|
|
ynh_exec_warn_less npm i -g ethercalc
|
2021-06-01 16:55:41 +02:00
|
|
|
ynh_exec_warn_less npm i zappajs
|
2021-04-20 21:43:18 +02:00
|
|
|
popd
|
2017-06-27 13:34:52 +02:00
|
|
|
|
|
|
|
#=================================================
|
2020-11-03 14:32:32 +01:00
|
|
|
# START SYSTEMD SERVICE
|
2017-06-27 13:34:52 +02:00
|
|
|
#=================================================
|
2020-11-03 14:32:32 +01:00
|
|
|
ynh_script_progression --message="Starting a systemd service..." --weight=2
|
2017-06-27 13:34:52 +02:00
|
|
|
|
2020-11-03 14:32:32 +01:00
|
|
|
# Start a systemd service
|
2021-06-01 23:35:06 +02:00
|
|
|
ynh_systemd_action --service_name=$app --action=start --log_path="systemd"
|
2017-06-27 13:34:52 +02:00
|
|
|
|
2020-11-03 14:16:38 +01:00
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_script_progression --message="Installation of EtherCalc completed" --last
|