Add "Bind IP Address" to app "port" selection UIs

There is no way to bind an app’s port mapping to a specific IP address in Electric Eel beta.

If an IP Alias is added to an interface, then that IP Alias can be used when configuring port mapping in raw docker-compose.

eg:

ports:
      - 192.168.0.40:80:80

Will bind port 80 on the host’s 192.168.0.40 IP alias to port 80 in the container.

Of course, for the above to work, the TrueNAS UI must first be bound to a specific IP instead of 0.0.0.0

Similarly, docker will bind to 0.0.0.0 by default, which means if no specific IP is provided for binding then the default could just be “0.0.0.0”

TrueNAS already uses similar UI for the GUI and SMB services

8 Likes

Looking at the Nginx Proxy Manager app, the ask is to simply allow configuring the “host_ip” value of the ports: section

    ports:
      - {"host_ip": "0.0.0.0", "mode": "ingress", "protocol": "tcp", "published": 30021, "target": 80}
      - {"host_ip": "0.0.0.0", "mode": "ingress", "protocol": "tcp", "published": 30020, "target": 81}
      - {"host_ip": "0.0.0.0", "mode": "ingress", "protocol": "tcp", "published": 30022, "target": 443}

Well, it works. Pity if you update the app or change a setting it will zap it :wink:

1 Like

I was able to do this on a custom app in Eel. The port definition with IP shouldn’t go away for those. Not ideal to have to use a custom app, but another workaround.

This IP address biinding can be fixed in the catalog infrastructure… after all the Apps are ported and migration enabled.

It should be a good Xmas present.

3 Likes

It would be super awesome to get an early present for just the Nginx Proxy Manager app as that would at least allow setting up a reverse proxy for all the other apps :wink:

(And then I’d make a video…)

5 Likes

Rule 34 of the TrueNAS forum: For every issue, there is a Stux video to solve it.

6 Likes

Then I guess this request can be closed as accepted to release the votes :wink:

4 Likes

Thanks for this!
I managed to get NPM working on an alias IP listening on ports 80 and 443 as mentioned using a custom YAML.

However something weird is happening to the TrueNAS GUI:

  • the GUI is available on the IP address it is bound to in the settings
  • the GUI is not available hostname.local nor on the domain I configured in my local DNS

Any thoughts how to tackle this?

i was following stux guide on using truenas native docker

i got a test dockge. but my issue was how to set a static ip different from truenas ip?

With jailmaker, you can set the docker to use at least 1 specific static ip that is separate from truenas.

And if you go to truenas general settings > web interface ipv4, you can also set the truenas ip here. Doing this then prevents port conflicts if you plan to use a proxy like nginx proxy manager for your dockers.

also for jailmaker i set it up using bridge as such (for jailmaker you also have to modify the jailmaker config to specify bridge, and also 1 network file in the jailmaker jail folder for network for the static ip used by the jail)

but for native truenas docker, i’m not sure how to proceed.

besides solving the proxy issue, some other apps also have conflicting ports, example unifi and tplink omada both want to use the same port. so you’d have to put them on different ips, or somehow setup a macvlan to get around that.

i know how to setup macvlan with portainer.

but i’m using dockge these days, so i don’t know how to setup another way for that.

tried using this but couldnt get it to work

kinda stuck atm. this is why i’m using jailmaker cauz i have a partial solution for this :cry:

that would be great :saluting_face: i’ll wait for that and try then ty.

IMG_2427

32 votes to release…

2 Likes