@@ -49,6 +49,7 @@ export interface UserProvidedCodeArgs {
49
49
category ?: string
50
50
"github-auth" ?: string
51
51
"disable-update-check" ?: boolean
52
+ "disable-file-downloads" ?: boolean
52
53
}
53
54
54
55
/**
@@ -157,6 +158,10 @@ export const options: Options<Required<UserProvidedArgs>> = {
157
158
"Disable update check. Without this flag, code-server checks every 6 hours against the latest github release and \n" +
158
159
"then notifies you once every week that a new release is available." ,
159
160
} ,
161
+ "disable-file-downloads" : {
162
+ type : "boolean" ,
163
+ description : "Disable file downloads from Code. Defaults to true." ,
164
+ } ,
160
165
// --enable can be used to enable experimental features. These features
161
166
// provide no guarantees.
162
167
enable : { type : "string[]" } ,
@@ -445,6 +450,7 @@ export interface DefaultedArgs extends ConfigArgs {
445
450
usingEnvHashedPassword : boolean
446
451
"extensions-dir" : string
447
452
"user-data-dir" : string
453
+ "disable-file-downloads" : boolean
448
454
/* Positional arguments. */
449
455
_ : string [ ]
450
456
}
@@ -556,6 +562,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
556
562
const proxyDomains = new Set ( ( args [ "proxy-domain" ] || [ ] ) . map ( ( d ) => d . replace ( / ^ \* \. / , "" ) ) )
557
563
args [ "proxy-domain" ] = Array . from ( proxyDomains )
558
564
565
+ if ( ! args [ "disable-file-downloads" ] ) {
566
+ args [ "disable-file-downloads" ] = false
567
+ }
568
+
559
569
if ( typeof args . _ === "undefined" ) {
560
570
args . _ = [ ]
561
571
}
0 commit comments