mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-15 00:08:30 +00:00
Merge a3363fa9bc
into 325e013e0d
This commit is contained in:
commit
3e568eb74c
@ -332,6 +332,23 @@ class Config
|
||||
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 domain != parsed_domain.domain
|
||||
puts "Config: 'domain' is invalid.
|
||||
|
||||
if parsed_domain.host.presence
|
||||
puts "Config: (Hint) Did you mean #{parsed_domain.host} ?"
|
||||
else
|
||||
puts "Config: (Hint) 'domain' should look like this: invidious.example.com"
|
||||
end
|
||||
exit(1)
|
||||
end
|
||||
end
|
||||
|
||||
return config
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user