Coder Social home page Coder Social logo

0.0.0.0 or localhost about e2core HOT 7 CLOSED

suborbital avatar suborbital commented on June 19, 2024
0.0.0.0 or localhost

from e2core.

Comments (7)

cohix avatar cohix commented on June 19, 2024 1

@k33g hmm interesting.

I think we need to add an ATMO_BIND_ADDRESS option separate from the port settings to solve this properly. Is that something you'd be interested in taking on?

If not, no worries :)

from e2core.

cohix avatar cohix commented on June 19, 2024 1

@flaki I believe you're correct! Good eye. I think setting the ATMO_HTTP_PORT=8080 environment variable and then specifying 8080 in the fly.toml is the likely solution here. @k33g could you give that a try and let us know how it goes?

from e2core.

cohix avatar cohix commented on June 19, 2024

Good question, it binds to :443 which is probably localhost? You can try setting ATMO_TLS_PORT=0.0.0.0:443 and ATMO_HTTP_PORT=0.0.0.0:80 to see if that works

from e2core.

k33g avatar k33g commented on June 19, 2024

It fails: Error: failed to server.Start: listen tcp :443: bind: permission denied

But I get this one too: (E) domain and HTTP port options are both unset, server will start up but fail to acquire a certificate. reconfigure and restart

I guess thatATMO_DOMAIN is "deactivated" when I use ATMO_TLS_PORT and ATMO_HTTP_PORT

I will do (soon) other tests on other hosting providers and check if I get the same problem

from e2core.

flaki avatar flaki commented on June 19, 2024

Good question, it binds to :443 which is probably localhost?

So I briefly looked into this, and according to the Go documentation, the behavior of Listen the underlying function used by Vektor's listenAndServe() call is:

For TCP networks, if the host in the address parameter is empty or a literal unspecified IP address, Listen listens on all available unicast and anycast IP addresses of the local system.

I believe this is exactly what the Fly.io host accepts (and the "literal unspecified IP address" I think actually refers to 0.0.0.0).
Rather, I believe the issue here seems to be simply that the application on Fly.io's setup is not expected to bind to privileged ports (<1024):

It fails: Error: failed to server.Start: listen tcp :443: bind: permission denied

What seems to be the case is that Fly.io expects an "internal port" to be configured in the fly.toml (a high port, or unprivileged port, a port number between 1024 - 65535) and will manage its own HTTPS-termination, that is, reaching the service on HTTP and HTTPS is possible without having to run Vektor in TLS mode.

from e2core.

k33g avatar k33g commented on June 19, 2024

@flaki @cohix 👍 well down, thanks, it work

tag="0.0.1"
app_name="helloatmo99"

flyctl apps create ${app_name} --json
FLY_APP_NAME="${app_name}" envsubst < ./fly.template.toml > ./fly.toml

flyctl deploy \
  --image registry.gitlab.com/k33g_org/discovering-atmo/deploy-atmo-services-on-fly.io:${tag} \
  --env ATMO_HTTP_PORT=8080 \
  --verbose --json

from e2core.

cohix avatar cohix commented on June 19, 2024

Amazing! I’ll close this.

from e2core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.