target/karmabot

USE_VAULT will always default to False

Closed this issue · 1 comments

Hey,

In line 20 of the settings.py file, there is a reference an environment variable, and it will default to False if that file doesn't exist.

USE_VAULT = os.environ.get('USE_VALUT', "False").lower() in ['true', '1', 't', 'y', 'yes']

In this case, I'm guessing that USE_VALUT doesn't actually exist as an environment variable, since there are references to USE_VAULT as an environment variable in other parts of the same file. This will therefore always default to False, and there are actions later in the code that are dependent on this:

For example, this will never get set even if you modify the environment variable itself:

if USE_VAULT: vault = hvac.Client(url=os.environ.get('VAULT_URI'), token=os.environ.get('VAULT_TOKEN')) vault_base_path = os.environ.get('VAULT_BASE', "secret")

I'm not sure if or how often the vault implementation is used, but it's also referenced in the README:

To use Vault, set
USE_VAULT to True . Defaults to False.
VAULT_URI to the Vault URI to connect to. Defaults to None.
VAULT_TOKEN to the Vault authentication token. Defaults to None.
VAULT_BASE to the location in Vault where tokens can be found. Defaults to secrets
Store the tokens in the VALUT_BASE location with the name access_{workspace_id}.txt >where {workspace} is the workspace ID (case sensitive), using the kv1 method.

By the way, I really like your implementation of karma with badges and decay.
Thanks,
Devin

Good catch! We have an internal version of this code base, so just missed that one. The plan is to move to the opensource one soon.

Thanks for the help!