Rename nginx and ssh compatibility setting for consistency

This commit is contained in:
Alexandre Aubin 2019-03-22 16:15:11 +01:00
parent e7d322b68c
commit fee79820e0
3 changed files with 8 additions and 8 deletions

View file

@ -24,8 +24,8 @@ do_pre_regen() {
fi fi
# Support different strategy for security configurations # Support different strategy for security configurations
if [[ -n "$(yunohost settings get 'service.ssh.ciphers.compatibility')" ]]; then if [[ -n "$(yunohost settings get 'service.ssh.compatibility')" ]]; then
ssh_ciphers_compatibility="$(yunohost settings get 'service.ssh.ciphers.compatibility')" ssh_ciphers_compatibility="$(yunohost settings get 'service.ssh.compatibility')"
fi fi
export ssh_keys export ssh_keys

View file

@ -37,8 +37,8 @@ do_pre_regen() {
domain_list=$(sudo yunohost domain list --output-as plain --quiet) domain_list=$(sudo yunohost domain list --output-as plain --quiet)
# Support different strategy for security configurations # Support different strategy for security configurations
if [[ -n "$(yunohost settings get 'security.ciphers.compatibility')" ]]; then if [[ -n "$(yunohost settings get 'security.nginx.compatibility')" ]]; then
security_ciphers_compatibility="$(yunohost settings get 'security.ciphers.compatibility')" security_ciphers_compatibility="$(yunohost settings get 'security.nginx.compatibility')"
fi fi
export security_ciphers_compatibility export security_ciphers_compatibility

View file

@ -40,9 +40,9 @@ DEFAULTS = OrderedDict([
("security.password.admin.strength", {"type": "int", "default": 1}), ("security.password.admin.strength", {"type": "int", "default": 1}),
("security.password.user.strength", {"type": "int", "default": 1}), ("security.password.user.strength", {"type": "int", "default": 1}),
("service.ssh.allow_deprecated_dsa_hostkey", {"type": "bool", "default": False}), ("service.ssh.allow_deprecated_dsa_hostkey", {"type": "bool", "default": False}),
("service.ssh.ciphers.compatibility", {"type": "enum", "default": "modern", ("security.ssh.compatibility", {"type": "enum", "default": "modern",
"choices": ["intermediate", "modern"]}), "choices": ["intermediate", "modern"]}),
("security.ciphers.compatibility", {"type": "enum", "default": "intermediate", ("security.nginx.compatibility", {"type": "enum", "default": "intermediate",
"choices": ["intermediate", "modern"]}), "choices": ["intermediate", "modern"]}),
]) ])
@ -283,12 +283,12 @@ def trigger_post_change_hook(setting_name, old_value, new_value):
# #
# =========================================== # ===========================================
@post_change_hook("security.ciphers.compatibility") @post_change_hook("security.nginx.compatibility")
def reconfigure_nginx(setting_name, old_value, new_value): def reconfigure_nginx(setting_name, old_value, new_value):
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['nginx']) service_regen_conf(names=['nginx'])
@post_change_hook("service.ssh.ciphers.compatibility") @post_change_hook("security.ssh.compatibility")
def reconfigure_ssh(setting_name, old_value, new_value): def reconfigure_ssh(setting_name, old_value, new_value):
if old_value != new_value: if old_value != new_value:
service_regen_conf(names=['ssh']) service_regen_conf(names=['ssh'])