mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
add config panel
This commit is contained in:
parent
b5158ba1ef
commit
d4c1f305aa
3 changed files with 24 additions and 1 deletions
16
config_panel.toml
Normal file
16
config_panel.toml
Normal file
|
@ -0,0 +1,16 @@
|
|||
version = "1.0"
|
||||
|
||||
[main]
|
||||
name = "Pixelfed configuration"
|
||||
services = ["__APP__"]
|
||||
|
||||
[main.config]
|
||||
name = "Configuration Options"
|
||||
|
||||
[main.config.open_registration]
|
||||
ask = "Open Registration"
|
||||
type = "boolean"
|
||||
yes = "true"
|
||||
no = "false"
|
||||
help = "Registrations are open by default."
|
||||
bind = "OPEN_REGISTRATION:__INSTALL_DIR__/.env"
|
|
@ -14,7 +14,7 @@ source /usr/share/yunohost/helpers
|
|||
#=================================================
|
||||
|
||||
app_key="base64:$(ynh_string_random --length=32 | base64)"
|
||||
|
||||
open_registration="true"
|
||||
fpm_footprint="low"
|
||||
fpm_free_footprint=0
|
||||
fpm_usage="low"
|
||||
|
@ -24,6 +24,7 @@ fpm_usage="low"
|
|||
#=================================================
|
||||
|
||||
ynh_app_setting_set --app=$app --key=app_key --value=$app_key
|
||||
ynh_app_setting_set --app=$app --key=open_registration --value=$open_registration
|
||||
ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint
|
||||
ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage
|
||||
|
|
|
@ -54,6 +54,12 @@ if [ -z "${app_key:-}" ]; then
|
|||
ynh_app_setting_set --app="$app" --key=app_key --value="$app_key"
|
||||
fi
|
||||
|
||||
# If open_registration doesn't exist, retrieve it
|
||||
if [ -z "${open_registration:-}" ]; then
|
||||
open_registration="true"
|
||||
ynh_app_setting_set --app="$app" --key=open_registration --value=$open_registration
|
||||
fi
|
||||
|
||||
if dpkg --compare-versions "0.9.0~ynh3" gt "$(ynh_read_manifest --manifest="/etc/yunohost/apps/$YNH_APP_INSTANCE_NAME/manifest.json" --manifest_key="version" || echo 1.0)" ; then
|
||||
ynh_script_progression --message="Ensuring upgrade compatibility to 0.9.0~ynh3..."
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue