@@ -332,10 +332,17 @@ type DangerousConfig struct {
332
332
}
333
333
334
334
const (
335
- flagEnterpriseKey = "enterprise"
336
- flagSecretKey = "secret"
335
+ flagEnterpriseKey = "enterprise"
336
+ flagSecretKey = "secret"
337
+ flagExternalProxies = "external_workspace_proxies"
337
338
)
338
339
340
+ func IsExternalProxies (opt clibase.Option ) bool {
341
+ // If it is a bool, use the bool value.
342
+ b , _ := strconv .ParseBool (opt .Annotations [flagExternalProxies ])
343
+ return b
344
+ }
345
+
339
346
func IsSecretDeploymentOption (opt clibase.Option ) bool {
340
347
return opt .Annotations .IsSet (flagSecretKey )
341
348
}
@@ -469,6 +476,7 @@ when required by your organization's security policy.`,
469
476
Value : & c .HTTPAddress ,
470
477
Group : & deploymentGroupNetworkingHTTP ,
471
478
YAML : "httpAddress" ,
479
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
472
480
}
473
481
tlsBindAddress := clibase.Option {
474
482
Name : "TLS Address" ,
@@ -479,6 +487,7 @@ when required by your organization's security policy.`,
479
487
Value : & c .TLS .Address ,
480
488
Group : & deploymentGroupNetworkingTLS ,
481
489
YAML : "address" ,
490
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
482
491
}
483
492
redirectToAccessURL := clibase.Option {
484
493
Name : "Redirect to Access URL" ,
@@ -498,6 +507,7 @@ when required by your organization's security policy.`,
498
507
Env : "CODER_ACCESS_URL" ,
499
508
Group : & deploymentGroupNetworking ,
500
509
YAML : "accessURL" ,
510
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
501
511
},
502
512
{
503
513
Name : "Wildcard Access URL" ,
@@ -507,6 +517,7 @@ when required by your organization's security policy.`,
507
517
Value : & c .WildcardAccessURL ,
508
518
Group : & deploymentGroupNetworking ,
509
519
YAML : "wildcardAccessURL" ,
520
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
510
521
},
511
522
redirectToAccessURL ,
512
523
{
@@ -533,7 +544,8 @@ when required by your organization's security policy.`,
533
544
httpAddress ,
534
545
tlsBindAddress ,
535
546
},
536
- Group : & deploymentGroupNetworking ,
547
+ Group : & deploymentGroupNetworking ,
548
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
537
549
},
538
550
// TLS settings
539
551
{
@@ -544,6 +556,7 @@ when required by your organization's security policy.`,
544
556
Value : & c .TLS .Enable ,
545
557
Group : & deploymentGroupNetworkingTLS ,
546
558
YAML : "enable" ,
559
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
547
560
},
548
561
{
549
562
Name : "Redirect HTTP to HTTPS" ,
@@ -556,6 +569,7 @@ when required by your organization's security policy.`,
556
569
UseInstead : clibase.OptionSet {redirectToAccessURL },
557
570
Group : & deploymentGroupNetworkingTLS ,
558
571
YAML : "redirectHTTP" ,
572
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
559
573
},
560
574
{
561
575
Name : "TLS Certificate Files" ,
@@ -565,6 +579,7 @@ when required by your organization's security policy.`,
565
579
Value : & c .TLS .CertFiles ,
566
580
Group : & deploymentGroupNetworkingTLS ,
567
581
YAML : "certFiles" ,
582
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
568
583
},
569
584
{
570
585
Name : "TLS Client CA Files" ,
@@ -574,6 +589,7 @@ when required by your organization's security policy.`,
574
589
Value : & c .TLS .ClientCAFile ,
575
590
Group : & deploymentGroupNetworkingTLS ,
576
591
YAML : "clientCAFile" ,
592
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
577
593
},
578
594
{
579
595
Name : "TLS Client Auth" ,
@@ -584,6 +600,7 @@ when required by your organization's security policy.`,
584
600
Value : & c .TLS .ClientAuth ,
585
601
Group : & deploymentGroupNetworkingTLS ,
586
602
YAML : "clientAuth" ,
603
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
587
604
},
588
605
{
589
606
Name : "TLS Key Files" ,
@@ -593,6 +610,7 @@ when required by your organization's security policy.`,
593
610
Value : & c .TLS .KeyFiles ,
594
611
Group : & deploymentGroupNetworkingTLS ,
595
612
YAML : "keyFiles" ,
613
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
596
614
},
597
615
{
598
616
Name : "TLS Minimum Version" ,
@@ -603,6 +621,7 @@ when required by your organization's security policy.`,
603
621
Value : & c .TLS .MinVersion ,
604
622
Group : & deploymentGroupNetworkingTLS ,
605
623
YAML : "minVersion" ,
624
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
606
625
},
607
626
{
608
627
Name : "TLS Client Cert File" ,
@@ -612,6 +631,7 @@ when required by your organization's security policy.`,
612
631
Value : & c .TLS .ClientCertFile ,
613
632
Group : & deploymentGroupNetworkingTLS ,
614
633
YAML : "clientCertFile" ,
634
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
615
635
},
616
636
{
617
637
Name : "TLS Client Key File" ,
@@ -621,6 +641,7 @@ when required by your organization's security policy.`,
621
641
Value : & c .TLS .ClientKeyFile ,
622
642
Group : & deploymentGroupNetworkingTLS ,
623
643
YAML : "clientKeyFile" ,
644
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
624
645
},
625
646
// Derp settings
626
647
{
@@ -711,6 +732,7 @@ when required by your organization's security policy.`,
711
732
Value : & c .Prometheus .Enable ,
712
733
Group : & deploymentGroupIntrospectionPrometheus ,
713
734
YAML : "enable" ,
735
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
714
736
},
715
737
{
716
738
Name : "Prometheus Address" ,
@@ -721,6 +743,7 @@ when required by your organization's security policy.`,
721
743
Value : & c .Prometheus .Address ,
722
744
Group : & deploymentGroupIntrospectionPrometheus ,
723
745
YAML : "address" ,
746
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
724
747
},
725
748
// Pprof settings
726
749
{
@@ -731,6 +754,7 @@ when required by your organization's security policy.`,
731
754
Value : & c .Pprof .Enable ,
732
755
Group : & deploymentGroupIntrospectionPPROF ,
733
756
YAML : "enable" ,
757
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
734
758
},
735
759
{
736
760
Name : "pprof Address" ,
@@ -741,6 +765,7 @@ when required by your organization's security policy.`,
741
765
Value : & c .Pprof .Address ,
742
766
Group : & deploymentGroupIntrospectionPPROF ,
743
767
YAML : "address" ,
768
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
744
769
},
745
770
// oAuth settings
746
771
{
@@ -997,13 +1022,14 @@ when required by your organization's security policy.`,
997
1022
Value : & c .Trace .Enable ,
998
1023
Group : & deploymentGroupIntrospectionTracing ,
999
1024
YAML : "enable" ,
1025
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1000
1026
},
1001
1027
{
1002
1028
Name : "Trace Honeycomb API Key" ,
1003
1029
Description : "Enables trace exporting to Honeycomb.io using the provided API Key." ,
1004
1030
Flag : "trace-honeycomb-api-key" ,
1005
1031
Env : "CODER_TRACE_HONEYCOMB_API_KEY" ,
1006
- Annotations : clibase.Annotations {}.Mark (flagSecretKey , "true" ),
1032
+ Annotations : clibase.Annotations {}.Mark (flagSecretKey , "true" ). Mark ( flagExternalProxies , "true" ) ,
1007
1033
Value : & c .Trace .HoneycombAPIKey ,
1008
1034
Group : & deploymentGroupIntrospectionTracing ,
1009
1035
},
@@ -1015,6 +1041,7 @@ when required by your organization's security policy.`,
1015
1041
Value : & c .Trace .CaptureLogs ,
1016
1042
Group : & deploymentGroupIntrospectionTracing ,
1017
1043
YAML : "captureLogs" ,
1044
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1018
1045
},
1019
1046
// Provisioner settings
1020
1047
{
@@ -1064,19 +1091,21 @@ when required by your organization's security policy.`,
1064
1091
Flag : "dangerous-disable-rate-limits" ,
1065
1092
Env : "CODER_DANGEROUS_DISABLE_RATE_LIMITS" ,
1066
1093
1067
- Value : & c .RateLimit .DisableAll ,
1068
- Hidden : true ,
1094
+ Value : & c .RateLimit .DisableAll ,
1095
+ Hidden : true ,
1096
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1069
1097
},
1070
1098
{
1071
1099
Name : "API Rate Limit" ,
1072
1100
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." ,
1073
1101
// Change the env from the auto-generated CODER_RATE_LIMIT_API to the
1074
1102
// old value to avoid breaking existing deployments.
1075
- Env : "CODER_API_RATE_LIMIT" ,
1076
- Flag : "api-rate-limit" ,
1077
- Default : "512" ,
1078
- Value : & c .RateLimit .API ,
1079
- Hidden : true ,
1103
+ Env : "CODER_API_RATE_LIMIT" ,
1104
+ Flag : "api-rate-limit" ,
1105
+ Default : "512" ,
1106
+ Value : & c .RateLimit .API ,
1107
+ Hidden : true ,
1108
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1080
1109
},
1081
1110
// Logging settings
1082
1111
{
@@ -1086,9 +1115,10 @@ when required by your organization's security policy.`,
1086
1115
Env : "CODER_VERBOSE" ,
1087
1116
FlagShorthand : "v" ,
1088
1117
1089
- Value : & c .Verbose ,
1090
- Group : & deploymentGroupIntrospectionLogging ,
1091
- YAML : "verbose" ,
1118
+ Value : & c .Verbose ,
1119
+ Group : & deploymentGroupIntrospectionLogging ,
1120
+ YAML : "verbose" ,
1121
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1092
1122
},
1093
1123
{
1094
1124
Name : "Human Log Location" ,
@@ -1099,6 +1129,7 @@ when required by your organization's security policy.`,
1099
1129
Value : & c .Logging .Human ,
1100
1130
Group : & deploymentGroupIntrospectionLogging ,
1101
1131
YAML : "humanPath" ,
1132
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1102
1133
},
1103
1134
{
1104
1135
Name : "JSON Log Location" ,
@@ -1109,6 +1140,7 @@ when required by your organization's security policy.`,
1109
1140
Value : & c .Logging .JSON ,
1110
1141
Group : & deploymentGroupIntrospectionLogging ,
1111
1142
YAML : "jsonPath" ,
1143
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1112
1144
},
1113
1145
{
1114
1146
Name : "Stackdriver Log Location" ,
@@ -1119,6 +1151,7 @@ when required by your organization's security policy.`,
1119
1151
Value : & c .Logging .Stackdriver ,
1120
1152
Group : & deploymentGroupIntrospectionLogging ,
1121
1153
YAML : "stackdriverPath" ,
1154
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1122
1155
},
1123
1156
// ☢️ Dangerous settings
1124
1157
{
@@ -1147,6 +1180,7 @@ when required by your organization's security policy.`,
1147
1180
Env : "CODER_EXPERIMENTS" ,
1148
1181
Value : & c .Experiments ,
1149
1182
YAML : "experiments" ,
1183
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1150
1184
},
1151
1185
{
1152
1186
Name : "Update Check" ,
@@ -1189,6 +1223,7 @@ when required by your organization's security policy.`,
1189
1223
Value : & c .ProxyTrustedHeaders ,
1190
1224
Group : & deploymentGroupNetworking ,
1191
1225
YAML : "proxyTrustedHeaders" ,
1226
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1192
1227
},
1193
1228
{
1194
1229
Name : "Proxy Trusted Origins" ,
@@ -1198,6 +1233,7 @@ when required by your organization's security policy.`,
1198
1233
Value : & c .ProxyTrustedOrigins ,
1199
1234
Group : & deploymentGroupNetworking ,
1200
1235
YAML : "proxyTrustedOrigins" ,
1236
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1201
1237
},
1202
1238
{
1203
1239
Name : "Cache Directory" ,
@@ -1233,28 +1269,31 @@ when required by your organization's security policy.`,
1233
1269
Value : & c .SecureAuthCookie ,
1234
1270
Group : & deploymentGroupNetworking ,
1235
1271
YAML : "secureAuthCookie" ,
1272
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1236
1273
},
1237
1274
{
1238
1275
Name : "Strict-Transport-Security" ,
1239
1276
Description : "Controls if the 'Strict-Transport-Security' header is set on all static file responses. " +
1240
1277
"This header should only be set if the server is accessed via HTTPS. This value is the MaxAge in seconds of " +
1241
1278
"the header." ,
1242
- Default : "0" ,
1243
- Flag : "strict-transport-security" ,
1244
- Env : "CODER_STRICT_TRANSPORT_SECURITY" ,
1245
- Value : & c .StrictTransportSecurity ,
1246
- Group : & deploymentGroupNetworkingTLS ,
1247
- YAML : "strictTransportSecurity" ,
1279
+ Default : "0" ,
1280
+ Flag : "strict-transport-security" ,
1281
+ Env : "CODER_STRICT_TRANSPORT_SECURITY" ,
1282
+ Value : & c .StrictTransportSecurity ,
1283
+ Group : & deploymentGroupNetworkingTLS ,
1284
+ YAML : "strictTransportSecurity" ,
1285
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1248
1286
},
1249
1287
{
1250
1288
Name : "Strict-Transport-Security Options" ,
1251
1289
Description : "Two optional fields can be set in the Strict-Transport-Security header; 'includeSubDomains' and 'preload'. " +
1252
1290
"The 'strict-transport-security' flag must be set to a non-zero value for these options to be used." ,
1253
- Flag : "strict-transport-security-options" ,
1254
- Env : "CODER_STRICT_TRANSPORT_SECURITY_OPTIONS" ,
1255
- Value : & c .StrictTransportSecurityOptions ,
1256
- Group : & deploymentGroupNetworkingTLS ,
1257
- YAML : "strictTransportSecurityOptions" ,
1291
+ Flag : "strict-transport-security-options" ,
1292
+ Env : "CODER_STRICT_TRANSPORT_SECURITY_OPTIONS" ,
1293
+ Value : & c .StrictTransportSecurityOptions ,
1294
+ Group : & deploymentGroupNetworkingTLS ,
1295
+ YAML : "strictTransportSecurityOptions" ,
1296
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1258
1297
},
1259
1298
{
1260
1299
Name : "SSH Keygen Algorithm" ,
@@ -1298,7 +1337,7 @@ when required by your organization's security policy.`,
1298
1337
Description : "Whether Coder only allows connections to workspaces via the browser." ,
1299
1338
Flag : "browser-only" ,
1300
1339
Env : "CODER_BROWSER_ONLY" ,
1301
- Annotations : clibase.Annotations {}.Mark (flagEnterpriseKey , "true" ),
1340
+ Annotations : clibase.Annotations {}.Mark (flagEnterpriseKey , "true" ). Mark ( flagExternalProxies , "true" ) ,
1302
1341
Value : & c .BrowserOnly ,
1303
1342
Group : & deploymentGroupNetworking ,
1304
1343
YAML : "browserOnly" ,
@@ -1318,17 +1357,19 @@ when required by your organization's security policy.`,
1318
1357
Flag : "disable-path-apps" ,
1319
1358
Env : "CODER_DISABLE_PATH_APPS" ,
1320
1359
1321
- Value : & c .DisablePathApps ,
1322
- YAML : "disablePathApps" ,
1360
+ Value : & c .DisablePathApps ,
1361
+ YAML : "disablePathApps" ,
1362
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1323
1363
},
1324
1364
{
1325
1365
Name : "Disable Owner Workspace Access" ,
1326
1366
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." ,
1327
1367
Flag : "disable-owner-workspace-access" ,
1328
1368
Env : "CODER_DISABLE_OWNER_WORKSPACE_ACCESS" ,
1329
1369
1330
- Value : & c .DisableOwnerWorkspaceExec ,
1331
- YAML : "disableOwnerWorkspaceAccess" ,
1370
+ Value : & c .DisableOwnerWorkspaceExec ,
1371
+ YAML : "disableOwnerWorkspaceAccess" ,
1372
+ Annotations : clibase.Annotations {}.Mark (flagExternalProxies , "true" ),
1332
1373
},
1333
1374
{
1334
1375
Name : "Session Duration" ,
0 commit comments