linuxserver / docker-unifi-network-application

GNU General Public License v3.0
721 stars 54 forks source link

[FEAT] Override HTTP/HTTPS ports #88

Closed haavar closed 5 months ago

haavar commented 6 months ago

Is this a new feature request?

Wanted change

Ability to override the HTTP (8080) and HTTPS (8443) ports by setting environment variables. Defaults should be provided, if the variables are not set.

Reason for change

Being able to change the ports would be beneficial to resolve port conflicts when running on a host with other docker containers.

Personally I ended up setting it up with macvlan networking, because of the number of ports needed by the controller and I got a couple of conflicts. When using macvlan, I'm not able to map ports like you normally would doing host networking. That means there is no option for me to map HTTPS to port 443.

Even if you did use a docker network driver that allowed for port mapping, it does not seem like you can remap port 8080 without breaking adoption. The controller allows you to override the "inform host", but only the hostname or IP and not the port. I'm assuming if the controller is configured with a different http[s] port, and not remapped, the "inform host" port would also be updated and adoption would work.

Proposed code change

No response

github-actions[bot] commented 6 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

pjdubya commented 5 months ago

I found that I needed to set up macvlan anyway because of a conflict with a different port (one of the discovery ports) and I didn't see an easy way to update the actual application and devices to use a new port for that anyway. While macvlan was a headache to get set up and could use a guide here, after I've gotten it working it's been great. I then use a reverse proxy on the actual host to point to the IP:PORT of the network app so that I have https service with the host's cert.

drizuid commented 5 months ago

this is covered in the unifi documentation and is fully possibly. We will NOT provide support for doing it via envvars though, do it the normal way, adapt your compose/run accordingly, and note that from that point, support would come from ubiquiti (lol) not us.