diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..cc4cc19 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,15 @@ +version = "1.0" + +[main] +name = "Kimai2 configuration" + + [main.config] + name = "Configuration Options" + + [main.config.registration] + ask = "Enable registration" + type = "boolean" + yes = "true" + no = "false" + help = "Allow Kimai account creation" + bind = "registration:__FINALPATH__/config/packages/local.yaml" diff --git a/scripts/install b/scripts/install index 583a065..0107276 100755 --- a/scripts/install +++ b/scripts/install @@ -135,8 +135,7 @@ setfacl -R -m g:"www-data":rwX -m u:$app:rwX "$final_path/var/" #================================================= ynh_script_progression --message="Adding a configuration file..." -if [ $registration -eq 1 ] -then +if [ $registration -eq 1 ]; then registration="true" else registration="false" @@ -158,14 +157,10 @@ chown $app:$app "$final_path/.env" #================================================= ynh_script_progression --message="Installing Kimai2..." -#update-alternatives --set php /usr/bin/php$phpversion - pushd "$final_path" ynh_exec_as $app php$phpversion bin/console kimai:install -n popd -#update-alternatives --set php /usr/bin/php${YNH_DEFAULT_PHP_VERSION} - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4d04c05..2604c35 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -23,9 +23,10 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name db_pwd=$(ynh_app_setting_get --app=$app --key=mysqlpwd) -registration=$(ynh_app_setting_get --app=$app --key=registration) random_key=$(ynh_app_setting_get --app=$app --key=random_key) +registration=$(ynh_app_setting_get --app=$app --key=registration) + #================================================= # CHECK VERSION #================================================= @@ -59,6 +60,11 @@ if [ -z "$final_path" ]; then ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +if [ -z "$registration" ]; then + registration_enabled="false" + ynh_app_setting_set --app=$app --key=registration --value=$registration +fi + # Cleaning legacy permissions if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all @@ -132,8 +138,7 @@ ynh_add_fpm_config #================================================= ynh_script_progression --message="Adding a configuration file..." -if [ $registration -eq 1 ] -then +if [ $registration -eq 1 ]; then registration="true" else registration="false"