Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

user-data-dir accessed via root url #2496

Answered by code-asher
dkebler asked this question in Q&A
Discussion options

I'm using the linuxserver container version. I'm trying to grok how to set up the root url to point to the --user-data-dir /doc that was set. I've mapped that to a directory on my host. I've set up caddy2 as my reverse proxy and all is good if enter <my doman>/?folder=/docs that folder is loaded in the editor.

Now I would like that to be my default so that entering just <my domain> will take me to that folder without needing the query string.

I've messed around with caddy2 but any rewrites I try the editor does not load at all. I suppose you can't help me with that but I was wondering if code-server itself has a way to set the default folder (or workspace) with flags. I did not see such when I ran the help. From the cli one can pass a [path] to open a particular folder but not seeing how to pass that when launching the container (really not a code-server issue but I'm asking anyway)

You must be logged in to vote
code-server will use the last non-flag argument as the default directory to open, so something like this should work: ``` docker run code-server /doc ``` But code-server also should remember the last opened directory so if you open it once with a query parameter you shouldn't need to do it again.

Replies: 2 comments

Comment options

code-server will use the last non-flag argument as the default directory to open, so something like this should work: ``` docker run code-server /doc ``` But code-server also should remember the last opened directory so if you open it once with a query parameter you shouldn't need to do it again.
You must be logged in to vote
0 replies
Answer selected by jsjoeio
Comment options

See my containered version here, clone it, edit the WORKSPACE_DIR variable in the Dockerfile (edit others as per your needs) and build the image, run it.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /