7
7
8
8
"github.com/coder/coder/cli/cliflag"
9
9
"github.com/coder/coder/cli/cliui"
10
+ "github.com/coder/coder/coderd/database"
10
11
"github.com/coder/coder/enterprise/coderd"
11
12
12
13
agpl "github.com/coder/coder/cli"
@@ -15,26 +16,33 @@ import (
15
16
16
17
func server () * cobra.Command {
17
18
var (
18
- auditLogging bool
19
- browserOnly bool
20
- scimAuthHeader string
21
- userWorkspaceQuota int
19
+ auditLogging bool
20
+ browserOnly bool
21
+ scimAuthHeader string
22
+ userWorkspaceQuota int
23
+ allowedApplicationSharingLevels []string
22
24
)
23
25
cmd := agpl .Server (func (ctx context.Context , options * agplcoderd.Options ) (* agplcoderd.API , error ) {
26
+ appSharingLevels := make ([]database.AppSharingLevel , len (allowedApplicationSharingLevels ))
27
+ for i , val := range allowedApplicationSharingLevels {
28
+ appSharingLevels [i ] = database .AppSharingLevel (val )
29
+ }
30
+
24
31
api , err := coderd .New (ctx , & coderd.Options {
25
- AuditLogging : auditLogging ,
26
- BrowserOnly : browserOnly ,
27
- SCIMAPIKey : []byte (scimAuthHeader ),
28
- UserWorkspaceQuota : userWorkspaceQuota ,
29
- Options : options ,
32
+ AuditLogging : auditLogging ,
33
+ BrowserOnly : browserOnly ,
34
+ SCIMAPIKey : []byte (scimAuthHeader ),
35
+ UserWorkspaceQuota : userWorkspaceQuota ,
36
+ AllowedApplicationSharingLevels : appSharingLevels ,
37
+ Options : options ,
30
38
})
31
39
if err != nil {
32
40
return nil , err
33
41
}
34
42
return api .AGPL , nil
35
43
})
36
- enterpriseOnly := cliui .Styles .Keyword .Render ("This is an Enterprise feature. Contact sales@coder.com for licensing" )
37
44
45
+ enterpriseOnly := cliui .Styles .Keyword .Render ("This is an Enterprise feature. Contact sales@coder.com for licensing" )
38
46
cliflag .BoolVarP (cmd .Flags (), & auditLogging , "audit-logging" , "" , "CODER_AUDIT_LOGGING" , true ,
39
47
"Specifies whether audit logging is enabled. " + enterpriseOnly )
40
48
cliflag .BoolVarP (cmd .Flags (), & browserOnly , "browser-only" , "" , "CODER_BROWSER_ONLY" , false ,
@@ -43,6 +51,8 @@ func server() *cobra.Command {
43
51
"Enables SCIM and sets the authentication header for the built-in SCIM server. New users are automatically created with OIDC authentication. " + enterpriseOnly )
44
52
cliflag .IntVarP (cmd .Flags (), & userWorkspaceQuota , "user-workspace-quota" , "" , "CODER_USER_WORKSPACE_QUOTA" , 0 ,
45
53
"A positive number applies a limit on how many workspaces each user can create. " + enterpriseOnly )
54
+ cliflag .StringArrayVarP (cmd .Flags (), & allowedApplicationSharingLevels , "permitted-app-sharing-levels" , "" , "CODER_PERMITTED_APP_SHARING_LEVELS" , []string {"owner" },
55
+ `Specifies the application sharing levels that are available site-wide. Available values are "owner", "template", "authenticated", "public". Multiple values can be specified, comma separated. ` + enterpriseOnly )
46
56
47
57
return cmd
48
58
}
0 commit comments