summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-07-21 22:35:28 -0500
committerOmar Roth <omarroth@hotmail.com>2018-07-21 22:35:28 -0500
commit87d520bb02751c7988c18b056d313cf5cf2da34e (patch)
treeb9603222a1f8f7c03350622147fc92f6fb7a8358 /src
parente49dadbb65797a59e983bbee16886e6084e852de (diff)
downloadinvidious-87d520bb02751c7988c18b056d313cf5cf2da34e.tar.gz
invidious-87d520bb02751c7988c18b056d313cf5cf2da34e.tar.bz2
invidious-87d520bb02751c7988c18b056d313cf5cf2da34e.zip
Add option to set HMAC key
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr2
-rw-r--r--src/invidious/helpers.cr1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 566686c2..f046b750 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 ef56da1a..3388c023 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