mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Merge pull request #1729 from Rjevski/12factor-database-url-restored
Support "Database URL" in addition to existing DB-related parameters
This commit is contained in:
commit
fc8c555519
4 changed files with 43 additions and 16 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue