Open benfrancis opened 3 months ago
Have you considered simply doing the same raspbian does, ship a script as oneshot daemon in your snap, that configures iptables the same way as in raspian ? the firewall-control
interface should provid all access you need and you'd only need to ship the respective userspace tools (i.e. iptables itself) in your snap ... that way you'd not need to battle with extra patches and the configuration would stay where it is (and be manageable through the existing tools that are already in use for this).
The default ports for the gateway application to serve an HTTP server on (configured in config/default.js) are 8080 and 4443, but when the current Raspbian-based image is built IP tables are configured to forward port 80 to 8080 and port 43 to 443. This is so the gateway application doesn't need to run as root in order to bind to ports 80 and 443.
In the snap package a simple daemon runs as root anyway, so we could just directly bind to port 80 and 443, but the snap needs to be told to do this.
We could either do this by:
snap set
, and then set a different default using a gadget snap when generating a custom Ubuntu Core OS image