mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-27 17:18:29 +00:00
check domain configuration before starting Invidious
This commit is contained in:
parent
df8839d1f0
commit
143d92af50
@ -319,6 +319,18 @@ class Config
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check if the domain configuration is valid
|
||||||
|
if (domain = config.domain).nil? || domain.empty?
|
||||||
|
puts "Config: 'domain' is required/can't be empty"
|
||||||
|
exit(1)
|
||||||
|
elsif parsed_domain = URI.parse(domain)
|
||||||
|
if !parsed_domain.scheme.nil?
|
||||||
|
puts "Config: 'domain' cannot contain a scheme (#{parsed_domain.scheme})"
|
||||||
|
puts "Config: (Hint) Set 'domain' to '#{parsed_domain.host}'"
|
||||||
|
exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return config
|
return config
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user