diff --git a/config_panel.toml b/config_panel.toml index a05a1e8..3fd5a87 100644 --- a/config_panel.toml +++ b/config_panel.toml @@ -2,18 +2,55 @@ version = "1.0" [main] name = "Dendrite configuration" +services = ["__APP__"] [main.registration] name = "User registration" + [main.registration.registration_shared_secret] + ask = "Shared Secret for Registration." + type = "string" + help = "Allows registration of default user or admin accounts, even if Registration disabled. See instructions https://matrix-org.github.io/synapse/latest/admin_api/register_api.html" + bind = ":/opt/yunohost/__APP__/dendrite.yaml" + + [main.registration.helptext] + ask = ''' + HOW TO REGISTER AN ACCOUNT ? + * Provide a Registration Shared Secret. + * To register an **admin** account for the user `USERNAME`, connect to your server with ssh and type : + `/opt/yunohost/dendrite/bin/create-account -config /opt/yunohost/dendrite/dendrite.yaml -username USERNAME -admin` + * Remove `-admin` to register a default user account + ''' + type = "markdown" + [main.registration.registration_disabled] - ask = "Should registration be disabled?" + ask = "Disable Registration from Element ?" type = "boolean" yes = true no = false - help = "Disallows registration of standard accounts. If your server is federated, reCAPTCHA verification should be activated to avoid spamming the whole Matrix network." + help = "If True, Registration of default user accounts from a Client App is disabled. If false and your server is federated, reCAPTCHA verification should be activated to avoid spamming the whole Matrix network." default = true + [main.registration.enable_registration_captcha] + ask = "Require CAPTCHA verification for Registration." + type = "boolean" + yes = true + no = false + help = "ReCAPTCHA API should be configured. See instructions https://matrix-org.github.io/dendrite/administration/registration#recaptcha-verification" + bind = ":/opt/yunohost/__APP__/dendrite.yaml" + default = true + visible = "!registration_disabled" + + [main.registration.guests_disabled] + ask = "Disable guests registration." + type = "boolean" + yes = true + no = false + help = "Guest registration is also disabled implicitly if Registration from Element is disabled." + bind = ":/opt/yunohost/__APP__/dendrite.yaml" + default = true + visible = "!registration_disabled" + [main.registration.disable_federation] ask = "Disable Federation." type = "boolean" @@ -21,28 +58,4 @@ name = "Dendrite configuration" no = false help = "Do not communicate with other homeservers of the Matrix Federation." bind = ":/opt/yunohost/__APP__/dendrite.yaml" - default = false - - [main.registration.guests_disabled] - ask = "Disable guests registration." - type = "boolean" - yes = true - no = false - help = "Guest registration is also disabled implicitly if registration is disabled." - bind = ":/opt/yunohost/__APP__/dendrite.yaml" - default = true - - [main.registration.registration_shared_secret] - ask = "Shared Secret for Registration." - type = "string" - help = "Allows registration of standard or admin accounts, even if Registration disabled. See instructions https://matrix-org.github.io/synapse/latest/admin_api/register_api.html" - bind = ":/opt/yunohost/__APP__/dendrite.yaml" - - [main.registration.enable_registration_captcha] - ask = "Enable CAPTCHA for registration." - type = "boolean" - yes = true - no = false - help = "ReCAPTCHA API should be configured. See instructions https://matrix-org.github.io/dendrite/administration/registration#recaptcha-verification" - bind = ":/opt/yunohost/__APP__/dendrite.yaml" - default = true + default = false \ No newline at end of file diff --git a/scripts/config b/scripts/config index 59b6269..46a5252 100644 --- a/scripts/config +++ b/scripts/config @@ -18,7 +18,7 @@ get_registration_disabled() { } set__registration_disabled() { - if [ $registration_disabled -eq "1" ] + if [ "$registration_disabled" -eq "1" ] then really_enable_open_registration="" else