Movatterモバイル変換


[0]ホーム

URL:


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

How to remove/disable download button on code server?#5886

Answeredbyjsjoeio
zhouzhou12 asked this question inQ&A
Discussion options

For data security, my organization requires to prohibit downloading files from server.
How to remove/disable the download button on the page of code server?
Who can help me?
Thanks!

You must be logged in to vote

I was surprised we don't have notes in the docs on this. Apologies! Here are the docs for that:

      --disable-file-downloads           Disable file downloads from Code. This can also beset with CS_DISABLE_FILE_DOWNLOADSset to'true' or'1'.

This is a flag you can pass tocode-server on startup.

Replies: 3 comments 5 replies

Comment options

I was surprised we don't have notes in the docs on this. Apologies! Here are the docs for that:

      --disable-file-downloads           Disable file downloads from Code. This can also beset with CS_DISABLE_FILE_DOWNLOADSset to'true' or'1'.

This is a flag you can pass tocode-server on startup.

You must be logged in to vote
1 reply
@zhouzhou12
Comment options

Thank you!

Answer selected byjsjoeio
Comment options

How can i use it with the docker?

You must be logged in to vote
1 reply
@code-asher
Comment options

You can add arguments to the end of thedocker run command.docker run codercom/code-server --disable-file-downloads for example.

Comment options

But its not working here i added insudo vi /etc/coder.d/coder.env

e.g.https://coder.example.com

CODER_ACCESS_URL=http://13.21.177.12
CS_DISABLE_FILE_DOWNLOADS=true

and i run this command

sudo systemctl daemon-reexec
sudo systemctl restart coder

Now if i go for coder and open incode-server and i click any file and clickDownload option it is downloading . and also it is sending the request like
blob:http:///some keys

so please tell me how to resolve this if i use code-server or vscode desktop if i click download it need to be give 403 error or it dont need to be download please give me the solution.

You must be logged in to vote
3 replies
@code-asher
Comment options

I do not believe systemd will read thatcoder.env file, will it? You probably have to set the environment variable in the service configuration file. For example:

[Service]Environment=CS_DISABLE_FILE_DOWNLOADS=true
@code-asher
Comment options

Except, I misread, you are starting Coder with systemd, not code-server, right? I think environment variables set on coderd will not propagate to the workspace agent.

How are you starting code-server? Are you usingthe module? If so, I am not sure there is a way to configure this. The module will have to be modified to support the flag.

But if you are not using the module and launching code-server yourself, you can just add the flag. For example:

resource "coder_agent" "main" {  arch           = data.coder_provisioner.me.arch  os             = "linux"  startup_script = <<-EOT    set -e    curl -fsSL https://code-server.dev/install.sh | sh -s -- --method=standalone --prefix=/tmp/code-server    /tmp/code-server/bin/code-server --auth none --port 13337 --disable-file-downloads >/tmp/code-server.log 2>&1 &  EOT
@code-asher
Comment options

Also note that this flag is for code-server only, it does not affect VS Code desktop.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
5 participants
@zhouzhou12@jsjoeio@rockan007@code-asher@paynpro

[8]ページ先頭

©2009-2025 Movatter.jp