From ba4254538f0f4b688cdc8e4aacd9fda3142d35fe Mon Sep 17 00:00:00 2001 From: William Brown Date: Sep 03 2019 23:58:43 +0000 Subject: Ticket 50567, 50568 - strict host check disable and display container version Bug Description: This is a minor fix to disable strict host checking by default as it causes some installs to unexpectedly fail. We also display the container version by default to aid future issue reports. Fix Description: strict host check to false, and print paths.version. https://pagure.io/389-ds-base/issue/50568 https://pagure.io/389-ds-base/issue/50567 Author: William Brown Review by: mreynolds (Thanks!) --- diff --git a/src/lib389/cli/dscontainer b/src/lib389/cli/dscontainer index e4bb073..7503b82 100755 --- a/src/lib389/cli/dscontainer +++ b/src/lib389/cli/dscontainer @@ -67,6 +67,7 @@ def begin_magic(): # # We wouldn't need this *except* for testing containers that build to /opt/dirsrv paths = Paths(serverid='localhost') + log.info("389 Directory Server Version: %s" % paths.version) # Make sure that /data/config, /data/ssca and /data/config exist, because # k8s may not template them out. diff --git a/src/lib389/lib389/instance/options.py b/src/lib389/lib389/instance/options.py index 5ee69a3..702b60a 100644 --- a/src/lib389/lib389/instance/options.py +++ b/src/lib389/lib389/instance/options.py @@ -114,7 +114,7 @@ class General2Base(Options2): self._type['full_machine_name'] = str self._helptext['full_machine_name'] = "Sets the fully qualified hostname (FQDN) of this system. When installing this instance with GSSAPI authentication behind a load balancer, set this parameter to the FQDN of the load balancer and, additionally, set \"strict_host_checking\" to \"false\"." - self._options['strict_host_checking'] = True + self._options['strict_host_checking'] = False self._type['strict_host_checking'] = bool self._helptext['strict_host_checking'] = "Sets whether the server verifies the forward and reverse record set in the \"full_machine_name\" parameter. When installing this instance with GSSAPI authentication behind a load balancer, set this parameter to \"false\". Container installs imply \"false\"." diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py index 9a9cd82..58012b3 100644 --- a/src/lib389/lib389/instance/setup.py +++ b/src/lib389/lib389/instance/setup.py @@ -244,7 +244,7 @@ class SetupDs(object): # Set the defaults general = {'config_version': 2, 'full_machine_name': socket.getfqdn(), - 'strict_host_checking': True, 'selinux': True, 'systemd': ds_paths.with_systemd, + 'strict_host_checking': False, 'selinux': True, 'systemd': ds_paths.with_systemd, 'defaults': '999999999', 'start': True} slapd = {'self_sign_cert_valid_months': 24, @@ -288,24 +288,6 @@ class SetupDs(object): if val != "": general['full_machine_name'] = val - # Strict host name checking - msg = ("\nUse strict hostname verification (set to \"no\" if using GSSAPI behind a load balancer) [yes]: ") - while 1: - val = input(msg).rstrip().lower() - if val != "": - if val == "no" or val == "n": - slapd['strict_host_checking'] = False - break - if val == "yes" or val == "y": - # Use default - break - - # Unknown value - print ("Value \"{}\" is invalid, please use \"yes\" or \"no\"".format(val)) - continue - else: - break - # Instance name - adjust defaults once set while 1: slapd['instance_name'] = general['full_machine_name'].split('.', 1)[0]