Skip to content

fix: auto-allow firewall port when creating website with non-standard port#12267

Open
jakub961241 wants to merge 1 commit into1Panel-dev:dev-v2from
jakub961241:fix/firewall-port-on-website-create-12233
Open

fix: auto-allow firewall port when creating website with non-standard port#12267
jakub961241 wants to merge 1 commit into1Panel-dev:dev-v2from
jakub961241:fix/firewall-port-on-website-create-12233

Conversation

@jakub961241
Copy link

Summary

Fixes #12233 - Creating a website with a non-standard port does not auto-allow the port in the firewall, but adding a domain with a non-standard port to an existing website does.

Root Cause

In agent/app/service/website.go line 305, getWebsiteDomains() returns addPorts as the second value, but it was being discarded with _:

// Before (line 305):
domains, _, _, err = getWebsiteDomains(...)

Meanwhile, website_domain.go:30-35 correctly captures and uses addPorts:

domainModels, addPorts, _, err = getWebsiteDomains(...)
go func() {
    _ = OperateFirewallPort(nil, addPorts)
}()

Fix

Capture addPorts and call OperateFirewallPort() in CreateWebsite, matching the existing pattern in CreateWebsiteDomain.

Changed file

  • agent/app/service/website.go (+7, -1)
fix: Automatically allow firewall access when creating websites with non-standard ports (#12233)

… port (1Panel-dev#12233)

When creating a new website with a non-standard port, the firewall was
not automatically updated. The getWebsiteDomains() return value for
addPorts was being discarded. This already worked correctly when adding
domains to an existing website (website_domain.go:35).

Now calls OperateFirewallPort() with the new ports, matching the
existing behavior in CreateWebsiteDomain.

Fixes 1Panel-dev#12233
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wanghe-fit2cloud for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Automatically allow firewall access when creating non-standard port sites

1 participant