Open Tulkas59 opened 5 years ago
Looks like it needs debugging. Suggest adding logs to this https://github.com/audreyt/ethercalc/blob/master/src/main.ls so you can see where the errors are.
Note this is main.ls file converted to JavaScript https://github.com/audreyt/ethercalc/blob/master/main.js You could edit it directly to debug.
@hermannschwaerzlerUIBK inserted much of the basepath code on Jun 20, 2018 https://github.com/audreyt/ethercalc/commits/master/src/main.ls
I am not an expert in web-based technologies but I have the feeling that the nodeJS part assumes you access to ethercalc with https://\<domain>/\<basepath>/ while the html part assumes you access to it with https://\<domain>/, which is not consistent.
Example main.ls: line 66:
@get "#BASEPATH/favicon-32x32.png": sendFile \favicon-32x32.png
Example index.html: line 58:
<link rel="stylesheet" type="text/css" href="./static/socialcalc.css">
Using
RewriteRule <DocumentRoot>/ethercalc/(.*) ws://localhost:8000/$1 [P,L]
I have NodeJS errors (e.g. cannot find _start):
Using
RewriteRule <DocumentRoot>/ethercalc/(.*) ws://localhost:8000/ethercalc/$1 [P,L]
I get the following error:
Loading failed for the <script> with source “https://<domain>/ethercalc/static/ethercalc.js”.
nodeJS part assumes you access to ethercalc with https://
/ /
Yes, that makes sense.
while the html part assumes you access to it with https://
/, which is not consistent.
Why do you think this? did you find an absolute path somewhere. "./static/socialcalc.css" is relative.
Indeed... This is stupid :-) I'll try to figure out why those files cannot be loaded.
Note also that the css file cannot be loaded/found (the welcome page is ugly), so this is not only related to the script files. Apache and ethercalc logs are empty.
HI, I encounter a similar error , apache is acting as a reverse proxy, proxying to ethercalc running as a docker
I messed around trying to rewrite URI but always got one problem. When i can access static files then I can't no more reach the server or the opposite
here is my docker command:
docker run --name %p --log-driver none --network ethercalc-network --rm -e REDIS_HOST=ethercalc-redis -e REDIS_PORT=6379 -p 8000:8000 audreyt/ethercalc ethercalc --basepath=/ethercalc
(gist here -> https://gist.github.com/emeric254/54395db8eda7e0f25c2c9deef9acda1e)
and my apache config:
RedirectPermanent /ethercalc /ethercalc/ <Location "/ethercalc/"> ProxyPass http://localhost:8000/ ProxyPassReverse http://localhost:8000/ </Location>
Examples: https://my.domain/ethercalc/_start -> 404 https://my.domain/ethercalc/manifest.json -> works https://my.domain/ethercalc/start.html -> works https://my.domain/ethercalc/_new -> 404 https://my.domain/ethercalc/ethercalc/ -> almost work (all static files are missing) https://my.domain/ethercalc// -> send me on a new spreadsheet, wtf ? :thinking:
@emeric254
Looks like a problem with "--basepath=/ethercalc" Not sure if it is a bug or a settings issue.
So there is a pattern here:
Examples: https://my.domain/ethercalc/_start -> 404 https://my.domain/ethercalc/manifest.json -> works https://my.domain/ethercalc/start.html -> works https://my.domain/ethercalc/_new -> 404
All the 404s use basepath - the "works" don't use basepath.
Suggest you search the docs and issue for "basepath" to see if you can confirm you have the settings correct.
@eddyparkinson I may not have been explicit enough in my comment,
so without "--basepath=/ethercalc" https://my.domain/ethercalc/_start -> works https://my.domain/ethercalc/start.html -> does not work
and with "--basepath=/ethercalc" https://my.domain/ethercalc/_start -> does not work (seems to be https://my.domain/ethercalc/ethercalc/_start) https://my.domain/ethercalc/start.html -> works
I'm reverse proxy under "/ethercalc" so it sounds correct to use the basepath (that's what you find from reading the doc)
Have you tired using basepath without the Apache redirct. Looks like the redirect is adding an extra basepath
Basepath is used in: https://github.com/audreyt/ethercalc/blob/master/main.js
created by https://github.com/audreyt/ethercalc/blob/master/src/main.ls
Maybe if you edit main.js you can pin down the cause.
NB I never found a solution (I am now using a dedicated subdomain) so please keep me in touch !
I've reproduced this error (with and without proxy). It seems like all routes that are explicitly set take the basepath into account do work. What does not work, as far as I can tell, are the routes to static files (withtout explicitly set up routes).
Let's say I use /ethercals as basepath than I get the following result: http://hostname/ethercalc/ -> works as it should http://hostname/ethercalc/_start -> works as it should http://hostname/ethercalc/static/jszip.js -> does not work (but is reachable under http://hostname/static/jszip.js) http://hostname/ethercalc/player/graph.js -> does not work (but is reachable under http://hostname/player/graph.js)
I think there is simply missing a route with basepath for all static files that are loaded directly by path.
re-map these 6 folders in the proxy
/images -> /ethercalc/images
/player -> /ethercalc/player
/socket.io -> /ethercalc/socket.io
/static/ -> /ethercalc/static/
/zappa -> /ethercalc/zappa
/l10n -> /ethercalc/l10n
e.g. map http://proxy-host/ethercalc/images/ to http://ethercalc-host/images
Note: static has several layers of sub folders
Also: set basepath
Edit: 1) joeried said this worked. see comment below, 2) added corrections as indicated by joeried
@joeried I think that reference was for you.
@eddyparkinson I'm not sure if I understand your mapping notation correctly. I guess you want me to map http://proxy-host/ethercalc/images/ to http://ethercalc-host/images , right? If I map them in that direction (with socket.io instead of socker.io and an additional mapping for /ethercalc/l10n/) ethercalc seems to be working.
The workaround with the additional configuration works, but the above mentioned paths could still be modified to take the basepath into account.
I posted another solution on https://github.com/audreyt/ethercalc/issues/427
Hello,
I know other issues are already related to this topic but none has led me to a solution.
96
427
I want to access ethercalc through an apache proxy like this: https://\<domain>/ethercalc/. It seems that all but the "new" button works fine if do not use --basepath and configure a basic proxy. It's getting more complicated when I try to use basepath to fix the "new" button. My configuration files are the following:
systemd service:
apache (first try):
apache (another try, same result):
The debug output of firefox:
I think it is related to the apache configuration but I failed to fix it.
Can you help me?
All the best,