mirror of
https://github.com/therootcompany/greenlock-express.js.git
synced 2025-02-23 13:18:04 +00:00
[doc] clarify usage of non-standard ports #8
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi AJ,
I am looking at the changes to Greenlock Express. I have an https server also using web sockets. From examples, I understand that the preferred method is to use glx.serveApp to start the servers. Now I am wondering how to then pass the https server to websockets. The websockets examples calls glx.httpsServer() instead but doing that would try to start another server. I am wondering if it would not be better to return [secureServer, plainServer] in the resolve() call below:
so that server variables can then be used for other tasks (like websockets or a clean shutdown for instance). What do you think?
Follow-up question: Are you planning to make plainPort/securePort configurable?
I guess if not, then I should probably write my own serveApp function.
Nevermind, I see the servers are available as glx.httpsServer() and glx.httpServer(). My question about plainPort/securePort still stands though.
If you are using http-01 challenges either you MUST use port 80 or you must have a proxy sending traffic to you on the other port.
Likewise, if you are using tls-alpn-01 challenges you MUST use port 443.
If you use dns-01 challenges, then validation is done out of band.
What if I'm on a docker machine and using port remapping?
That would count as a proxy.
But why bother? Why not just run it on the standard ports even in Docker?
Not sure there is a reason for it but I do.
Did you get it sorted out?
I would appreciate being able to specify the ports. I am waiting for the new cloudflare dns-01 plugin to test things out with v3.
You can specify the ports. I thought you said you found it in the example:
(and then you don't call
serveApp(myApp)
)See https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/examples/https/server.js#L24
Oh yes sure. I meant I would prefer to be able to use serveApp and specify the ports. Otherwise I will just replicate part of serveApp locally, so it's not a huge issue if you prefer not to add the port configuration functionality.
There's nothing to replicate. serverApp just calls
glx.httpServer(redirector)
and thenglx.httpsServer(null, myApp)
.See https://git.rootprojects.org/root/greenlock-express.js/src/branch/master/servers.js#L79
Well, I suppose there is
require("redirect-https")()
. But I could just make that the default when called with no other argument. In fact, I will....37c3aee
Done.I see what you're saying. I can just still start the servers the same way I use to. I guess I was just trying to avoid replicating code that you already provide.
Oh, you mean the 4 lines?
I thought about having the option for passing port numbers, but all that ever happens is that people don't understand what they're doing and they get it wrong and open an issue, so I figured it's better to just have a "raw https server example" with a comment that says "you must use ports 80 and 443" rather than giving people too many "advanced" options that are just going to confuse them.
The biggest documentation challenge I'm facing right now is how to help people utilize the
store
callbacks so that they aren't duplicating work, and themanage
callbacks so that they aren't creating security holes for various rate limit DoS attacks.A lot of people have code to get certificates and then upload them elsewhere... which is the whole purpose of the
certificate.setKeypair
andcertificate.set
callbacks.Haha yeah. Understood. I have not looked into that part yet and was actually looking for documentation on the init config (which I saw somewhere but cannot seem to find anymore).
Most of the core docs are in the Greenlock repo under "JavaScript API":
https://git.rootprojects.org/root/greenlock.js
The use of the
<details>
element is a double-edged sword. It makes it easy to organize, but difficult to search.Seeing this under acme-dns-01-digitalocean documentation:
but then this under GreenLock-Express:
makes things a bit confusing. Which one am I supposed to use? create or init/serve?
That's the Greenlock v2 documentation. It'll take me a while to update everything. If you could PR to update it, that would be nice.
I'm going to be spending time today to go update them... but there are a dozen.
If you'd like to help, just pick one:
https://git.coolaj86.com/coolaj86/acme-http-01-test.js/issues/1
serveApp secureServer/plainServer variables are inaccessibleto [doc] clarify usage of non-standard ports