Skip to content

Implement basic directives via HTTP headers and/or cookies #2506

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

Closed
daumling opened this issue Dec 23, 2020 · 4 comments
Closed

Implement basic directives via HTTP headers and/or cookies #2506

daumling opened this issue Dec 23, 2020 · 4 comments
Labels

Comments

@daumling
Copy link

daumling commented Dec 23, 2020

I've implemented a simple auth mechanism using nginx's auth feature. This works just nicely. What I'd like to have is a way to supply basic features to code-server via HTTP headers or cookies.

When a user logs in, the login script could, for example, set a HTTP header with a code-server directive to emulate a chroot for the given user, like e.g.

X-Codeserver-Root: /home/username

This would tell code-server to use the given folder as root folder for this session. This would be a great sandboxing feature for multiple users.

Other HTTP headers would include:

X-Codeserver-Workspace: ...path name ....
X-Codeserver-Folder: ...path name...
X-Codeserver-File: ...path name...

In my case, several users contribute to markdown documentation that is hosted on Github. This solution would allow each use to have his/her own copy of the Github repo, making it safe for concurrent editing.

I am sure that there may be other ideas or use cases for code-server control through HTTP headers.

@daumling daumling added the feature New user visible feature label Dec 23, 2020
@nhooyr
Copy link
Contributor

nhooyr commented Jan 18, 2021

This is something that should be implemented outside of code-server. You could have a proxy that launches a new code-server per user in a chroot.

@nhooyr nhooyr closed this as completed Jan 18, 2021
@nhooyr nhooyr added wontfix and removed feature New user visible feature labels Jan 18, 2021
@nhooyr
Copy link
Contributor

nhooyr commented Jan 18, 2021

@daumling
Copy link
Author

daumling commented Jan 18, 2021 via email

@nhooyr
Copy link
Contributor

nhooyr commented Jan 18, 2021

Thanks, I am already using query parameters, but nothing keeps users from leaving their folder tree, which could be a security problem.

See #1834

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants