-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set environment variable VSCODE_PROXY_URI #1510
Comments
Neat. I don't think we have this ATM. Thoughts @code-asher ? |
I experimented with replacing So the environment variable sounds like a reasonable way to solve this. Either that or require that extensions be aware that they might be behind a proxied base path and make connections accordingly. There might be other cases I haven't considered though so the environment variable seems like the most flexible. |
We should also make this environment variable available to the terminal (in addition to extensions), see #1939. |
@code-asher Any timeframe on this issue? Does the name tend towards The project collaborators at Ikuyadeu/vscode-R might give another go at REditorSupport/vscode-R#275 while working on REditorSupport/vscode-R#358. |
We don't have this on the roadmap at the moment but it seems pretty
trivial to implement so I think we could reasonably have it for 3.11.0.
|
Oh right the name. I think `CODE_SERVER_HTTP_REFERER` makes sense.
|
@code-asher Keeping in mind other derivatives of VS Code (e.g. Eclipse Theia) it would make sense to tend towards Agreed? |
Alternaively |
That makes perfect sense to me! My vote would be for |
Please use Thank you! |
Should we be using the actual Then if the user has sub-domain proxies enabled we could set it to Otherwise we might need to use |
@code-asher The actual
|
It does, it's just less stable because not all applications handle the base path properly so I'm biased against it haha 😛 In this case it's probably fine though. Does Theia support |
I don't think Theia supports |
Gotcha, do we need to consider that they (or some other editor) might choose a different path than code-server if they do implement it? (In which case I imagine extensions need a way to distinguish between editors.) |
For the time being, you don't have to take this into account. But keeping an open mind: Why not setting |
And if the user has sub-domain proxies enabled: Not setting From the viewpoint of the extension:
|
@code-asher Having said the above, I realise that
Go ahead with this solution. |
Sounds good! I'll knock this out tomorrow so let me know if anything changes in the meantime. |
@code-asher I'm running code-server via JupyterHub as part of a JupyterLab image. There is a deployment at https://vscode-r.jupyter.b-data.ch for which your GitHub account has been whitelisted. |
I've whitelisted @bpmct for https://vscode-r.jupyter.b-data.ch, too. |
The setup is based on https://gitlab.b-data.ch/docker/deployments/jupyter and currently running
👉 Full specification of the JupyterLab image at https://gitlab.b-data.ch/jupyterlab/r/r-ver/-/blob/master/r-ver/latest.Dockerfile; plus I’m happy to further customize the Docker image, i.e. adding any Linux package you need for testing/development/etc*. |
Installed packages according to https://github.com/cdr/code-server/blob/main/docs/CONTRIBUTING.md#requirements |
@jsjoeio Should one be able to develop and test extensions with code-server? I followed https://github.com/Ikuyadeu/vscode-R/wiki/Contributing and |
Hmm...it looks like there was an issue in the past but I haven't tried ever so I can't say. I'm also not familiar with vscode-R so I can't help much but that does sound odd. If you follow this Hello World guide and it doesn't work with code-server, then there is probably a bug (and you can open a separate bug report for us to look into). |
Opened separate bug report: #3661 |
Awesome. You rock! Thank you! |
FYI https://vscode-r.jupyter.b-data.ch has been updated:
|
Just a heads-up - we've had a bunch of other priorities come up and haven't been able to get to this yet (but we will soon) |
@code-asher coder/vscode#37 sets Why the double brackets? |
Since REditorSupport/vscode-R#803 already in place, this will lead to errors with the current version of the R extension. I suggest the following:
In the meantime and before releasing code-server v4.0.2:
ℹ️ This makes sure, that both versions (single brackets, double brackets) are handled correctly. |
Ahh I did not realize this was already implemented in vscode-R! I used double braces to match VS Code's own templating scheme they use with webview URIs. I will go ahead and move back to one. |
With the implementation of the HTTP proxy it would be great to have an environment variable
VSCODE_HTTP_REFERER
available to build custon URLs for proxied webview requests.This feature helps solving REditorSupport/vscode-R#275. The existence of such an environment variable also allows to differentiate a local (VS Code) installation from a server (code-server) installation.
Other server-based IDEs set an environment variable based on the HTTP referer when the client session is initialized. See https://github.com/rstudio/rstudio/blob/aa266ded96123f654e5f3163cde39697744eee89/src/cpp/session/SessionClientInit.cpp#L170 for example.
Could you implement something similar in code-server? Or is the information on the HTTP referer already available somewhere else?
The text was updated successfully, but these errors were encountered: