Update env to remove secrets and add secrets to redis

This commit is contained in:
Dustin Pianalto
2019-12-23 20:51:40 -09:00
parent 8664bac978
commit 5e691b8dcf
4 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -85,4 +85,4 @@ async def on_ready():
with open(f'{bot.config_dir}restart', 'w') as f:
f.write('0')
bot.run(os.environ['TOKEN'])
bot.run(bot.token)
+4 -2
View File
@@ -24,8 +24,10 @@ class Geeksbot(commands.Bot):
self.config_dir = 'geeksbot/config'
self.config_file = 'bot_config.json'
self.extension_dir = 'exts'
self.cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=1, charset="utf-8", decode_responses=True)
self.api_token = os.environ['API_TOKEN']
self.cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=os.environ['REDIS_DB'], charset="utf-8", decode_responses=True)
settings_cache = redis.Redis(host=os.environ['REDIS_HOST'], port=os.environ['REDIS_PORT'], db=1, charset="utf-8", decode_responses=True)
self.token = settings_cache.get('DISCORD_TOKEN')
self.api_token = settings_cache.get('API_TOKEN')
self.aio_session = aiohttp.ClientSession(loop=self.loop)
self.auth_header = {'Authorization': f'Token {self.api_token}'}
self.api_base = 'https://geeksbot.app/api'