Skip to content

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

# 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.

exit(1)
elsif parsed_domain = URI.parse(domain)
if domain != parsed_domain.domain
puts "Config: 'domain' is invalid.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
puts "Config: 'domain' is invalid.
puts "Config: 'domain' is invalid."

end

# Check if the domain configuration is valid
if (domain = config.domain).nil? || domain.empty?
Copy link
Member

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

Suggested change
if (domain = config.domain).nil? || domain.empty?
if !config.domain.presence

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