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

62 lines
2.1 KiB
Text
Raw Permalink Normal View History

2016-03-01 10:47:41 +01:00
#!/bin/bash
2018-11-30 14:47:44 +01:00
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
2019-02-26 23:56:20 +01:00
# INSTALL SOURCES
2018-11-30 14:47:44 +01:00
#=================================================
2022-02-04 15:58:59 +01:00
ynh_script_progression --message="Setting up source files..."
2018-11-30 14:47:44 +01:00
2019-02-26 23:56:20 +01:00
# To avoid a complete rebuild, I downloaded the gh-pages as explained here: https://github.com/keeweb/keeweb#self-hosting
# and put all files in "../sources/extra_files/app/", like that I can assure the version install in YunoHost is the version described in the manifest
2023-11-02 19:00:22 +01:00
mkdir -p "$install_dir"
cp -r ../sources/extra_files/app/* "$install_dir"
2018-11-30 14:47:44 +01:00
#=================================================
# NGINX CONFIGURATION
#=================================================
2021-02-08 09:32:10 +01:00
ynh_script_progression --message="Configuring NGINX web server..."
2018-11-30 14:47:44 +01:00
ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# USE THE CONFIG FILE
#=================================================
2023-11-02 19:00:22 +01:00
ynh_replace_string "(no-config)" "config.json" "$install_dir/index.html"
2018-11-30 14:47:44 +01:00
#=================================================
# COPY THE CONFIG FILE
#=================================================
2022-02-04 15:36:57 +01:00
ynh_script_progression --message="Adding a configuration file..."
2018-11-30 14:47:44 +01:00
2023-11-02 19:05:09 +01:00
ynh_add_config --template="config.json" --destination="$install_dir/config.json"
2018-11-30 14:47:44 +01:00
#=================================================
# GENERIC FINALISATION
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
# Les fichiers appartiennent à root
2023-11-02 19:00:22 +01:00
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
2018-11-30 14:47:44 +01:00
2021-02-08 09:32:10 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last