fedwiki / wiki-server

Federated Wiki client and server in Node.js
Other
153 stars 35 forks source link

Set argv.url even if port is 80 #165

Closed alltom closed 2 years ago

alltom commented 2 years ago

The previous version set argv.url to undefined, which causes the server to crash when it attempts to launch. This version sets argv.url to "http://localhost" when port is 80.

WardCunningham commented 2 years ago

I'm guessing that your code is what was intended by the original carelessly scoped 'unless' clause.

I am wondering where the server launch was failing? What made this show up now, four years later?

alltom commented 2 years ago

The line that crashes on startup was added in December, 2020: wikiName = new URL(argv.url).hostname, though I see that same pattern has been used in sitemap.coffee and in search.coffee for 2 years.

Maybe it's unusual to use port 80 directly now that SSL is standard? Or maybe people don't update their software?

Docker containers on App Engine use the hosts' network stack and I hadn't gotten around to setting up SSL yet, which is why I discovered this bug while setting up federated-wiki/wiki-docker.

WardCunningham commented 2 years ago

Thank you for this explanation.

WardCunningham commented 2 years ago

published as wiki-server@0.19.4