2023-11-28 13:20:48 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# In simple cases, you don't need a config script.
|
|
|
|
|
|
|
|
# With a simple config_panel.toml, you can write in the app settings, in the
|
|
|
|
# upstream config file or replace complete files (logo ...) and restart services.
|
|
|
|
|
|
|
|
# The config scripts allows you to go further, to handle specific cases
|
|
|
|
# (validation of several interdependent fields, specific getter/setter for a value,
|
|
|
|
# display dynamic informations or choices, pre-loading of config type .cube... ).
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# RETRIEVE ARGUMENTS
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
install_dir=$(ynh_app_setting_get --app=$app --key=install_dir)
|
2023-12-04 06:59:26 +01:00
|
|
|
data_dir=$(ynh_app_setting_get --app=$app --key=data_dir)
|
2023-11-28 13:20:48 +01:00
|
|
|
|
|
|
|
#=================================================
|
2023-12-04 06:59:26 +01:00
|
|
|
# SPECIFIC ACTION FOR TOML SHORT KEY
|
2023-11-28 13:20:48 +01:00
|
|
|
#=================================================
|
2023-12-04 06:59:26 +01:00
|
|
|
install_custom_requirements() {
|
|
|
|
#Enable python virtual environnement
|
|
|
|
source $install_dir/bin/activate
|
2023-11-28 13:20:48 +01:00
|
|
|
|
2023-12-04 06:59:26 +01:00
|
|
|
#Install user's custom requirements
|
|
|
|
pip install -r $data_dir/requirements.txt
|
2023-11-28 13:20:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# GENERIC FINALIZATION
|
|
|
|
#=================================================
|
|
|
|
ynh_app_config_run $1
|