etherpad-lite/src/node
Muh Muhten 3cedf474e5 Fix misparse of port when binding Unix socket
The hostname:port of URIs used in Minify are currently bogus and refer
to localhost only for historical reasons; there's no reason to retain
them and omitting them avoids generating an invalid URI when "port" is
not an integer.

Context: settings.port is passed to express's listen; if not numeric, it
is used a filename for a Unix domain socket.
This allows e.g. starting a server to be reverse-proxied on a multi-user
system, using the filesystem to handle access control and avoiding need
to allocate port numbers.

Before this change, etherpad-lite starts without error when configured
to listen on a Unix domain socket in this manner. However, `pad.js` and
`ace2_common.js` are generated incorrecting, causing an error
"Uncaught Error: The module at "ep_etherpad-lite/static/js/rjquery" does not exist."
when loading the editor:

When settings.port is a non-numeric string, e.g. `etherpad.sock`, a URI
of the form `http://localhost:etherpad.sock/static/js/rjquery.js` is
generated and parsed to find the file needed. In this case, the file
searched for is `:etherpad.sock/static/js/rjquery.js`, rather than the
expected `static/js/rjquery.js`. No such file exists, and the required
code is silently omitted from the bundle.

As a workaround, hard-code a (meaningless) hostname which can be parsed
correctly, since the current code makes no use of it anyway.
2018-08-10 01:57:30 +02:00
..
db upgrade to 1.6.5 2018-04-24 12:25:56 +03:00
eejs use latest ejs 2015-04-11 09:53:27 +01:00
handler sync with ether/etherpad-lite 2018-05-02 11:08:57 +03:00
hooks Fix misparse of port when binding Unix socket 2018-08-10 01:57:30 +02:00
utils Fix misparse of port when binding Unix socket 2018-08-10 01:57:30 +02:00
easysync_tests.js Revert "51c14d9947 changed the return value of" 2015-02-16 06:22:49 +01:00
padaccess.js Use the cookie parser middleware 2015-05-07 18:35:21 +01:00
README.md Merge branch 'pita' 2012-03-02 22:00:20 +01:00
server.js runtime: deprecate Node <= 7. From Etherpad 1.8.0 minimum Node version will be 8 2018-07-28 23:33:24 +02:00
stats.js Record metrics with 'measured' 2013-10-27 17:42:55 +01:00

About the folder structure

  • db - all modules that are accesing the data structure and are communicating directly to the database
  • handler - all modules that responds directly to requests/messages of the browser
  • utils - helper modules

Module name conventions

Module file names start with a capital letter and uses camelCase

Where does it start?

server.js is started directly