From 5ed1bc08a24c6b707a5266ebf85151429277a371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 27 Mar 2020 13:03:23 +0100 Subject: [PATCH] add eos to makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- .gitignore | 2 + Makefile | 125 ++++++++++++++++++++++++++++++ changelog/unreleased/add-eos.md | 5 ++ docs/eos.md | 73 +++++++++++++++++ go.mod | 2 +- go.sum | 32 +++++--- pkg/command/revastorageeos.go | 40 ++++++++++ pkg/command/revastorageeosdata.go | 40 ++++++++++ pkg/command/revastoragehome.go | 2 - pkg/command/revastorageoc.go | 2 - pkg/micro/runtime/runtime.go | 2 + 11 files changed, 308 insertions(+), 17 deletions(-) create mode 100644 changelog/unreleased/add-eos.md create mode 100644 docs/eos.md create mode 100644 pkg/command/revastorageeos.go create mode 100644 pkg/command/revastorageeosdata.go diff --git a/.gitignore b/.gitignore index 7e6ba9b43db..90d38351b07 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ coverage.out /hugo *.key *crt + +/eos-docker \ No newline at end of file diff --git a/Makefile b/Makefile index 34c413e44f4..353288585ab 100644 --- a/Makefile +++ b/Makefile @@ -158,3 +158,128 @@ docs: config-docs-generate docs-copy docs-build .PHONY: watch watch: go run github.com/cespare/reflex -c reflex.conf + +# ------------------------------------------------------------------------------- +# EOS related destinations +# ------------------------------------------------------------------------------- + +eos-docker: + git clone https://gitlab.cern.ch/eos/eos-docker.git + +eos-docker/scripts/start_services_ocis.sh: eos-docker + # TODO find a way to properly inject the following env vars into the container: + # EOS_UTF8=1 enables utf8 filenames + # EOS_NS_ACCOUNTING=1 enables dir size propagation + # EOS_SYNCTIME_ACCOUNTING=1 enables mtime propagation + # - needs the sys.mtime.propagation=1 on a home dir, handled by the reva eos storage driver + # - sys.allow.oc.sync=1 is not needed, it is an option for the eos built in webdav endpoint + # 1. -e: for now, we patch the start_services.sh and use that + # 2. -e: we need to expose the storageprovider ports whan running the docker containen + # TODO use port from address to open different ports, this currently only works for one client container + sed -e "s/--name eos-mgm1 --net/--name eos-mgm1 --env EOS_UTF8=1 --env EOS_NS_ACCOUNTING=1 --env EOS_SYNCTIME_ACCOUNTING=1 --net/" -e 's/--name $${CLIENTHOSTNAME} --net=eoscluster.cern.ch/--name $${CLIENTHOSTNAME} -p 9154:9154 -p 9155:9155 -p 9156:9156 -p 9157:9157 -p 9158:9158 -p 9159:9159 -p 9160:9160 -p 9161:9161 --net=eoscluster.cern.ch/' ./eos-docker/scripts/start_services.sh > ./eos-docker/scripts/start_services_ocis.sh + chmod +x ./eos-docker/scripts/start_services_ocis.sh + +.PHONY: eos-deploy +eos-deploy: eos-docker/scripts/start_services_ocis.sh + # TODO keep eos up to date: see https://gitlab.cern.ch/dss/eos/tags + ./eos-docker/scripts/start_services_ocis.sh -i gitlab-registry.cern.ch/dss/eos:4.7.5 -q + # Install ldap packages + docker exec -i eos-mgm1 yum install -y nss-pam-ldapd nscd authconfig + docker exec -i eos-cli1 yum install -y nss-pam-ldapd nscd authconfig + +.PHONY: eos-setup +eos-setup: eos-docker/scripts/start_services_ocis.sh + #Allow resolving uids against ldap + # 9125 is the ldap port, 9126 would be tls ... but self signed cert + # TODO check out the error message (ignoring for now ... still works): read LDAP host from env var, if not set fall back to docker host, in docker compose should be the ocis-glauth container because it contains guest accounts a well + export LDAP_HOST=`docker exec -it eos-mgm1 /sbin/ip route|awk '/default/ { print $$3 }'`; \ + docker exec -i eos-mgm1 authconfig --enableldap --enableldapauth --ldapserver="`echo -n $$LDAP_HOST`:9125" --ldapbasedn="dc=example,dc=org" --update; \ + docker exec -i eos-cli1 authconfig --enableldap --enableldapauth --ldapserver="`echo -n $$LDAP_HOST`:9125" --ldapbasedn="dc=example,dc=org" --update; + + # setup users on mgm + #TODO Failed to get D-Bus connection: Operation not permitted\ngetsebool: SELinux is disabled + docker exec -i eos-mgm1 sed -i "s/#binddn cn=.*/binddn cn=reva,ou=sysusers,dc=example,dc=org/" /etc/nslcd.conf + docker exec -i eos-mgm1 sed -i "s/#bindpw .*/bindpw reva/" /etc/nslcd.conf + # print the actual authconfig + docker exec -i eos-mgm1 authconfig --test + # start nslcd. you need to restart it if you change the ldap config + docker exec -i eos-mgm1 nslcd + # use unix accounts + docker exec -i eos-mgm1 eos vid set map -unix "" vuid:0 vgid:0 + # allow cli to create homes + docker exec -i eos-mgm1 eos vid add gateway eos-cli1 + # krb not needed + docker exec -i eos-mgm1 eos vid disable krb5 + + # setup users on cli, same as for mgm + docker exec -i eos-cli1 sed -i "s/#binddn cn=.*/binddn cn=reva,ou=sysusers,dc=example,dc=org/" /etc/nslcd.conf + docker exec -i eos-cli1 sed -i "s/#bindpw .*/bindpw reva/" /etc/nslcd.conf + docker exec -i eos-cli1 nslcd + + # create necessary lib link for ocis + docker exec -i eos-cli1 ln -s /lib64/ld-linux-x86-64.so.2 /lib + +.PHONY: eos-test +eos-test: + # check we know the demo users + docker exec -i eos-mgm1 id einstein + docker exec -i eos-mgm1 id marie + docker exec -i eos-mgm1 id feynman + +.PHONY: eos-copy-ocis +eos-copy-ocis: build + # copy the binary to the eos-cli1 container + docker cp ./bin/ocis eos-cli1:/usr/local/bin/ocis + docker cp ./bin/ocis-debug eos-cli1:/usr/local/bin/ocis-debug + +.PHONY: eos-ocis-storage-home +eos-ocis-storage-home: + # configure the home storage to use the eos driver and return the mount id of the eos driver in responses + docker exec -i \ + --env OCIS_LOG_LEVEL=debug \ + --env REVA_STORAGE_HOME_DRIVER=eos \ + --env REVA_STORAGE_HOME_MOUNT_ID=1284d238-aa92-42ce-bdc4-0b0000009158 \ + eos-cli1 ocis reva-storage-home & + docker exec -i \ + --env OCIS_LOG_LEVEL=debug \ + --env REVA_STORAGE_HOME_DATA_DRIVER=eos \ + eos-cli1 ocis reva-storage-home-data & + docker exec -i \ + --env OCIS_LOG_LEVEL=debug \ + eos-cli1 ocis reva-storage-eos & + docker exec -i \ + --env OCIS_LOG_LEVEL=debug \ + eos-cli1 ocis reva-storage-eos-data & + +.PHONY: eos-ocis +eos-ocis: + export OCIS_LOG_LEVEL=debug; \ + export DAV_FILES_NAMESPACE="/eos/"; \ + bin/ocis micro & \ + bin/ocis glauth & \ + bin/ocis graph-explorer & \ + bin/ocis graph & \ + bin/ocis konnectd & \ + bin/ocis phoenix & \ + bin/ocis thumbnails & \ + bin/ocis webdav & \ + bin/ocis reva-auth-basic & \ + bin/ocis reva-auth-bearer & \ + bin/ocis reva-frontend & \ + bin/ocis reva-gateway & \ + bin/ocis reva-sharing & \ + bin/ocis reva-users & \ + bin/ocis proxy & + + +.PHONY: eos-start +eos-start: eos-deploy eos-setup eos-copy-ocis eos-ocis-storage-home eos-ocis + +.PHONY: eos-clean +eos-clean: + rm eos-docker/scripts/start_services_ocis.sh + +.PHONY: eos-stop +eos-stop: eos-docker + ./eos-docker/scripts/shutdown_services.sh + diff --git a/changelog/unreleased/add-eos.md b/changelog/unreleased/add-eos.md new file mode 100644 index 00000000000..4c14862cb95 --- /dev/null +++ b/changelog/unreleased/add-eos.md @@ -0,0 +1,5 @@ +Enhancement: Document how to run OCIS on top of EOS + +We have added rules to the Makefile that use the official [eos docker images](https://gitlab.cern.ch/eos/eos-docker) to boot an eos cluster and configure OCIS to use it. + +https://github.com/owncloud/ocis/pull/172 \ No newline at end of file diff --git a/docs/eos.md b/docs/eos.md new file mode 100644 index 00000000000..eecf8636b3a --- /dev/null +++ b/docs/eos.md @@ -0,0 +1,73 @@ +--- +title: "EOS" +date: 2020-02-27T20:35:00+01:00 +weight: 30 +geekdocRepo: https://github.com/owncloud/ocis +geekdocEditPath: edit/master/docs +geekdocFilePath: eos.md +--- + +{{< toc >}} + +OCIS can be configured to run on top of [eos](https://eos.web.cern.ch/). While the [eos documentation](http://eos-docs.web.cern.ch/) does cover a lot of topics it leaves out some details that you may have to either pull from various [docker containers](https://gitlab.cern.ch/eos/eos-docker), the [forums](https://eos-community.web.cern.ch/) or even the [source](https://github.com/cern-eos/eos) itself. + +This document is a work in progress of the current setup. + +## Current status + +Using ocis and eos it is possible today to manage folders. Sharing is [heavily](https://github.com/cs3org/reva/pull/523) [under](https://github.com/cs3org/reva/pull/585) [development](https://github.com/cs3org/reva/pull/482). FIle up and download needs proper configuration of the dataprovider to also use eos. + +## How to do it + +### Grab it! + +``` +$ git clone git@github.com:owncloud/ocis.git +$ cd ocis +``` + + +### Run it! + +We poured the nitty gritty details of setting up ocis into Makefile destinations. After running + +``` +$ make eos-start +``` + +the eos related docker containers will be created, started and setup to authenticate a gainst the ocis-glauth service. + +It will also copy the ocis binary tho the `eos-cli1` container and start `ocis reva-storage-home` with the necessary environment variables to use the eos storage driver. + +For details have a look at the `Makefile`. + + +### Test it! + +You should now be able to point your browser to https://localhost:9200 and login using the demo user credentials, eg `einstein:relativity`. + +{{< hint info >}} +If you encounter an error when the IdP redirects you back to phoenix, just reload the page and it should be gone ... or debug it. PR welcome! +{{< /hint >}} + +Create a folder in the ui. Then check it was created in eos: + +``` +$ docker exec -it eos-mgm1 eos ls /eos/dockertest/einstein +``` + +Now create a new folder in eos (using eos-mgm1 you will be logged in as admin, see the `whoami`, which is why we `chown` the folder to the uid and gid of einstein afterwards): + +``` +$ docker exec -it eos-mgm1 eos whoami +$ docker exec -it eos-mgm1 eos mkdir /eos/dockertest/einstein/rocks +$ docker exec -it eos-mgm1 eos chown 20000:30000 /eos/dockertest/einstein/rocks +``` + +Check that the folder exists in the web ui. + +## Next steps + +- configure storage-home-data to enable file upload, PRs against `ocis-reva` welcome +- get sharing implemented, PRs against `reva` welcome +- simplify home logic, see https://github.com/cs3org/reva/issues/601 and https://github.com/cs3org/reva/issues/578 diff --git a/go.mod b/go.mod index 512c7fc40d4..52d59107f25 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/owncloud/ocis-phoenix v0.4.1 github.com/owncloud/ocis-pkg/v2 v2.2.0 github.com/owncloud/ocis-proxy v0.3.1 - github.com/owncloud/ocis-reva v0.1.1 + github.com/owncloud/ocis-reva v0.1.2-0.20200415163208-833cdbbcb04d github.com/owncloud/ocis-thumbnails v0.1.0 github.com/owncloud/ocis-webdav v0.1.0 github.com/restic/calens v0.2.0 diff --git a/go.sum b/go.sum index 03a2dc55c17..85845499f41 100644 --- a/go.sum +++ b/go.sum @@ -121,8 +121,8 @@ github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.25.31/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.29.28 h1:4eKUDBN+v1yxpGDxxPY+FG2Abc6yJB6vvkEDRJ9jIW0= -github.com/aws/aws-sdk-go v1.29.28/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= +github.com/aws/aws-sdk-go v1.30.7 h1:IaXfqtioP6p9SFAnNfsqdNczbR5UNbYqvcZUSsCAdTY= +github.com/aws/aws-sdk-go v1.30.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= 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-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -207,11 +207,11 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSY 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-20191128165347-19746c015c83/go.mod h1:IsVGyZrOLUQD48JIhlM/xb3Vz6He5o2+W0ZTfUGY+IU= -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/go-cs3apis v0.0.0-20200408065125-6e23f3ecec0a h1:+enFdliTCV/aaLAvLmeka/r9wUoEypngV4JD5Gy92Uc= +github.com/cs3org/go-cs3apis v0.0.0-20200408065125-6e23f3ecec0a/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY= github.com/cs3org/reva v0.0.2-0.20200115110931-4c7513415ec5/go.mod h1:Hk3eCcdhtv4eIhKvRK736fQuOyS1HuHnUcz0Dq6NK1A= -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/cs3org/reva v0.1.1-0.20200414133413-5e90b20d20ca h1:5RyVPbkQlY0jUwPJJx0x8nXrTiVUiPfegthytvVBp3o= +github.com/cs3org/reva v0.1.1-0.20200414133413-5e90b20d20ca/go.mod h1:baGkmcec/4WxTux30nbIz05RWKaueMGTkDihcVxLp8Y= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -339,6 +339,8 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v0.0.0-20170622202551-6a1fa9404c0a/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -474,6 +476,8 @@ github.com/jinzhu/copier v0.0.0-20190924061706-b57f9002281a/go.mod h1:yL958EeXv8 github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= @@ -615,8 +619,8 @@ github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1D github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.2.1 h1:pSevhhKCEjOuZHQWDBYAHxcimg60m1fGFj6atY7zAdE= -github.com/mitchellh/mapstructure v1.2.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.2.2 h1:dxe5oCinTXiTIcfgmZecdCzPmAJKd46KsCWc35r0TV4= +github.com/mitchellh/mapstructure v1.2.2/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= @@ -706,11 +710,12 @@ github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukw github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 h1:lNCW6THrCKBiJBpz8kbVGjC7MgdCGKwuvBgc7LoD6sw= github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= 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/fosite v0.31.0 h1:NZ0FA4ywPEYrCGLNVBAz2dq8vTacLDbbO4Iiy68WCKQ= +github.com/ory/fosite v0.31.0/go.mod h1:lSSqjo8Kr/U1P3kJWxsNGHmq7TnH/7pS1ijvQRT7G+g= 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= +github.com/owncloud/flaex v0.0.0-20200411150708-dce59891a203/go.mod h1:jip86t4OVURJTf8CM/0e2qcji/Y4NG3l2lR8kex4JWw= github.com/owncloud/flaex v0.2.0 h1:3FLf8oyMgA6HLK7w4+VJ5N1oVA8G7MptLCVjfxxIaww= github.com/owncloud/flaex v0.2.0/go.mod h1:jip86t4OVURJTf8CM/0e2qcji/Y4NG3l2lR8kex4JWw= github.com/owncloud/ocis-accounts v0.1.0 h1:6YjvRWNW26QHOqOFONg0HeogxhxaVGS1S2AoCUgzE3M= @@ -738,8 +743,8 @@ github.com/owncloud/ocis-pkg/v2 v2.2.0 h1:lsb1PSn8F4ppPHOECVc3fqziDM/VdGQ/zqxQnE github.com/owncloud/ocis-pkg/v2 v2.2.0/go.mod h1:MXv7QzsYsu4YWuyJxhq1kLLmJa/r5gbqHe1FXulMHaw= github.com/owncloud/ocis-proxy v0.3.1 h1:49weyxHNQjOeWTaf31LlQp5uul8ZoJenfe9o4P4fetU= github.com/owncloud/ocis-proxy v0.3.1/go.mod h1:HwsIKM9etps19bBVwjOX+Jrv9pfDvw3azvaHaxMiBCI= -github.com/owncloud/ocis-reva v0.1.1 h1:rO027ihdshmpWFeMwdE9IVVSogPTCXkco+/YhN0+Peg= -github.com/owncloud/ocis-reva v0.1.1/go.mod h1:cV9QOm+fdr1hHg8h49JCragWTQ4yRTDt3e0ZncuwDBM= +github.com/owncloud/ocis-reva v0.1.2-0.20200415163208-833cdbbcb04d h1:XqXTE1PqaSYyKEJdx3NAesF3CgZJbKXydltrmm1QNd8= +github.com/owncloud/ocis-reva v0.1.2-0.20200415163208-833cdbbcb04d/go.mod h1:XgZUqsOSp8ik58f61P0TvdHvgswoqV/7RTiXMuCmKmQ= github.com/owncloud/ocis-thumbnails v0.0.0-20200318131505-e0ab0b37a5a4/go.mod h1:VmCoxwitTs6oRxIaGz6xridLPwA6ReRMej22jBhkRIM= github.com/owncloud/ocis-thumbnails v0.1.0 h1:rUzNeu5bKH01WnG/EKJZGy6rnlqZ4tlArDaUwIZK0hM= github.com/owncloud/ocis-thumbnails v0.1.0/go.mod h1:VmCoxwitTs6oRxIaGz6xridLPwA6ReRMej22jBhkRIM= @@ -1131,6 +1136,7 @@ golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -1297,6 +1303,8 @@ k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/command/revastorageeos.go b/pkg/command/revastorageeos.go new file mode 100644 index 00000000000..13a428c02c0 --- /dev/null +++ b/pkg/command/revastorageeos.go @@ -0,0 +1,40 @@ +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/command" + svcconfig "github.com/owncloud/ocis-reva/pkg/config" + "github.com/owncloud/ocis-reva/pkg/flagset" + "github.com/owncloud/ocis/pkg/config" + "github.com/owncloud/ocis/pkg/register" +) + +// RevaStorageEOSCommand is the entrypoint for the reva-storage-oc command. +func RevaStorageEOSCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "reva-storage-eos", + Usage: "Start reva eos storage", + Category: "Extensions", + Flags: flagset.StorageEOSWithConfig(cfg.Reva), + Action: func(c *cli.Context) error { + scfg := configureRevaStorageEOS(cfg) + + return cli.HandleAction( + command.StorageEOS(scfg).Action, + c, + ) + }, + } +} + +func configureRevaStorageEOS(cfg *config.Config) *svcconfig.Config { + cfg.Reva.Log.Level = cfg.Log.Level + cfg.Reva.Log.Pretty = cfg.Log.Pretty + cfg.Reva.Log.Color = cfg.Log.Color + + return cfg.Reva +} + +func init() { + register.AddCommand(RevaStorageEOSCommand) +} diff --git a/pkg/command/revastorageeosdata.go b/pkg/command/revastorageeosdata.go new file mode 100644 index 00000000000..f7866828442 --- /dev/null +++ b/pkg/command/revastorageeosdata.go @@ -0,0 +1,40 @@ +package command + +import ( + "github.com/micro/cli/v2" + "github.com/owncloud/ocis-reva/pkg/command" + svcconfig "github.com/owncloud/ocis-reva/pkg/config" + "github.com/owncloud/ocis-reva/pkg/flagset" + "github.com/owncloud/ocis/pkg/config" + "github.com/owncloud/ocis/pkg/register" +) + +// RevaStorageEOSDataCommand is the entrypoint for the reva-storage-eos-data command. +func RevaStorageEOSDataCommand(cfg *config.Config) *cli.Command { + return &cli.Command{ + Name: "reva-storage-eos-data", + Usage: "Start reva eos storage dataprovider", + Category: "Extensions", + Flags: flagset.StorageEOSDataWithConfig(cfg.Reva), + Action: func(c *cli.Context) error { + scfg := configureRevaStorageEOSData(cfg) + + return cli.HandleAction( + command.StorageEOSData(scfg).Action, + c, + ) + }, + } +} + +func configureRevaStorageEOSData(cfg *config.Config) *svcconfig.Config { + cfg.Reva.Log.Level = cfg.Log.Level + cfg.Reva.Log.Pretty = cfg.Log.Pretty + cfg.Reva.Log.Color = cfg.Log.Color + + return cfg.Reva +} + +func init() { + register.AddCommand(RevaStorageEOSDataCommand) +} diff --git a/pkg/command/revastoragehome.go b/pkg/command/revastoragehome.go index 6e2f90a3cbd..0608b34ae2e 100644 --- a/pkg/command/revastoragehome.go +++ b/pkg/command/revastoragehome.go @@ -32,8 +32,6 @@ func configureRevaStorageHome(cfg *config.Config) *svcconfig.Config { cfg.Reva.Log.Pretty = cfg.Log.Pretty cfg.Reva.Log.Color = cfg.Log.Color - cfg.Reva.Reva.StorageHome.ExposeDataServer = true - return cfg.Reva } diff --git a/pkg/command/revastorageoc.go b/pkg/command/revastorageoc.go index 267421bb1fa..8f9e950d7cb 100644 --- a/pkg/command/revastorageoc.go +++ b/pkg/command/revastorageoc.go @@ -32,8 +32,6 @@ func configureRevaStorageOC(cfg *config.Config) *svcconfig.Config { cfg.Reva.Log.Pretty = cfg.Log.Pretty cfg.Reva.Log.Color = cfg.Log.Color - cfg.Reva.Reva.StorageOC.ExposeDataServer = true - return cfg.Reva } diff --git a/pkg/micro/runtime/runtime.go b/pkg/micro/runtime/runtime.go index 5e083d55051..a38c00b6954 100644 --- a/pkg/micro/runtime/runtime.go +++ b/pkg/micro/runtime/runtime.go @@ -45,6 +45,8 @@ var ( //"reva-storage-root", "reva-storage-home", "reva-storage-home-data", + "reva-storage-eos", + "reva-storage-eos-data", "reva-storage-oc", "reva-storage-oc-data", "glauth",