-
-
Notifications
You must be signed in to change notification settings - Fork 352
Add BASEPATH env var to enable use of --base-path option #19
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
Conversation
Quoted substitution breaks if there is a space in var
1 similar comment
Thanks for the PR @tdack but I can't get this to work. Are you sure it worked for you with a local build? Because you had the basepath var wrapped in quotes in the original PR, which causes the space to be included as part of the variable and code server gives an error However, after fixing that, code server seems to run with the option accepted. But the option doesn't seem to work. |
@tdack it seems like code-server devs had a completely different interpretation of how base path should be used, so they intended it to work only with a reverse proxy, which is super confusing to the end user. Also, the difference in base path handling behavior between setting or not setting a password may indicate a bug there. In any case, it seems they will remove the base-path option soon and make all paths relative so it should work with reverse proxies natively: coder/code-server#1302 |
@aptalca It did work, however, my testing was done with code-server behind a reverse proxy, and accessed through the proxy. So it looks like you are right about their intention. Hopefully the issue to remove the option and use relative paths gets sorted. Thanks for fixing my mistakes and considering it. |
Description:
Add support for BASEPATH environment variable to enable use of code-server
--base-path
optionBenefits of this PR and context:
When reverse proxied, allows code-server to be served from any path, not just the root of the domain/ip, eg:
http://<your-ip>:8443/code
How Has This Been Tested?
http://<your-ip>:8443/code
http://<your-ip>:8443/code
http://<your-ip>:8443/code/login
http://<your-ip>:8443/code
Source / References:
--base-path option: https://github.com/cdr/code-server/blob/c8fc54bfb1ba0fae592dee33a5f68843d9b41a4a/src/node/cli.ts#L59