Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/invidious/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,25 @@ class Config
end
end

# Check if the domain configuration is valid
if (domain = config.domain)
if parsed_domain = URI.parse(domain)
if port = parsed_domain.path.to_i?
puts "Config (Hint): Remove the port from your domain: ':#{port}'"
exit(1)
end
if (path_items = parsed_domain.path.split("/")).size > 1
path = path_items[1..].join("/")
puts "Config (Hint): Remove the path from your domain: '/#{path}'"
exit(1)
end
if scheme = parsed_domain.scheme.presence
puts "Config (Hint): Remove the scheme from your domain: '#{scheme}://'"
exit(1)
end
end
end

return config
end
end
Loading