You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Preface: I am not a node developer and my analysis may be based on wrong assumptions.
I'm trying to run a self-hosted version of outline. The server runs behind a corporate proxy. Consequently, I've set environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY). I can reach outline's login-page from the internet without any problems and (upon clicking "login with slack") are forwarded to slack to allow access to the workspace. However, it appears that while outline is reachable from the internet, outline itself is not able to reach the internet and thus cannot make use of slacks callback url. See corresponding log:
outline_1 | ClientError [BadRequestError]: request to https://slack.com/api/oauth.access?client_id=*****************.*****************&client_secret=*********************************&redirect_uri=http%3A%2F%2F******.*********.**%3A30705%2Fauth%2Fslack.callback&code=***************.******************.************************* failed, reason: connect ETIMEDOUT 3.123.248.34:443
outline_1 | at new InvalidRequestError (/opt/outline/build/server/errors.js:51:34)
outline_1 | at request (/opt/outline/build/server/slack.js:49:11)
outline_1 | at processTicksAndRejections (internal/process/task_queues.js:93:5)
outline_1 | at async /opt/outline/build/server/auth/slack.js:66:16
outline_1 | at async /opt/outline/node_modules/koa-mount/index.js:58:5 {
outline_1 | id: 'invalid_request',
outline_1 | headerSent: true
outline_1 | }
Upon further inspection, I learned that Nodejs doesn't respect HTTP_PROXY environment variables and developers are responsible themselves to support operations behind a proxy (nodejs/node/issues/8381). Outline uses the isomorphic-fetch package to handle the communication with the slack API. Unfortunately, isomorphic-fetch does not read HTTP_PROXY environment variables either (matthew-andrews/isomorphic-fetch/issues/171). By replacing isomorphic-fetch with fetch-with-proxy, I got outline running behind a proxy (see fork: dad89f8 and bddefc4).
However, this proof of concept is probably still hacky.
Expected behavior
Outline should respect http_proxy environment variables.
Outline (please complete the following information):
Hi @thllwg – your analysis and solution seems correct. Swapping out the dep will need more testing to ensure it does not regress other situations. Would you like to put a PR in?
Hey! The issue has been automatically marked as stale because it has not had recent activity. It will be closed soon if no further activity occurs. Please reply here if you wish for the issue to be kept open.
* fix: Add server-side proxy support via fetch-with-proxy
closes#1893
For some fun discussion on why this is required, see this issue: nodejs/node#8381
* lint
Preface: I am not a node developer and my analysis may be based on wrong assumptions.
I'm trying to run a self-hosted version of outline. The server runs behind a corporate proxy. Consequently, I've set environment variables (
HTTP_PROXY
,HTTPS_PROXY
,NO_PROXY
). I can reach outline's login-page from the internet without any problems and (upon clicking "login with slack") are forwarded to slack to allow access to the workspace. However, it appears that while outline is reachable from the internet, outline itself is not able to reach the internet and thus cannot make use of slacks callback url. See corresponding log:Upon further inspection, I learned that Nodejs doesn't respect
HTTP_PROXY
environment variables and developers are responsible themselves to support operations behind a proxy (nodejs/node/issues/8381). Outline uses theisomorphic-fetch
package to handle the communication with the slack API. Unfortunately,isomorphic-fetch
does not readHTTP_PROXY
environment variables either (matthew-andrews/isomorphic-fetch/issues/171). By replacingisomorphic-fetch
withfetch-with-proxy
, I got outline running behind a proxy (see fork: dad89f8 and bddefc4).However, this proof of concept is probably still hacky.
Expected behavior
Outline should respect http_proxy environment variables.
Outline (please complete the following information):
The text was updated successfully, but these errors were encountered: