mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-20 17:26:29 -05:00
Merge a3363fa9bcdda227e78bef4af4c4789818047484 into 325e013e0d9e5670fa0df7635ff30a0ee029e05e
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…
x
Reference in New Issue
Block a user