mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Compare commits
8 Commits
b15b0651ba
...
5e8b3b6e12
Author | SHA1 | Date | |
---|---|---|---|
|
5e8b3b6e12 | ||
|
53e8a5d62d | ||
|
c3b06e7a6d | ||
|
d3e6d7b6c5 | ||
|
f5244055a2 | ||
|
af86cdbd38 | ||
|
b3637f20a9 | ||
|
c676272604 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -6,7 +6,7 @@ docker/ @unixfox
|
||||
kubernetes/ @unixfox
|
||||
|
||||
README.md @thefrenchghosty
|
||||
config/config.example.yml @thefrenchghosty @SamantazFox @unixfox
|
||||
config/config.example.yml @SamantazFox @unixfox
|
||||
|
||||
scripts/ @syeopite
|
||||
shards.lock @syeopite
|
||||
|
@ -82,6 +82,7 @@ class Config
|
||||
|
||||
# Used to tell Invidious it is behind a proxy, so links to resources should be https://
|
||||
property https_only : Bool?
|
||||
property login_only : Bool?
|
||||
# HMAC signing key for CSRF tokens and verifying pubsub subscriptions
|
||||
property hmac_key : String = ""
|
||||
# Domain to be used for links to resources on the site where an absolute URL is required
|
||||
|
@ -61,18 +61,6 @@ module Invidious::Routes::BeforeAll
|
||||
env.response.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains; preload"
|
||||
end
|
||||
|
||||
return if {
|
||||
"/sb/",
|
||||
"/vi/",
|
||||
"/s_p/",
|
||||
"/yts/",
|
||||
"/ggpht/",
|
||||
"/api/manifest/",
|
||||
"/videoplayback",
|
||||
"/latest_version",
|
||||
"/download",
|
||||
}.any? { |r| env.request.resource.starts_with? r }
|
||||
|
||||
if env.request.cookies.has_key? "SID"
|
||||
sid = env.request.cookies["SID"].value
|
||||
|
||||
@ -100,6 +88,24 @@ module Invidious::Routes::BeforeAll
|
||||
end
|
||||
end
|
||||
|
||||
unregistered_path_whitelist = {"/", "/login", "/licenses", "/privacy"}
|
||||
if CONFIG.login_only && !env.get?("user") && !unregistered_path_whitelist.includes?(env.request.path)
|
||||
env.response.headers["Location"] = "/login"
|
||||
haltf env, status_code: 302
|
||||
end
|
||||
|
||||
return if {
|
||||
"/sb/",
|
||||
"/vi/",
|
||||
"/s_p/",
|
||||
"/yts/",
|
||||
"/ggpht/",
|
||||
"/api/manifest/",
|
||||
"/videoplayback",
|
||||
"/latest_version",
|
||||
"/download",
|
||||
}.any? { |r| env.request.resource.starts_with? r }
|
||||
|
||||
dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s
|
||||
thin_mode = env.params.query["thin_mode"]? || preferences.thin_mode.to_s
|
||||
thin_mode = thin_mode == "true"
|
||||
|
Loading…
Reference in New Issue
Block a user