Commit Graph

31 Commits

Author SHA1 Message Date
Richard Hansen 649fbdccf5 express: Move static handlers to `expressPreSession`
This avoids the need to exempt the paths from authentication checks,
and it eliminates unnecessary express-session state.
2021-12-20 20:08:19 -05:00
Richard Hansen f86df5322e CachingMiddleware: Asyncify 2021-02-27 14:03:09 +01:00
John McLear 483f4344c2
performance: maxAge for favicon and plugin definitions (#4761) 2021-02-13 08:13:48 +00:00
Richard Hansen d9607f7c66 static: Asyncify 2021-02-12 07:08:51 +00:00
Richard Hansen 7f4a7156e2 Minify: Move `getTar()` to `static.js`
`static.js` is the only file that uses it.
2021-02-12 07:08:51 +00:00
Richard Hansen 996dc81825 Minify: Move tar processing into a function
This reduces the overhead of `require()`ing the module, and it will
make it easier for a future commit to asyncify everything in
`Minify.js`.
2021-02-12 07:08:51 +00:00
Richard Hansen 8919f63c98 lint: Replace use of underscore.js with plain ECMAScript 2021-02-12 07:08:51 +00:00
John McLear 6df3eadecd lint: src/node/hooks/express/static.js 2021-01-25 22:53:11 -05:00
Richard Hansen 8e5fd19db2 lint: Run `eslint --fix` on `src/` 2020-11-24 20:06:12 +00:00
Richard Hansen 79119baf58 hooks: Call the callback when done
If a hook function neither calls the callback nor returns a
(non-undefined) value then there's no way for the hook system to know
if/when the hook function has finished.
2020-10-24 16:08:50 +01:00
Richard Hansen da459888dc plugins: Move plugin definitions to avoid monkey patching
Also document the plugin data structures.
2020-09-08 00:50:24 +01:00
muxator dc7e49f89d Remove trailing whitespaces
Hoping to minimize future diffs. Not touching vendorized libraries.
2019-04-16 00:34:29 +02:00
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
Tom Hunkapiller 133188320a fix: only match /javascript/* for caching middleware 2015-04-11 09:54:40 -05:00
Tom Hunkapiller de67714cf8 fix minify route path; update deprecated calls 2015-04-10 05:52:58 -05:00
Tom Hunkapiller d0b39c01fb update for express 4.x 2015-04-08 23:12:11 -05:00
John McLear 689ced8443 and this one.. 2015-01-18 20:15:17 +00:00
webzwo0i b204aa2085 remove more dead requires. 2014-12-16 19:10:01 +01:00
Chad Weider 024a26f272 Minify publishes its own mock request thing. 2012-09-03 14:37:26 -07:00
Chad Weider cd11717b99 Eliminate the loopback that has been causing so much trouble.
`localhost`, `0.0.0.0`, `127.0.0.1` each works only in some places some of the time, this works around the problem by overriding Yajsml's built-in request mechanism in favor of a hacked together one. TODO: Serve files from another service, or directly from the file system in order to make this unnecessary.

Fixes #747
2012-07-22 23:55:07 -07:00
Matthias Bartelmeß f34e13f761 on plugin definitions, only expose plugins with client_hooks registered. dont expose 'package' property 2012-04-04 15:10:27 +02:00
Matthias Bartelmeß 8bf481f27b Send the Content-Type header for plugin-definitions.json in the right format 2012-03-24 13:28:17 +01:00
Chad Weider 0d6ec8c04a Minify implements virtual plugins resources. 2012-03-10 14:39:37 -08:00
Chad Weider 1a1f222221 Change paths. 2012-03-10 14:39:37 -08:00
Peter 'Pita' Martischka 7b518eeb2d Fixing client side require, the minify code is completly unused now, very ugly solution 2012-03-04 23:45:33 +01:00
Egil Moeller 81440cd856 Removed old pluginfw stuff 2012-03-01 19:00:58 +01:00
Egil Moeller 73aa0687b8 Client side hooks are now loaded and works 2012-03-01 18:45:02 +01:00
Egil Moeller 2c7b84ca3e Minify now supports plugins 2012-02-26 22:01:52 +01:00
Egil Moeller fd5b7c1080 require(ep_pluginname/static/blabla); now works both on client and server 2012-02-26 15:34:03 +01:00
Egil Moeller da52353ba3 The big rename of pluginbs from pluginomatic to ep 2012-02-26 13:54:32 +01:00
Egil Moeller 1239ce7f28 The Big Renaming - etherpad is now an NPM module 2012-02-26 13:07:51 +01:00
Renamed from node/hooks/express/static.js (Browse further)