From 08c09b79d59e25ff957f4c2aa956578adc75e000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 17 Mar 2020 18:27:45 +0100 Subject: [PATCH 01/11] new ocis config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-typos.md | 5 ++ changelog/unreleased/issue-6.md | 2 +- changelog/unreleased/new-ocis-config.md | 10 +++ docs/testing.md | 85 +++++++++++++++++++++++++ go.mod | 2 +- go.sum | 32 +++++++--- pkg/command/gateway.go | 2 +- 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 | 15 ++--- pkg/flagset/authbasic.go | 12 ++-- pkg/flagset/authbearer.go | 2 +- pkg/flagset/frontend.go | 30 +-------- pkg/flagset/gateway.go | 8 +++ 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 | 10 +-- 23 files changed, 206 insertions(+), 129 deletions(-) create mode 100644 changelog/unreleased/fix-typos.md create mode 100644 changelog/unreleased/new-ocis-config.md create mode 100644 docs/testing.md diff --git a/changelog/unreleased/fix-typos.md b/changelog/unreleased/fix-typos.md new file mode 100644 index 0000000..0abcd37 --- /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 99aff1a..567c4b3 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 0000000..903e386 --- /dev/null +++ b/changelog/unreleased/new-ocis-config.md @@ -0,0 +1,10 @@ +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. + +https://github.com/owncloud/ocis-reva/pull/113 \ No newline at end of file diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 0000000..aacd1f4 --- /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 6450ad3..32a1f46 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.0.2-0.20200318111623-a2f97d4aa741 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 ad34f75..24ac085 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.26 h1:T8LJNOVt0HZgJQySeE+1Pr3ClcX+rb7ddq/ZAjnHzDc= +github.com/aws/aws-sdk-go v1.29.26/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= @@ -131,8 +136,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma 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/reva v0.0.2-0.20200318111623-a2f97d4aa741 h1:7GjGW/GFVMr1eQLRV1f2hi2wLGVQzA3m1ZGqW/blLiE= +github.com/cs3org/reva v0.0.2-0.20200318111623-a2f97d4aa741/go.mod h1:Vx5IitCX4vrPmLAwQGWAEb3O4AMxsSbOlzRngEqOrus= 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= @@ -428,8 +439,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 +515,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= @@ -672,7 +685,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 +692,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= @@ -805,8 +819,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 4425e32..223114e 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/storagehome.go b/pkg/command/storagehome.go index 3a09488..5bcb098 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 68f2772..8004d05 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 266a68c..7c5c847 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 994d51d..e1e124e 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 8b20019..23f0062 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 d65d55c..3aa8538 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -22,6 +22,9 @@ 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 } // Port defines the available port configuration. @@ -53,17 +56,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 +143,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. diff --git a/pkg/flagset/authbasic.go b/pkg/flagset/authbasic.go index 8d43865..5a9e2d8 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: 9125, 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,7 +162,7 @@ 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{ diff --git a/pkg/flagset/authbearer.go b/pkg/flagset/authbearer.go index 51180ce..ebcd80c 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, diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index 4d47511..ac660f3 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 0640c2e..acbe807 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/storagehome.go b/pkg/flagset/storagehome.go index 0c40ba9..0719cbc 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 6a7ed70..610d73d 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 95d5f87..6845365 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 57bea0a..e811a32 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 27bd19a..5b81de4 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 7d5cebb..68e74ce 100644 --- a/pkg/flagset/users.go +++ b/pkg/flagset/users.go @@ -93,14 +93,14 @@ func UsersWithConfig(cfg *config.Config) []cli.Flag { }, &cli.IntFlag{ Name: "ldap-port", - Value: 636, + Value: 9125, 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, @@ -121,14 +121,14 @@ func UsersWithConfig(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, @@ -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, From 075c6608b85f48810299554cf5e914431a8c3cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 17 Mar 2020 18:27:45 +0100 Subject: [PATCH 02/11] Change default settings to be able to run ocis server without any configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- changelog/unreleased/fix-typos.md | 5 ++ changelog/unreleased/issue-6.md | 2 +- changelog/unreleased/new-ocis-config.md | 10 +++ docs/testing.md | 85 +++++++++++++++++++++++++ go.mod | 2 +- go.sum | 34 +++++++--- pkg/command/gateway.go | 2 +- 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 | 15 ++--- pkg/flagset/authbasic.go | 14 ++-- pkg/flagset/authbearer.go | 2 +- pkg/flagset/frontend.go | 30 +-------- pkg/flagset/gateway.go | 8 +++ 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 ++--- 23 files changed, 212 insertions(+), 133 deletions(-) create mode 100644 changelog/unreleased/fix-typos.md create mode 100644 changelog/unreleased/new-ocis-config.md create mode 100644 docs/testing.md diff --git a/changelog/unreleased/fix-typos.md b/changelog/unreleased/fix-typos.md new file mode 100644 index 0000000..0abcd37 --- /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 99aff1a..567c4b3 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 0000000..903e386 --- /dev/null +++ b/changelog/unreleased/new-ocis-config.md @@ -0,0 +1,10 @@ +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. + +https://github.com/owncloud/ocis-reva/pull/113 \ No newline at end of file diff --git a/docs/testing.md b/docs/testing.md new file mode 100644 index 0000000..aacd1f4 --- /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 6450ad3..32a1f46 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.0.2-0.20200318111623-a2f97d4aa741 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 ad34f75..6ba3a67 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.26 h1:T8LJNOVt0HZgJQySeE+1Pr3ClcX+rb7ddq/ZAjnHzDc= +github.com/aws/aws-sdk-go v1.29.26/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= @@ -131,8 +136,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma 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/reva v0.0.2-0.20200318111623-a2f97d4aa741 h1:7GjGW/GFVMr1eQLRV1f2hi2wLGVQzA3m1ZGqW/blLiE= +github.com/cs3org/reva v0.0.2-0.20200318111623-a2f97d4aa741/go.mod h1:Vx5IitCX4vrPmLAwQGWAEb3O4AMxsSbOlzRngEqOrus= 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= @@ -428,8 +439,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 +515,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 +658,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 +686,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 +693,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 +777,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 +821,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 4425e32..223114e 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/storagehome.go b/pkg/command/storagehome.go index 3a09488..5bcb098 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 68f2772..8004d05 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 266a68c..7c5c847 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 994d51d..e1e124e 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 8b20019..23f0062 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 d65d55c..3aa8538 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -22,6 +22,9 @@ 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 } // Port defines the available port configuration. @@ -53,17 +56,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 +143,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. diff --git a/pkg/flagset/authbasic.go b/pkg/flagset/authbasic.go index 8d43865..59cb01e 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 51180ce..ebcd80c 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, diff --git a/pkg/flagset/frontend.go b/pkg/flagset/frontend.go index 4d47511..ac660f3 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 0640c2e..acbe807 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/storagehome.go b/pkg/flagset/storagehome.go index 0c40ba9..0719cbc 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 6a7ed70..610d73d 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 95d5f87..6845365 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 57bea0a..e811a32 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 27bd19a..5b81de4 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 7d5cebb..2c935fd 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, From 39b07d4f70a4e1b8d60e0e471f6ac6b423791c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 19 Mar 2020 14:22:08 +0100 Subject: [PATCH 03/11] allow configuring user sharing driver, default to json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/user-sharing-driver-json.md | 5 +++++ pkg/command/sharing.go | 4 ++-- pkg/config/config.go | 9 ++++++++- pkg/flagset/sharing.go | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/user-sharing-driver-json.md diff --git a/changelog/unreleased/user-sharing-driver-json.md b/changelog/unreleased/user-sharing-driver-json.md new file mode 100644 index 0000000..b278da6 --- /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/pkg/command/sharing.go b/pkg/command/sharing.go index c40e494..aa248f2 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/config/config.go b/pkg/config/config.go index d65d55c..276b1b5 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -24,6 +24,13 @@ type Gateway struct { DisableHomeCreationOnLogin bool } +// Sharing defines the available sharing configuration. +type Sharing struct { + Port + UserDriver string + PublicDriver string +} + // Port defines the available port configuration. type Port struct { // MaxCPUs can be a number or a percentage @@ -212,7 +219,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/sharing.go b/pkg/flagset/sharing.go index 97003f0..f9babdc 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, + }, } } From 70272967074d9431f9b979e048da6763838b071f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 19 Mar 2020 16:28:38 +0100 Subject: [PATCH 04/11] update reva MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 +- go.sum | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 32a1f46..65e32a2 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.20200318111623-a2f97d4aa741 + github.com/cs3org/reva v0.1.1-0.20200319141623-3ada0644d62b 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 6ba3a67..fa901fd 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee/go.mod h1:u7Wtt github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.29.26 h1:T8LJNOVt0HZgJQySeE+1Pr3ClcX+rb7ddq/ZAjnHzDc= github.com/aws/aws-sdk-go v1.29.26/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +github.com/aws/aws-sdk-go v1.29.27 h1:4A53lDDGtk4TvnXFzvcOO3Vx3tDqEPfwvChhhxTPN/M= +github.com/aws/aws-sdk-go v1.29.27/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= @@ -136,8 +138,12 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma 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/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.0.2-0.20200318111623-a2f97d4aa741 h1:7GjGW/GFVMr1eQLRV1f2hi2wLGVQzA3m1ZGqW/blLiE= github.com/cs3org/reva v0.0.2-0.20200318111623-a2f97d4aa741/go.mod h1:Vx5IitCX4vrPmLAwQGWAEb3O4AMxsSbOlzRngEqOrus= +github.com/cs3org/reva v0.1.1-0.20200319141623-3ada0644d62b h1:tAIcUl1yi9W/oCG2WEzRK6DCITaJte1brMcYeww+cjk= +github.com/cs3org/reva v0.1.1-0.20200319141623-3ada0644d62b/go.mod h1:sJxT/ttYyB3uCRYoDXDC+t/E8zKauKJ888cyuuNdaVI= 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= @@ -384,6 +390,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.0 h1:pFIkD+d/36DA4zE+VL2xI0Th1yNh+CWaUcJkaGivz3A= +github.com/mitchellh/mapstructure v1.2.0/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= From e9c6d2d784af7e320806f42ba00c27b136dc4bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Mar 2020 12:08:22 +0100 Subject: [PATCH 05/11] switch to preferred_username as opaqueid MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/new-ocis-config.md | 1 + pkg/flagset/authbearer.go | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/new-ocis-config.md b/changelog/unreleased/new-ocis-config.md index 903e386..b919ce6 100644 --- a/changelog/unreleased/new-ocis-config.md +++ b/changelog/unreleased/new-ocis-config.md @@ -6,5 +6,6 @@ We changed the default configuration to integrate better with ocis. - 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`. Tha 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 \ No newline at end of file diff --git a/pkg/flagset/authbearer.go b/pkg/flagset/authbearer.go index ebcd80c..c01dcbc 100644 --- a/pkg/flagset/authbearer.go +++ b/pkg/flagset/authbearer.go @@ -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, From 4d660e103b6a2820c92040b03a7c3d39239817c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Mar 2020 12:40:34 +0100 Subject: [PATCH 06/11] update drone config to override new defaults to match test environment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.drone.star b/.drone.star index 559fb55..4027b21 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 &', From 8ea72930d5017f8c463c35c173a24b1638353f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Mar 2020 16:10:12 +0100 Subject: [PATCH 07/11] use latest reva MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- go.mod | 2 +- go.sum | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/go.mod b/go.mod index 65e32a2..c546224 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.1.1-0.20200319141623-3ada0644d62b + 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 fa901fd..c1b3828 100644 --- a/go.sum +++ b/go.sum @@ -71,10 +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.29.26 h1:T8LJNOVt0HZgJQySeE+1Pr3ClcX+rb7ddq/ZAjnHzDc= -github.com/aws/aws-sdk-go v1.29.26/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= -github.com/aws/aws-sdk-go v1.29.27 h1:4A53lDDGtk4TvnXFzvcOO3Vx3tDqEPfwvChhhxTPN/M= -github.com/aws/aws-sdk-go v1.29.27/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +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= @@ -136,14 +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/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.0.2-0.20200318111623-a2f97d4aa741 h1:7GjGW/GFVMr1eQLRV1f2hi2wLGVQzA3m1ZGqW/blLiE= -github.com/cs3org/reva v0.0.2-0.20200318111623-a2f97d4aa741/go.mod h1:Vx5IitCX4vrPmLAwQGWAEb3O4AMxsSbOlzRngEqOrus= -github.com/cs3org/reva v0.1.1-0.20200319141623-3ada0644d62b h1:tAIcUl1yi9W/oCG2WEzRK6DCITaJte1brMcYeww+cjk= -github.com/cs3org/reva v0.1.1-0.20200319141623-3ada0644d62b/go.mod h1:sJxT/ttYyB3uCRYoDXDC+t/E8zKauKJ888cyuuNdaVI= +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= @@ -390,8 +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.0 h1:pFIkD+d/36DA4zE+VL2xI0Th1yNh+CWaUcJkaGivz3A= -github.com/mitchellh/mapstructure v1.2.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +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= From 345d528834873a27ef5b9552a27306d77db463dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 20 Mar 2020 17:04:27 +0100 Subject: [PATCH 08/11] typo --- changelog/unreleased/new-ocis-config.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog/unreleased/new-ocis-config.md b/changelog/unreleased/new-ocis-config.md index b919ce6..f703146 100644 --- a/changelog/unreleased/new-ocis-config.md +++ b/changelog/unreleased/new-ocis-config.md @@ -6,6 +6,6 @@ We changed the default configuration to integrate better with ocis. - 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`. Tha 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 +- 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 \ No newline at end of file +https://github.com/owncloud/ocis-reva/pull/113 From c73ad9146d39a9f5a036d01948c2fb71ce8d61e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Sat, 21 Mar 2020 22:19:03 +0100 Subject: [PATCH 09/11] use updatet api tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index 4027b21..dd56e4f 100644 --- a/.drone.star +++ b/.drone.star @@ -176,7 +176,7 @@ def testing(ctx): 'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva/' }, 'commands': [ - 'git clone -b master --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner', + 'git clone -b ocis-tests-expect-40x-on-not-exist --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner', 'cd /srv/app/testrunner', 'make test-acceptance-api' ], From d936ef58d87ac68b2eab3aa98831b5f2ba64c420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Sat, 21 Mar 2020 23:52:02 +0100 Subject: [PATCH 10/11] core tests got merged already MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .drone.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.star b/.drone.star index dd56e4f..4027b21 100644 --- a/.drone.star +++ b/.drone.star @@ -176,7 +176,7 @@ def testing(ctx): 'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva/' }, 'commands': [ - 'git clone -b ocis-tests-expect-40x-on-not-exist --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner', + 'git clone -b master --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner', 'cd /srv/app/testrunner', 'make test-acceptance-api' ], From fcb9f0243a743267777efd223575aac38d7a2529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Sun, 22 Mar 2020 08:06:28 +0100 Subject: [PATCH 11/11] fix changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/fix-typos.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/unreleased/fix-typos.md b/changelog/unreleased/fix-typos.md index 0abcd37..c971099 100644 --- a/changelog/unreleased/fix-typos.md +++ b/changelog/unreleased/fix-typos.md @@ -1,4 +1,4 @@ -Bugfix: we fixed a typo in the `REVA_LDAP_SCHEMA_MAIL` environment variable. +Bugfix: we fixed a typo in the `REVA_LDAP_SCHEMA_MAIL` environment variable It was misspelled as `REVA_LDAP_SCHEMA_Mail`.