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
Éric Gaspar f61fe54919 v2
2023-11-02 19:05:09 +01:00

61 lines
2.1 KiB
Bash

#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# INSTALL SOURCES
#=================================================
ynh_script_progression --message="Setting up source files..."
# 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
mkdir -p "$install_dir"
cp -r ../sources/extra_files/app/* "$install_dir"
#=================================================
# NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Configuring NGINX web server..."
ynh_add_nginx_config
#=================================================
# SPECIFIC SETUP
#=================================================
# USE THE CONFIG FILE
#=================================================
ynh_replace_string "(no-config)" "config.json" "$install_dir/index.html"
#=================================================
# COPY THE CONFIG FILE
#=================================================
ynh_script_progression --message="Adding a configuration file..."
ynh_add_config --template="config.json" --destination="$install_dir/config.json"
#=================================================
# GENERIC FINALISATION
#=================================================
# SECURING FILES AND DIRECTORIES
#=================================================
# Les fichiers appartiennent à root
chmod 750 "$install_dir"
chmod -R o-rwx "$install_dir"
chown -R $app:www-data "$install_dir"
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression --message="Installation of $app completed" --last