Skip to content

Cleanup node fqdn/ip validation#2307

Merged
Boy132 merged 1 commit intomainfrom
boy132/allow-node-ip-with-ssl
May 4, 2026
Merged

Cleanup node fqdn/ip validation#2307
Boy132 merged 1 commit intomainfrom
boy132/allow-node-ip-with-ssl

Conversation

@Boy132
Copy link
Copy Markdown
Member

@Boy132 Boy132 commented Apr 28, 2026

Closes #2285

Domain name:
grafik

IP address:
grafik

@Boy132 Boy132 self-assigned this Apr 28, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

The changes fix overly strict FQDN validation that incorrectly rejected IP addresses when the panel is served over HTTPS. The validation logic is replaced with state-dependent checks that consider both the FQDN input and resolved IP address. UI feedback is improved with clearer SSL and DNS-related hints. Form structure is reorganized to remove the explicit dns toggle and reposition fields.

Changes

Cohort / File(s) Summary
FQDN Validation & Form Structure
app/Filament/Admin/Resources/Nodes/Pages/CreateNode.php, app/Filament/Admin/Resources/Nodes/Pages/EditNode.php
Reworked fqdn field validation to allow IPs even when panel is secure, replacing blanket prohibition with state-dependent logic that checks both fqdn and derived ip. Updated hintColor and hint to provide context-aware SSL/DNS feedback. Removed explicit ip input field and dns toggle, replacing with hidden non-saved ip field. Relocated daemon_listen earlier in schema. Simplified connection field layout and helper text logic.
Translation Strings
lang/en/admin/node.php
Replaced legacy SSL/DNS error messages with new keys recommending domain usage for easier TLS management and introducing DNS failure messaging. Updated "valid/invalid" labels to be explicitly DNS-related ("Valid DNS", "Invalid DNS"). Reformatted panel_on_ssl help text by removing HTML line break.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: cleanup and reworking of node FQDN and IP validation logic across multiple files.
Description check ✅ Passed The description references issue #2285 and includes visual demonstrations of the expected form behavior for both domain names and IP addresses.
Linked Issues check ✅ Passed The PR successfully addresses issue #2285 by removing the blocking validation that prevented IP addresses when using SSL, instead showing only a non-error hint recommending domain names.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the FQDN/IP validation issue: form field refactoring, validation logic updates, and related UI/language adjustments are all necessary to resolve #2285.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
app/Filament/Admin/Resources/Nodes/Pages/EditNode.php (1)

134-286: Extract the shared node-connection schema.

This block now matches CreateNode::getDefaultSteps() almost line-for-line. The DNS hints, validation, and port defaults will drift the next time one side changes. Pulling the common field definitions into a shared builder/trait would keep create/edit behavior aligned.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/Filament/Admin/Resources/Nodes/Pages/EditNode.php` around lines 134 -
286, The EditNode page duplicates the node-connection form block from
CreateNode::getDefaultSteps(), causing drift; extract the shared field
definitions (e.g., the TextInput::make('fqdn') block, Hidden::make('ip'),
TextInput::make('daemon_connect'), TextInput::make('daemon_listen'),
TextInput::make('name'), ToggleButtons::make('connection'),
Hidden::make('scheme'), Hidden::make('behind_proxy')) into a single reusable
builder or trait (e.g., NodeConnectionFields::getFields() or a
NodeFormTrait::connectionFields()) and have both EditNode and CreateNode call
that method to return the Field/Component array; ensure the extracted method
preserves the live/debounce/rules/prohibited/hint/afterStateUpdated logic and
default values so behavior remains identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/Filament/Admin/Resources/Nodes/Pages/CreateNode.php`:
- Around line 81-96: The prohibited() rule on the hostname field currently
blocks saves when the hidden ip state is empty, which rejects valid hostnames if
DNS hasn't resolved yet; change this by removing or disabling the prohibited()
save-block and instead surface DNS resolution failures only as a non-blocking
warning in the UI. Concretely, remove the anonymous prohibited(...) validator
tied to trans('admin/node.dns_error') on the hostname field (the mirror exists
in EditNode.php), and keep the afterStateUpdated() flow that calls
get_ip_from_hostname() to populate the ip state but do not make ip required for
persistence; if desired, show trans('admin/node.dns_error') via a
validationMessage or helper text/error banner rather than a prohibition so users
are informed but can still save.

---

Nitpick comments:
In `@app/Filament/Admin/Resources/Nodes/Pages/EditNode.php`:
- Around line 134-286: The EditNode page duplicates the node-connection form
block from CreateNode::getDefaultSteps(), causing drift; extract the shared
field definitions (e.g., the TextInput::make('fqdn') block, Hidden::make('ip'),
TextInput::make('daemon_connect'), TextInput::make('daemon_listen'),
TextInput::make('name'), ToggleButtons::make('connection'),
Hidden::make('scheme'), Hidden::make('behind_proxy')) into a single reusable
builder or trait (e.g., NodeConnectionFields::getFields() or a
NodeFormTrait::connectionFields()) and have both EditNode and CreateNode call
that method to return the Field/Component array; ensure the extracted method
preserves the live/debounce/rules/prohibited/hint/afterStateUpdated logic and
default values so behavior remains identical.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 104032c2-253f-447b-9734-2de1782cc825

📥 Commits

Reviewing files that changed from the base of the PR and between 4fdbbff and 0d62344.

📒 Files selected for processing (3)
  • app/Filament/Admin/Resources/Nodes/Pages/CreateNode.php
  • app/Filament/Admin/Resources/Nodes/Pages/EditNode.php
  • lang/en/admin/node.php

Comment thread app/Filament/Admin/Resources/Nodes/Pages/CreateNode.php
@Boy132 Boy132 merged commit 2a64ea8 into main May 4, 2026
17 checks passed
@Boy132 Boy132 deleted the boy132/allow-node-ip-with-ssl branch May 4, 2026 07:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node FQDN validation incorrectly prevents IP addresses when Panel is served over HTTPS

2 participants