Skip to content

luci-app-dockerman: proper handling of hostIP in ports#8422

Open
icegood wants to merge 1 commit intoopenwrt:masterfrom
icegood:dockerman_host_fix
Open

luci-app-dockerman: proper handling of hostIP in ports#8422
icegood wants to merge 1 commit intoopenwrt:masterfrom
icegood:dockerman_host_fix

Conversation

@icegood
Copy link
Copy Markdown

@icegood icegood commented Mar 15, 2026

  1. Retain during containers copying
  2. Make it clickable against
    2.1 router host if ip is general
    2.2 against given host if specific

Fixes #7850

  • [x ] This PR is not from my main or master branch 💩, but a separate branch ✅
  • [ x] Each commit has a valid ✒️ Signed-off-by: <my@email.address> row (via git commit --signoff)
  • [ x] Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • [ x] Incremented 🆙 any PKG_VERSION in the Makefile
  • [ x] Tested on: (architecture, openwrt version, browser) ✅ x86_64
  • [ x] ( Preferred ) Mention: @ the original code author for feedback @systemcrash @feckert
  • [ x] ( Preferred ) Screenshot or mp4 of changes:
docker_hosts - [ x] \( Optional ) Closes: e.g. openwrt/luci#issue-number #7854 - [ ] \( Optional ) Depends on: e.g. openwrt/packages#pr-number in sister repo - [ ] Description: (describe the changes proposed in this PR)

@icegood icegood force-pushed the dockerman_host_fix branch from 9144271 to 00605a1 Compare March 28, 2026 09:40
1) Retain during containers copying
2) Make it clickable against
2.1 router host if ip is general
2.2 against given host if specific

Fixes openwrt#7850

Signed-off-by: Serhii Ivanov <icegood1980@gmail.com>
@icegood icegood force-pushed the dockerman_host_fix branch from 00605a1 to 40b87ae Compare March 28, 2026 09:42
@icegood icegood changed the title dockerman: proper handling of hostIP in ports luci-app-dockerman: proper handling of hostIP in ports Mar 28, 2026
@github-actions

This comment has been minimized.

if (Array.isArray(bindings)) {
for (const b of bindings) {
if (!b?.HostPort) continue;
const ip = (b.HostIp && b.HostIp !== '0.0.0.0') ? b.HostIp + ':' : '';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need an IPv6 check here also?

if (m) return [`${m[2]}/${m[3]}`, [{ HostPort: m[1] }]];
return null;
// formats: hostPort:cPort/proto or hostIp:hostPort:cPort/proto
const m = p.match(/^(?:([^:]+):(\d+)|(\d+)):(\d+)\/(tcp|udp)$/);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about two different matches - one for each type. This way it's easier to read the code.

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.

luci-app-dockerman: Exposed Ports(-p)

2 participants