2018-11-27 17:09:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source _common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
2024-01-24 09:14:15 +01:00
|
|
|
#=================================================
|
|
|
|
# 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
|
2024-01-24 09:33:44 +01:00
|
|
|
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"
|
2024-01-24 09:33:44 +01:00
|
|
|
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__"
|
2024-01-24 09:33:44 +01:00
|
|
|
default_provider="framapad"
|
|
|
|
commented_provider="// CUSTOM_PROVIDER"
|
2018-11-27 17:09:29 +01:00
|
|
|
if [ "$etherpad_instance" != "https://annuel2.framapad.org" ]; then
|
2024-01-24 09:33:44 +01:00
|
|
|
provider="${domain%%.*}"
|
|
|
|
default_provider="$provider"
|
|
|
|
commented_provider=""
|
2018-11-27 17:09:29 +01:00
|
|
|
fi
|
2024-01-24 09:33:44 +01:00
|
|
|
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
|
|
|
|
2024-01-24 09:33:44 +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
|