Uberspace / lab

The Uberlab provides various tutorials - written by you! - on how to run software and tools on Uberspace 7.
https://lab.uberspace.de
Other
308 stars 406 forks source link

[etherpad] guide is broken #1754

Closed no-one closed 1 month ago

no-one commented 2 months ago

Guide https://lab.uberspace.de/guide_etherpad/ is broken if you want to use the latest version. First of all, the error

Error: Cannot find module '/home/USERNAME/etherpad/node_modules/ep_etherpad-lite/node/server.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
    at Module._load (node:internal/modules/cjs/loader:981:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

will occur, because in https://github.com/ether/etherpad-lite/commit/ead3c0ea381b8cb5b7ac39004a7f319200504a4d server.js (as mentioned in the guide) became server.ts.

If this is fixed, there is still the following error:

/home/USERNAME/etherpad/src/node/server.ts:25
import {PluginType} from "./types/Plugin";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at internalCompileFunction (node:internal/vm:76:18)
    at wrapSafe (node:internal/modules/cjs/loader:1283:20)
    at Module._compile (node:internal/modules/cjs/loader:1328:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
    at node:internal/main/run_main_module:28:49

Node.js v18.20.2

I don't have time to deal with it right now, but maybe someone else will find the solution.

/cc @ezzra

Uatschitchun commented 1 month ago

With 2.0.x etherpad's admin panel isn't working anymore even if etherpad.ini is changed to reflect changes like in #1757.

See: https://github.com/ether/etherpad-lite/issues/6369#issuecomment-2127941879

bugtrapper commented 1 month ago

@Uatschitchun You're right, sorry that I missed to include that. The admin UI has to be created in a first run in etherpad-lite 2.x by running /bin/run.sh once. I updated my pull request accordingly.

Uatschitchun commented 1 month ago

@bugtrapper yes, nice one!

See my comment on the PR regarding replacing bin/installDeps.sh.

Problem regarding admin UI not working sadly still appears when running EP under a sub URI as /pad with: uberspace web backend set /pad --https --port 9001 --remove-prefix

Uatschitchun commented 1 month ago

With 2.0.x etherpad's admin panel isn't working anymore even if etherpad.ini is changed to reflect changes like in #1757.

See: ether/etherpad-lite#6369 (comment)

The guide is working when serving from /. If serving from a subfolder like /pad, the Admin UI isn't available as it needs X-Proxy-Path header to be set to '/pad' in nginx together with: uberspace web backend set /pad --http --port 9001 --remove-prefix

Tried to set with uberspace web header set /pad X-Proxy-Path "/pad" but although curl -I https://frickeln.uber.space/pad gives: x-proxy-path: /pad and cat /readonly/$user/nginx.conf gives

    location = /pad {
        rewrite ^/pad/?(.*) /$1 break;
        proxy_pass http://user.local.uberspace.de:9001;

        more_set_headers 'X-Xss-Protection: 1; mode=block';
        more_set_headers 'X-Proxy-Path: /pad';
        more_set_headers 'X-Frame-Options: SAMEORIGIN';
        more_set_headers 'Strict-Transport-Security: max-age=31536000';
        more_set_headers 'X-Content-Type-Options: nosniff';
        more_set_headers 'Referrer-Policy: strict-origin-when-cross-origin';

    }

this is not received on EP's side and Admin UI fails because of wrong path/URLs