-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 2 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" | ||||||
|
||||||
| exit(1) | ||||||
| elsif parsed_domain = URI.parse(domain) | ||||||
| if domain != parsed_domain.domain | ||||||
| puts "Config: 'domain' is invalid. | ||||||
|
||||||
| puts "Config: 'domain' is invalid. | |
| puts "Config: 'domain' is invalid." |
Check failure on line 331 in src/invidious/config.cr
GitHub Actions / build - crystal: 1.13.3, stable: true
unexpected token: "Config"
Check failure on line 331 in src/invidious/config.cr
GitHub Actions / build - crystal: 1.12.2, stable: true
unexpected token: "Config"
Check failure on line 331 in src/invidious/config.cr
GitHub Actions / build - crystal: 1.15.1, stable: true
unexpected token: "Config"
Check failure on line 331 in src/invidious/config.cr
GitHub Actions / build - crystal: 1.14.1, stable: true
unexpected token: "Config"
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.presenceinstead of a separate nil/empty check