Example #1
0
def write_certmap_conf(realm, ca_subject):
    """(Re)write certmap.conf with given CA subject DN."""
    serverid = installutils.realm_to_serverid(realm)
    ds_dirname = config_dirname(serverid)
    certmap_filename = os.path.join(ds_dirname, "certmap.conf")
    shutil.copyfile(
        os.path.join(paths.USR_SHARE_IPA_DIR, "certmap.conf.template"),
        certmap_filename)
    installutils.update_file(certmap_filename, '$ISSUER_DN', str(ca_subject))
Example #2
0
 def __certmap_conf(self):
     shutil.copyfile(
         os.path.join(paths.USR_SHARE_IPA_DIR, "certmap.conf.template"),
         os.path.join(config_dirname(self.serverid), "certmap.conf"),
     )
     installutils.update_file(
         config_dirname(self.serverid) + "certmap.conf", "$SUBJECT_BASE", str(self.subject_base)
     )
     sysupgrade.set_upgrade_state("certmap.conf", "subject_base", str(self.subject_base))
Example #3
0
def write_certmap_conf(realm, ca_subject):
    """(Re)write certmap.conf with given CA subject DN."""
    serverid = installutils.realm_to_serverid(realm)
    ds_dirname = config_dirname(serverid)
    certmap_filename = os.path.join(ds_dirname, "certmap.conf")
    shutil.copyfile(
        os.path.join(paths.USR_SHARE_IPA_DIR, "certmap.conf.template"),
        certmap_filename)
    installutils.update_file(certmap_filename, '$ISSUER_DN', str(ca_subject))
Example #4
0
 def __certmap_conf(self):
     shutil.copyfile(ipautil.SHARE_DIR + "certmap.conf.template",
                     config_dirname(self.serverid) + "certmap.conf")
     installutils.update_file(config_dirname(self.serverid) + "certmap.conf",
                              '$SUBJECT_BASE', str(self.subject_base))
     sysupgrade.set_upgrade_state(
         'certmap.conf',
         'subject_base',
         str(self.subject_base)
     )
Example #5
0
 def __certmap_conf(self):
     shutil.copyfile(
         os.path.join(paths.USR_SHARE_IPA_DIR, "certmap.conf.template"),
         os.path.join(config_dirname(self.serverid), "certmap.conf"))
     installutils.update_file(config_dirname(self.serverid) + "certmap.conf",
                              '$SUBJECT_BASE', str(self.subject_base))
     sysupgrade.set_upgrade_state(
         'certmap.conf',
         'subject_base',
         str(self.subject_base)
     )
Example #6
0
 def __add_include(self):
     """This should run after __set_mod_nss_port so is already backed up"""
     if installutils.update_file(
             paths.HTTPD_SSL_SITE_CONF, '</VirtualHost>', 'Include {path}\n'
             '</VirtualHost>'.format(
                 path=paths.HTTPD_IPA_REWRITE_CONF)) != 0:
         self.print_msg("Adding Include conf.d/ipa-rewrite to "
                        "%s failed." % paths.HTTPD_SSL_SITE_CONF)
Example #7
0
 def __add_include(self):
     """This should run after __set_mod_nss_port so is already backed up"""
     if installutils.update_file(paths.HTTPD_SSL_SITE_CONF,
                                 '</VirtualHost>',
                                 'Include {path}\n'
                                 '</VirtualHost>'.format(
                                     path=paths.HTTPD_IPA_REWRITE_CONF)
                                 ) != 0:
         self.print_msg("Adding Include conf.d/ipa-rewrite to "
                        "%s failed." % paths.HTTPD_SSL_SITE_CONF)
Example #8
0
 def __set_mod_nss_port(self):
     self.fstore.backup_file(paths.HTTPD_NSS_CONF)
     if installutils.update_file(paths.HTTPD_NSS_CONF, '8443', '443') != 0:
         print("Updating port in %s failed." % paths.HTTPD_NSS_CONF)
Example #9
0
 def __set_mod_nss_port(self):
     self.fstore.backup_file(paths.HTTPD_NSS_CONF)
     if installutils.update_file(paths.HTTPD_NSS_CONF, '8443', '443') != 0:
         print("Updating port in %s failed." % paths.HTTPD_NSS_CONF)
Example #10
0
 def __add_include(self):
     """This should run after __set_mod_nss_port so is already backed up"""
     if installutils.update_file(paths.HTTPD_NSS_CONF, '</VirtualHost>', 'Include conf.d/ipa-rewrite.conf\n</VirtualHost>') != 0:
         print("Adding Include conf.d/ipa-rewrite to %s failed." % paths.HTTPD_NSS_CONF)