Skip to content

docs: Document Trusted Hosts validation and input formats#699

Merged
adiati98 merged 20 commits into
mautic:7.1from
Promptless:promptless/trusted-hosts-validation
Apr 23, 2026
Merged

docs: Document Trusted Hosts validation and input formats#699
adiati98 merged 20 commits into
mautic:7.1from
Promptless:promptless/trusted-hosts-validation

Conversation

@promptless-for-oss
Copy link
Copy Markdown

Open this suggestion in Promptless to view citations and reasoning process

Documents the Trusted Hosts configuration field validation behavior added in PR #16006.

Changes

docs/configuration/settings.rst

  • Updated Trusted Hosts documentation: Clarifies that this field accepts both plain domain names (e.g., mautic.yourdomain.com) and regex patterns for advanced matching
  • Validation behavior: Documents that Mautic validates input on save and displays an error for invalid domains or regex patterns
  • Caution warning: Warns users about lockout risk if invalid values are entered
  • Fixed duplicate entries: Removed incorrectly duplicated content that appeared in both CORS and Miscellaneous settings sections

Context

PR #16006 fixes issue #15743 by adding validation to the Trusted Hosts field. The validation accepts valid domain names or valid regex patterns, and prevents users from saving invalid values that could lock them out of Mautic.


Tip: Set up a GitHub Issues trigger in Projects to enable @Promptless mentions in issues 🐙

promptless Bot added 15 commits March 31, 2026 23:11
Expand documentation for the Trusted Hosts configuration setting to:
- Explain that regex patterns are required, not plain hostnames
- Provide correct and incorrect examples
- Document the new validation behavior that prevents invalid patterns
- Add a caution warning about lockout risk

Related to mautic/mautic PR #16006.
The previous documentation incorrectly stated that Trusted Hosts requires
regex patterns only. The merged PR #16006 actually accepts both:
- Plain domain names (e.g., mautic.yourdomain.com)
- Regex patterns for advanced matching (e.g., .*\.?trusted.com$)

Also removes duplicate entries that were incorrectly placed in both CORS
settings and Miscellaneous settings sections.
@promptless-for-oss promptless-for-oss requested a review from a team as a code owner April 22, 2026 09:39
@promptless-for-oss promptless-for-oss requested review from adiati98 and removed request for a team April 22, 2026 09:39
Comment thread docs/configuration/settings.rst
Comment thread docs/configuration/settings.rst Outdated
Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

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

@promptless-for-oss please address the suggestions.

Comment thread docs/configuration/settings.rst Outdated
Comment thread docs/configuration/settings.rst Outdated
@adiati98 adiati98 requested a review from a team April 22, 2026 09:48
Apply reviewer suggestions to remove "will" and use more direct
active voice in the Trusted Hosts validation documentation.
@promptless-for-oss
Copy link
Copy Markdown
Author

I've addressed the review feedback:

  1. Validation behavior text - Updated to use active voice: "Mautic validates your input during the save process. Invalid domain names or regex patterns trigger an error message."

  2. Caution warning - Reworded to remove "will": "Incorrect settings can prevent access to your Mautic instance. Getting locked out requires manually editing the database or configuration file to fix the setting."

Both changes remove "will" and use more direct, active phrasing as requested.

escopecz
escopecz previously approved these changes Apr 22, 2026
Copy link
Copy Markdown
Member

@escopecz escopecz left a comment

Choose a reason for hiding this comment

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

Reads good 👍

@promptless-for-oss
Copy link
Copy Markdown
Author

Thanks for the review! Ready for merge when you are.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

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

@promptless-for-oss please address the suggestions.

Comment thread docs/configuration/settings.rst Outdated
Comment thread docs/configuration/settings.rst Outdated
Comment thread docs/configuration/settings.rst Outdated
- Use 'regular expression' instead of 'regex' per Vale style guide
- Fix caution admonition indentation to 3 spaces
@promptless-for-oss
Copy link
Copy Markdown
Author

I've addressed the review feedback:

  1. Vale warning fixed: Changed "regex" to "regular expression" per the style guide
  2. Caution admonition formatting: Fixed the content indentation to 3 spaces relative to the directive

The changes have been pushed to this branch. Ready for another review when you have a moment.

Change "where your Mautic is installed" to "where you installed Mautic"
per reviewer request.
@promptless-for-oss
Copy link
Copy Markdown
Author

I've applied the active voice change:

  • Changed "where your Mautic is installed" → "where you installed Mautic"

Ready for review.

Comment thread docs/configuration/settings.rst Outdated
Changed domain examples in Trusted hosts documentation for consistency:
- mautic.yourdomain.com → mautic.example.com
- trusted.com → example.com in regular expression examples
@promptless-for-oss
Copy link
Copy Markdown
Author

I've applied your feedback for URL example consistency:

  • Changed mautic.yourdomain.commautic.example.com
  • Changed .*\.?trusted.com$.*\.?example.com$ (in both the input and Mautic-enclosed form)

This aligns with the example.com domain used elsewhere in the documentation.

Ready for review.

Comment thread docs/configuration/settings.rst Outdated
Avoids word repetition since example.com is already used in the text.
@promptless-for-oss
Copy link
Copy Markdown
Author

I've applied your feedback to avoid word repetition:

  • Changed "For example" → "For instance"

This avoids repeating "example" since example.com is used in the domain.

Ready for review.

Copy link
Copy Markdown
Contributor

@adiati98 adiati98 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@adiati98 adiati98 merged commit b47517d into mautic:7.1 Apr 23, 2026
3 checks passed
@promptless-for-oss promptless-for-oss deleted the promptless/trusted-hosts-validation branch April 23, 2026 18:32
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.

3 participants