summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
authorPerflyst <mail@perflyst.de>2021-03-02 18:41:10 +0100
committerGitHub <noreply@github.com>2021-03-02 18:41:10 +0100
commitfc8c555519e5abdf06bbaf94bdf79d068050fb21 (patch)
tree45fa07ef45500a3ef9db062591bf29062db029d2 /src/invidious.cr
parent44f30c0e056a7d9b57c4093f06f6f0a7ad8def05 (diff)
parent79e99908def94a44c22af649c12ab0387151e7e9 (diff)
downloadinvidious-fc8c555519e5abdf06bbaf94bdf79d068050fb21.tar.gz
invidious-fc8c555519e5abdf06bbaf94bdf79d068050fb21.tar.bz2
invidious-fc8c555519e5abdf06bbaf94bdf79d068050fb21.zip
Merge pull request #1729 from Rjevski/12factor-database-url-restored
Support "Database URL" in addition to existing DB-related parameters
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 07a445b0..cb2bb5fe 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -33,16 +33,7 @@ require "./invidious/jobs/**"
CONFIG = Config.load
HMAC_KEY = CONFIG.hmac_key || Random::Secure.hex(32)
-PG_URL = URI.new(
- scheme: "postgres",
- user: CONFIG.db.user,
- password: CONFIG.db.password,
- host: CONFIG.db.host,
- port: CONFIG.db.port,
- path: CONFIG.db.dbname,
-)
-
-PG_DB = DB.open PG_URL
+PG_DB = DB.open CONFIG.database_url
ARCHIVE_URL = URI.parse("https://archive.org")
LOGIN_URL = URI.parse("https://accounts.google.com")
PUBSUB_URL = URI.parse("https://pubsubhubbub.appspot.com")
@@ -195,7 +186,7 @@ if CONFIG.captcha_key
end
connection_channel = Channel({Bool, Channel(PQ::Notification)}).new(32)
-Invidious::Jobs.register Invidious::Jobs::NotificationJob.new(connection_channel, PG_URL)
+Invidious::Jobs.register Invidious::Jobs::NotificationJob.new(connection_channel, CONFIG.database_url)
Invidious::Jobs.start_all