def METHOD_NAME():
    try:
        flowauth_fernet_key = environ["FLOWAUTH_FERNET_KEY"].encode()
        _ = Fernet(flowauth_fernet_key)  # Error if fernet key is bad
        log_level = getattr(
            logging, getenv("FLOWAUTH_LOG_LEVEL", "error").upper(), logging.ERROR
        )
        db_uri = getenv("DB_URI", os.getenv("DB_URI", "sqlite:////tmp/test.db"))
        db_uri = db_uri.format(getenv("FLOWAUTH_DB_PASSWORD", ""))
        return dict(
            PRIVATE_JWT_SIGNING_KEY=load_private_key(
                environ["PRIVATE_JWT_SIGNING_KEY"]
            ),
            LOG_LEVEL=log_level,
            ADMIN_USER=environ["FLOWAUTH_ADMIN_USERNAME"],
            ADMIN_PASSWORD=environ["FLOWAUTH_ADMIN_PASSWORD"],
            SQLALCHEMY_DATABASE_URI=db_uri,
            SQLALCHEMY_ENGINE_OPTIONS=dict(pool_recycle=3600),
            SECRET_KEY=environ["SECRET_KEY"],
            SESSION_PROTECTION="strong",
            SQLALCHEMY_TRACK_MODIFICATIONS=False,
            FLOWAUTH_FERNET_KEY=flowauth_fernet_key,
            DEMO_MODE=True if getenv("DEMO_MODE") is not None else False,
            RESET_DB=True if getenv("RESET_FLOWAUTH_DB") is not None else False,
            DB_IS_SET_UP=Event(),
            CACHE_BACKEND=get_cache_backend(),
            FLOWAUTH_TWO_FACTOR_ISSUER=getenv("FLOWAUTH_TWO_FACTOR_ISSUER", "FlowAuth"),
            TWO_FACTOR_VALID_WINDOW=int(getenv("TWO_FACTOR_VALID_WINDOW", 0)),
        )
    except KeyError as e:
        raise UndefinedConfigOption(
            f"Undefined configuration option: '{e.args[0]}'. Please set docker secret or environment variable."
        )