diff --git a/config_panel.toml b/config_panel.toml new file mode 100644 index 0000000..5ade1d5 --- /dev/null +++ b/config_panel.toml @@ -0,0 +1,14 @@ +version = "1.0" + +[main] +name = "Lufi configuration" +services = ["__APP__"] + + [main.config] + name = "Configuration Options" + + [main.config.max_file_size] + ask = "Max file size" + type = "number" + help = "Choose the maximum file size allowed to send, in Mo (0 = no limit)" + bind = "max_file_size:/var/www/__APP__/lufi.conf" \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 4df853a..80b8fa2 100644 --- a/manifest.toml +++ b/manifest.toml @@ -2,8 +2,8 @@ packaging_format = 2 id = "lufi" name = "Lufi" -description.en = "Self hosting files and sharing anonymous application" -description.fr = "Application d'hébergement et de partage de fichiers anonyme" +description.en = "Files and sharing anonymous application" +description.fr = "Application de partage de fichiers anonyme" version = "0.05.21~ynh1" @@ -20,7 +20,7 @@ website = "https://git.framasoft.org/luc/lufi" yunohost = ">= 11.1.17" architectures = "all" multi_instance = true -ldap = false +ldap = true sso = false disk = "50M" ram.build = "50M" @@ -38,18 +38,11 @@ ram.runtime = "50M" type = "group" default = "visitors" - [install.max_file_size] - ask.en = "Choose a max file size, in Mo (0 = no limit)" - ask.fr = "Choisissez une taille de fichier maximum chemin, en Mo (0 = pas de limite)" - type = "string" - example = "100" - default = "100" - [install.use_ldap] ask.en = "Install Lufi with LDAP configuration?" ask.fr = "Installer Lufi avec la configuration LDAP ?" - help.en = "A Lufi with LDAP enabled will allow only YunoHost users to upload." - help.fr = "Un Lufi avec LDAP activé autorisera seulement les utilisateurs YunoHost à téléverser." + help.en = "Lufi with LDAP enabled will allow only YunoHost users to upload." + help.fr = "Lufi avec LDAP activé autorisera seulement les utilisateurs YunoHost à téléverser." type = "boolean" default = false diff --git a/scripts/install b/scripts/install index 7e41da3..afd66c3 100644 --- a/scripts/install +++ b/scripts/install @@ -13,15 +13,8 @@ source /usr/share/yunohost/helpers #================================================= secret=$(ynh_string_random --length=24) - -#================================================= -# CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS -#================================================= - -# Check if max_file_size is a number -if ! [[ $max_file_size =~ "^[\-0-9]+$" ]] && [ $max_file_size -lt 0 ]; then - ynh_die --message="Max file must be a number positive or zero" -fi +max_file_size= "100" +use_ldap=$YNH_APP_ARG_USE_LDAP #================================================= # STORE SETTINGS FROM MANIFEST diff --git a/scripts/upgrade b/scripts/upgrade index 1565bf5..0481ec4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,8 +29,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="$install_dir/ #================================================= ynh_script_progression --message="Ensuring downward compatibility..." - -if [ -z "$max_file_size" ]; then +if [ -z "${max_file_size:-}" ]; then max_file_size=100 # 100 Mo ynh_app_setting_set --app=$app --key=max_file_size --value=$max_file_size fi diff --git a/tests.toml b/tests.toml index 57dcf8f..addbc4d 100644 --- a/tests.toml +++ b/tests.toml @@ -6,5 +6,4 @@ test_format = 1.0 # Default args to use for install # ------------------------------- - args.max_file_size=100 args.use_ldap=0