@@ -333,10 +333,17 @@ type DangerousConfig struct {
333
333
}
334
334
335
335
const (
336
- flagEnterpriseKey = "enterprise"
337
- flagSecretKey = "secret"
336
+ flagEnterpriseKey = "enterprise"
337
+ flagSecretKey = "secret"
338
+ flagExternalProxies = "external_workspace_proxies"
338
339
)
339
340
341
+ func IsExternalProxies (opt clibase.Option ) bool {
342
+ // If it is a bool, use the bool value.
343
+ b , _ := strconv .ParseBool (opt .Annotations [flagExternalProxies ])
344
+ return b
345
+ }
346
+
340
347
func IsSecretDeploymentOption (opt clibase.Option ) bool {
341
348
return opt .Annotations .IsSet (flagSecretKey )
342
349
}
@@ -470,6 +477,7 @@ when required by your organization's security policy.`,
470
477
Value : & c .HTTPAddress ,
471
478
Group : & deploymentGroupNetworkingHTTP ,
472
479
YAML : "httpAddress" ,
480
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
473
481
}
474
482
tlsBindAddress := clibase.Option {
475
483
Name : "TLS Address" ,
@@ -480,6 +488,7 @@ when required by your organization's security policy.`,
480
488
Value : & c .TLS .Address ,
481
489
Group : & deploymentGroupNetworkingTLS ,
482
490
YAML : "address" ,
491
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
483
492
}
484
493
redirectToAccessURL := clibase.Option {
485
494
Name : "Redirect to Access URL" ,
@@ -499,6 +508,7 @@ when required by your organization's security policy.`,
499
508
Env : "CODER_ACCESS_URL" ,
500
509
Group : & deploymentGroupNetworking ,
501
510
YAML : "accessURL" ,
511
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
502
512
},
503
513
{
504
514
Name : "Wildcard Access URL" ,
@@ -508,6 +518,7 @@ when required by your organization's security policy.`,
508
518
Value : & c .WildcardAccessURL ,
509
519
Group : & deploymentGroupNetworking ,
510
520
YAML : "wildcardAccessURL" ,
521
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
511
522
},
512
523
redirectToAccessURL ,
513
524
{
@@ -534,7 +545,8 @@ when required by your organization's security policy.`,
534
545
httpAddress ,
535
546
tlsBindAddress ,
536
547
},
537
- Group : & deploymentGroupNetworking ,
548
+ Group : & deploymentGroupNetworking ,
549
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
538
550
},
539
551
// TLS settings
540
552
{
@@ -545,6 +557,7 @@ when required by your organization's security policy.`,
545
557
Value : & c .TLS .Enable ,
546
558
Group : & deploymentGroupNetworkingTLS ,
547
559
YAML : "enable" ,
560
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
548
561
},
549
562
{
550
563
Name : "Redirect HTTP to HTTPS" ,
@@ -557,6 +570,7 @@ when required by your organization's security policy.`,
557
570
UseInstead : clibase.OptionSet {redirectToAccessURL },
558
571
Group : & deploymentGroupNetworkingTLS ,
559
572
YAML : "redirectHTTP" ,
573
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
560
574
},
561
575
{
562
576
Name : "TLS Certificate Files" ,
@@ -566,6 +580,7 @@ when required by your organization's security policy.`,
566
580
Value : & c .TLS .CertFiles ,
567
581
Group : & deploymentGroupNetworkingTLS ,
568
582
YAML : "certFiles" ,
583
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
569
584
},
570
585
{
571
586
Name : "TLS Client CA Files" ,
@@ -575,6 +590,7 @@ when required by your organization's security policy.`,
575
590
Value : & c .TLS .ClientCAFile ,
576
591
Group : & deploymentGroupNetworkingTLS ,
577
592
YAML : "clientCAFile" ,
593
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
578
594
},
579
595
{
580
596
Name : "TLS Client Auth" ,
@@ -585,6 +601,7 @@ when required by your organization's security policy.`,
585
601
Value : & c .TLS .ClientAuth ,
586
602
Group : & deploymentGroupNetworkingTLS ,
587
603
YAML : "clientAuth" ,
604
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
588
605
},
589
606
{
590
607
Name : "TLS Key Files" ,
@@ -594,6 +611,7 @@ when required by your organization's security policy.`,
594
611
Value : & c .TLS .KeyFiles ,
595
612
Group : & deploymentGroupNetworkingTLS ,
596
613
YAML : "keyFiles" ,
614
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
597
615
},
598
616
{
599
617
Name : "TLS Minimum Version" ,
@@ -604,6 +622,7 @@ when required by your organization's security policy.`,
604
622
Value : & c .TLS .MinVersion ,
605
623
Group : & deploymentGroupNetworkingTLS ,
606
624
YAML : "minVersion" ,
625
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
607
626
},
608
627
{
609
628
Name : "TLS Client Cert File" ,
@@ -613,6 +632,7 @@ when required by your organization's security policy.`,
613
632
Value : & c .TLS .ClientCertFile ,
614
633
Group : & deploymentGroupNetworkingTLS ,
615
634
YAML : "clientCertFile" ,
635
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
616
636
},
617
637
{
618
638
Name : "TLS Client Key File" ,
@@ -622,6 +642,7 @@ when required by your organization's security policy.`,
622
642
Value : & c .TLS .ClientKeyFile ,
623
643
Group : & deploymentGroupNetworkingTLS ,
624
644
YAML : "clientKeyFile" ,
645
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
625
646
},
626
647
// Derp settings
627
648
{
@@ -712,6 +733,7 @@ when required by your organization's security policy.`,
712
733
Value : & c .Prometheus .Enable ,
713
734
Group : & deploymentGroupIntrospectionPrometheus ,
714
735
YAML : "enable" ,
736
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
715
737
},
716
738
{
717
739
Name : "Prometheus Address" ,
@@ -722,6 +744,7 @@ when required by your organization's security policy.`,
722
744
Value : & c .Prometheus .Address ,
723
745
Group : & deploymentGroupIntrospectionPrometheus ,
724
746
YAML : "address" ,
747
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
725
748
},
726
749
{
727
750
Name : "Prometheus Collect Agent Stats" ,
@@ -741,6 +764,7 @@ when required by your organization's security policy.`,
741
764
Value : & c .Pprof .Enable ,
742
765
Group : & deploymentGroupIntrospectionPPROF ,
743
766
YAML : "enable" ,
767
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
744
768
},
745
769
{
746
770
Name : "pprof Address" ,
@@ -751,6 +775,7 @@ when required by your organization's security policy.`,
751
775
Value : & c .Pprof .Address ,
752
776
Group : & deploymentGroupIntrospectionPPROF ,
753
777
YAML : "address" ,
778
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
754
779
},
755
780
// oAuth settings
756
781
{
@@ -1007,13 +1032,14 @@ when required by your organization's security policy.`,
1007
1032
Value : & c .Trace .Enable ,
1008
1033
Group : & deploymentGroupIntrospectionTracing ,
1009
1034
YAML : "enable" ,
1035
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1010
1036
},
1011
1037
{
1012
1038
Name : "Trace Honeycomb API Key" ,
1013
1039
Description : "Enables trace exporting to Honeycomb.io using the provided API Key." ,
1014
1040
Flag : "trace-honeycomb-api-key" ,
1015
1041
Env : "CODER_TRACE_HONEYCOMB_API_KEY" ,
1016
- Annotations : clibase.Annotations {}.Mark (flagSecretKey , "true" ),
1042
+ Annotations : clibase.Annotations {}.Mark (flagSecretKey , "true" ). Mark ( flagExternalProxies , "true" ) ,
1017
1043
Value : & c .Trace .HoneycombAPIKey ,
1018
1044
Group : & deploymentGroupIntrospectionTracing ,
1019
1045
},
@@ -1025,6 +1051,7 @@ when required by your organization's security policy.`,
1025
1051
Value : & c .Trace .CaptureLogs ,
1026
1052
Group : & deploymentGroupIntrospectionTracing ,
1027
1053
YAML : "captureLogs" ,
1054
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1028
1055
},
1029
1056
// Provisioner settings
1030
1057
{
@@ -1074,19 +1101,21 @@ when required by your organization's security policy.`,
1074
1101
Flag : "dangerous-disable-rate-limits" ,
1075
1102
Env : "CODER_DANGEROUS_DISABLE_RATE_LIMITS" ,
1076
1103
1077
- Value : & c .RateLimit .DisableAll ,
1078
- Hidden : true ,
1104
+ Value : & c .RateLimit .DisableAll ,
1105
+ Hidden : true ,
1106
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1079
1107
},
1080
1108
{
1081
1109
Name : "API Rate Limit" ,
1082
1110
Description : "Maximum number of requests per minute allowed to the API per user, or per IP address for unauthenticated users. Negative values mean no rate limit. Some API endpoints have separate strict rate limits regardless of this value to prevent denial-of-service or brute force attacks." ,
1083
1111
// Change the env from the auto-generated CODER_RATE_LIMIT_API to the
1084
1112
// old value to avoid breaking existing deployments.
1085
- Env : "CODER_API_RATE_LIMIT" ,
1086
- Flag : "api-rate-limit" ,
1087
- Default : "512" ,
1088
- Value : & c .RateLimit .API ,
1089
- Hidden : true ,
1113
+ Env : "CODER_API_RATE_LIMIT" ,
1114
+ Flag : "api-rate-limit" ,
1115
+ Default : "512" ,
1116
+ Value : & c .RateLimit .API ,
1117
+ Hidden : true ,
1118
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1090
1119
},
1091
1120
// Logging settings
1092
1121
{
@@ -1096,9 +1125,10 @@ when required by your organization's security policy.`,
1096
1125
Env : "CODER_VERBOSE" ,
1097
1126
FlagShorthand : "v" ,
1098
1127
1099
- Value : & c .Verbose ,
1100
- Group : & deploymentGroupIntrospectionLogging ,
1101
- YAML : "verbose" ,
1128
+ Value : & c .Verbose ,
1129
+ Group : & deploymentGroupIntrospectionLogging ,
1130
+ YAML : "verbose" ,
1131
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1102
1132
},
1103
1133
{
1104
1134
Name : "Human Log Location" ,
@@ -1109,6 +1139,7 @@ when required by your organization's security policy.`,
1109
1139
Value : & c .Logging .Human ,
1110
1140
Group : & deploymentGroupIntrospectionLogging ,
1111
1141
YAML : "humanPath" ,
1142
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1112
1143
},
1113
1144
{
1114
1145
Name : "JSON Log Location" ,
@@ -1119,6 +1150,7 @@ when required by your organization's security policy.`,
1119
1150
Value : & c .Logging .JSON ,
1120
1151
Group : & deploymentGroupIntrospectionLogging ,
1121
1152
YAML : "jsonPath" ,
1153
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1122
1154
},
1123
1155
{
1124
1156
Name : "Stackdriver Log Location" ,
@@ -1129,6 +1161,7 @@ when required by your organization's security policy.`,
1129
1161
Value : & c .Logging .Stackdriver ,
1130
1162
Group : & deploymentGroupIntrospectionLogging ,
1131
1163
YAML : "stackdriverPath" ,
1164
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1132
1165
},
1133
1166
// ☢️ Dangerous settings
1134
1167
{
@@ -1157,6 +1190,7 @@ when required by your organization's security policy.`,
1157
1190
Env : "CODER_EXPERIMENTS" ,
1158
1191
Value : & c .Experiments ,
1159
1192
YAML : "experiments" ,
1193
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1160
1194
},
1161
1195
{
1162
1196
Name : "Update Check" ,
@@ -1199,6 +1233,7 @@ when required by your organization's security policy.`,
1199
1233
Value : & c .ProxyTrustedHeaders ,
1200
1234
Group : & deploymentGroupNetworking ,
1201
1235
YAML : "proxyTrustedHeaders" ,
1236
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1202
1237
},
1203
1238
{
1204
1239
Name : "Proxy Trusted Origins" ,
@@ -1208,6 +1243,7 @@ when required by your organization's security policy.`,
1208
1243
Value : & c .ProxyTrustedOrigins ,
1209
1244
Group : & deploymentGroupNetworking ,
1210
1245
YAML : "proxyTrustedOrigins" ,
1246
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1211
1247
},
1212
1248
{
1213
1249
Name : "Cache Directory" ,
@@ -1243,28 +1279,31 @@ when required by your organization's security policy.`,
1243
1279
Value : & c .SecureAuthCookie ,
1244
1280
Group : & deploymentGroupNetworking ,
1245
1281
YAML : "secureAuthCookie" ,
1282
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1246
1283
},
1247
1284
{
1248
1285
Name : "Strict-Transport-Security" ,
1249
1286
Description : "Controls if the 'Strict-Transport-Security' header is set on all static file responses. " +
1250
1287
"This header should only be set if the server is accessed via HTTPS. This value is the MaxAge in seconds of " +
1251
1288
"the header." ,
1252
- Default : "0" ,
1253
- Flag : "strict-transport-security" ,
1254
- Env : "CODER_STRICT_TRANSPORT_SECURITY" ,
1255
- Value : & c .StrictTransportSecurity ,
1256
- Group : & deploymentGroupNetworkingTLS ,
1257
- YAML : "strictTransportSecurity" ,
1289
+ Default : "0" ,
1290
+ Flag : "strict-transport-security" ,
1291
+ Env : "CODER_STRICT_TRANSPORT_SECURITY" ,
1292
+ Value : & c .StrictTransportSecurity ,
1293
+ Group : & deploymentGroupNetworkingTLS ,
1294
+ YAML : "strictTransportSecurity" ,
1295
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1258
1296
},
1259
1297
{
1260
1298
Name : "Strict-Transport-Security Options" ,
1261
1299
Description : "Two optional fields can be set in the Strict-Transport-Security header; 'includeSubDomains' and 'preload'. " +
1262
1300
"The 'strict-transport-security' flag must be set to a non-zero value for these options to be used." ,
1263
- Flag : "strict-transport-security-options" ,
1264
- Env : "CODER_STRICT_TRANSPORT_SECURITY_OPTIONS" ,
1265
- Value : & c .StrictTransportSecurityOptions ,
1266
- Group : & deploymentGroupNetworkingTLS ,
1267
- YAML : "strictTransportSecurityOptions" ,
1301
+ Flag : "strict-transport-security-options" ,
1302
+ Env : "CODER_STRICT_TRANSPORT_SECURITY_OPTIONS" ,
1303
+ Value : & c .StrictTransportSecurityOptions ,
1304
+ Group : & deploymentGroupNetworkingTLS ,
1305
+ YAML : "strictTransportSecurityOptions" ,
1306
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1268
1307
},
1269
1308
{
1270
1309
Name : "SSH Keygen Algorithm" ,
@@ -1308,7 +1347,7 @@ when required by your organization's security policy.`,
1308
1347
Description : "Whether Coder only allows connections to workspaces via the browser." ,
1309
1348
Flag : "browser-only" ,
1310
1349
Env : "CODER_BROWSER_ONLY" ,
1311
- Annotations : clibase.Annotations {}.Mark (flagEnterpriseKey , "true" ),
1350
+ Annotations : clibase.Annotations {}.Mark (flagEnterpriseKey , "true" ). Mark ( flagExternalProxies , "true" ) ,
1312
1351
Value : & c .BrowserOnly ,
1313
1352
Group : & deploymentGroupNetworking ,
1314
1353
YAML : "browserOnly" ,
@@ -1328,17 +1367,19 @@ when required by your organization's security policy.`,
1328
1367
Flag : "disable-path-apps" ,
1329
1368
Env : "CODER_DISABLE_PATH_APPS" ,
1330
1369
1331
- Value : & c .DisablePathApps ,
1332
- YAML : "disablePathApps" ,
1370
+ Value : & c .DisablePathApps ,
1371
+ YAML : "disablePathApps" ,
1372
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1333
1373
},
1334
1374
{
1335
1375
Name : "Disable Owner Workspace Access" ,
1336
1376
Description : "Remove the permission for the 'owner' role to have workspace execution on all workspaces. This prevents the 'owner' from ssh, apps, and terminal access based on the 'owner' role. They still have their user permissions to access their own workspaces." ,
1337
1377
Flag : "disable-owner-workspace-access" ,
1338
1378
Env : "CODER_DISABLE_OWNER_WORKSPACE_ACCESS" ,
1339
1379
1340
- Value : & c .DisableOwnerWorkspaceExec ,
1341
- YAML : "disableOwnerWorkspaceAccess" ,
1380
+ Value : & c .DisableOwnerWorkspaceExec ,
1381
+ YAML : "disableOwnerWorkspaceAccess" ,
1382
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1342
1383
},
1343
1384
{
1344
1385
Name : "Session Duration" ,
0 commit comments