Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fijxu
Copy link
Member

@Fijxu Fijxu commented Jun 15, 2025

Closes #5351

image

@Fijxu Fijxu requested a review from syeopite June 15, 2025 21:11
@@ -319,6 +319,18 @@ 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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

domain can be empty on local instances.

Comment on lines +327 to +329
if !parsed_domain.scheme.nil?
puts "Config: 'domain' cannot contain a scheme (#{parsed_domain.scheme})"
puts "Config: (Hint) Set 'domain' to '#{parsed_domain.host}'"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the scheme is an usual mistake, we should probably catch all other kinds of errors (trailing /, port number, etc)...

Suggested change
if !parsed_domain.scheme.nil?
puts "Config: 'domain' cannot contain a scheme (#{parsed_domain.scheme})"
puts "Config: (Hint) Set 'domain' to '#{parsed_domain.host}'"
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Detect and warn on common domain config misconfigurations
2 participants