kopia lustrzana https://github.com/iv-org/invidious
Merge a3363fa9bc
into 325e013e0d
commit
3e568eb74c
|
@ -332,6 +332,23 @@ 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 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
|
return config
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Ładowanie…
Reference in New Issue