ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.11k stars 2.8k forks source link

Support proxy server in plugin installation script #6275

Closed fgreinacher closed 2 months ago

fgreinacher commented 3 months ago

Is your feature request related to a problem? Please describe.

We are using a proxy server for all outgoing network requests. We configure our systems with the HTTP_PROXY, HTTPS_PROXY, and NO_PROXY variables to specify for which requests the proxy server is needed.

The plugin install script uses node-fetch internally and does therefore not support this out of the box and therefore does not work for us:

/opt/etherpad-lite/node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1501
            reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
                   ^
FetchError: Failed to get package 'ep_headings2' request to https://registry.npmjs.org/ep_headings2 failed, reason: 
    at ClientRequest.<anonymous> (/opt/etherpad-lite/node_modules/.pnpm/node-fetch@2.7.0/node_modules/node-fetch/lib/index.js:1501:11)
    at ClientRequest.emit (node:events:519:28)
    at ClientRequest.emit (node:domain:488:12)
    at TLSSocket.socketErrorListener (node:_http_client:500:9)
    at TLSSocket.emit (node:events:519:28)
    at TLSSocket.emit (node:domain:488:12)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:[82](https://code.siemens.com/core/tools/-/jobs/173129812#L82):21) {
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT'
}

Describe the solution you'd like

The script should consider the system proxy configuration.

Describe alternatives you've considered

Using pnpm install directly works, but we'd like to stick with the recommended approach.

Additional context

n/a

Plugin?

No, this needs to be implemented in the script.

Vringe commented 3 months ago

@fgreinacher I'm also looking for a solution. Were you able to install it through pnpm install directly? As far as I see, the live-plugin-manager installs the plugins into a special directory under src/plugin_packages. I was not able to install a plugin by hand in there.

fgreinacher commented 3 months ago

@Vringe No, right now we've reverted to v1. If you install the plugins via pnpm it will try to migrate them and run into the same issue.

There is already an upstream issue at https://github.com/davideicardi/live-plugin-manager/issues/48 that I will look into.

Vringe commented 3 months ago

Strange, that did not work for me. I ended up cloning the plugin repos and provide them via pnpm run install-plugins --path.

SamTV12345 commented 3 months ago

There was a pull request #6201 which should add support for proxy downloading. Maybe you can set these variables also at runtime but no idea.

Vringe commented 3 months ago

@SamTV12345 This works at build-time, but unfortunately not at run-time.

fgreinacher commented 3 months ago

I have submitted https://github.com/davideicardi/live-plugin-manager/pull/85

SamTV12345 commented 3 months ago

@fgreinacher Feel free to ping me once this is merged. I'll then create a new release for our version of live-plugin-manager

fgreinacher commented 2 months ago

@SamTV12345 This is fixed in live-plugin-manager@0.19.0.

SamTV12345 commented 2 months ago

Added and merged :)

fgreinacher commented 2 months ago

Thanks @SamTV12345, this works well with the develop version! Eagerly waiting for the next Etherpad release :)

Vringe commented 2 months ago

Works like a charm with 2.0.2. Thank you guys.