SamEureka / balenaCodeServer

balenaCodeServer is a free Visual Studio Code based IDE that runs in your browser, served from your Raspberry Pi!
10 stars 5 forks source link

Hosting to port 80 #14

Open nanospearing opened 2 years ago

nanospearing commented 2 years ago

When ever I point it host off of port 80 it fails becuase it doesn’t have permission!

SamEureka commented 2 years ago

@KozmikNano, that is expected behavior. I believe that most operating systems protect access to tcp/udp ports 0-1024. Only 'root' can start sockets on those ports. In this case code-server creates a non-root user named 'abc' to run all services.

A possible solution would be to use iptables to redirect the traffic from 8080 to 80. Something like this might work: (I have not tested this, but it will get you started.)

RUN /sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080

added to code-server/Dockerfile.template

I'm not planning on adding this as a feature.

Good luck and thanks for checking out my repo. //SamEureka

Roundhead22 commented 2 years ago

where do i put that line of code to redirect it to port 80 and how do i do that (im new to linux and raspberry pi)

SamEureka commented 1 year ago

where do i put that line of code to redirect it to port 80 and how do i do that (im new to linux and raspberry pi)

@Roundhead22,

After downloading this repo to your computer, I would put it after this line.

Hope this helps! @SamEureka

SamEureka commented 5 months ago

Been thinking about this issue.

cap_add=NET_BIND_SERVICE maybe?

I'll do some testing.