mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
regenconf: be paranoid and force the boolean setting to be yes/no
This commit is contained in:
parent
839672d28f
commit
1e4e7044a4
2 changed files with 5 additions and 1 deletions
|
@ -1085,6 +1085,10 @@ int_to_bool() {
|
|||
sed -e 's/^1$/True/g' -e 's/^0$/False/g'
|
||||
}
|
||||
|
||||
int_to_yesno() {
|
||||
sed -e 's/^1$/yes/g' -e 's/^0$/no/g'
|
||||
}
|
||||
|
||||
toml_to_json() {
|
||||
python3 -c 'import toml, json, sys; print(json.dumps(toml.load(sys.stdin)))'
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ do_pre_regen() {
|
|||
# Support different strategy for security configurations
|
||||
export compatibility="$(yunohost settings get 'security.ssh.ssh_compatibility')"
|
||||
export port="$(yunohost settings get 'security.ssh.ssh_port')"
|
||||
export password_authentication="$(yunohost settings get 'security.ssh.ssh_password_authentication' | int_to_bool)"
|
||||
export password_authentication="$(yunohost settings get 'security.ssh.ssh_password_authentication' | int_to_yesno)"
|
||||
export ssh_keys
|
||||
export ipv6_enabled
|
||||
ynh_render_template "sshd_config" "${pending_dir}/etc/ssh/sshd_config"
|
||||
|
|
Loading…
Add table
Reference in a new issue