Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Snap] Provide option to run on ports 80/443 #3154

Open
benfrancis opened this issue Aug 21, 2024 · 1 comment
Open

[Snap] Provide option to run on ports 80/443 #3154

benfrancis opened this issue Aug 21, 2024 · 1 comment
Labels
snap Issues relating to the snap package task
Milestone

Comments

@benfrancis
Copy link
Member

benfrancis commented Aug 21, 2024

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:

  • Changing the default ports when building the snap package, so it takes effect for everyone who installs the snap
  • Implement a snap configuration so that a user can set the ports using snap set, and then set a different default using a gadget snap when generating a custom Ubuntu Core OS image
@benfrancis benfrancis added task snap Issues relating to the snap package labels Aug 21, 2024
@benfrancis benfrancis added this to the 2.0 milestone Aug 21, 2024
@ogra1
Copy link
Contributor

ogra1 commented Oct 23, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snap Issues relating to the snap package task
Projects
Status: Sprint Backlog
Development

No branches or pull requests

2 participants