From 87d520bb02751c7988c18b056d313cf5cf2da34e Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 21 Jul 2018 22:35:28 -0500 Subject: [PATCH] Add option to set HMAC key --- src/invidious.cr | 2 +- src/invidious/helpers.cr | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 566686c2b..f046b750b 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -25,7 +25,7 @@ require "yaml" require "./invidious/*" CONFIG = Config.from_yaml(File.read("config/config.yml")) -HMAC_KEY = Random::Secure.random_bytes(32) +HMAC_KEY = CONFIG.hmac_key || Random::Secure.random_bytes(32) crawl_threads = CONFIG.crawl_threads channel_threads = CONFIG.channel_threads diff --git a/src/invidious/helpers.cr b/src/invidious/helpers.cr index ef56da1a7..3388c0232 100644 --- a/src/invidious/helpers.cr +++ b/src/invidious/helpers.cr @@ -43,6 +43,7 @@ class Config ), dl_api_key: String?, https_only: Bool?, + hmac_key: String?, }) end