-
-
Notifications
You must be signed in to change notification settings - Fork 2k
check domain configuration before starting Invidious #5352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -319,6 +319,23 @@ | |||||
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" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
exit(1) | ||||||
elsif parsed_domain = URI.parse(domain) | ||||||
if domain != parsed_domain.domain | ||||||
puts "Config: 'domain' is invalid. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if parsed_domain.host.presence | ||||||
puts "Config: (Hint) Did you mean #{parsed_domain.host} ?" | ||||||
Check failure on line 331 in src/invidious/config.cr
|
||||||
else | ||||||
puts "Config: (Hint) 'domain' should look like this: invidious.example.com" | ||||||
end | ||||||
exit(1) | ||||||
end | ||||||
end | ||||||
|
||||||
return config | ||||||
end | ||||||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way you can use
String.presence
instead of a separate nil/empty check