Beispiel #1
0
def get_named_directories_root():
    form = _delist(request.form)
    if "named" in form:
        root = form["named"]
    else:
        root = wizard.config["General"].get("nameddirectoriesroot", None)
    if root is None or not os.path.isdir(root):
        return render_template("named_directories.html", menu_options=wizard.get_available_options(), root=root)
    wizard.change_config("General", nameddirectoriesroot=root)
    return redirect(url_for("choose_containers"))
def get_named_directories_root():
    form = _delist(request.form)
    if 'named' in form:
        root = form['named']
    else:
        root = wizard.config['General'].get('nameddirectoriesroot', None)
    if root is None or not os.path.isdir(root):
        return render_template('named_directories.html',
                               menu_options=wizard.get_available_options(),
                               root=root)
    wizard.change_config('General', nameddirectoriesroot=root)
    return redirect(url_for('choose_containers'))
def choose_containers():
    if len(request.form) > 0:
        active_containers = []
        for entry in request.form:
            active_containers.append(entry)
        wizard.change_config('General', containers=active_containers)
        return redirect(url_for('configure_containers'))
    active_containers = wizard.config['General'].get('containers', ['ldap'])
    return render_template('choose_containers.html',
                           menu_options=wizard.get_available_options(),
                           descriptive_names=wizard.descriptive_names,
                           dependencies=wizard.dependencies,
                           container_role=wizard.container_role,
                           active_containers=active_containers,
                           container_order=wizard.container_order)
Beispiel #4
0
def welcome(run=0):
    if run == 0:
        form = wizard.config.get("General", {})
    else:
        form = _delist(request.form)
        if _has_all_parameters(
            form, ["host", "country", "state", "locality", "orgname", "orgunit", "commonname", "email"]
        ):
            wizard.change_config("General", **form)
            return redirect(url_for("determine_ssh_status", run=0))
    if "host" not in form:
        form["host"] = socket.getfqdn()

    all_params = {"run": run, **form}
    return render_template("welcome.html", menu_options=wizard.get_available_options(), **all_params)
def welcome(run=0):
    if run == 0:
        form = wizard.config.get('General', {})
    else:
        form = _delist(request.form)
        if _has_all_parameters(form, ['host', 'country', 'state', 'locality',
                                      'orgname', 'orgunit', 'commonname',
                                      'email']):
            wizard.change_config('General', **form)
            return redirect(url_for('determine_ssh_status', run=0))
    if 'host' not in form:
        form['host'] = socket.getfqdn()
        
    all_params = {'run': run, **form}
    return render_template('welcome.html',
                           menu_options=wizard.get_available_options(),
                           **all_params)
Beispiel #6
0
def choose_containers():
    if len(request.form) > 0:
        active_containers = []
        for entry in request.form:
            active_containers.append(entry)
        wizard.change_config("General", containers=active_containers)
        return redirect(url_for("configure_containers"))
    active_containers = wizard.config["General"].get("containers", ["ldap"])
    return render_template(
        "choose_containers.html",
        menu_options=wizard.get_available_options(),
        descriptive_names=wizard.descriptive_names,
        dependencies=wizard.dependencies,
        container_role=wizard.container_role,
        active_containers=active_containers,
        container_order=wizard.container_order,
    )
def create_certificate_authority(run=0):
    if os.path.exists('etc/ca/demoCA'):
        return render_template('exists_ca.html',
                               menu_options=wizard.get_available_options(),
                               next_route='/named_directories')
    ca_template = _ca_template.format(
        country=wizard.config['General']['country'],
        state=wizard.config['General']['state'],
        locality=wizard.config['General']['locality'],
        orgname=wizard.config['General']['orgname'],
        orgunit=wizard.config['General']['orgunit'],
        commonname=wizard.config['General']['commonname'],
        email=wizard.config['General']['email'])
    with open('init.ssl', 'wt') as w:
        w.write(ca_template)
    ca_ok = ca.create_ca()
    if ca_ok:
        wizard.change_config('CA', type='self-signed')
        return redirect(url_for('get_named_directories_root'))
    return render_template('ca_not_created.html',
                           menu_options=wizard.get_available_options())
Beispiel #8
0
def create_certificate_authority(run=0):
    if os.path.exists("etc/ca/demoCA"):
        return render_template(
            "exists_ca.html", menu_options=wizard.get_available_options(), next_route="/named_directories"
        )
    ca_template = _ca_template.format(
        country=wizard.config["General"]["country"],
        state=wizard.config["General"]["state"],
        locality=wizard.config["General"]["locality"],
        orgname=wizard.config["General"]["orgname"],
        orgunit=wizard.config["General"]["orgunit"],
        commonname=wizard.config["General"]["commonname"],
        email=wizard.config["General"]["email"],
    )
    with open("init.ssl", "wt") as w:
        w.write(ca_template)
    ca_ok = ca.create_ca()
    if ca_ok:
        wizard.change_config("CA", type="self-signed")
        return redirect(url_for("get_named_directories_root"))
    return render_template("ca_not_created.html", menu_options=wizard.get_available_options())