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

68 lines
2.3 KiB
Text
Raw Normal View History

2018-11-27 17:09:29 +01:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# INITIALIZE AND STORE SETTINGS
#=================================================
# FIXME: subdir install does not seem to be supported anymore.
path="/"
ynh_app_setting_set --app="$app" --key=path --value="$path"
2018-11-27 17:09:29 +01:00
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
2020-12-12 08:56:05 +01:00
ynh_script_progression --message="Setting up source files..." --weight=4
2018-11-27 17:09:29 +01:00
# Note: We use git instead of ynh_setup_source, cause this repo use submodules
ynh_exec_as "$app" git clone https://github.com/zamentur/libreto.git "$install_dir/libreto" --quiet
ynh_exec_as "$app" git -C "$install_dir/libreto" checkout "$COMMIT" --quiet
ynh_exec_as "$app" git -C "$install_dir/libreto" submodule update --init --recursive --quiet
2018-11-27 17:09:29 +01:00
2023-03-19 13:57:05 +01:00
chmod -R o-rwx "$install_dir"
chown -R "$app:www-data" "$install_dir"
2018-11-27 17:09:29 +01:00
#=================================================
2022-06-15 22:53:07 +02:00
# SPECIFIC SETUP
#=================================================
# ADD A CONFIGURATION
2018-11-27 17:09:29 +01:00
#=================================================
2022-06-15 22:53:07 +02:00
ynh_script_progression --message="Adding a configuration file..."
2020-12-12 08:56:05 +01:00
2024-01-24 09:47:27 +01:00
provider="__PROVIDER__"
default_provider="framapad"
commented_provider="// CUSTOM_PROVIDER"
2018-11-27 17:09:29 +01:00
if [ "$etherpad_instance" != "https://annuel2.framapad.org" ]; then
provider="${domain%%.*}"
default_provider="$provider"
commented_provider=""
2018-11-27 17:09:29 +01:00
fi
ynh_add_config --template="config.dist.php" --destination="$install_dir/libreto/config.php"
chown "$app:www-data" "$install_dir/libreto/config.php"
#=================================================
# SYSTEM CONFIGURATION
#=================================================
ynh_script_progression --message="Adding system configurations related to $app..." --weight=1
2018-11-27 17:09:29 +01:00
# Create a dedicated PHP-FPM config
ynh_add_fpm_config --usage=low --footprint=low
# Create a dedicated NGINX config
ynh_add_nginx_config
2018-11-27 17:09:29 +01:00
2020-12-12 08:56:05 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2018-11-27 17:09:29 +01:00
2020-12-12 08:56:05 +01:00
ynh_script_progression --message="Installation of $app completed" --last