import os

def read_vars():
    if os.environ.get("SYNAPSE_REVITALIZATION_AUTH_TOKEN_TERM") == None:
        auth_token_term = 180
    else:
        auth_token_term = os.environ["SYNAPSE_REVITALIZATION_AUTH_TOKEN_TERM"]

    admin_auth_token_file = os.environ["SYNAPSE_REVITALIZATION_ADMIN_AUTH_TOKEN_FILE"]

    with open(admin_auth_token_file, "r") as file:
        admin_auth_token = file.read().split("\n")[0]

    return {
        "auth_token_term": auth_token_term,
        "admin_auth_token": admin_auth_token,
        "server_key_file": os.environ["SYNAPSE_REVITALIZATION_SERVER_KEY_FILE"],
        "origin_server_name": os.environ["SYNAPSE_REVITALIZATION_SERVER_NAME"],
        "origin_server": os.environ["SYNAPSE_REVITALIZATION_SERVER_ADDRESS"],
    }
