Merge branch 'master' into fix-simple

This commit is contained in:
Alex Unger
2020-04-17 08:49:27 +02:00
committed by GitHub
24 changed files with 1348 additions and 257 deletions

View File

@@ -126,12 +126,141 @@ def testing(ctx):
},
},
},
{
'name': 'ocis-server',
'image': 'webhippie/golang:1.13',
'pull': 'always',
'detach': True,
'environment' : {
'REVA_LDAP_HOSTNAME': 'ldap',
'REVA_LDAP_PORT': 636,
'REVA_LDAP_BIND_PASSWORD': 'admin',
'REVA_LDAP_BIND_DN': 'cn=admin,dc=owncloud,dc=com',
'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',
'REVA_STORAGE_OC_DATA_TEMP_FOLDER': '/srv/app/tmp/',
'REVA_STORAGE_OWNCLOUD_REDIS_ADDR': 'redis:6379',
'REVA_OIDC_ISSUER': 'https://ocis-server:9200',
'PHOENIX_WEB_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'PHOENIX_ASSET_PATH': '/srv/app/phoenix/dist',
'KONNECTD_IDENTIFIER_REGISTRATION_CONF': '/drone/src/tests/config/drone/identifier-registration.yml',
'KONNECTD_ISS': 'https://ocis-server:9200',
'KONNECTD_TLS': 'true',
'LDAP_URI': 'ldap://ldap',
'LDAP_BINDDN': 'cn=admin,dc=owncloud,dc=com',
'LDAP_BINDPW': 'admin',
'LDAP_BASEDN': 'dc=owncloud,dc=com'
},
'commands': [
'mkdir -p /srv/app/tmp/reva',
'bin/ocis server'
],
'volumes': [
{
'name': 'gopath',
'path': '/srv/app'
},
]
},
{
'name': 'oC10APIAcceptanceTests',
'image': 'owncloudci/php:7.2',
'pull': 'always',
'environment' : {
'TEST_SERVER_URL': 'http://ocis-server:9140',
'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva/',
'TEST_EXTERNAL_USER_BACKENDS':'true',
'REVA_LDAP_HOSTNAME':'ldap',
'TEST_OCIS':'true',
'BEHAT_FILTER_TAGS': '~@skipOnOcis&&~@skipOnLDAP&&@TestAlsoOnExternalUserBackend&&~@local_storage',
},
'commands': [
'git clone -b master --depth=1 https://github.com/owncloud/core.git /srv/app/testrunner',
'cd /srv/app/testrunner',
'make test-acceptance-api',
],
'volumes': [{
'name': 'gopath',
'path': '/srv/app',
}]
},
{
'name': 'phoenixWebUIAcceptanceTests',
'image': 'owncloudci/nodejs:10',
'pull': 'always',
'environment': {
'SERVER_HOST': 'http://ocis-server:9100',
'BACKEND_HOST': 'http://ocis-server:9140',
'RUN_ON_OCIS': 'true',
'OCIS_REVA_DATA_ROOT': '/srv/app/tmp/reva',
'OCIS_SKELETON_DIR': '/srv/app/testing/data/webUISkeleton',
'OCIS_PHOENIX_CONFIG': '/drone/src/tests/config/drone/ocis-config.json',
'LDAP_SERVER_URL': 'ldap://ldap',
'TEST_TAGS': 'not @skipOnOCIS and not @skip',
'LOCAL_UPLOAD_DIR': '/uploads'
},
'commands': [
'git clone -b master --depth=1 https://github.com/owncloud/testing.git /srv/app/testing',
'git clone -b master --depth=1 https://github.com/owncloud/phoenix.git /srv/app/phoenix',
'cp -r /srv/app/phoenix/tests/acceptance/filesForUpload/* /uploads',
'cd /srv/app/phoenix',
'yarn install-all',
'yarn dist',
'cp -r /drone/src/tests/config/drone/ocis-config.json /srv/app/phoenix/dist/config.json',
'yarn run acceptance-tests-drone'
],
'volumes': [{
'name': 'gopath',
'path': '/srv/app',
},
{
'name': 'uploads',
'path': '/uploads'
}]
},
],
'services': [
{
'name': 'ldap',
'image': 'osixia/openldap',
'pull': 'always',
'environment': {
'LDAP_DOMAIN': 'owncloud.com',
'LDAP_ORGANISATION': 'ownCloud',
'LDAP_ADMIN_PASSWORD': 'admin',
'LDAP_TLS_VERIFY_CLIENT': 'never',
'HOSTNAME': 'ldap'
},
},
{
'name': 'redis',
'image': 'webhippie/redis',
'pull': 'always',
'environment': {
'REDIS_DATABASES': 1
},
},
{
'name': 'selenium',
'image': 'selenium/standalone-chrome-debug:latest',
'pull': 'always',
'volumes': [{
'name': 'uploads',
'path': '/uploads'
}],
},
],
'volumes': [
{
'name': 'gopath',
'temp': {},
},
{
'name': 'uploads',
'temp': {}
}
],
'trigger': {
'ref': [

2
.gitignore vendored
View File

@@ -5,3 +5,5 @@ coverage.out
/hugo
*.key
*crt
/eos-docker

View File

@@ -5,8 +5,11 @@
* Change - Add the thumbnails command: [#156](https://github.com/owncloud/ocis/issues/156)
* Change - Initial release of basic version: [#2](https://github.com/owncloud/ocis/issues/2)
* Change - Start ocis-proxy with the ocis server command: [#119](https://github.com/owncloud/ocis/issues/119)
* Enhancement - Document how to run OCIS on top of EOS: [#172](https://github.com/owncloud/ocis/pull/172)
* Enhancement - Update proxy to v0.2.0: [#167](https://github.com/owncloud/ocis/pull/167)
* Enhancement - Update extensions: [#180](https://github.com/owncloud/ocis/pull/180)
* Enhancement - Update extensions: [#151](https://github.com/owncloud/ocis/pull/151)
* Enhancement - Update extensions: [#209](https://github.com/owncloud/ocis/pull/209)
## Details
@@ -34,11 +37,29 @@
https://github.com/owncloud/ocis/issues/136
* Enhancement - Document how to run OCIS on top of EOS: [#172](https://github.com/owncloud/ocis/pull/172)
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
* Enhancement - Update proxy to v0.2.0: [#167](https://github.com/owncloud/ocis/pull/167)
https://github.com/owncloud/ocis/pull/167
* Enhancement - Update extensions: [#180](https://github.com/owncloud/ocis/pull/180)
We've updated various extensions to a tagged release: - ocis-phoenix v0.4.0 (phoenix v0.7.0)
- ocis-pkg v2.2.0 - ocis-proxy v0.3.1 - ocis-reva v0.1.1 - ocis-thumbnails v0.1.0 -
ocis-webdav v0.1.0
https://github.com/owncloud/ocis/pull/180
* Enhancement - Update extensions: [#151](https://github.com/owncloud/ocis/pull/151)
We've updated various extensions to a tagged release: - ocis-konnectd v0.2.0 - ocis-glauth
@@ -47,3 +68,11 @@
https://github.com/owncloud/ocis/pull/151
* Enhancement - Update extensions: [#209](https://github.com/owncloud/ocis/pull/209)
We've updated various extensions: - ocis-konnectd v0.3.1 - ocis-phoenix v0.5.0 (phoenix
v0.8.0) - ocis-reva v0.2.0
https://github.com/owncloud/ocis/pull/209

141
Makefile
View File

@@ -4,6 +4,7 @@ IMPORT := github.com/owncloud/$(NAME)
BIN := bin
DIST := dist
HUGO := hugo
CONFIG := config/identifier-registration.yaml
ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
@@ -46,6 +47,7 @@ ifndef DATE
endif
LDFLAGS += -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
.PHONY: all
@@ -56,10 +58,14 @@ sync:
go mod download
.PHONY: clean
clean:
clean: clean-config
go clean -i ./...
rm -rf $(BIN) $(DIST) $(HUGO)
.PHONY: clean-config
clean-config:
rm -rf $(CONFIG)
.PHONY: fmt
fmt:
gofmt -s -w $(SOURCES)
@@ -99,7 +105,7 @@ $(BIN)/$(EXECUTABLE): $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $@ ./cmd/$(NAME)
$(BIN)/$(EXECUTABLE)-debug: $(SOURCES)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
$(GOBUILD) -v -tags '$(TAGS)' -ldflags '$(DEBUG_LDFLAGS)' -gcflags '$(GCFLAGS)' -o $@ ./cmd/$(NAME)
.PHONY: release
release: release-dirs release-linux release-windows release-darwin release-copy release-check
@@ -143,13 +149,142 @@ docs-copy:
git checkout origin/source -f; \
rsync --delete -ax ../docs/ content/$(NAME)
.PHONY: config-docs-generate
config-docs-generate:
go run github.com/owncloud/flaex >| docs/configuration.md
.PHONY: docs-build
docs-build:
cd $(HUGO); hugo
.PHONY: docs
docs: docs-copy docs-build
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 "<pwd>" 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

View File

@@ -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

View File

@@ -0,0 +1,11 @@
Enhancement: Update extensions
We've updated various extensions to a tagged release:
- ocis-phoenix v0.4.0 (phoenix v0.7.0)
- ocis-pkg v2.2.0
- ocis-proxy v0.3.1
- ocis-reva v0.1.1
- ocis-thumbnails v0.1.0
- ocis-webdav v0.1.0
https://github.com/owncloud/ocis/pull/180

View File

@@ -0,0 +1,8 @@
Enhancement: Update extensions
We've updated various extensions:
- ocis-konnectd v0.3.1
- ocis-phoenix v0.5.0 (phoenix v0.8.0)
- ocis-reva v0.2.0
https://github.com/owncloud/ocis/pull/209

View File

@@ -1,6 +1,6 @@
---
title: "Configuration"
date: 2020-02-27T20:35:00+01:00
date: "2020-04-14T22:00:52+0200"
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs
@@ -13,6 +13,8 @@ geekdocFilePath: configuration.md
oCIS Single Binary is not responsible for configuring extensions. Instead, each extension could either be configured by environment variables, cli flags or config files.
Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/ocis_proxy/configuration) which lists all possible configurations. Config files and environment variables are picked up if you use the `./bin/ocis server` command within the oCIS single binary. Command line flags must be set explicitly on the extensions subcommands.
### Configuration using config files
Out of the box extensions will attempt to read configuration details from:
@@ -25,254 +27,172 @@ $HOME/.ocis
For this configuration to be picked up, have a look at your extension `root` command and look for which default config name it has assigned. *i.e: ocis-proxy reads `proxy.json | yaml | toml ...`*.
So far we support the file formats `JSON` and `YAML`, if you want to get a full example configuration just take a look at [our repository](https://github.com/owncloud/ocis/tree/master/config), there you can always see the latest configuration format. These example configurations include all available options and the default values. The configuration file will be automatically loaded if it's placed at `/etc/ocis/ocis.yml`, `${HOME}/.ocis/ocis.yml` or `$(pwd)/config/ocis.yml`.
### Envrionment variables
If you prefer to configure the service with environment variables you can see the available variables below.
#### Global
OCIS_CONFIG_FILE
: Path to config file
OCIS_LOG_LEVEL
: Set logging level, defaults to `info`
OCIS_LOG_COLOR
: Enable colored logging, defaults to `true`
OCIS_LOG_PRETTY
: Enable pretty logging, defaults to `true`
#### Server
OCIS_TRACING_ENABLED
: Enable sending traces
OCIS_TRACING_TYPE
: Tracing backend type,
OCIS_TRACING_ENDPOINT
:Endpoint for the agent
OCIS_TRACING_COLLECTOR
: Endpoint for the collector
OCIS_TRACING_SERVICE
: Service name for tracing"
OCIS_DEBUG_ADDR
: Address to bind debug server, defaults to `0.0.0.0:9010`
OCIS_DEBUG_TOKEN
: Token to grant metrics access, empty default value
OCIS_DEBUG_PPROF
: Enable pprof debugging, defaults to `false`
OCIS_DEBUG_ZPAGES
: Enable zpages debugging, defaults to `false`
OCIS_HTTP_ADDR
: Address to bind http server, defaults to `0.0.0.0:9000`
OCIS_HTTP_ROOT
: Root path for http endpoint, defaults to `/`
OCIS_GRPC_ADDR
: Address to bind grpc server, defaults to `0.0.0.0:9001`
OCIS_SERVICES_ENABLED
: List of enabled services, defaults to `phoenix,konnectd,graph,ocs,webdav,hello`
#### Health
OCIS_DEBUG_ADDR
: Address to debug endpoint, defaults to `0.0.0.0:9010`
### Commandline flags
If you prefer to configure the service with commandline flags you can see the available variables below.
If you prefer to configure the service with commandline flags you can see the available variables below. Command line flags are only working when calling the subcommand directly.
#### Global
## Root Command
--config-file
: Path to config file
ownCloud Infinite Scale Stack
--log-level
: Set logging level, defaults to `info`
Usage: `ocis [global options] command [command options] [arguments...]`
--log-color
: Enable colored logging, defaults to `true`
--config-file | $OCIS_CONFIG_FILE
: Path to config file.
--log-pretty
: Enable pretty logging, defaults to `true`
--log-level | $OCIS_LOG_LEVEL
: Set logging level. Default: `info`.
#### Server
--log-pretty | $OCIS_LOG_PRETTY
: Enable pretty logging. Default: `true`.
--tracing-enabled
: Enable sending traces
--log-color | $OCIS_LOG_COLOR
: Enable colored logging. Default: `true`.
--tracing-type
: Tracing backend type,
## Sub Commands
--tracing-endpoint
:Endpoint for the agent
### ocis health
--tracing-collector
: Endpoint for the collector
Check health status
--tracing-service
: Service name for tracing"
Usage: `ocis health [command options] [arguments...]`
--debug-addr
: Address to bind debug server, defaults to `0.0.0.0:9010`
--debug-addr | $OCIS_DEBUG_ADDR
: Address to debug endpoint. Default: `0.0.0.0:9010`.
--debug-token
: Token to grant metrics access, empty default value
### ocis server
--debug-pprof
: Enable pprof debugging, defaults to `false`
Start fullstack server
--debug-zpages
: Enable zpages debugging, defaults to `false`
Usage: `ocis server [command options] [arguments...]`
--http-addr
: Address to bind http server, defaults to `0.0.0.0:9000`
--tracing-enabled | $OCIS_TRACING_ENABLED
: Enable sending traces.
--http-root
: Root path for http endpoint, defaults to `/`
--tracing-type | $OCIS_TRACING_TYPE
: Tracing backend type. Default: `jaeger`.
--grpc-addr
: Address to bind grpc server, defaults to `0.0.0.0:9001`
--tracing-endpoint | $OCIS_TRACING_ENDPOINT
: Endpoint for the agent.
--services-enabled
: List of enabled services, defaults to `hello,phoenix,graph,graph-explorer,ocs,webdav,reva-frontend,reva-gateway,reva-users,reva-auth-basic,reva-auth-bearer,reva-sharing,reva-storage-root,reva-storage-home,reva-storage-home-data,reva-storage-oc,reva-storage-oc-data,devldap`
--tracing-collector | $OCIS_TRACING_COLLECTOR
: Endpoint for the collector.
#### Health
--tracing-service | $OCIS_TRACING_SERVICE
: Service name for tracing. Default: `ocis`.
--debug-addr
: Address to debug endpoint, defaults to `0.0.0.0:9010`
--debug-addr | $OCIS_DEBUG_ADDR
: Address to bind debug server. Default: `0.0.0.0:9010`.
### Configuration file
--debug-token | $OCIS_DEBUG_TOKEN
: Token to grant metrics access.
So far we support the file formats `JSON` and `YAML`, if you want to get a full example configuration just take a look at [our repository](https://github.com/owncloud/ocis/tree/master/config), there you can always see the latest configuration format. These example configurations include all available options and the default values. The configuration file will be automatically loaded if it's placed at `/etc/ocis/ocis.yml`, `${HOME}/.ocis/ocis.yml` or `$(pwd)/config/ocis.yml`.
--debug-pprof | $OCIS_DEBUG_PPROF
: Enable pprof debugging.
## Usage
--debug-zpages | $OCIS_DEBUG_ZPAGES
: Enable zpages debugging.
The program provides a few sub-commands on execution. The available configuration methods have already been mentioned above. Generally you can always see a formated help output if you execute the binary via `ocis --help`.
--http-addr | $OCIS_HTTP_ADDR
: Address to bind http server. Default: `0.0.0.0:9000`.
### Server
--http-root | $OCIS_HTTP_ROOT
: Root path of http server. Default: `/`.
The server command is used to start the http and debug server on two addresses within a single process. The http server is serving the general webservice while the debug server is used for health check, readiness check and to server the metrics mentioned below. For further help please execute:
--grpc-addr | $OCIS_GRPC_ADDR
: Address to bind grpc server. Default: `0.0.0.0:9001`.
{{< highlight txt >}}
ocis server --help
{{< / highlight >}}
### List of available Extension subcommands
### Health
There are more subcommands to start the individual extensions. Please check the documentation about their usage and options in the dedicated section of the documentation.
The health command is used to execute a health check, if the exit code equals zero the service should be up and running, if the exist code is greater than zero the service is not in a healthy state. Generally this command is used within our Docker containers, it could also be used within Kubernetes.
#### ocis proxy
{{< highlight txt >}}
ocis health --help
{{< / highlight >}}
Start proxy server
## Metrics
#### ocis reva-storage-oc-data
This service provides some [Prometheus](https://prometheus.io/) metrics through the debug endpoint, you can optionally secure the metrics endpoint by some random token, which got to be configured through one of the flag `--debug-token` or the environment variable `OCIS_DEBUG_TOKEN` mentioned above. By default the metrics endpoint is bound to `http://0.0.0.0:8001/metrics`.
Start reva oc storage dataprovider
go_gc_duration_seconds
: A summary of the GC invocation durations
#### ocis reva-auth-bearer
go_gc_duration_seconds_sum
: A summary of the GC invocation durations
Start reva auth-bearer service
go_gc_duration_seconds_count
: A summary of the GC invocation durations
#### ocis webdav
go_goroutines
: Number of goroutines that currently exist
Start webdav server
go_info
: Information about the Go environment
#### ocis reva-sharing
go_memstats_alloc_bytes
: Number of bytes allocated and still in use
Start reva sharing service
go_memstats_alloc_bytes_total
: Total number of bytes allocated, even if freed
#### ocis reva-gateway
go_memstats_buck_hash_sys_bytes
: Number of bytes used by the profiling bucket hash table
Start reva gateway
go_memstats_frees_total
: Total number of frees
#### ocis graph-explorer
go_memstats_gc_cpu_fraction
: The fraction of this program's available CPU time used by the GC since the program started
Start graph explorer
go_memstats_gc_sys_bytes
: Number of bytes used for garbage collection system metadata
#### ocis reva-auth-basic
go_memstats_heap_alloc_bytes
: Number of heap bytes allocated and still in use
Start reva auth-basic service
go_memstats_heap_idle_bytes
: Number of heap bytes waiting to be used
#### ocis hello
go_memstats_heap_inuse_bytes
: Number of heap bytes that are in use
Start hello server
go_memstats_heap_objects
: Number of allocated objects
#### ocis reva-storage-home
go_memstats_heap_released_bytes
: Number of heap bytes released to OS
Start reva home storage
go_memstats_heap_sys_bytes
: Number of heap bytes obtained from system
#### ocis reva-storage-oc
go_memstats_last_gc_time_seconds
: Number of seconds since 1970 of last garbage collection
Start reva oc storage
go_memstats_lookups_total
: Total number of pointer lookups
#### ocis reva-frontend
go_memstats_mallocs_total
: Total number of mallocs
Start reva frontend
go_memstats_mcache_inuse_bytes
: Number of bytes in use by mcache structures
#### ocis reva-storage-home-data
go_memstats_mcache_sys_bytes
: Number of bytes used for mcache structures obtained from system
Start reva home storage dataprovider
go_memstats_mspan_inuse_bytes
: Number of bytes in use by mspan structures
#### ocis graph
go_memstats_mspan_sys_bytes
: Number of bytes used for mspan structures obtained from system
Start graph server
go_memstats_next_gc_bytes
: Number of heap bytes when next garbage collection will take place
#### ocis konnectd
go_memstats_other_sys_bytes
: Number of bytes used for other system allocations
Start konnectd server
go_memstats_stack_inuse_bytes
: Number of bytes in use by the stack allocator
#### ocis thumbnails
go_memstats_stack_sys_bytes
: Number of bytes obtained from system for stack allocator
Start thumbnails server
go_memstats_sys_bytes
: Number of bytes obtained from system
#### ocis glauth
go_threads
: Number of OS threads created
Start glauth server
promhttp_metric_handler_requests_in_flight
: Current number of scrapes being served
#### ocis phoenix
Start phoenix server
#### ocis ocs
Start ocs server
#### ocis reva-users
Start reva users service
#### ocis reva-storage-root
Start reva root storage
promhttp_metric_handler_requests_total
: Total number of scrapes by HTTP status code

217
docs/debugging.md Normal file
View File

@@ -0,0 +1,217 @@
---
title: "Debugging"
date: 2020-03-19T08:21:00+01:00
weight: 50
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs
geekdocFilePath: debugging.md
---
## Debugging
As a single binary for easy deployment running `ocis server` just forks itself to start all the services, which makes debugging those processes a little harder.
Ultimately, we want to be able to stop a single service using eg. `ocis kill phoenix` so that you can start the service you want to debug in debug mode. We need to [change the way we fork processes](https://github.com/owncloud/ocis/issues/77) though, otherwise the runtime will automatically restart a service if killed.
### Start ocis
For debugging there are two workflows that work well, depending on your preferences.
#### Use the debug binary and attach to the process as needed
Run the debug binary with `OCIS_LOG_LEVEL=debug bin/ocis-debug server` and then find the service you want to debug using:
```console
# ps ax | grep ocis
12837 pts/1 Sl+ 0:00 bin/ocis-debug server
12845 pts/1 Sl 0:00 bin/ocis-debug graph
12847 pts/1 Sl 0:00 bin/ocis-debug reva-auth-bearer
12848 pts/1 Sl 0:00 bin/ocis-debug graph-explorer
12849 pts/1 Sl 0:00 bin/ocis-debug ocs
12850 pts/1 Sl 0:00 bin/ocis-debug reva-storage-oc-data
12863 pts/1 Sl 0:00 bin/ocis-debug webdav
12874 pts/1 Sl 0:00 bin/ocis-debug reva-frontend
12897 pts/1 Sl 0:00 bin/ocis-debug reva-sharing
12905 pts/1 Sl 0:00 bin/ocis-debug reva-gateway
12912 pts/1 Sl 0:00 bin/ocis-debug reva-storage-home
12920 pts/1 Sl 0:00 bin/ocis-debug reva-users
12929 pts/1 Sl 0:00 bin/ocis-debug glauth
12940 pts/1 Sl 0:00 bin/ocis-debug reva-storage-home-data
12948 pts/1 Sl 0:00 bin/ocis-debug konnectd
12952 pts/1 Sl 0:00 bin/ocis-debug proxy
12961 pts/1 Sl 0:00 bin/ocis-debug thumbnails
12971 pts/1 Sl 0:00 bin/ocis-debug reva-storage-oc
12981 pts/1 Sl 0:00 bin/ocis-debug web
12993 pts/1 Sl 0:00 bin/ocis-debug api
12998 pts/1 Sl 0:00 bin/ocis-debug registry
13004 pts/1 Sl 0:00 bin/ocis-debug phoenix
13015 pts/1 Sl 0:00 bin/ocis-debug reva-auth-basic
```
Then you can set a breakpoint in the service you need and attach to the process via processid. To debug the `reva-sharing` service the VS Code `launch.json` would look like this:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "ocis attach",
"type": "go",
"request": "attach",
"mode": "local",
"processId": 12897,
}
]
}
```
#### Start all services independently to replace one of them with a debug process
1. You can use this `./ocis.sh` script to start all services independently, so they don't get restrarted by the runtime when you kill them:
```bash
#/bin/sh
LOG_LEVEL="debug"
bin/ocis --log-level=$LOG_LEVEL micro &
bin/ocis --log-level=$LOG_LEVEL glauth &
bin/ocis --log-level=$LOG_LEVEL graph-explorer &
bin/ocis --log-level=$LOG_LEVEL graph &
#bin/ocis --log-level=$LOG_LEVEL hello &
bin/ocis --log-level=$LOG_LEVEL konnectd &
#bin/ocis --log-level=$LOG_LEVEL ocs &
bin/ocis --log-level=$LOG_LEVEL phoenix &
bin/ocis --log-level=$LOG_LEVEL reva-auth-basic &
bin/ocis --log-level=$LOG_LEVEL reva-auth-bearer &
bin/ocis --log-level=$LOG_LEVEL reva-frontend &
bin/ocis --log-level=$LOG_LEVEL reva-gateway &
bin/ocis --log-level=$LOG_LEVEL reva-sharing &
bin/ocis --log-level=$LOG_LEVEL reva-storage-home &
bin/ocis --log-level=$LOG_LEVEL reva-storage-home-data &
bin/ocis --log-level=$LOG_LEVEL reva-storage-oc &
bin/ocis --log-level=$LOG_LEVEL reva-storage-oc-data &
bin/ocis --log-level=$LOG_LEVEL reva-storage-root &
bin/ocis --log-level=$LOG_LEVEL reva-users &
#bin/ocis --log-level=$LOG_LEVEL webdav
bin/ocis --log-level=$LOG_LEVEL proxy &
```
2. Get the list of running processes:
```console
# ps ax | grep ocis
12837 pts/1 Sl+ 0:00 bin/ocis-debug server
12845 pts/1 Sl 0:00 bin/ocis-debug graph
12847 pts/1 Sl 0:00 bin/ocis-debug reva-auth-bearer
12848 pts/1 Sl 0:00 bin/ocis-debug graph-explorer
12849 pts/1 Sl 0:00 bin/ocis-debug ocs
12850 pts/1 Sl 0:00 bin/ocis-debug reva-storage-oc-data
12863 pts/1 Sl 0:00 bin/ocis-debug webdav
12874 pts/1 Sl 0:00 bin/ocis-debug reva-frontend
12897 pts/1 Sl 0:00 bin/ocis-debug reva-sharing
12905 pts/1 Sl 0:00 bin/ocis-debug reva-gateway
12912 pts/1 Sl 0:00 bin/ocis-debug reva-storage-home
12920 pts/1 Sl 0:00 bin/ocis-debug reva-users
12929 pts/1 Sl 0:00 bin/ocis-debug glauth
12940 pts/1 Sl 0:00 bin/ocis-debug reva-storage-home-data
12948 pts/1 Sl 0:00 bin/ocis-debug konnectd
12952 pts/1 Sl 0:00 bin/ocis-debug proxy
12961 pts/1 Sl 0:00 bin/ocis-debug thumbnails
12971 pts/1 Sl 0:00 bin/ocis-debug reva-storage-oc
12981 pts/1 Sl 0:00 bin/ocis-debug web
12993 pts/1 Sl 0:00 bin/ocis-debug api
12998 pts/1 Sl 0:00 bin/ocis-debug registry
13004 pts/1 Sl 0:00 bin/ocis-debug phoenix
13015 pts/1 Sl 0:00 bin/ocis-debug reva-auth-basic
```
3. Kill the service you want to start in debug mode:
```console
# kill 17628
```
4. Start the service you are interested in in debug mode. When using make to build the binary there is already a `bin/ocis-debug` binary for you. When running an IDE tell it which service to start by providing the corresponding sub command, eg. `bin\ocis-debug reva-frontend`.
### Gather error messages
We recommend you collect all related information in a single file or in a github issue. Let us start with an error that pops up in the Web UI:
> Error while sharing.
> error sending a grpc stat request
This popped up when I tried to add `marie` as a collaborator in phoenix. That triggers a request to the server which I copied as curl. We can strip a lot of headers and the gist of it is:
```console
# curl 'https://localhost:9200/ocs/v1.php/apps/files_sharing/api/v1/shares' -d 'shareType=0&shareWith=marie&path=%2FNeuer+Ordner&permissions=1' -u einstein:relativity -k -v | xmllint -format -
[... headers ...]
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
<meta>
<status>error</status>
<statuscode>998</statuscode>
<message>error sending a grpc stat request</message>
</meta>
</ocs>
```
{{< hint info >}}
The username and password only work when basic auth is available. Otherwise you have to obtain a bearer token, eg. by grabbing it from the browser.
{{< /hint >}}
{{< hint danger >}}
TODO add ocis cli tool to obtain a bearer token.
{{< /hint >}}
We also have a few interesting log entries:
```
0:43PM INF home/jfd/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200318111623-a2f97d4aa741/internal/grpc/interceptors/log/log.go:69 > unary code=OK end="18/Mar/2020:22:43:40 +0100" from=tcp://[::1]:44078 pid=17836 pkg=rgrpc start="18/Mar/2020:22:43:40 +0100" time_ns=95841 traceid=b4eb9a9f45921f7d3632523ca32a42b0 uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider user-agent=grpc-go/1.26.0
10:43PM ERR home/jfd/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200318111623-a2f97d4aa741/internal/grpc/interceptors/log/log.go:69 > unary code=Unknown end="18/Mar/2020:22:43:40 +0100" from=tcp://[::1]:43910 pid=17836 pkg=rgrpc start="18/Mar/2020:22:43:40 +0100" time_ns=586115 traceid=b4eb9a9f45921f7d3632523ca32a42b0 uri=/cs3.gateway.v1beta1.GatewayAPI/Stat user-agent=grpc-go/1.26.0
10:43PM ERR home/jfd/go/pkg/mod/github.com/cs3org/reva@v0.0.2-0.20200318111623-a2f97d4aa741/internal/http/services/owncloud/ocs/reqres.go:94 > error sending a grpc stat request error="rpc error: code = Unknown desc = gateway: error calling Stat: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial tcp [::1]:9152: connect: connection refused\"" pid=17832 pkg=rhttp traceid=b4eb9a9f45921f7d3632523ca32a42b0
```
{{< hint danger >}}
TODO return the trace id in the response so we can correlate easier. For reva tracked in https://github.com/cs3org/reva/issues/587
{{< /hint >}}
The last line gives us a hint where the log message originated: `.../github.com/cs3org/reva@v0.0.2-0.20200318111623-a2f97d4aa741/internal/http/services/owncloud/ocs/reqres.go:94`. Which looks like this:
```go
89: // WriteOCSResponse handles writing ocs responses in json and xml
90: func WriteOCSResponse(w http.ResponseWriter, r *http.Request, res *Response, err error) {
91: var encoded []byte
92:
93: if err != nil {
94: appctx.GetLogger(r.Context()).Error().Err(err).Msg(res.OCS.Meta.Message)
95: }
```
Ok, so this seems to be a convenience method that is called from multiple places an also handles errors. Unfortunately, this hides the actual source of the error. We could set a breakpoint in line 94 and reproduce the problem, which can be a lot harder than just clicking the share button or sending a curl request again. So let us see what else the log tells us.
The previous line tells us that a Stat request failed: `uri=/cs3.gateway.v1beta1.GatewayAPI/Stat`. This time the line is written by the grpc log interceptor. What else is there?
The first line tells us that looking up the responsible storage provider seems to have succeeded: `uri=/cs3.storage.registry.v1beta1.RegistryAPI/GetStorageProvider`.
At this point it your familiarity with the codebase starts to become a factor. If you are new you should probably go back to setting a break point on the log line and check the stack trace.
Debug wherever the call trace leads you to ... good luck!
### Managing dependencies and testing changes
You can either run and manage the services independently, or you can update the `go.mod` file and replace dependencies with your local version.
To debug the reva frontend we need to add two replacements:
```
// use the local ocis-reva repo
replace github.com/owncloud/ocis-reva => ../ocis-reva
// also use the local reva repo
replace github.com/cs3org/reva => ../reva
```
{{< hint info >}}
The username and password only work when basic auth is available. Otherwise you have to obtain a bearer token, eg. by grabbing it from the browser.
{{< /hint >}}
Rebuild ocis to make sure the dependency is used. It should be sufficient to just restart the service you want to debug.

73
docs/eos.md Normal file
View File

@@ -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

View File

@@ -1,5 +1,5 @@
---
title: "Extensions"
title: "Extension"
date: 2020-02-27T20:35:00+01:00
weight: 40
geekdocRepo: https://github.com/owncloud/ocis

View File

@@ -53,6 +53,26 @@ chmod +x ocis
- Running ocis currently needs a working Redis caching server
- The default promary storage location is `/var/tmp/reva/data`. You can change that value by configuration.
## Usage
The program provides a few sub-commands on execution. The available configuration methods have already been mentioned above. Generally you can always see a formated help output if you execute the binary via `ocis --help`.
### Server
The server command is used to start the http and debug server on two addresses within a single process. The http server is serving the general webservice while the debug server is used for health check, readiness check and to server the metrics mentioned below. For further help please execute:
{{< highlight txt >}}
ocis server --help
{{< / highlight >}}
### Health
The health command is used to execute a health check, if the exit code equals zero the service should be up and running, if the exist code is greater than zero the service is not in a healthy state. Generally this command is used within our Docker containers, it could also be used within Kubernetes.
{{< highlight txt >}}
ocis health --help
{{< / highlight >}}
## Quickstart for Developers
Following https://github.com/owncloud/ocis#development
@@ -107,3 +127,102 @@ com.owncloud.api.hello
To the list of available services.
## Metrics
This service provides some [Prometheus](https://prometheus.io/) metrics through the debug endpoint, you can optionally secure the metrics endpoint by some random token, which got to be configured through one of the flag `--debug-token` or the environment variable `OCIS_DEBUG_TOKEN` mentioned above. By default the metrics endpoint is bound to `http://0.0.0.0:8001/metrics`.
go_gc_duration_seconds
: A summary of the GC invocation durations
go_gc_duration_seconds_sum
: A summary of the GC invocation durations
go_gc_duration_seconds_count
: A summary of the GC invocation durations
go_goroutines
: Number of goroutines that currently exist
go_info
: Information about the Go environment
go_memstats_alloc_bytes
: Number of bytes allocated and still in use
go_memstats_alloc_bytes_total
: Total number of bytes allocated, even if freed
go_memstats_buck_hash_sys_bytes
: Number of bytes used by the profiling bucket hash table
go_memstats_frees_total
: Total number of frees
go_memstats_gc_cpu_fraction
: The fraction of this program's available CPU time used by the GC since the program started
go_memstats_gc_sys_bytes
: Number of bytes used for garbage collection system metadata
go_memstats_heap_alloc_bytes
: Number of heap bytes allocated and still in use
go_memstats_heap_idle_bytes
: Number of heap bytes waiting to be used
go_memstats_heap_inuse_bytes
: Number of heap bytes that are in use
go_memstats_heap_objects
: Number of allocated objects
go_memstats_heap_released_bytes
: Number of heap bytes released to OS
go_memstats_heap_sys_bytes
: Number of heap bytes obtained from system
go_memstats_last_gc_time_seconds
: Number of seconds since 1970 of last garbage collection
go_memstats_lookups_total
: Total number of pointer lookups
go_memstats_mallocs_total
: Total number of mallocs
go_memstats_mcache_inuse_bytes
: Number of bytes in use by mcache structures
go_memstats_mcache_sys_bytes
: Number of bytes used for mcache structures obtained from system
go_memstats_mspan_inuse_bytes
: Number of bytes in use by mspan structures
go_memstats_mspan_sys_bytes
: Number of bytes used for mspan structures obtained from system
go_memstats_next_gc_bytes
: Number of heap bytes when next garbage collection will take place
go_memstats_other_sys_bytes
: Number of bytes used for other system allocations
go_memstats_stack_inuse_bytes
: Number of bytes in use by the stack allocator
go_memstats_stack_sys_bytes
: Number of bytes obtained from system for stack allocator
go_memstats_sys_bytes
: Number of bytes obtained from system
go_threads
: Number of OS threads created
promhttp_metric_handler_requests_in_flight
: Current number of scrapes being served
promhttp_metric_handler_requests_total
: Total number of scrapes by HTTP status code

21
go.mod
View File

@@ -6,6 +6,7 @@ require (
contrib.go.opencensus.io/exporter/jaeger v0.2.0
contrib.go.opencensus.io/exporter/ocagent v0.6.0
contrib.go.opencensus.io/exporter/zipkin v0.1.1
github.com/UnnoTed/fileb0x v1.1.4
github.com/chzyer/logex v1.1.10 // indirect
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
@@ -14,27 +15,25 @@ require (
github.com/micro/go-micro/v2 v2.0.1-0.20200212105717-d76baf59de2e
github.com/micro/micro/v2 v2.0.1-0.20200210100719-f38a1d8d5348
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/flaex v0.2.0
github.com/owncloud/ocis-glauth v0.4.0
github.com/owncloud/ocis-graph v0.0.0-20200318175820-9a5a6e029db7
github.com/owncloud/ocis-graph-explorer v0.0.0-20200210111049-017eeb40dc0c
github.com/owncloud/ocis-hello v0.1.0-alpha1.0.20200207094758-c866cafca7e5
github.com/owncloud/ocis-konnectd v0.2.0
github.com/owncloud/ocis-konnectd v0.3.1
github.com/owncloud/ocis-ocs v0.0.0-20200318181133-cc66a0531da7
github.com/owncloud/ocis-phoenix v0.3.0
github.com/owncloud/ocis-pkg/v2 v2.1.0
github.com/owncloud/ocis-proxy v0.2.1
github.com/owncloud/ocis-reva v0.1.0
github.com/owncloud/ocis-thumbnails v0.0.0-20200318131505-e0ab0b37a5a4
github.com/owncloud/ocis-webdav v0.0.0-20200319135906-711d1be75a2b
github.com/owncloud/ocis-phoenix v0.5.0
github.com/owncloud/ocis-pkg/v2 v2.2.0
github.com/owncloud/ocis-proxy v0.3.1
github.com/owncloud/ocis-reva v0.2.0
github.com/owncloud/ocis-thumbnails v0.1.0
github.com/owncloud/ocis-webdav v0.1.0
github.com/restic/calens v0.2.0
go.opencensus.io v0.22.3
go.uber.org/atomic v1.5.1 // indirect
go.uber.org/multierr v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4 // indirect
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae // indirect
stash.kopano.io/kc/konnect v0.29.0 // indirect
)
replace stash.kopano.io/kc/konnect => github.com/IljaN/konnect v0.30.0-alpha1
replace google.golang.org/grpc => google.golang.org/grpc v1.26.0

341
go.sum

File diff suppressed because it is too large Load Diff

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -84,7 +84,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
Name: "tracing-service",
Value: "hello",
Value: "ocis",
Usage: "Service name for tracing",
EnvVars: []string{"OCIS_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,

View File

@@ -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",

View File

@@ -0,0 +1,94 @@
---
title: "Configuration"
date: "{{ date "2006-01-02T15:04:05-0700" now }}"
weight: 20
geekdocRepo: https://github.com/owncloud/ocis
geekdocEditPath: edit/master/docs
geekdocFilePath: configuration.md
---
{{- define "options"}}
{{ $fnName := (last . ).Flags -}}
{{ range $opt := first . }}{{ with list $fnName $opt -}}
{{ $o := last . -}}
{{ if eq $o.FnName $fnName -}}
--{{ $o.Name }} | ${{ index $o.Env 0 }}
: {{ $o.Usage }}. {{- if $o.Default }} Default: `{{ $o.Default }}`.{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ end }}
{{`{{< toc >}}`}}
## Configuration
oCIS Single Binary is not responsible for configuring extensions. Instead, each extension could either be configured by environment variables, cli flags or config files.
Each extension has its dedicated documentation page (e.g. https://owncloud.github.io/extensions/ocis_proxy/configuration) which lists all possible configurations. Config files and environment variables are picked up if you use the `./bin/ocis server` command within the oCIS single binary. Command line flags must be set explicitly on the extensions subcommands.
### Configuration using config files
Out of the box extensions will attempt to read configuration details from:
```console
/etc/ocis
$HOME/.ocis
./config
```
For this configuration to be picked up, have a look at your extension `root` command and look for which default config name it has assigned. *i.e: ocis-proxy reads `proxy.json | yaml | toml ...`*.
So far we support the file formats `JSON` and `YAML`, if you want to get a full example configuration just take a look at [our repository](https://github.com/owncloud/ocis/tree/master/config), there you can always see the latest configuration format. These example configurations include all available options and the default values. The configuration file will be automatically loaded if it's placed at `/etc/ocis/ocis.yml`, `${HOME}/.ocis/ocis.yml` or `$(pwd)/config/ocis.yml`.
### Envrionment variables
If you prefer to configure the service with environment variables you can see the available variables below.
### Commandline flags
If you prefer to configure the service with commandline flags you can see the available variables below. Command line flags are only working when calling the subcommand directly.
{{ $options := .Options -}}
{{ range $com := .Commands }}{{ with (list $options $com) -}}
{{ $c := last . -}}
{{ if eq $c.Name "ocis" -}}
## Root Command
{{ $c.Usage }}
Usage: `ocis [global options] command [command options] [arguments...]`
{{ template "options" . -}}
## Sub Commands
{{ end -}}
{{ end -}}
{{ end -}}
{{- range $com := .Commands }}{{ with (list $options $com) -}}
{{- $c := last . }}
{{- if eq $c.Name "server" "health" -}}
{{- if ne $c.FnName "Simple" -}}
### ocis {{ $c.Name }}
{{ $c.Usage }}
Usage: `ocis {{ $c.Name }} [command options] [arguments...]`
{{ template "options" . }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
### List of available Extension subcommands
There are more subcommands to start the individual extensions. Please check the documentation about their usage and options in the dedicated section of the documentation.
{{ range $com := .Commands }}{{ with $com -}}
{{ if and (ne .Name "health") (ne .Name "server") (ne .Name "ocis") -}}
#### ocis {{ .Name }}
{{ .Usage }}
{{ end -}}
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,15 @@
---
# OpenID Connect client registry.
clients:
- id: phoenix
name: OCIS
application_type: web
insecure: yes
redirect_uris:
- http://ocis-server:9100/oidc-callback.html
- http://ocis-server:9100
origins:
- http://ocis-server:9100
authorities:

View File

@@ -0,0 +1,19 @@
{
"server": "http://ocis-server:9140",
"theme": "owncloud",
"version": "0.1.0",
"openIdConnect": {
"metadata_url": "https://ocis-server:9200/.well-known/openid-configuration",
"authority": "https://ocis-server:9200",
"client_id": "phoenix",
"response_type": "code",
"scope": "openid profile email"
},
"apps": [
"files",
"draw-io",
"pdf-viewer",
"markdown-editor",
"media-viewer"
]
}

9
tools.go Normal file
View File

@@ -0,0 +1,9 @@
// +build tools
package main
import (
_ "github.com/UnnoTed/fileb0x"
_ "github.com/owncloud/flaex"
_ "github.com/restic/calens"
)