etherpad-lite
etherpad-lite copied to clipboard
Etherpad-lite version 2.2.2 doesn't work anymore with nginx subdirectory url configuration (unable to load indexBootstrap-XZV.min.js)
Describe the bug
I have serveral etherpad-lite instances. The main instance is under https://pad.domain.tld and there are other instances under https://pad.domain.tld/instance1/, https://pad.domain.tld/instance2/ and https://pad.domain.tld/instance3/. After upgrading to etherpad-lite version 2.2.2 only the main instance is still working, the subfolder instances fail to load indexBootstrap-XYZ.min.js. This is probably due to the javascript change in version 2.2.2. Please help.
- Main instance:
https://pad.domain.tldsuccessfully loadsindexBootstrap-MAIN.min.jsfromhttps://pad.domain.tld/indexBootstrap-MAIN.min.js - Subdirectory instance: As an example the instance under
https://pad.domain.tld/instance/tries to loadindexBootstrap-OTHERINSTANCE.min.jsfromhttps://pad.domain.tld/indexBootstrap-OTHERINSTANCE.min.js(withoutinstancesubfolder path) which fails (HTTP error code 404). BUT theindexBootstrap-OTHERINSTANCE.min.jsis reachable fromhttps://pad.domain.tld/instance/indexBootstrap-OTHERINSTANCE.js(with subdirectory path/instance).
To Reproduce Steps to reproduce the behavior:
- Install a custom etherpad-lite instance on a subdirectory, for example
https://pad.domain.tld/instance/ - Configure nginx to serve etherpad-lite from a subdirectory as described in https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy#from-subdirectory-url
- Try to use
https://pad.domain.tld/instance/ - See that the instance failes to load
https://pad.domain.tld/instance/in the browser network console.
Expected behavior Version 2.2.2 should still work in subdirectory/subfolder installations.
Server (please complete the following information):
- Etherpad version: 2.2.2
- OS: Debian 12
- Node.js version v18.19.0
Edit: Possibly related to https://github.com/ether/etherpad-lite/issues/6588, https://github.com/ether/etherpad-lite/issues/5359
Feel free to try on develop. That should be fixed.
On a first try, applying https://github.com/ether/etherpad-lite/commit/3dae23a1e59f49939cdd73e3ffc9026f86045723 seems to help. I'll wait for the next release until I close the ticket. Apparently there are some plugins which do not work.
On a first try, applying 3dae23a seems to help. I'll wait for the next release until I close the ticket. Apparently there are some plugins which do not work.
Thanks for the reply. Do you have any more plugins not working? If yes then just list them in a new issue and I'll fix them.
I have the same issue but using etherpad's Docker image instead of installing it myself.
Applying the above commit and then building the image didn't help.
I still have the same error in the develop branch. If I open a pad in the develop branch, it only shows the loading screen. In the console it shows the error "https://xxx/padbootstrap-OwAkEXFiro8.min.js not found", https://xxx/etherpad/padbootstrap-OwAkEXFiro8.min.js exists.
Current Setup:
-
Etherpad is running as a Docker service
-
Nginx is configured to proxy requests to Etherpad under a subfolder:
``` location /etherpad/ { proxy_pass http://etherpad/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } ```
The main Etherpad page seems to load, but it fails to fetch the padbootstrap-dWVv7D4yciw.min.js file, resulting in a 404 error.
Could you send me the index.html script section please? It says for me which should always work as it goes 2 levels up the stack which should be the subfolder path. @Adz10kvtech
I also ran into this issue on master, but applying 3dae23a (and then rebuilding the assets) did not solve it for me either.
Can I provide anything in order to help debugging this?
Try the develop image or the develop branch if you are working bare metal. @yacchin1205 had also a fix for the subdirectory problem.
Using the docker image etherpad:develop that was available 2 days ago, I was able to access pads when etherpad was configured to be served from a subdirectory however the /admin/plugins had still the same issueL
Using the docker image etherpad:develop that was available 2 days ago, I was able to access pads when etherpad was configured to be served from a subdirectory however the /admin/plugins had still the same issueL
Did you apply the patches in https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy/ ? You need to set some headers in order to have the rooting correctly for the /admin/ endpoint.
It's still now working with version 2.2.4, now I get a different error.
ReferenceError: io is not defined
at https://pad.domain.tld/subdir/padbootstrap-5LZ5AmITgSI.min.js at line 72
ErrorId: pCIxHAKsfQtQntw7iiIo
Unhandled Promise rejection
URL: https://pad.domain.tld/subdir/p/testingpad
UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
It's still now working with version 2.2.4, now I get a different error.
ReferenceError: io is not defined at https://pad.domain.tld/subdir/padbootstrap-5LZ5AmITgSI.min.js at line 72 ErrorId: pCIxHAKsfQtQntw7iiIo Unhandled Promise rejection URL: https://pad.domain.tld/subdir/p/testingpad UserAgent: Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
That sounds actually good. It means the JavaScript is executed but runs into an error. Do you use any plugins on your instance?
Ah, I see, without plugins, it works fine. It's ep_comments_page (version 1.0.36) which causes the error. I'll probably open another bug report.. See https://github.com/ether/ep_comments_page/issues/339
Did you apply the patches in https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy/ ? You need to set some headers in order to have the rooting correctly for the /admin/ endpoint.
Sorry about the delay, I have read the wiki entry, I don't see anything really Etherpad specific to make it work behind a reverse proxy..
But the reverse proxy seems to be working as intended, the /admin/plugins pages returns a 200 status code with the below html.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Etherpad Admin Dashboard</title>
<link rel="icon" href="/favicon.ico">
<script type="module" crossorigin src="/admin/assets/index-a_6o1ecH.js"></script>
<link rel="stylesheet" crossorigin href="/admin/assets/index-NApm68Ro.css">
</head>
<body>
<div id="root"></div>
<div id="loading"></div>
</body>
</html>
As you can see, it tries to load the assets based on document root, which doesn't work if it's served from a from a subdirectory. Modifying those URLs directly in the container (/opt/etherpad-lite/src/templates/admin/index.html) allows the css to be fetched and the javascript to load, it later tries to fetch the fonts and translations, and that fails for the same reason.
By again editing the css and javascript manually, I was able to make those resources load as well, but the page is still blank, and it doesn't try to call /admin-auth as it is supposed to do. I assume other parts of the code assumes that everything is loaded from /admin .
Did you apply the patches in https://github.com/ether/etherpad-lite/wiki/How-to-put-Etherpad-Lite-behind-a-reverse-Proxy/ ? You need to set some headers in order to have the rooting correctly for the /admin/ endpoint.
Sorry about the delay, I have read the wiki entry, I don't see anything really Etherpad specific to make it work behind a reverse proxy..
But the reverse proxy seems to be working as intended, the
/admin/pluginspages returns a 200 status code with the below html.<!doctype html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Etherpad Admin Dashboard</title> <link rel="icon" href="/favicon.ico"> <script type="module" crossorigin src="/admin/assets/index-a_6o1ecH.js"></script> <link rel="stylesheet" crossorigin href="/admin/assets/index-NApm68Ro.css"> </head> <body> <div id="root"></div> <div id="loading"></div> </body> </html>As you can see, it tries to load the assets based on document root, which doesn't work if it's served from a from a subdirectory. Modifying those URLs directly in the container (
/opt/etherpad-lite/src/templates/admin/index.html) allows the css to be fetched and the javascript to load, it later tries to fetch the fonts and translations, and that fails for the same reason.By again editing the css and javascript manually, I was able to make those resources load as well, but the page is still blank, and it doesn't try to call
/admin-authas it is supposed to do. I assume other parts of the code assumes that everything is loaded from/admin.
You need to set the Proxy Header var x-proxy-path to your subpath. Then it will work