From 5554c72d9a205af4f537b14b65511b0d62d7adab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 18 Aug 2021 17:22:52 +0200 Subject: [PATCH] gotta run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- docs/extensions/storage/users.md | 4 +- docs/ocis/deployment/bridge.md | 101 +++++++++++++++++++++++++--- glauth/pkg/command/server.go | 16 +++-- glauth/pkg/config/config.go | 9 +-- glauth/pkg/flagset/flagset.go | 16 ++--- idp/pkg/flagset/flagset.go | 4 +- ocis/docker-compose-eos-test.yml | 2 +- ocis/docker/eos-ocis-dev/start-ldap | 4 +- ocis/docker/eos-ocis/setup | 2 +- proxy/pkg/command/server.go | 6 +- proxy/pkg/config/config.go | 4 +- storage/pkg/command/authbasic.go | 4 ++ storage/pkg/command/gateway.go | 5 ++ storage/pkg/command/users.go | 4 ++ storage/pkg/flagset/ldap.go | 4 +- thumbnails/pkg/command/server.go | 7 +- web/pkg/command/server.go | 6 +- 17 files changed, 156 insertions(+), 42 deletions(-) diff --git a/docs/extensions/storage/users.md b/docs/extensions/storage/users.md index 4a5e716faf..3b911ca8f5 100644 --- a/docs/extensions/storage/users.md +++ b/docs/extensions/storage/users.md @@ -38,10 +38,10 @@ If the below defaults don't match your environment change them accordingly: ``` export STORAGE_LDAP_HOSTNAME=localhost export STORAGE_LDAP_PORT=9126 -export STORAGE_LDAP_BASE_DN='dc=example,dc=org' +export STORAGE_LDAP_BASE_DN='dc=ocis,dc=test' export STORAGE_LDAP_USERFILTER='(&(objectclass=posixAccount)(cn=%s))' export STORAGE_LDAP_GROUPFILTER='(&(objectclass=posixGroup)(cn=%s))' -export STORAGE_LDAP_BIND_DN='cn=reva,ou=sysusers,dc=example,dc=org' +export STORAGE_LDAP_BIND_DN='cn=reva,ou=sysusers,dc=ocis,dc=test' export STORAGE_LDAP_BIND_PASSWORD=reva export STORAGE_LDAP_USER_SCHEMA_UID=uid export STORAGE_LDAP_USER_SCHEMA_MAIL=mail diff --git a/docs/ocis/deployment/bridge.md b/docs/ocis/deployment/bridge.md index 5e8656cd95..b291b1bfde 100644 --- a/docs/ocis/deployment/bridge.md +++ b/docs/ocis/deployment/bridge.md @@ -74,21 +74,35 @@ This should give you an `ocis/bin/ocis` binary. Try listing the help with `ocis/ You can check out a custom branch and build a custom binary which can then be used for the below steps. {{< /hint >}} -### Start ocis-glauth +### Start ocis glauth We are going to use the built binary and ownCloud 10 graphapi app to turn ownCloud 10 into the datastore for an LDAP proxy. -#### Run it! +#### configure it -You need to point `ocis/bin/ocis glauth` to your owncloud domain: -```console -$ ocis/bin/ocis --ocis-log-level debug glauth --backend-datastore owncloud --backend-server https://cloud.ocis.test/apps/graphapi/v1.0 --backend-basedn dc=ocis,dc=test +While ocis can be configured using environment variables, eg. for a docker compose setup we are going to use a more traditional config file here. +Create a config file for ocis in either `/etc/ocis`, `$HOME/.ocis` or `./.config`. You can use `.json`, `.yaml` or `.toml`. I will use toml here, because ... reasons. + +```toml +[glauth.backend] +datastore = "owncloud" # switch to the owncloud datastore +servers = ["https://cloud.ocis.test/apps/graphapi/v1.0"] # the graph api endpoint to connect to +basedn = "dc=ocis,dc=test" # base dn to construct the LDAP dn. The user `admin` will become `cn=admin,dc=ocis,dc=test` ``` -`--ocis-log-level debug` is only used to generate more verbose output -`--backend-datastore owncloud` switches to the owncloud datastore -`--backend-server https://cloud.ocis.test/apps/graphapi/v1.0` is the URL to a graphapi endpoint of an existing ownCloud 10 instance -`--backend-basedn dc=ocis,dc=test` is used to construct the LDAP dn. The user `admin` will become `cn=admin,dc=ocis,dc=test`. +{{< hint >}} +There is a bug in the config merging for environment variables, cli flags and config files causing log settings not to be picked up from the config file when specifying `--extensions`. That is why I will +* configure most of the config in a file, +* adjust logging using `OCIS_LOG_*` environment variables and +* specify which extension to run using `ocis/bin/ocis server --extensions "comma, separated, list, of, extensions"`. +{{< /hint >}} + +#### Run it! + +For now, we only start the glauth extension: +```console +$ OCIS_LOG_PRETTY=true OCIS_LOG_COLOR=true ocis/bin/ocis server --extensions "glauth" +``` #### Check it is up and running @@ -106,11 +120,78 @@ $ ldapsearch -x -H ldap://127.0.0.1:9125 -b dc=ocis,dc=test -D "cn=admin,dc=ocis This is currently a readonly implementation and minimal to the usecase of authenticating users with an IDP. {{< /hint >}} +### Start ocis storage-gateway, storage-authbasic and storage-userprovider + +We are going to set up reva to authenticate users against our glauth LDAP proxy. This allows us to log in and use the reva cli. The ocis storage-gateway starts the reva gateway which will authenticate basic auth requests using the storage-authbasic service. Furthermore, users have to be available in the storage-userprovider to retrieve displayname, email address and other user metadata. + +To configure LDAP to use our glauth we add this section to the config file: + +```toml +[storage.reva.ldap] +idp = "https://ocis.ocis.test" +basedn = "dc=ocis,dc=test" +binddn = "cn=admin,dc=ocis,dc=test" # an admin user in your oc10 +bindpassword = "secret" +userschema = { uid = "uid", displayname = "givenname" } # TODO make glauth return an ownclouduuid and displayname attribute +``` + +Now we can start all necessary services. + +```console +$ OCIS_LOG_PRETTY=true OCIS_LOG_COLOR=true ocis/bin/ocis server --extensions "glauth, storage-gateway, storage-authbasic, storage-userprovider" +``` + + +{{< hint warning >}} +Here I ran out of time. I tried to verify this step with the reva cli: +`cmd/reva/reva -insecure -host localhost:9142` +`login basic` +but it tries to create the user home, which cannot be disabled in a config file: https://github.com/owncloud/ocis/issues/2416#issuecomment-901197053 + +starting `STORAGE_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN=true OCIS_LOG_LEVEL=debug OCIS_LOG_PRETTY=true OCIS_LOG_COLOR=true ocis/bin/ocis server --extensions "storage-gateway, storage-authbasic, storage-userprovider"` let me login: + +```console +✗ cmd/reva/reva -insecure -host localhost:9142 +reva-cli v1.11.0-27-g95b1f2ee (rev-95b1f2ee) +Please use `exit` or `Ctrl-D` to exit this program. +>> login basic +username: jfd +password: OK +>> whoami +id: username:"jfd" mail:"jfd@butonic.de" display_name:"J\303\266rn" uid_number:99 gid_number:99 +>> exit +``` + +I hope https://github.com/owncloud/ocis/pull/2024 fixes the parsing order of things. + +everything below this is outdated + +... gotta run +{{< /hint >}} + + +### Start ocis storage-userprovider + +```console +ocis/bin/ocis storage-userprovider --ldap-port 19126 --ldap-user-schema-uid uid --ldap-user-schema-displayName givenName --addr :19144 +``` + +TODO clone `git clone git@github.com:cs3org/cs3apis.git` + +query users using [grpcurl](https://github.com/fullstorydev/grpcurl) +```console +grpcurl -import-path ./cs3apis/ -proto ./cs3apis/cs3/identity/user/v1beta1/user_api.proto -plaintext localhost:19144 cs3.identity.user.v1beta1.UserAPI/FindUsers +ERROR: + Code: Unauthenticated + Message: auth: core access token not found +``` + + ### Start ocis idp #### Set environment variables -The build in [libregraph/lico](https://github.com/libregraph/lico) needs environment variables to configure the LDAP server: +The built in [libregraph/lico](https://github.com/libregraph/lico) needs environment variables to configure the LDAP server: ```console export OCIS_URL=https://ocis.ocis.test export IDP_LDAP_URI=ldap://127.0.0.1:9125 diff --git a/glauth/pkg/command/server.go b/glauth/pkg/command/server.go index 5a2f1f10d1..e5789bf9d5 100644 --- a/glauth/pkg/command/server.go +++ b/glauth/pkg/command/server.go @@ -30,12 +30,18 @@ func Server(cfg *config.Config) *cli.Command { if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } - cfg.Backend.Servers = ctx.StringSlice("backend-server") - cfg.Fallback.Servers = ctx.StringSlice("fallback-server") + // StringSliceFlag doesn't support Destination + // UPDATE Destination on string flags supported. Wait for https://github.com/urfave/cli/pull/1078 to get to micro/cli + if len(ctx.StringSlice("backend-server")) > 0 { + cfg.Backend.Servers = ctx.StringSlice("backend-server") + } + if len(ctx.StringSlice("fallback-server")) > 0 { + cfg.Fallback.Servers = ctx.StringSlice("fallback-server") + } if !cfg.Supervised { return ParseConfig(ctx, cfg) } - logger.Debug().Str("service", "glauth").Msg("ignoring config file parsing when running supervised") + logger.Debug().Strs("backend-server", ctx.StringSlice("backend-server")).Str("service", "glauth").Msg("ignoring config file parsing when running supervised") return nil }, Action: func(c *cli.Context) error { @@ -62,11 +68,11 @@ func Server(cfg *config.Config) *cli.Command { lcfg := glauthcfg.LDAP{ Enabled: cfg.Ldap.Enabled, - Listen: cfg.Ldap.Address, + Listen: cfg.Ldap.Addr, } lscfg := glauthcfg.LDAPS{ Enabled: cfg.Ldaps.Enabled, - Listen: cfg.Ldaps.Address, + Listen: cfg.Ldaps.Addr, Cert: cfg.Ldaps.Cert, Key: cfg.Ldaps.Key, } diff --git a/glauth/pkg/config/config.go b/glauth/pkg/config/config.go index 21c1019081..0d88c318a0 100644 --- a/glauth/pkg/config/config.go +++ b/glauth/pkg/config/config.go @@ -36,15 +36,16 @@ type Tracing struct { // Ldap defined the available LDAP configuration. type Ldap struct { - Address string + Addr string Enabled bool } // Ldaps defined the available LDAPS configuration. type Ldaps struct { - Ldap - Cert string - Key string + Addr string + Enabled bool + Cert string + Key string } // Backend defined the available backend configuration. diff --git a/glauth/pkg/flagset/flagset.go b/glauth/pkg/flagset/flagset.go index 29ef1069a7..6fb69847e2 100644 --- a/glauth/pkg/flagset/flagset.go +++ b/glauth/pkg/flagset/flagset.go @@ -132,10 +132,10 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "ldap-addr", - Value: flags.OverrideDefaultString(cfg.Ldap.Address, "0.0.0.0:9125"), + Value: flags.OverrideDefaultString(cfg.Ldap.Addr, "0.0.0.0:9125"), Usage: "Address to bind ldap server", EnvVars: []string{"GLAUTH_LDAP_ADDR"}, - Destination: &cfg.Ldap.Address, + Destination: &cfg.Ldap.Addr, }, &cli.BoolFlag{ Name: "ldap-enabled", @@ -147,10 +147,10 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "ldaps-addr", - Value: flags.OverrideDefaultString(cfg.Ldaps.Address, "0.0.0.0:9126"), + Value: flags.OverrideDefaultString(cfg.Ldaps.Addr, "0.0.0.0:9126"), Usage: "Address to bind ldap server", EnvVars: []string{"GLAUTH_LDAPS_ADDR"}, - Destination: &cfg.Ldaps.Address, + Destination: &cfg.Ldaps.Addr, }, &cli.BoolFlag{ Name: "ldaps-enabled", @@ -178,7 +178,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "backend-basedn", - Value: flags.OverrideDefaultString(cfg.Backend.BaseDN, "dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Backend.BaseDN, "dc=ocis,dc=test"), Usage: "base distinguished name to expose", EnvVars: []string{"GLAUTH_BACKEND_BASEDN"}, Destination: &cfg.Backend.BaseDN, @@ -221,8 +221,8 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringSliceFlag{ Name: "backend-server", - Value: cli.NewStringSlice("https://demo.owncloud.com/apps/graphapi/v1.0"), - Usage: `--backend-server http://internal1.example.com [--backend-server http://internal2.example.com]`, + Value: cli.NewStringSlice(), + Usage: `--backend-server https://demo.owncloud.com/apps/graphapi/v1.0 [--backend-server "https://demo2.owncloud.com/apps/graphapi/v1.0"]`, EnvVars: []string{"GLAUTH_BACKEND_SERVERS"}, }, &cli.BoolFlag{ @@ -237,7 +237,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "fallback-basedn", - Value: flags.OverrideDefaultString(cfg.Fallback.BaseDN, "dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Fallback.BaseDN, "dc=ocis,dc=test"), Usage: "base distinguished name to expose", EnvVars: []string{"GLAUTH_FALLBACK_BASEDN"}, Destination: &cfg.Fallback.BaseDN, diff --git a/idp/pkg/flagset/flagset.go b/idp/pkg/flagset/flagset.go index aa41ee52a1..7cf92a5971 100644 --- a/idp/pkg/flagset/flagset.go +++ b/idp/pkg/flagset/flagset.go @@ -166,7 +166,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-bind-dn", - Value: flags.OverrideDefaultString(cfg.Ldap.BindDN, "cn=idp,ou=sysusers,dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Ldap.BindDN, "cn=idp,ou=sysusers,dc=ocis,dc=test"), Usage: "Bind DN for the LDAP server (glauth)", EnvVars: []string{"IDP_LDAP_BIND_DN"}, Destination: &cfg.Ldap.BindDN, @@ -180,7 +180,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-base-dn", - Value: flags.OverrideDefaultString(cfg.Ldap.BaseDN, "ou=users,dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Ldap.BaseDN, "ou=users,dc=ocis,dc=test"), Usage: "LDAP base DN of the oCIS users", EnvVars: []string{"IDP_LDAP_BASE_DN"}, Destination: &cfg.Ldap.BaseDN, diff --git a/ocis/docker-compose-eos-test.yml b/ocis/docker-compose-eos-test.yml index dd4464e167..b6172b1c48 100644 --- a/ocis/docker-compose-eos-test.yml +++ b/ocis/docker-compose-eos-test.yml @@ -47,7 +47,7 @@ services: # the eos end xrdcopy binaries use this env var to find the eos mgm EOS_MGM_URL: ${EOS_MGM_URL:-root://mgm-master.testnet:1094} # TODO without this the /etc/nclcd.conf file is empty - LDAP_BINDDN: "cn=reva,ou=sysusers,dc=example,dc=org" + LDAP_BINDDN: "cn=reva,ou=sysusers,dc=ocis,dc=test" LDAP_BINDPW: "reva" mgm-master: diff --git a/ocis/docker/eos-ocis-dev/start-ldap b/ocis/docker/eos-ocis-dev/start-ldap index 64a5df0e68..38c85d7481 100755 --- a/ocis/docker/eos-ocis-dev/start-ldap +++ b/ocis/docker/eos-ocis-dev/start-ldap @@ -1,6 +1,6 @@ #!/bin/sh -LDAP_BINDDN=${LDAP_BINDDN:-cn=reva,ou=sysusers,dc=example,dc=org} +LDAP_BINDDN=${LDAP_BINDDN:-cn=reva,ou=sysusers,dc=ocis,dc=test} LDAP_BINDPW=${LDAP_BINDPW:-reva} echo "Waiting for EOS MGM" @@ -9,7 +9,7 @@ chmod +x /wait-for-mgm /wait-for-mgm; echo "----- [ocis] LDAP setup -----"; -authconfig --enableldap --enableldapauth --ldapserver=${EOS_LDAP_HOST} --ldapbasedn="dc=example,dc=org" --update; +authconfig --enableldap --enableldapauth --ldapserver=${EOS_LDAP_HOST} --ldapbasedn="dc=ocis,dc=test" --update; sed -i "s/#binddn cn=.*/binddn ${LDAP_BINDDN}/" /etc/nslcd.conf sed -i "s/#bindpw .*/bindpw ${LDAP_BINDPW}/" /etc/nslcd.conf # start in debug mode; diff --git a/ocis/docker/eos-ocis/setup b/ocis/docker/eos-ocis/setup index b146fbbf43..d629eeb009 100755 --- a/ocis/docker/eos-ocis/setup +++ b/ocis/docker/eos-ocis/setup @@ -3,7 +3,7 @@ set -x echo "----- [ocis] LDAP setup -----" -authconfig --enableldap --enableldapauth --ldapserver=${EOS_LDAP_HOST} --ldapbasedn="dc=example,dc=org" --update +authconfig --enableldap --enableldapauth --ldapserver=${EOS_LDAP_HOST} --ldapbasedn="dc=ocis,dc=test" --update sed -i "s/#binddn cn=.*/binddn ${LDAP_BINDDN}/" /etc/nslcd.conf sed -i "s/#bindpw .*/bindpw ${LDAP_BINDPW}/" /etc/nslcd.conf # start in debug mode diff --git a/proxy/pkg/command/server.go b/proxy/pkg/command/server.go index b066c7d556..f68e8d67e0 100644 --- a/proxy/pkg/command/server.go +++ b/proxy/pkg/command/server.go @@ -44,7 +44,11 @@ func Server(cfg *config.Config) *cli.Command { if cfg.HTTP.Root != "/" { cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") } - cfg.PreSignedURL.AllowedHTTPMethods = ctx.StringSlice("presignedurl-allow-method") + // StringSliceFlag doesn't support Destination + // UPDATE Destination on string flags supported. Wait for https://github.com/urfave/cli/pull/1078 to get to micro/cli + if len(ctx.StringSlice("presignedurl-allow-method")) > 0 { + cfg.PreSignedURL.AllowedHTTPMethods = ctx.StringSlice("presignedurl-allow-method") + } if err := loadUserAgent(ctx, cfg); err != nil { return err diff --git a/proxy/pkg/config/config.go b/proxy/pkg/config/config.go index e263302741..036c6d29d4 100644 --- a/proxy/pkg/config/config.go +++ b/proxy/pkg/config/config.go @@ -121,8 +121,8 @@ type Config struct { Reva Reva PreSignedURL PreSignedURL AccountBackend string - UserOIDCClaim string - UserCS3Claim string + UserOIDCClaim string + UserCS3Claim string AutoprovisionAccounts bool EnableBasicAuth bool InsecureBackends bool diff --git a/storage/pkg/command/authbasic.go b/storage/pkg/command/authbasic.go index 3e0d11db41..161ca51de6 100644 --- a/storage/pkg/command/authbasic.go +++ b/storage/pkg/command/authbasic.go @@ -49,6 +49,10 @@ func AuthBasic(cfg *config.Config) *cli.Command { pidFile := path.Join(os.TempDir(), "revad-"+c.Command.Name+"-"+uuid.String()+".pid") rcfg := authBasicConfigFromStruct(c, cfg) + logger.Debug(). + Str("server", "authbasic"). + Interface("reva-config", rcfg). + Msg("config") gr.Add(func() error { runtime.RunWithOptions(rcfg, pidFile, runtime.WithLogger(&logger.Logger)) diff --git a/storage/pkg/command/gateway.go b/storage/pkg/command/gateway.go index 50032f2e70..91970d6e20 100644 --- a/storage/pkg/command/gateway.go +++ b/storage/pkg/command/gateway.go @@ -50,6 +50,11 @@ func Gateway(cfg *config.Config) *cli.Command { uuid := uuid.Must(uuid.NewV4()) pidFile := path.Join(os.TempDir(), "revad-"+c.Command.Name+"-"+uuid.String()+".pid") rcfg := gatewayConfigFromStruct(c, cfg, logger) + logger.Debug(). + Str("server", "gateway"). + Interface("reva-config", rcfg). + Msg("config") + defer cancel() gr.Add(func() error { diff --git a/storage/pkg/command/users.go b/storage/pkg/command/users.go index f93171e1eb..02a23227c9 100644 --- a/storage/pkg/command/users.go +++ b/storage/pkg/command/users.go @@ -52,6 +52,10 @@ func Users(cfg *config.Config) *cli.Command { pidFile := path.Join(os.TempDir(), "revad-"+c.Command.Name+"-"+uuid.String()+".pid") rcfg := usersConfigFromStruct(c, cfg) + logger.Debug(). + Str("server", "users"). + Interface("reva-config", rcfg). + Msg("config") gr.Add(func() error { runtime.RunWithOptions( diff --git a/storage/pkg/flagset/ldap.go b/storage/pkg/flagset/ldap.go index b5f069a45b..ca35e29b7c 100644 --- a/storage/pkg/flagset/ldap.go +++ b/storage/pkg/flagset/ldap.go @@ -25,7 +25,7 @@ func LDAPWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-base-dn", - Value: flags.OverrideDefaultString(cfg.Reva.LDAP.BaseDN, "dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Reva.LDAP.BaseDN, "dc=ocis,dc=test"), Usage: "LDAP basedn", EnvVars: []string{"STORAGE_LDAP_BASE_DN"}, Destination: &cfg.Reva.LDAP.BaseDN, @@ -105,7 +105,7 @@ func LDAPWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-bind-dn", - Value: flags.OverrideDefaultString(cfg.Reva.LDAP.BindDN, "cn=reva,ou=sysusers,dc=example,dc=org"), + Value: flags.OverrideDefaultString(cfg.Reva.LDAP.BindDN, "cn=reva,ou=sysusers,dc=ocis,dc=test"), Usage: "LDAP bind dn", EnvVars: []string{"STORAGE_LDAP_BIND_DN"}, Destination: &cfg.Reva.LDAP.BindDN, diff --git a/thumbnails/pkg/command/server.go b/thumbnails/pkg/command/server.go index 9825b229ba..578ac72c9c 100644 --- a/thumbnails/pkg/command/server.go +++ b/thumbnails/pkg/command/server.go @@ -23,7 +23,12 @@ func Server(cfg *config.Config) *cli.Command { Flags: flagset.ServerWithConfig(cfg), Before: func(ctx *cli.Context) error { logger := NewLogger(cfg) - cfg.Thumbnail.Resolutions = ctx.StringSlice("thumbnail-resolution") + + // StringSliceFlag doesn't support Destination + // UPDATE Destination on string flags supported. Wait for https://github.com/urfave/cli/pull/1078 to get to micro/cli + if len(ctx.StringSlice("thumbnail-resolution")) > 0 { + cfg.Thumbnail.Resolutions = ctx.StringSlice("thumbnail-resolution") + } if !cfg.Supervised { return ParseConfig(ctx, cfg) diff --git a/web/pkg/command/server.go b/web/pkg/command/server.go index 2d518000bd..eb5c3e3541 100644 --- a/web/pkg/command/server.go +++ b/web/pkg/command/server.go @@ -29,7 +29,11 @@ func Server(cfg *config.Config) *cli.Command { cfg.HTTP.Root = strings.TrimRight(cfg.HTTP.Root, "/") } - cfg.Web.Config.Apps = ctx.StringSlice("web-config-app") + // StringSliceFlag doesn't support Destination + // UPDATE Destination on string flags supported. Wait for https://github.com/urfave/cli/pull/1078 to get to micro/cli + if len(ctx.StringSlice("web-config-app")) > 0 { + cfg.Web.Config.Apps = ctx.StringSlice("web-config-app") + } if !cfg.Supervised { if err := ParseConfig(ctx, cfg); err != nil {