From 7ae8fc22f5fe7b2a1f9df818a0bdb051587d4672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Sun, 22 Mar 2020 09:56:13 +0100 Subject: [PATCH] update reva (#113) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * new ocis config Signed-off-by: Jörn Friedrich Dreyer * Change default settings to be able to run ocis server without any configuration - Konnectd uses no TLS as it is behind the proxy. - Glauth generates dev-certificates for ldap on startup if none is provided. - Glauth can launch unencrypted (9125) and encrypted (9126) port in parallel Signed-off-by: Jörn Friedrich Dreyer * allow configuring user sharing driver, default to json Signed-off-by: Jörn Friedrich Dreyer * update reva Signed-off-by: Jörn Friedrich Dreyer * switch to preferred_username as opaqueid Signed-off-by: Jörn Friedrich Dreyer * update drone config to override new defaults to match test environment Signed-off-by: Jörn Friedrich Dreyer * use latest reva Signed-off-by: Jörn Friedrich Dreyer * typo * use updatet api tests Signed-off-by: Jörn Friedrich Dreyer * core tests got merged already Signed-off-by: Jörn Friedrich Dreyer * fix changelog Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 6 +- changelog/unreleased/fix-typos.md | 5 ++ changelog/unreleased/issue-6.md | 2 +- changelog/unreleased/new-ocis-config.md | 11 +++ .../unreleased/user-sharing-driver-json.md | 5 ++ docs/testing.md | 85 +++++++++++++++++++ go.mod | 2 +- go.sum | 40 ++++++--- pkg/command/gateway.go | 2 +- pkg/command/sharing.go | 4 +- pkg/command/storagehome.go | 8 +- pkg/command/storagehomedata.go | 2 + pkg/command/storageoc.go | 9 +- pkg/command/storageocdata.go | 2 + pkg/command/storageroot.go | 14 ++- pkg/config/config.go | 24 +++--- pkg/flagset/authbasic.go | 14 +-- pkg/flagset/authbearer.go | 12 ++- pkg/flagset/frontend.go | 30 +------ pkg/flagset/gateway.go | 8 ++ pkg/flagset/sharing.go | 14 +++ pkg/flagset/storagehome.go | 21 ++--- pkg/flagset/storagehomedata.go | 7 ++ pkg/flagset/storageoc.go | 29 +++---- pkg/flagset/storageocdata.go | 7 ++ pkg/flagset/storageroot.go | 21 ++--- pkg/flagset/users.go | 16 ++-- 27 files changed, 258 insertions(+), 142 deletions(-) create mode 100644 changelog/unreleased/fix-typos.md create mode 100644 changelog/unreleased/new-ocis-config.md create mode 100644 changelog/unreleased/user-sharing-driver-json.md create mode 100644 docs/testing.md diff --git a/.drone.star b/.drone.star index 559fb550fa..4027b21f5e 100644 --- a/.drone.star +++ b/.drone.star @@ -132,8 +132,11 @@ def testing(ctx): 'pull': 'always', 'detach': True, 'environment' : { - 'REVA_USERS_DRIVER': 'ldap', 'REVA_LDAP_HOSTNAME': 'ldap', + 'REVA_LDAP_PORT': 636, + 'REVA_LDAP_BIND_DN': 'cn=admin,dc=owncloud,dc=com', + 'REVA_LDAP_BIND_PASSWORD': 'admin', + 'REVA_LDAP_BASE_DN': 'dc=owncloud,dc=com', 'REVA_STORAGE_HOME_DATA_TEMP_FOLDER': '/srv/app/tmp/', 'REVA_STORAGE_LOCAL_ROOT': '/srv/app/tmp/reva/root', 'REVA_STORAGE_OWNCLOUD_DATADIR': '/srv/app/tmp/reva/data', @@ -147,7 +150,6 @@ def testing(ctx): 'bin/ocis-reva auth-basic &', 'bin/ocis-reva auth-bearer &', 'bin/ocis-reva sharing &', - 'bin/ocis-reva storage-root &', 'bin/ocis-reva storage-home &', 'bin/ocis-reva storage-home-data &', 'bin/ocis-reva storage-oc &', diff --git a/changelog/unreleased/fix-typos.md b/changelog/unreleased/fix-typos.md new file mode 100644 index 0000000000..c971099dd1 --- /dev/null +++ b/changelog/unreleased/fix-typos.md @@ -0,0 +1,5 @@ +Bugfix: we fixed a typo in the `REVA_LDAP_SCHEMA_MAIL` environment variable + +It was misspelled as `REVA_LDAP_SCHEMA_Mail`. + +https://github.com/owncloud/ocis-reva/pull/113 \ No newline at end of file diff --git a/changelog/unreleased/issue-6.md b/changelog/unreleased/issue-6.md index 99aff1aa36..567c4b3c96 100644 --- a/changelog/unreleased/issue-6.md +++ b/changelog/unreleased/issue-6.md @@ -2,6 +2,6 @@ Change: start multiple services with dedicated commands The initial version would only allow us to use a set of reva configurations to start multiple services. We use a more opinionated set of commands to start dedicated services that allows us to configure them individually. -It allowcs us to switch eg. the user backend to LDAP and fully it on the cli. +It allows us to switch eg. the user backend to LDAP and fully use it on the cli. https://github.com/owncloud/ocis-reva/issues/6 \ No newline at end of file diff --git a/changelog/unreleased/new-ocis-config.md b/changelog/unreleased/new-ocis-config.md new file mode 100644 index 0000000000..f703146a82 --- /dev/null +++ b/changelog/unreleased/new-ocis-config.md @@ -0,0 +1,11 @@ +Change: default to running behind ocis-proxy + +We changed the default configuration to integrate better with ocis. + +- We use ocis-glauth as the default ldap server on port 9125 with base `dc=example,dc=org`. +- We use a dedicated technical `reva` user to make ldap binds +- Clients are supposed to use the ocis-proxy endpoint `https://localhost:9200` +- We removed unneeded ocis configuration from the frontend which no longer serves an oidc provider. +- We changed the default user OpaqueID attribute from `sub` to `preferred_username`. The latter is a claim populated by konnectd that can also be used by the reva ldap user manager to look up users by their OpaqueId + +https://github.com/owncloud/ocis-reva/pull/113 diff --git a/changelog/unreleased/user-sharing-driver-json.md b/changelog/unreleased/user-sharing-driver-json.md new file mode 100644 index 0000000000..b278da6939 --- /dev/null +++ b/changelog/unreleased/user-sharing-driver-json.md @@ -0,0 +1,5 @@ +Enhancement: Allow configuring user sharing driver + +We now default to `json` which persists shares in the sharing manager in a json file instead of an in memory db. + +https://github.com/owncloud/ocis-reva/pull/115 diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 0000000000..aacd1f41bd --- /dev/null +++ b/docs/testing.md @@ -0,0 +1,85 @@ +--- +title: "Testing" +date: 2018-05-02T00:00:00+00:00 +weight: 37 +geekdocRepo: https://github.com/owncloud/ocis-reva +geekdocEditPath: edit/master/docs +geekdocFilePath: testing.md +--- + + +## Acceptance tests + +We are using the ownCloud 10 acceptance testsuite against ocis. To set this up you need the owncloud 10 core repo, an ldap server that the acceptance tests can use to manage users and the ocis-reva code. + +### Getting the tests + +All you need to do to get the acceptance tests is check out the core repo: +``` +git clone https://github.com/owncloud/core.git +``` + +### Run an ldap server in a docker container + +The ownCloud 10 acceptance tests will need write permission. You can start a suitable ldap server in a docker container with: + +``` +docker run --hostname ldap.my-company.com \ + -e LDAP_TLS_VERIFY_CLIENT=never \ + -e LDAP_DOMAIN=owncloud.com \ + -e LDAP_ORGANISATION=ownCloud \ + -e LDAP_ADMIN_PASSWORD=admin \ + --name docker-slapd \ + -p 127.0.0.1:389:389 \ + -p 636:636 -d osixia/openldap +``` + +### Run ocis-reva with that ldap server + +`ocis-reva` provides multiple subcommands. To configure them all via env vars you can export these environment variables. + +``` +export REVA_USERS_DRIVER=ldap +export REVA_LDAP_HOSTNAME=localhost +export REVA_LDAP_PORT=636 +export REVA_LDAP_BASE_DN='dc=owncloud,dc=com' +export REVA_LDAP_USERFILTER='(&(objectclass=posixAccount)(cn=%s))' +export REVA_LDAP_GROUPFILTER='(&(objectclass=posixGroup)(cn=%s))' +export REVA_LDAP_BIND_DN='cn=admin,dc=owncloud,dc=com' +export REVA_LDAP_BIND_PASSWORD=admin +export REVA_LDAP_SCHEMA_UID=uid +export REVA_LDAP_SCHEMA_MAIL=mail +export REVA_LDAP_SCHEMA_DISPLAYNAME=displayName +export REVA_LDAP_SCHEMA_CN=cn +``` + +Then you need to start the ocis-reva services +``` +bin/ocis-reva frontend & \ +bin/ocis-reva gateway & \ +bin/ocis-reva auth-basic & \ +bin/ocis-reva auth-bearer & \ +bin/ocis-reva sharing & \ +bin/ocis-reva storage-home & \ +bin/ocis-reva storage-home-data & \ +bin/ocis-reva storage-oc & \ +bin/ocis-reva storage-oc-data & \ +bin/ocis-reva users & +``` + +### Run the acceptance tests + +In the ownCloud 10 core repo run + +``` +make test-acceptance-api \ +TEST_SERVER_URL=http://localhost:9140 \ +TEST_EXTERNAL_USER_BACKENDS=true \ +TEST_OCIS=true \ +OCIS_REVA_DATA_ROOT=/var/tmp/reva/ \ +BEHAT_FILTER_TAGS='~@skipOnOcis&&~@skipOnLDAP&&@TestAlsoOnExternalUserBackend&&~@local_storage' +``` + +### Notes +- rerunning the tests requires wiping the users in the ldap server, otherwise the tests will fail when trying to populate the users +- users are created with usernames like `user0`, the default password is `123456` \ No newline at end of file diff --git a/go.mod b/go.mod index 6450ad3b74..c54622476f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.13 require ( github.com/cespare/xxhash/v2 v2.1.1 // indirect - github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b + github.com/cs3org/reva v0.1.1-0.20200320145721-40c4334849c3 github.com/gofrs/uuid v3.2.0+incompatible github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e // indirect github.com/micro/cli/v2 v2.1.1 diff --git a/go.sum b/go.sum index ad34f753cc..c1b3828789 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.0.2 h1:tRi7ENs+AaOUCH+j6qwNQgPYfV26dX3JNonq+V4mhqc= github.com/Masterminds/semver/v3 v3.0.2/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig/v3 v3.0.1 h1:RuaOafp+8qOLUPX1lInLfUrLc1MEVbnz7a40RLoixKY= github.com/Masterminds/sprig/v3 v3.0.1/go.mod h1:Cp7HwZjmqKrC+Y7XqSJOU2yRvAJRGLiohfgz5ZJj8+4= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -67,8 +71,8 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee h1:3T/l+vMotQ7cDSLWNAn2Vg1SAQ3mdyLgBWWBitSS3uU= github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee/go.mod h1:u7Wtt4WATGGgae9mURNGQQqxAudPKrxfsbSDSGOso+g= github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.28.13 h1:JyCQQ86yil3hg7MtWdNH8Pbcgx92qlUV2v22Km63Mf4= -github.com/aws/aws-sdk-go v1.28.13/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.29.28 h1:4eKUDBN+v1yxpGDxxPY+FG2Abc6yJB6vvkEDRJ9jIW0= +github.com/aws/aws-sdk-go v1.29.28/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -96,6 +100,7 @@ github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wX github.com/cheggaaa/pb v1.0.28/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -129,10 +134,10 @@ github.com/cpu/goacmedns v0.0.1/go.mod h1:sesf/pNnCYwUevQEQfEwY0Y3DydlQWSGZbaMEl github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/cs3org/go-cs3apis v0.0.0-20200115100126-824a5f718250 h1:N/WWs9OegcgFlsUo7/iahxq+e3luhZKu0B8wLrWBsTQ= -github.com/cs3org/go-cs3apis v0.0.0-20200115100126-824a5f718250/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= -github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b h1:8kfSFbzmolP/ZAm455PsAjD5qSqpESryEjpK0ceAWS0= -github.com/cs3org/reva v0.0.2-0.20200212114015-0dbce24f7e8b/go.mod h1:/Sg6MOumvaYkxRJJNZ0c8AvDJe+sn7MJnnxJfwY2MhE= +github.com/cs3org/go-cs3apis v0.0.0-20200306065539-29abc33f5be0 h1:jTKILSBtDm0GEw3FtXPxc5wxGpaw2pxzREg1GBV9LIQ= +github.com/cs3org/go-cs3apis v0.0.0-20200306065539-29abc33f5be0/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= +github.com/cs3org/reva v0.1.1-0.20200320145721-40c4334849c3 h1:7BfCqdqybadKHM54yat8xvmjVdZhbRpHsEkv5705ASU= +github.com/cs3org/reva v0.1.1-0.20200320145721-40c4334849c3/go.mod h1:Gbm21YRiquCdR34ATmcp6HF0IGSr/EyhSIm/jHh0ZCc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -155,6 +160,7 @@ github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkg github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -187,6 +193,7 @@ github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3yg github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= @@ -217,6 +224,8 @@ github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5 h1:F768QJ1E9tib+q5Sc8MkdJi1RxLTbRcTf8LJV56aRls= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= @@ -273,6 +282,8 @@ github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/huandu/xstrings v1.3.0 h1:gvV6jG9dTgFEncxo+AF7PH6MZXi/vZl25owA/8Dg8Wo= +github.com/huandu/xstrings v1.3.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -373,6 +384,8 @@ github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9 github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.2.1 h1:pSevhhKCEjOuZHQWDBYAHxcimg60m1fGFj6atY7zAdE= +github.com/mitchellh/mapstructure v1.2.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -428,8 +441,8 @@ github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mo github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= -github.com/ory/fosite v0.30.2 h1:1HQZPXQ+PdeIe27H9Fjfvxem5uxVc/diIwUDk5XTEM4= -github.com/ory/fosite v0.30.2/go.mod h1:Lq9qQ9Sl6mcea2Tt8J7PU+wUeFYPZ+vg7N3zPVKGbN8= +github.com/ory/fosite v0.30.4 h1:2cd8qlIad58Lgz3MrVtpaaEQKDXLphYvCEClJTYPUJE= +github.com/ory/fosite v0.30.4/go.mod h1:Lq9qQ9Sl6mcea2Tt8J7PU+wUeFYPZ+vg7N3zPVKGbN8= github.com/ory/go-convenience v0.1.0 h1:zouLKfF2GoSGnJwGq+PE/nJAE6dj2Zj5QlTgmMTsTS8= github.com/ory/go-convenience v0.1.0/go.mod h1:uEY/a60PL5c12nYz4V5cHY03IBmwIAEm8TWB0yn9KNs= github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= @@ -504,6 +517,8 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.17.2 h1:RMRHFw2+wF7LO0QqtELQwo8hqSmqISyCJeFeAAuWcRo= github.com/rs/zerolog v1.17.2/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= +github.com/rs/zerolog v1.18.0 h1:CbAm3kP2Tptby1i9sYy2MGRg0uxIN9cyDb59Ys7W8z8= +github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= @@ -645,6 +660,7 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -672,7 +688,6 @@ golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191011234655-491137f69257/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -680,6 +695,8 @@ golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181003184128-c57b0facaced/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -762,6 +779,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64 golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -805,8 +823,8 @@ google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= diff --git a/pkg/command/gateway.go b/pkg/command/gateway.go index 4425e3217e..223114edb1 100644 --- a/pkg/command/gateway.go +++ b/pkg/command/gateway.go @@ -120,7 +120,7 @@ func Gateway(cfg *config.Config) *cli.Command { "driver": "static", "drivers": map[string]interface{}{ "static": map[string]interface{}{ - "home_provider": cfg.Reva.StorageHome.MountPath, + "home_provider": cfg.Reva.Gateway.HomeProvider, "rules": map[string]interface{}{ cfg.Reva.StorageRoot.MountPath: cfg.Reva.StorageRoot.URL, cfg.Reva.StorageRoot.MountID: cfg.Reva.StorageRoot.URL, diff --git a/pkg/command/sharing.go b/pkg/command/sharing.go index c40e494303..aa248f2426 100644 --- a/pkg/command/sharing.go +++ b/pkg/command/sharing.go @@ -84,10 +84,10 @@ func Sharing(cfg *config.Config) *cli.Command { // TODO build services dynamically "services": map[string]interface{}{ "usershareprovider": map[string]interface{}{ - "driver": "memory", + "driver": cfg.Reva.Sharing.UserDriver, }, "publicshareprovider": map[string]interface{}{ - "driver": "memory", + "driver": cfg.Reva.Sharing.PublicDriver, }, }, }, diff --git a/pkg/command/storagehome.go b/pkg/command/storagehome.go index 3a09488578..5bcb098def 100644 --- a/pkg/command/storagehome.go +++ b/pkg/command/storagehome.go @@ -107,6 +107,8 @@ func StorageHome(cfg *config.Config) *cli.Command { "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": true, + "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, @@ -120,12 +122,6 @@ func StorageHome(cfg *config.Config) *cli.Command { "mount_path": cfg.Reva.StorageHome.MountPath, "mount_id": cfg.Reva.StorageHome.MountID, "expose_data_server": cfg.Reva.StorageHome.ExposeDataServer, - "path_wrapper": cfg.Reva.StorageHome.PathWrapper, - "path_wrappers": map[string]interface{}{ - "context": map[string]interface{}{ - "prefix": cfg.Reva.StorageHome.PathWrapperContext.Prefix, - }, - }, // TODO use cfg.Reva.StorageHomeData.URL, ? "data_server_url": cfg.Reva.StorageHome.DataServerURL, "enable_home_creation": cfg.Reva.StorageHome.EnableHomeCreation, diff --git a/pkg/command/storagehomedata.go b/pkg/command/storagehomedata.go index 68f2772df8..8004d05f34 100644 --- a/pkg/command/storagehomedata.go +++ b/pkg/command/storagehomedata.go @@ -108,6 +108,8 @@ func StorageHomeData(cfg *config.Config) *cli.Command { "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, + "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, diff --git a/pkg/command/storageoc.go b/pkg/command/storageoc.go index 266a68c86e..7c5c84790e 100644 --- a/pkg/command/storageoc.go +++ b/pkg/command/storageoc.go @@ -107,7 +107,8 @@ func StorageOC(cfg *config.Config) *cli.Command { "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, - "layout": cfg.Reva.Storages.OwnCloud.Layout, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, + "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, @@ -121,12 +122,6 @@ func StorageOC(cfg *config.Config) *cli.Command { "mount_path": cfg.Reva.StorageOC.MountPath, "mount_id": cfg.Reva.StorageOC.MountID, "expose_data_server": cfg.Reva.StorageOC.ExposeDataServer, - "path_wrapper": cfg.Reva.StorageOC.PathWrapper, - "path_wrappers": map[string]interface{}{ - "context": map[string]interface{}{ - "prefix": cfg.Reva.StorageOC.PathWrapperContext.Prefix, - }, - }, // TODO use cfg.Reva.SStorageOCData.URL, ? "data_server_url": cfg.Reva.StorageOC.DataServerURL, "enable_home_creation": cfg.Reva.StorageOC.EnableHomeCreation, diff --git a/pkg/command/storageocdata.go b/pkg/command/storageocdata.go index 994d51d736..e1e124e231 100644 --- a/pkg/command/storageocdata.go +++ b/pkg/command/storageocdata.go @@ -108,6 +108,8 @@ func StorageOCData(cfg *config.Config) *cli.Command { "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, + "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, diff --git a/pkg/command/storageroot.go b/pkg/command/storageroot.go index 8b20019a53..23f00625f4 100644 --- a/pkg/command/storageroot.go +++ b/pkg/command/storageroot.go @@ -107,6 +107,8 @@ func StorageRoot(cfg *config.Config) *cli.Command { "datadirectory": cfg.Reva.Storages.OwnCloud.Datadirectory, "scan": cfg.Reva.Storages.OwnCloud.Scan, "redis": cfg.Reva.Storages.OwnCloud.Redis, + "enable_home": cfg.Reva.Storages.OwnCloud.EnableHome, + "user_layout": cfg.Reva.Storages.OwnCloud.Layout, }, "s3": map[string]interface{}{ "region": cfg.Reva.Storages.S3.Region, @@ -117,15 +119,9 @@ func StorageRoot(cfg *config.Config) *cli.Command { "prefix": cfg.Reva.Storages.S3.Prefix, }, }, - "mount_path": cfg.Reva.StorageRoot.MountPath, - "mount_id": cfg.Reva.StorageRoot.MountID, - "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, - "path_wrapper": cfg.Reva.StorageRoot.PathWrapper, - "path_wrappers": map[string]interface{}{ - "context": map[string]interface{}{ - "prefix": cfg.Reva.StorageRoot.PathWrapperContext.Prefix, - }, - }, + "mount_path": cfg.Reva.StorageRoot.MountPath, + "mount_id": cfg.Reva.StorageRoot.MountID, + "expose_data_server": cfg.Reva.StorageRoot.ExposeDataServer, "data_server_url": cfg.Reva.StorageRoot.DataServerURL, "enable_home_creation": cfg.Reva.StorageRoot.EnableHomeCreation, }, diff --git a/pkg/config/config.go b/pkg/config/config.go index d65d55cdf1..35a1075170 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -22,6 +22,16 @@ type Gateway struct { CommitShareToStorageRef bool ShareFolder string DisableHomeCreationOnLogin bool + // include the home folder config for the storage registry + // HomeProvider is the path in the global namespace that the static storage registry uses to determine the home storage + HomeProvider string +} + +// Sharing defines the available sharing configuration. +type Sharing struct { + Port + UserDriver string + PublicDriver string } // Port defines the available port configuration. @@ -53,17 +63,10 @@ type Users struct { JSON string } -// PathWrapperContext defines the available PathWrapperContext configuration. -type PathWrapperContext struct { - Prefix string -} - // StoragePort defines the available storage configuration. type StoragePort struct { Port Driver string - PathWrapper string - PathWrapperContext PathWrapperContext MountPath string MountID string ExposeDataServer bool @@ -147,9 +150,10 @@ type DriverLocal struct { // DriverOwnCloud defines the available ownCloud storage driver configuration. type DriverOwnCloud struct { Datadirectory string - Scan bool - Redis string Layout string + Redis string + Scan bool + EnableHome bool } // DriverS3 defines the available S3 storage driver configuration. @@ -212,7 +216,7 @@ type Reva struct { Users Users AuthBasic Port AuthBearer Port - Sharing Port + Sharing Sharing StorageRoot StoragePort StorageHome StoragePort StorageHomeData StoragePort diff --git a/pkg/flagset/authbasic.go b/pkg/flagset/authbasic.go index 8d43865617..59cb01e5f3 100644 --- a/pkg/flagset/authbasic.go +++ b/pkg/flagset/authbasic.go @@ -86,7 +86,7 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "users-driver", - Value: "demo", + Value: "ldap", Usage: "user driver: 'demo', 'json' or 'ldap'", EnvVars: []string{"REVA_USERS_DRIVER"}, Destination: &cfg.Reva.Users.Driver, @@ -110,14 +110,14 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { }, &cli.IntFlag{ Name: "ldap-port", - Value: 636, + Value: 9126, Usage: "LDAP port", EnvVars: []string{"REVA_LDAP_PORT"}, Destination: &cfg.Reva.LDAP.Port, }, &cli.StringFlag{ Name: "ldap-base-dn", - Value: "dc=owncloud,dc=com", + Value: "dc=example,dc=org", Usage: "LDAP basedn", EnvVars: []string{"REVA_LDAP_BASE_DN"}, Destination: &cfg.Reva.LDAP.BaseDN, @@ -138,14 +138,14 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-bind-dn", - Value: "cn=admin,dc=owncloud,dc=com", + Value: "cn=reva,ou=sysusers,dc=example,dc=org", Usage: "LDAP bind dn", EnvVars: []string{"REVA_LDAP_BIND_DN"}, Destination: &cfg.Reva.LDAP.BindDN, }, &cli.StringFlag{ Name: "ldap-bind-password", - Value: "admin", + Value: "reva", Usage: "LDAP bind password", EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"}, Destination: &cfg.Reva.LDAP.BindPassword, @@ -162,12 +162,12 @@ func AuthBasicWithConfig(cfg *config.Config) []cli.Flag { Name: "ldap-schema-mail", Value: "mail", Usage: "LDAP schema mail", - EnvVars: []string{"REVA_LDAP_SCHEMA_Mail"}, + EnvVars: []string{"REVA_LDAP_SCHEMA_MAIL"}, Destination: &cfg.Reva.LDAP.Schema.Mail, }, &cli.StringFlag{ Name: "ldap-schema-displayName", - Value: "displayName", + Value: "sn", Usage: "LDAP schema displayName", EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"}, Destination: &cfg.Reva.LDAP.Schema.DisplayName, diff --git a/pkg/flagset/authbearer.go b/pkg/flagset/authbearer.go index 51180ce983..c01dcbc0f0 100644 --- a/pkg/flagset/authbearer.go +++ b/pkg/flagset/authbearer.go @@ -86,7 +86,7 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "oidc-issuer", - Value: "https://localhost:9130", + Value: "https://localhost:9200", Usage: "OIDC issuer", EnvVars: []string{"REVA_OIDC_ISSUER"}, Destination: &cfg.Reva.OIDC.Issuer, @@ -99,8 +99,14 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.OIDC.Insecure, }, &cli.StringFlag{ - Name: "oidc-id-claim", - Value: "sub", // sub is stable and defined as unique. the user manager needs to take care of the sub to user metadata lookup + Name: "oidc-id-claim", + // preferred_username is a workaround + // the user manager needs to take care of the sub to user metadata lookup, which ldap cannot do + // TODO sub is stable and defined as unique. + // AFAICT we want to use the account id from ocis-accounts + // TODO add an ocis middleware to reva that changes the users opaqueid? + // TODO add an ocis-accounts backed user manager + Value: "preferred_username", Usage: "OIDC id claim", EnvVars: []string{"REVA_OIDC_ID_CLAIM"}, Destination: &cfg.Reva.OIDC.IDClaim, diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index 4d4751132d..ac660f3383 100644 --- a/pkg/flagset/frontend.go +++ b/pkg/flagset/frontend.go @@ -109,32 +109,6 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.OCDav.DavFilesNamespace, }, - // OIDC - - &cli.StringFlag{ - Name: "oidc-issuer", - Value: "https://localhost:9130", - Usage: "OIDC issuer", - EnvVars: []string{"REVA_OIDC_ISSUER"}, - Destination: &cfg.Reva.OIDC.Issuer, - }, - &cli.BoolFlag{ - Name: "oidc-insecure", - Value: true, - Usage: "OIDC allow insecure communication", - EnvVars: []string{"REVA_OIDC_INSECURE"}, - Destination: &cfg.Reva.OIDC.Insecure, - }, - &cli.StringFlag{ - Name: "oidc-id-claim", - Value: "sub", // sub is stable and defined as unique. the user manager needs to take care of the sub to user metadata lookup - Usage: "OIDC id claim", - EnvVars: []string{"REVA_OIDC_ID_CLAIM"}, - Destination: &cfg.Reva.OIDC.IDClaim, - }, - - // TODO allow configuring clients - // Services // Frontend @@ -169,8 +143,8 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringSliceFlag{ Name: "service", - Value: cli.NewStringSlice("datagateway", "wellknown", "oidcprovider", "ocdav", "ocs"), - Usage: "--service datagateway [--service wellknown]", + Value: cli.NewStringSlice("datagateway", "ocdav", "ocs"), + Usage: "--service ocdav [--service ocs]", EnvVars: []string{"REVA_FRONTEND_SERVICES"}, }, diff --git a/pkg/flagset/gateway.go b/pkg/flagset/gateway.go index 0640c2e01e..acbe80718b 100644 --- a/pkg/flagset/gateway.go +++ b/pkg/flagset/gateway.go @@ -169,6 +169,14 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag { // storage registry + &cli.StringFlag{ + Name: "storage-home-provider", + Value: "/home", + Usage: "mount point of the storage provider for user homes in the global namespace", + EnvVars: []string{"REVA_STORAGE_HOME_PROVIDER"}, + Destination: &cfg.Reva.Gateway.HomeProvider, + }, + &cli.StringFlag{ Name: "frontend-url", Value: "localhost:9140", diff --git a/pkg/flagset/sharing.go b/pkg/flagset/sharing.go index 97003f0b99..f9babdc144 100644 --- a/pkg/flagset/sharing.go +++ b/pkg/flagset/sharing.go @@ -120,5 +120,19 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag { Usage: "--service usershareprovider [--service publicshareprovider]", EnvVars: []string{"REVA_SHARING_SERVICES"}, }, + &cli.StringFlag{ + Name: "user-driver", + Value: "json", + Usage: "driver to use for the UserShareProvider", + EnvVars: []string{"REVA_SHARING_USER_DRIVER"}, + Destination: &cfg.Reva.Sharing.UserDriver, + }, + &cli.StringFlag{ + Name: "public-driver", + Value: "memory", + Usage: "driver to use for the PublicShareProvider", + EnvVars: []string{"REVA_SHARING_PUBLIC_DRIVER"}, + Destination: &cfg.Reva.Sharing.PublicDriver, + }, } } diff --git a/pkg/flagset/storagehome.go b/pkg/flagset/storagehome.go index 0c40ba94c0..0719cbc8e1 100644 --- a/pkg/flagset/storagehome.go +++ b/pkg/flagset/storagehome.go @@ -130,20 +130,6 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_HOME_DRIVER"}, Destination: &cfg.Reva.StorageHome.Driver, }, - &cli.StringFlag{ - Name: "path-wrapper", - Value: "context", - Usage: "path wrapper", - EnvVars: []string{"REVA_STORAGE_HOME_PATH_WRAPPER"}, - Destination: &cfg.Reva.StorageHome.PathWrapper, - }, - &cli.StringFlag{ - Name: "path-wrapper-context-prefix", - Value: "", - Usage: "path wrapper context prefix", - EnvVars: []string{"REVA_STORAGE_HOME_PATH_WRAPPER_CONTEXT_PREFIX"}, - Destination: &cfg.Reva.StorageHome.PathWrapperContext.Prefix, - }, &cli.StringFlag{ Name: "mount-path", Value: "/home", @@ -318,6 +304,13 @@ func StorageHomeWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, Destination: &cfg.Reva.Storages.OwnCloud.Redis, }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: true, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, + }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Username}}", diff --git a/pkg/flagset/storagehomedata.go b/pkg/flagset/storagehomedata.go index 6a7ed7028c..610d73db3d 100644 --- a/pkg/flagset/storagehomedata.go +++ b/pkg/flagset/storagehomedata.go @@ -282,6 +282,13 @@ func StorageHomeDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, Destination: &cfg.Reva.Storages.OwnCloud.Redis, }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: true, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, + }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Username}}", diff --git a/pkg/flagset/storageoc.go b/pkg/flagset/storageoc.go index 95d5f875d2..6845365b74 100644 --- a/pkg/flagset/storageoc.go +++ b/pkg/flagset/storageoc.go @@ -130,20 +130,6 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OC_DRIVER"}, Destination: &cfg.Reva.StorageOC.Driver, }, - &cli.StringFlag{ - Name: "path-wrapper", - Value: "", - Usage: "path wrapper", - EnvVars: []string{"REVA_STORAGE_OC_PATH_WRAPPER"}, - Destination: &cfg.Reva.StorageOC.PathWrapper, - }, - &cli.StringFlag{ - Name: "path-wrapper-context-prefix", - Value: "", - Usage: "path wrapper context prefix", - EnvVars: []string{"REVA_STORAGE_OC_PATH_WRAPPER_CONTEXT_PREFIX"}, - Destination: &cfg.Reva.StorageOC.PathWrapperContext.Prefix, - }, &cli.StringFlag{ Name: "mount-path", Value: "/oc", @@ -173,11 +159,11 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Reva.StorageOC.DataServerURL, }, &cli.BoolFlag{ - Name: "enable-home-creation", - // Value: true, // TODO jfd we may need to default to true here so the new webdav endpoint will autocreate user homes as well + Name: "enable-home-creation", + Value: false, Usage: "if enabled home dirs will be automatically created", - EnvVars: []string{"REVA_STORAGE_HOME_ENABLE_HOME_CREATION"}, - Destination: &cfg.Reva.StorageHome.EnableHomeCreation, + EnvVars: []string{"REVA_STORAGE_OC_ENABLE_HOME_CREATION"}, + Destination: &cfg.Reva.StorageOC.EnableHomeCreation, }, // Storage drivers @@ -318,6 +304,13 @@ func StorageOCWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, Destination: &cfg.Reva.Storages.OwnCloud.Redis, }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: false, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, + }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Username}}", diff --git a/pkg/flagset/storageocdata.go b/pkg/flagset/storageocdata.go index 57bea0a147..e811a326d2 100644 --- a/pkg/flagset/storageocdata.go +++ b/pkg/flagset/storageocdata.go @@ -282,6 +282,13 @@ func StorageOCDataWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, Destination: &cfg.Reva.Storages.OwnCloud.Redis, }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: false, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, + }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Username}}", diff --git a/pkg/flagset/storageroot.go b/pkg/flagset/storageroot.go index 27bd19a5be..5b81de4839 100644 --- a/pkg/flagset/storageroot.go +++ b/pkg/flagset/storageroot.go @@ -130,20 +130,6 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_ROOT_DRIVER"}, Destination: &cfg.Reva.StorageRoot.Driver, }, - &cli.StringFlag{ - Name: "path-wrapper", - Value: "", - Usage: "path wrapper", - EnvVars: []string{"REVA_STORAGE_ROOT_PATH_WRAPPER"}, - Destination: &cfg.Reva.StorageRoot.PathWrapper, - }, - &cli.StringFlag{ - Name: "path-wrapper-context-prefix", - Value: "", - Usage: "path wrapper context prefix", - EnvVars: []string{"REVA_STORAGE_ROOT_PATH_WRAPPER_CONTEXT_PREFIX"}, - Destination: &cfg.Reva.StorageRoot.PathWrapperContext.Prefix, - }, &cli.StringFlag{ Name: "mount-path", Value: "/", @@ -316,6 +302,13 @@ func StorageRootWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"REVA_STORAGE_OWNCLOUD_REDIS_ADDR"}, Destination: &cfg.Reva.Storages.OwnCloud.Redis, }, + &cli.BoolFlag{ + Name: "storage-owncloud-enable-home", + Value: false, + Usage: "enable the creation of home storages", + EnvVars: []string{"REVA_STORAGE_OWNCLOUD_ENABLE_HOME"}, + Destination: &cfg.Reva.Storages.OwnCloud.EnableHome, + }, &cli.StringFlag{ Name: "storage-owncloud-layout", Value: "{{.Username}}", diff --git a/pkg/flagset/users.go b/pkg/flagset/users.go index 7d5cebbb66..2c935fdd3b 100644 --- a/pkg/flagset/users.go +++ b/pkg/flagset/users.go @@ -93,42 +93,42 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.IntFlag{ Name: "ldap-port", - Value: 636, + Value: 9126, Usage: "LDAP port", EnvVars: []string{"REVA_LDAP_PORT"}, Destination: &cfg.Reva.LDAP.Port, }, &cli.StringFlag{ Name: "ldap-base-dn", - Value: "dc=owncloud,dc=com", + Value: "dc=example,dc=org", Usage: "LDAP basedn", EnvVars: []string{"REVA_LDAP_BASE_DN"}, Destination: &cfg.Reva.LDAP.BaseDN, }, &cli.StringFlag{ Name: "ldap-userfilter", - Value: "(&(objectclass=posixAccount)(cn=%s))", + Value: "(&(objectclass=posixAccount)(cn=%s*))", Usage: "LDAP userfilter", EnvVars: []string{"REVA_LDAP_USERFILTER"}, Destination: &cfg.Reva.LDAP.UserFilter, }, &cli.StringFlag{ Name: "ldap-groupfilter", - Value: "(&(objectclass=posixGroup)(cn=%s))", + Value: "(&(objectclass=posixGroup)(cn=%s*))", Usage: "LDAP groupfilter", EnvVars: []string{"REVA_LDAP_GROUPFILTER"}, Destination: &cfg.Reva.LDAP.GroupFilter, }, &cli.StringFlag{ Name: "ldap-bind-dn", - Value: "cn=admin,dc=owncloud,dc=com", + Value: "cn=reva,ou=sysusers,dc=example,dc=org", Usage: "LDAP bind dn", EnvVars: []string{"REVA_LDAP_BIND_DN"}, Destination: &cfg.Reva.LDAP.BindDN, }, &cli.StringFlag{ Name: "ldap-bind-password", - Value: "admin", + Value: "reva", Usage: "LDAP bind password", EnvVars: []string{"REVA_LDAP_BIND_PASSWORD"}, Destination: &cfg.Reva.LDAP.BindPassword, @@ -150,7 +150,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "ldap-schema-displayName", - Value: "displayName", + Value: "sn", Usage: "LDAP schema displayName", EnvVars: []string{"REVA_LDAP_SCHEMA_DISPLAYNAME"}, Destination: &cfg.Reva.LDAP.Schema.DisplayName, @@ -204,7 +204,7 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { &cli.StringFlag{ Name: "driver", - Value: "demo", + Value: "ldap", Usage: "user driver: 'demo', 'json' or 'ldap'", EnvVars: []string{"REVA_USERS_DRIVER"}, Destination: &cfg.Reva.Users.Driver,