Beispiel #1
0
def cato_decrypt(encrypted):
    if encrypted:
        return catocryptpy.decrypt_string(encrypted, catoconfig.CONFIG["key"])
    else:
        return encrypted
Beispiel #2
0
def cato_decrypt(encrypted):
    if encrypted:
        return catocryptpy.decrypt_string(encrypted, config["key"])
    else:
        return encrypted
Beispiel #3
0
            elif key == "extensions":
                # extensions require a little parsing, and path environment variable expansion
                pairs = value.split(";")
                for p in pairs:
                    if ":" in p:
                        n, v = p.split(":")
                        if n and v:
                            cfg["extensions"][n.strip()] = os.path.expandvars(v.strip())
            elif key == "features":
                # features are a comma delimited string in the conf file, make a list
                features = value.split(",")
                cfg["features"] = [f.strip() for f in features]
            else:
                cfg[key] = value

    un_key = catocryptpy.decrypt_string(enc_key, "")
    cfg["key"] = un_key
    un_pass = catocryptpy.decrypt_string(enc_pass, un_key)
    cfg["password"] = un_pass
    un_mongo_pass = catocryptpy.decrypt_string(enc_mongo_pass, un_key) if enc_mongo_pass else ""
    cfg["mongodb.password"] = un_mongo_pass

    # these aren't direct settings, rather derived from other settings
    cfg["admin_ui_protocol"] = "https" if cfg["admin_ui_use_ssl"] == "true" else "http"
    cfg["user_ui_protocol"] = "https" if cfg["user_ui_use_ssl"] == "true" else "http"
    cfg["cd_ui_protocol"] = "https" if cfg["cd_ui_use_ssl"] == "true" else "http"
    cfg["rest_api_protocol"] = "https" if cfg["rest_api_use_ssl"] == "true" else "http"
    cfg["dash_api_protocol"] = "https" if cfg["dash_api_use_ssl"] == "true" else "http"
    cfg["newsfeed_api_protocol"] = "https" if cfg["newsfeed_api_use_ssl"] == "true" else "http"
    cfg["csk_ui_protocol"] = "https" if cfg["csk_ui_use_ssl"] == "true" else "http"
Beispiel #4
0
            else:
                value = ""

            if key == "key":
                if not value:
                    raise Exception(
                        "ERROR: cato.conf 'key' setting is required.")
                enc_key = value
            elif key == "password":
                if not value:
                    raise Exception(
                        "ERROR: cato.conf 'password' setting is required.")
                enc_pass = value
            else:
                key_vals[key] = value
    un_key = catocryptpy.decrypt_string(enc_key, "")
    key_vals["key"] = un_key
    un_pass = catocryptpy.decrypt_string(enc_pass, un_key)
    key_vals["password"] = un_pass

    # something else here...
    # the root cato directory should have a VERSION file.
    # read it's value into a config setting
    verfilename = os.path.join(base_path, "VERSION")
    if os.path.isfile(verfilename):
        with open(verfilename, "r") as version_file:
            ver = version_file.read()
            key_vals["version"] = ver
    else:
        print "Info: VERSION file does not exist."
Beispiel #5
0
            if len(row) > 1:
                value = row[1]
            else:
                value = ""

            if key == "key":
                if not value:
                    raise Exception("ERROR: cato.conf 'key' setting is required.")
                enc_key = value
            elif key == "password":
                if not value:
                    raise Exception("ERROR: cato.conf 'password' setting is required.")
                enc_pass = value
            else:
                key_vals[key] = value
    un_key = catocryptpy.decrypt_string(enc_key,"")
    key_vals["key"] = un_key
    un_pass = catocryptpy.decrypt_string(enc_pass,un_key)
    key_vals["password"] = un_pass
    
    # something else here... 
    # the root cato directory should have a VERSION file.
    # read it's value into a config setting
    verfilename = os.path.join(base_path, "VERSION")
    if os.path.isfile(verfilename):
        with open(verfilename, "r") as version_file:
            ver = version_file.read()
            key_vals["version"] = ver
    else:
        print "Info: VERSION file does not exist."