merge master

This commit is contained in:
Michael Barz
2021-12-10 14:38:46 +01:00
783 changed files with 59360 additions and 45942 deletions
+34 -40
View File
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.0. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
BINGO_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
GOPATH ?= $(shell go env GOPATH)
@@ -17,23 +17,23 @@ GO ?= $(shell which go)
# @echo "Running bingo"
# @$(BINGO) <flags/args..>
#
BINGO := $(GOBIN)/bingo-v0.4.0
BINGO := $(GOBIN)/bingo-v0.5.1
$(BINGO): $(BINGO_DIR)/bingo.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/bingo-v0.4.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.4.0 "github.com/bwplotka/bingo"
@echo "(re)installing $(GOBIN)/bingo-v0.5.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=bingo.mod -o=$(GOBIN)/bingo-v0.5.1 "github.com/bwplotka/bingo"
BUF := $(GOBIN)/buf-v0.40.0
BUF := $(GOBIN)/buf-v0.56.0
$(BUF): $(BINGO_DIR)/buf.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/buf-v0.40.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.40.0 "github.com/bufbuild/buf/cmd/buf"
@echo "(re)installing $(GOBIN)/buf-v0.56.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buf.mod -o=$(GOBIN)/buf-v0.56.0 "github.com/bufbuild/buf/cmd/buf"
BUILDIFIER := $(GOBIN)/buildifier-v0.0.0-20210227132407-f2aed9ee205d
BUILDIFIER := $(GOBIN)/buildifier-v0.0.0-20210920153738-d6daef01a1a2
$(BUILDIFIER): $(BINGO_DIR)/buildifier.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/buildifier-v0.0.0-20210227132407-f2aed9ee205d"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buildifier.mod -o=$(GOBIN)/buildifier-v0.0.0-20210227132407-f2aed9ee205d "github.com/bazelbuild/buildtools/buildifier"
@echo "(re)installing $(GOBIN)/buildifier-v0.0.0-20210920153738-d6daef01a1a2"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=buildifier.mod -o=$(GOBIN)/buildifier-v0.0.0-20210920153738-d6daef01a1a2 "github.com/bazelbuild/buildtools/buildifier"
CALENS := $(GOBIN)/calens-v0.2.0
$(CALENS): $(BINGO_DIR)/calens.mod
@@ -41,23 +41,17 @@ $(CALENS): $(BINGO_DIR)/calens.mod
@echo "(re)installing $(GOBIN)/calens-v0.2.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=calens.mod -o=$(GOBIN)/calens-v0.2.0 "github.com/restic/calens"
FILEB0X := $(GOBIN)/fileb0x-v1.1.4
$(FILEB0X): $(BINGO_DIR)/fileb0x.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/fileb0x-v1.1.4"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=fileb0x.mod -o=$(GOBIN)/fileb0x-v1.1.4 "github.com/UnnoTed/fileb0x"
FLAEX := $(GOBIN)/flaex-v0.2.1-0.20210701123229-9d7dceed124f
$(FLAEX): $(BINGO_DIR)/flaex.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/flaex-v0.2.1-0.20210701123229-9d7dceed124f"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=flaex.mod -o=$(GOBIN)/flaex-v0.2.1-0.20210701123229-9d7dceed124f "github.com/owncloud/flaex"
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.37.1
GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.42.1
$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/golangci-lint-v1.37.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.37.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
@echo "(re)installing $(GOBIN)/golangci-lint-v1.42.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.42.1 "github.com/golangci/golangci-lint/cmd/golangci-lint"
GOX := $(GOBIN)/gox-v1.0.1
$(GOX): $(BINGO_DIR)/gox.mod
@@ -65,11 +59,11 @@ $(GOX): $(BINGO_DIR)/gox.mod
@echo "(re)installing $(GOBIN)/gox-v1.0.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=gox.mod -o=$(GOBIN)/gox-v1.0.1 "github.com/mitchellh/gox"
HUGO := $(GOBIN)/hugo-v0.87.0
HUGO := $(GOBIN)/hugo-v0.88.1
$(HUGO): $(BINGO_DIR)/hugo.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/hugo-v0.87.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.87.0 "github.com/gohugoio/hugo"
@echo "(re)installing $(GOBIN)/hugo-v0.88.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=hugo.mod -o=$(GOBIN)/hugo-v0.88.1 "github.com/gohugoio/hugo"
MUTAGEN := $(GOBIN)/mutagen-v0.11.8
$(MUTAGEN): $(BINGO_DIR)/mutagen.mod
@@ -77,29 +71,29 @@ $(MUTAGEN): $(BINGO_DIR)/mutagen.mod
@echo "(re)installing $(GOBIN)/mutagen-v0.11.8"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=mutagen.mod -o=$(GOBIN)/mutagen-v0.11.8 "github.com/mutagen-io/mutagen/cmd/mutagen"
OAPI_CODEGEN := $(GOBIN)/oapi-codegen-v1.6.1
OAPI_CODEGEN := $(GOBIN)/oapi-codegen-v1.8.2
$(OAPI_CODEGEN): $(BINGO_DIR)/oapi-codegen.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/oapi-codegen-v1.6.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=oapi-codegen.mod -o=$(GOBIN)/oapi-codegen-v1.6.1 "github.com/deepmap/oapi-codegen/cmd/oapi-codegen"
@echo "(re)installing $(GOBIN)/oapi-codegen-v1.8.2"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=oapi-codegen.mod -o=$(GOBIN)/oapi-codegen-v1.8.2 "github.com/deepmap/oapi-codegen/cmd/oapi-codegen"
PROTOC_GEN_DOC := $(GOBIN)/protoc-gen-doc-v1.4.1
PROTOC_GEN_DOC := $(GOBIN)/protoc-gen-doc-v1.5.0
$(PROTOC_GEN_DOC): $(BINGO_DIR)/protoc-gen-doc.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-doc-v1.4.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-doc.mod -o=$(GOBIN)/protoc-gen-doc-v1.4.1 "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
@echo "(re)installing $(GOBIN)/protoc-gen-doc-v1.5.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-doc.mod -o=$(GOBIN)/protoc-gen-doc-v1.5.0 "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc"
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.26.0
PROTOC_GEN_GO := $(GOBIN)/protoc-gen-go-v1.27.1
$(PROTOC_GEN_GO): $(BINGO_DIR)/protoc-gen-go.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.26.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.26.0 "google.golang.org/protobuf/cmd/protoc-gen-go"
@echo "(re)installing $(GOBIN)/protoc-gen-go-v1.27.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-go.mod -o=$(GOBIN)/protoc-gen-go-v1.27.1 "google.golang.org/protobuf/cmd/protoc-gen-go"
PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888
PROTOC_GEN_MICRO := $(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9
$(PROTOC_GEN_MICRO): $(BINGO_DIR)/protoc-gen-micro.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"
@echo "(re)installing $(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-micro.mod -o=$(GOBIN)/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9 "github.com/asim/go-micro/cmd/protoc-gen-micro/v3"
PROTOC_GEN_MICROWEB := $(GOBIN)/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9
$(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod
@@ -107,15 +101,15 @@ $(PROTOC_GEN_MICROWEB): $(BINGO_DIR)/protoc-gen-microweb.mod
@echo "(re)installing $(GOBIN)/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-microweb.mod -o=$(GOBIN)/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9 "github.com/owncloud/protoc-gen-microweb"
PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.3.0
PROTOC_GEN_OPENAPIV2 := $(GOBIN)/protoc-gen-openapiv2-v2.6.0
$(PROTOC_GEN_OPENAPIV2): $(BINGO_DIR)/protoc-gen-openapiv2.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/protoc-gen-openapiv2-v2.3.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-openapiv2.mod -o=$(GOBIN)/protoc-gen-openapiv2-v2.3.0 "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
@echo "(re)installing $(GOBIN)/protoc-gen-openapiv2-v2.6.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=protoc-gen-openapiv2.mod -o=$(GOBIN)/protoc-gen-openapiv2-v2.6.0 "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2"
REFLEX := $(GOBIN)/reflex-v0.3.0
REFLEX := $(GOBIN)/reflex-v0.3.1
$(REFLEX): $(BINGO_DIR)/reflex.mod
@# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies.
@echo "(re)installing $(GOBIN)/reflex-v0.3.0"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=reflex.mod -o=$(GOBIN)/reflex-v0.3.0 "github.com/cespare/reflex"
@echo "(re)installing $(GOBIN)/reflex-v0.3.1"
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=reflex.mod -o=$(GOBIN)/reflex-v0.3.1 "github.com/cespare/reflex"
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/bwplotka/bingo v0.4.0
require github.com/bwplotka/bingo v0.5.1
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/bufbuild/buf v0.40.0 // cmd/buf
require github.com/bufbuild/buf v0.56.0 // cmd/buf
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/bazelbuild/buildtools v0.0.0-20210227132407-f2aed9ee205d // buildifier
require github.com/bazelbuild/buildtools v0.0.0-20210920153738-d6daef01a1a2 // buildifier
+1 -1
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/restic/calens v0.2.0
-5
View File
@@ -1,5 +0,0 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
require github.com/UnnoTed/fileb0x v1.1.4
+1 -1
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/owncloud/flaex v0.2.1-0.20210701123229-9d7dceed124f
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/golangci/golangci-lint v1.37.1 // cmd/golangci-lint
require github.com/golangci/golangci-lint v1.42.1 // cmd/golangci-lint
+1 -1
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/mitchellh/gox v1.0.1
+2 -2
View File
@@ -1,7 +1,7 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
replace github.com/markbates/inflect => github.com/markbates/inflect v0.0.0-20171215194931-a12c3aec81a6
require github.com/gohugoio/hugo v0.87.0
require github.com/gohugoio/hugo v0.88.1
+1 -1
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/mutagen-io/mutagen v0.11.8 // cmd/mutagen
+1 -1
View File
@@ -2,4 +2,4 @@ module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.15
require github.com/deepmap/oapi-codegen v1.6.1 // cmd/oapi-codegen
require github.com/deepmap/oapi-codegen v1.8.2 // cmd/oapi-codegen
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/pseudomuto/protoc-gen-doc v1.4.1 // cmd/protoc-gen-doc
require github.com/pseudomuto/protoc-gen-doc v1.5.0 // cmd/protoc-gen-doc
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require google.golang.org/protobuf v1.26.0 // cmd/protoc-gen-go
require google.golang.org/protobuf v1.27.1 // cmd/protoc-gen-go
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20210329103359-9b41d1bf0888
require github.com/asim/go-micro/cmd/protoc-gen-micro/v3 v3.0.0-20211012122208-f63e46a7d1e9
+1 -1
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/owncloud/protoc-gen-microweb v0.0.0-20210824101557-828409dbfbf9
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/grpc-ecosystem/grpc-gateway/v2 v2.3.0 // protoc-gen-openapiv2
require github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 // protoc-gen-openapiv2
+2 -2
View File
@@ -1,5 +1,5 @@
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
go 1.16
go 1.17
require github.com/cespare/reflex v0.3.0
require github.com/cespare/reflex v0.3.1
+12 -14
View File
@@ -1,4 +1,4 @@
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.4.0. DO NOT EDIT.
# Auto generated binary variables helper managed by https://github.com/bwplotka/bingo v0.5.1. DO NOT EDIT.
# All tools are designed to be build inside $GOBIN.
# Those variables will work only until 'bingo get' was invoked, or if tools were installed via Makefile's Variables.mk.
GOBIN=${GOBIN:=$(go env GOBIN)}
@@ -8,37 +8,35 @@ if [ -z "$GOBIN" ]; then
fi
BINGO="${GOBIN}/bingo-v0.4.0"
BINGO="${GOBIN}/bingo-v0.5.1"
BUF="${GOBIN}/buf-v0.40.0"
BUF="${GOBIN}/buf-v0.56.0"
BUILDIFIER="${GOBIN}/buildifier-v0.0.0-20210227132407-f2aed9ee205d"
BUILDIFIER="${GOBIN}/buildifier-v0.0.0-20210920153738-d6daef01a1a2"
CALENS="${GOBIN}/calens-v0.2.0"
FILEB0X="${GOBIN}/fileb0x-v1.1.4"
FLAEX="${GOBIN}/flaex-v0.2.1-0.20210701123229-9d7dceed124f"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.37.1"
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.42.1"
GOX="${GOBIN}/gox-v1.0.1"
HUGO="${GOBIN}/hugo-v0.87.0"
HUGO="${GOBIN}/hugo-v0.88.1"
MUTAGEN="${GOBIN}/mutagen-v0.11.8"
OAPI_CODEGEN="${GOBIN}/oapi-codegen-v1.6.1"
OAPI_CODEGEN="${GOBIN}/oapi-codegen-v1.8.2"
PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.4.1"
PROTOC_GEN_DOC="${GOBIN}/protoc-gen-doc-v1.5.0"
PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.26.0"
PROTOC_GEN_GO="${GOBIN}/protoc-gen-go-v1.27.1"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20210329103359-9b41d1bf0888"
PROTOC_GEN_MICRO="${GOBIN}/protoc-gen-micro-v3.0.0-20211012122208-f63e46a7d1e9"
PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20210824101557-828409dbfbf9"
PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.3.0"
PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.6.0"
REFLEX="${GOBIN}/reflex-v0.3.0"
REFLEX="${GOBIN}/reflex-v0.3.1"
+1 -2
View File
@@ -12,9 +12,8 @@ exclude_paths:
- 'idp/scripts/**'
- 'settings/rollup.config.js'
- 'accounts/rollup.config.js'
- 'ocis/docker/eos-ocis/Dockerfile'
- 'ocis/docker/eos-ocis-dev/Dockerfile'
- 'deployments/**'
- 'tests/acceptance/expected-failures-*.md'
- 'tests/acceptance/features/bootstrap/**'
...
+3 -3
View File
@@ -1,7 +1,7 @@
# The test runner source for API tests
CORE_COMMITID=370fd807e464dcc5cb9619a8890107424254dfa6
CORE_BRANCH=master
CORE_COMMITID=4bbd91de68aefdf94c03d2920a3353702f856280
CORE_BRANCH=acceptance-test-changes-waiting-2021-11
# The test runner source for UI tests
WEB_COMMITID=e44bf0c76d1811339ac58941130a411f420bd302
WEB_COMMITID=ed4a8b32240b59666a6c2b162d95b50ff7191eb8
WEB_BRANCH=master
+281 -335
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -28,6 +28,9 @@ vendor
vendor-bin/**/vendor
vendor-bin/**/composer.lock
# API acceptance tests - auto-generated files
.php-cs-fixer.cache
# drone CI is in .drone.star, do not let someone accidentally commit a local .drone.yml
.drone.yml
+11 -4
View File
@@ -1,7 +1,14 @@
SKIP_CONFIG_DOCS_GENERATE ?= 0
CONFIG_DOCS_BASE_PATH ?= ../docs/extensions
.PHONY: config-docs-generate
config-docs-generate: $(FLAEX)
@echo "$(NAME): generating config docs"
@$(FLAEX) >| ../docs/extensions/$(NAME)/configuration.md
config-docs-generate: #$(FLAEX)
# since https://github.com/owncloud/ocis/pull/2708 flaex can no longer be used
# TODO: how to document configuration
# @if [ $(SKIP_CONFIG_DOCS_GENERATE) -ne 1 ]; then \
# $(FLAEX) >| $(CONFIG_DOCS_BASE_PATH)/$(NAME)/configuration.md \
# ; fi;
.PHONY: grpc-docs-generate
grpc-docs-generate: ../docs/extensions/${NAME}/grpc.md
grpc-docs-generate: buf-generate
-4
View File
@@ -1,6 +1,2 @@
.PHONY: generate
generate: ci-node-generate ci-go-generate
.PHONY: embed.yml
embed.yml: $(FILEB0X)
@cd pkg/assets/ && echo -n "$(NAME): embed.go - " && $(FILEB0X) embed.yml
+7 -10
View File
@@ -1,4 +1,5 @@
IMPORT := github.com/owncloud/ocis/$(NAME)
OCIS_REPO := github.com/owncloud/ocis
IMPORT := ($OCIS_REPO)/$(NAME)
BIN := bin
DIST := dist
@@ -10,11 +11,7 @@ else
UNAME := $(shell uname -s)
endif
ifeq ($(UNAME), Darwin)
GOBUILD ?= go build -i
else
GOBUILD ?= go build
endif
GOBUILD ?= go build
SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
@@ -40,8 +37,8 @@ ifndef DATE
DATE := $(shell date -u '+%Y%m%d')
endif
LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)"
LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "$(OCIS_REPO)/ocis-pkg/version.String=$(VERSION)" -X "$(OCIS_REPO)/ocis-pkg/version.Date=$(DATE)"
DEBUG_LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -X "$(OCIS_REPO)/ocis-pkg/version.String=$(VERSION)" -X "$(OCIS_REPO)/ocis-pkg/version.Date=$(DATE)"
GCFLAGS += all=-N -l
@@ -69,11 +66,11 @@ fmt:
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME)
.PHONY: ci-golangci-lint
ci-golangci-lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E golint -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
$(GOLANGCI_LINT) run -E gosec -E bodyclose -E dogsled -E durationcheck -E revive -E ifshort -E makezero -E prealloc -E predeclared --path-prefix $(NAME) --timeout 10m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
.PHONY: test
test:
+1 -1
View File
@@ -12,7 +12,7 @@ OUTPUT_DIR = ./l10n
TEMPLATE_FILE = ./l10n/template.pot
# Name of the generated .po files for each available locale.
LOCALE_FILES = $(shell find l10n/locale -name '*.po')
LOCALE_FILES = $(shell find l10n/locale -name '*.po' 2> /dev/null)
.PHONY: l10n-push
l10n-push:
+18 -60
View File
@@ -1,63 +1,21 @@
.PHONY: protoc-gen-openapiv2
protoc-gen-openapiv2:
GO111MODULE=off go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-openapiv2
.PHONY: protoc-deps
protoc-deps: $(BINGO)
@# #TODO: bingo creates symlinks from the -l option in the current directory
@# if no GOPATH and GOBIN is set, but they should reside inside .bingo
@# for now we move them manually
@cd .. && GOPATH="" GOBIN="" $(BINGO) get -l google.golang.org/protobuf/cmd/protoc-gen-go
@cd .. && mv protoc-gen-go .bingo/
@cd .. && GOPATH="" GOBIN="" $(BINGO) get -l github.com/asim/go-micro/cmd/protoc-gen-micro/v3
@cd .. && mv protoc-gen-micro .bingo/
@cd .. && GOPATH="" GOBIN="" $(BINGO) get -l github.com/owncloud/protoc-gen-microweb
@cd .. && mv protoc-gen-microweb .bingo/
@cd .. && GOPATH="" GOBIN="" $(BINGO) get -l github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
@cd .. && mv protoc-gen-openapiv2 .bingo/
@cd .. && GOPATH="" GOBIN="" $(BINGO) get -l github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
@cd .. && mv protoc-gen-doc .bingo/
.PHONY: $(PROTO_SRC)/${NAME}.pb.go
$(PROTO_SRC)/${NAME}.pb.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_GO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-go=$(PROTOC_GEN_GO) \
--go_out=$(PROTO_SRC) \
--go_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto
.PHONY: buf-generate
buf-generate: $(BUF) protoc-deps
$(BUF) generate
.PHONY: $(PROTO_SRC)/${NAME}.pb.micro.go
$(PROTO_SRC)/${NAME}.pb.micro.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICRO)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.micro.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-micro=$(PROTOC_GEN_MICRO) \
--micro_out=logtostderr=true:$(PROTO_SRC) \
--micro_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.pb.web.go
$(PROTO_SRC)/${NAME}.pb.web.go: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_MICROWEB)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.pb.web.go"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-microweb=$(PROTOC_GEN_MICROWEB) \
--microweb_out=logtostderr=true:$(PROTO_SRC) \
--microweb_opt=paths=source_relative \
$(PROTO_SRC)/${NAME}.proto
.PHONY: $(PROTO_SRC)/${NAME}.swagger.json
$(PROTO_SRC)/${NAME}.swagger.json: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_OPENAPIV2)
@echo "$(NAME): generating $(PROTO_SRC)/${NAME}.swagger.json"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-openapiv2=$(PROTOC_GEN_OPENAPIV2) \
--openapiv2_out=logtostderr=true:$(PROTO_SRC)/ \
$(PROTO_SRC)/${NAME}.proto
.PHONY: ../docs/extensions/${NAME}/grpc.md
../docs/extensions/${NAME}/grpc.md: $(BUF) protoc-gen-openapiv2 $(PROTOC_GEN_DOC)
@echo "$(NAME): generating ../docs/extensions/${NAME}/grpc.md"
@$(BUF) protoc \
-I=$(PROTO_SRC)/ \
-I=../third_party/ \
-I=$(GOPATH)/src/github.com/grpc-ecosystem/grpc-gateway \
--plugin protoc-gen-doc=$(PROTOC_GEN_DOC) \
--doc_opt=./templates/GRPC.tmpl,grpc.md \
--doc_out=../docs/extensions/${NAME} \
$(PROTO_SRC)/${NAME}.proto
+8
View File
@@ -0,0 +1,8 @@
ifeq ($(MAKE_DEPTH),)
MAKE_DEPTH := 0
else
$(eval MAKE_DEPTH := $(shell echo "$$(( $(MAKE_DEPTH) + 1 ))" ) )
endif
export
+15 -7
View File
@@ -7,22 +7,30 @@ release: release-dirs release-linux release-windows release-darwin release-copy
.PHONY: release-dirs
release-dirs:
mkdir -p $(DIST)/binaries $(DIST)/release
@mkdir -p $(DIST)/binaries $(DIST)/release
# docker specific packaging flags
DOCKER_LDFLAGS += -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathType=path" -X "$(OCIS_REPO)/ocis-pkg/config/defaults.BaseDataPathValue=/var/lib/ocis"
release-linux-docker-amd64: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker-arm: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker-arm64: $(GOX) release-dirs
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' -os 'linux' -arch 'arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-linux
release-linux: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
release-linux-docker: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-windows
release-windows: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-darwin
release-darwin: $(GOX) release-dirs
$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64 arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
.PHONY: release-copy
release-copy:
+16
View File
@@ -0,0 +1,16 @@
<?php
$dirToParse = 'tests/acceptance/';
$dirIterator = new DirectoryIterator(__DIR__ . '/' . $dirToParse);
$excludeDirs = [
'node_modules'
];
$finder = PhpCsFixer\Finder::create()
->exclude($excludeDirs)
->in(__DIR__);
$config = new OC\CodingStandard\Config();
$config->setFinder($finder);
return $config;
+10 -4
View File
@@ -7,13 +7,19 @@
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/ocis/cmd/ocis",
"args": ["server"],
"args": [
"server"
],
"env": {
// log settings for human developers
"OCIS_LOG_LEVEL": "debug",
"OCIS_LOG_PRETTY": "true",
"OCIS_LOG_COLOR": "true",
"PROXY_ENABLE_BASIC_AUTH": "true"
// enable basic auth for dev setup so that we can use curl for testing
"PROXY_ENABLE_BASIC_AUTH": "true",
// set insecure options because we don't have valid certificates in dev environments
"OCIS_INSECURE": "true",
}
},
}
]
}
}
+827 -2
View File
@@ -2,19 +2,806 @@
The following sections list the changes for unreleased.
[unreleased]: https://github.com/owncloud/ocis/compare/v1.11.0...master
[unreleased]: https://github.com/owncloud/ocis/compare/v1.15.0...master
## Summary
* Bugfix - Fix claim selector based routing for basic auth: [#2779](https://github.com/owncloud/ocis/pull/2779)
* Bugfix - Disallow creation of a group with empty name via the OCS api: [#2825](https://github.com/owncloud/ocis/pull/2825)
* Bugfix - Fix using s3ng as the metadata storage backend: [#2807](https://github.com/owncloud/ocis/pull/2807)
* Bugfix - Use the CS3api up- and download workflow for the accounts service: [#2837](https://github.com/owncloud/ocis/pull/2837)
* Change - Rename `APP_PROVIDER_BASIC_*` environment variables: [#2812](https://github.com/owncloud/ocis/pull/2812)
* Change - Restructure Configuration Parsing: [#2708](https://github.com/owncloud/ocis/pull/2708)
* Change - OIDC: fallback if IDP doesn't provide "preferred_username" claim: [#2644](https://github.com/owncloud/ocis/issues/2644)
* Enhancement - Cleanup ocis-pkg config: [#2813](https://github.com/owncloud/ocis/pull/2813)
* Enhancement - Support signature auth in the public share auth middleware: [#2831](https://github.com/owncloud/ocis/pull/2831)
* Enhancement - Correct shutdown of services under runtime: [#2843](https://github.com/owncloud/ocis/pull/2843)
* Enhancement - Update REVA to v1.17.0: [#2849](https://github.com/owncloud/ocis/pull/2849)
* Enhancement - Update ownCloud Web to v4.6.0: [#2846](https://github.com/owncloud/ocis/pull/2846)
## Details
* Bugfix - Fix claim selector based routing for basic auth: [#2779](https://github.com/owncloud/ocis/pull/2779)
We've fixed the claim selector based routing for requests using basic auth. Previously
requests using basic auth have always been routed to the DefaultPolicy when using the claim
selector despite the set cookie because the basic auth middleware fakes some OIDC claims.
Now the cookie is checked before routing to the DefaultPolicy and therefore set cookie will
also be respected for requests using basic auth.
https://github.com/owncloud/ocis/pull/2779
* Bugfix - Disallow creation of a group with empty name via the OCS api: [#2825](https://github.com/owncloud/ocis/pull/2825)
We've fixed the behavior for group creation on the OCS api, where it was possible to create a
group with an empty name. This was is not possible on oC10 and is therefore also forbidden on oCIS
to keep compatibility. This PR forbids the creation and also ensures the correct status code
for both OCS v1 and OCS v2 apis.
https://github.com/owncloud/ocis/issues/2823
https://github.com/owncloud/ocis/pull/2825
* Bugfix - Fix using s3ng as the metadata storage backend: [#2807](https://github.com/owncloud/ocis/pull/2807)
It is now possible to use s3ng as the metadata storage backend.
https://github.com/owncloud/ocis/issues/2668
https://github.com/owncloud/ocis/pull/2807
* Bugfix - Use the CS3api up- and download workflow for the accounts service: [#2837](https://github.com/owncloud/ocis/pull/2837)
We've fixed the interaction of the accounts service with the metadata storage after bypassing
the InitiateUpload and InitiateDownload have been removed from various storage drivers. The
accounts service now uses the proper CS3apis workflow for up- and downloads.
https://github.com/owncloud/ocis/pull/2837
https://github.com/cs3org/reva/pull/2309
* Change - Rename `APP_PROVIDER_BASIC_*` environment variables: [#2812](https://github.com/owncloud/ocis/pull/2812)
We've renamed the `APP_PROVIDER_BASIC_*` to `APP_PROVIDER_*` since the `_BASIC_` part is a
copy and paste error. Now all app provider environment variables are consistently starting
with `APP_PROVIDER_*`.
https://github.com/owncloud/ocis/pull/2812
https://github.com/owncloud/ocis/pull/2811
* Change - Restructure Configuration Parsing: [#2708](https://github.com/owncloud/ocis/pull/2708)
Tags: ocis
CLI flags are no longer needed for subcommands, as we rely solely on env variables and config
files. This greatly simplifies configuration and deployment.
https://github.com/owncloud/ocis/pull/2708
* Change - OIDC: fallback if IDP doesn't provide "preferred_username" claim: [#2644](https://github.com/owncloud/ocis/issues/2644)
Some IDPs don't add the "preferred_username" claim. Fallback to the "email" claim in that case
https://github.com/owncloud/ocis/issues/2644
* Enhancement - Cleanup ocis-pkg config: [#2813](https://github.com/owncloud/ocis/pull/2813)
Certain values were of no use when configuring the ocis runtime.
https://github.com/owncloud/ocis/pull/2813
* Enhancement - Support signature auth in the public share auth middleware: [#2831](https://github.com/owncloud/ocis/pull/2831)
Enabled public share requests to be authenticated using the public share signature.
https://github.com/owncloud/ocis/pull/2831
* Enhancement - Correct shutdown of services under runtime: [#2843](https://github.com/owncloud/ocis/pull/2843)
Supervised goroutines now shut themselves down on context cancellation propagation.
https://github.com/owncloud/ocis/pull/2843
* Enhancement - Update REVA to v1.17.0: [#2849](https://github.com/owncloud/ocis/pull/2849)
Updated REVA to v1.17.0 This update includes:
* Fix [cs3org/reva#2305](https://github.com/cs3org/reva/pull/2305): Make sure /app/new takes `target` as absolute path
* Fix [cs3org/reva#2303](https://github.com/cs3org/reva/pull/2303): Fix content disposition header for public links files
* Fix [cs3org/reva#2316](https://github.com/cs3org/reva/pull/2316): Fix the share types in propfinds
* Fix [cs3org/reva#2803](https://github.com/cs3org/reva/pull/2803): Fix app provider for editor public links
* Fix [cs3org/reva#2298](https://github.com/cs3org/reva/pull/2298): Remove share refs from trashbin
* Fix [cs3org/reva#2309](https://github.com/cs3org/reva/pull/2309): Remove early finish for zero byte file uploads
* Fix [cs3org/reva#1941](https://github.com/cs3org/reva/pull/1941): Fix TUS uploads with transfer token only
* Chg [cs3org/reva#2210](https://github.com/cs3org/reva/pull/2210): Fix app provider new file creation and improved error codes
* Enh [cs3org/reva#2217](https://github.com/cs3org/reva/pull/2217): OIDC auth driver for ESCAPE IAM
* Enh [cs3org/reva#2256](https://github.com/cs3org/reva/pull/2256): Return user type in the response of the ocs GET user call
* Enh [cs3org/reva#2315](https://github.com/cs3org/reva/pull/2315): Add new attributes to public link propfinds
* Enh [cs3org/reva#2740](https://github.com/cs3org/reva/pull/2740): Implement space membership endpoints
* Enh [cs3org/reva#2252](https://github.com/cs3org/reva/pull/2252): Add the xattr sys.acl to SysACL (eosgrpc)
* Enh [cs3org/reva#2314](https://github.com/cs3org/reva/pull/2314): OIDC: fallback if IDP doesn't provide "preferred_username" claim
https://github.com/owncloud/ocis/pull/2849
https://github.com/owncloud/ocis/pull/2835
https://github.com/owncloud/ocis/pull/2837
* Enhancement - Update ownCloud Web to v4.6.0: [#2846](https://github.com/owncloud/ocis/pull/2846)
Tags: web
We updated ownCloud Web to v4.6.0. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/2846
https://github.com/owncloud/web/releases/tag/v4.6.0
# Changelog for [1.15.0] (2021-11-19)
The following sections list the changes for 1.15.0.
[1.15.0]: https://github.com/owncloud/ocis/compare/v1.14.0...v1.15.0
## Summary
* Bugfix - Don't allow empty password: [#197](https://github.com/owncloud/product/issues/197)
* Bugfix - Fix basic auth config: [#2719](https://github.com/owncloud/ocis/pull/2719)
* Bugfix - Fix basic auth with custom user claim: [#2755](https://github.com/owncloud/ocis/pull/2755)
* Bugfix - Fix oCIS startup ony systems with IPv6: [#2698](https://github.com/owncloud/ocis/pull/2698)
* Bugfix - Fix opening images in media viewer for some usernames: [#2738](https://github.com/owncloud/ocis/pull/2738)
* Bugfix - Fix error logging when there is no thumbnail for a file: [#2702](https://github.com/owncloud/ocis/pull/2702)
* Bugfix - Don't announce resharing via capabilities: [#2690](https://github.com/owncloud/ocis/pull/2690)
* Change - Make all insecure options configurable and change the default to false: [#2700](https://github.com/owncloud/ocis/issues/2700)
* Change - Update ownCloud Web to v4.5.0: [#2780](https://github.com/owncloud/ocis/pull/2780)
* Enhancement - Add API to list all spaces: [#2692](https://github.com/owncloud/ocis/pull/2692)
* Enhancement - Update REVA to v1.16.0: [#2737](https://github.com/owncloud/ocis/pull/2737)
## Details
* Bugfix - Don't allow empty password: [#197](https://github.com/owncloud/product/issues/197)
It was allowed to create users with empty or spaces-only password. This is fixed
https://github.com/owncloud/product/issues/197
* Bugfix - Fix basic auth config: [#2719](https://github.com/owncloud/ocis/pull/2719)
Users could authenticate using basic auth even though `PROXY_ENABLE_BASIC_AUTH` was set to
false.
https://github.com/owncloud/ocis/issues/2466
https://github.com/owncloud/ocis/pull/2719
* Bugfix - Fix basic auth with custom user claim: [#2755](https://github.com/owncloud/ocis/pull/2755)
We've fixed authentication with basic if oCIS is configured to use a non-standard claim as user
claim (`PROXY_USER_OIDC_CLAIM`). Prior to this bugfix the authentication always failed and
is now working.
https://github.com/owncloud/ocis/pull/2755
* Bugfix - Fix oCIS startup ony systems with IPv6: [#2698](https://github.com/owncloud/ocis/pull/2698)
We've fixed failing startup of oCIS on systems with IPv6 addresses.
https://github.com/owncloud/ocis/issues/2300
https://github.com/owncloud/ocis/pull/2698
* Bugfix - Fix opening images in media viewer for some usernames: [#2738](https://github.com/owncloud/ocis/pull/2738)
We've fixed the opening of images in the media viewer for user names containing special
characters (eg. `@`) which will be URL-escaped. Before this fix users could not see the image in
the media viewer. Now the user name is correctly escaped and the user can view the image in the
media viewer.
https://github.com/owncloud/ocis/pull/2738
* Bugfix - Fix error logging when there is no thumbnail for a file: [#2702](https://github.com/owncloud/ocis/pull/2702)
We've fixed the behavior of the logging when there is no thumbnail for a file (because the
filetype is not supported for thumbnail generation). Previously the WebDAV service always
issues an error log in this case. Now, we don't log this event any more.
https://github.com/owncloud/ocis/pull/2702
* Bugfix - Don't announce resharing via capabilities: [#2690](https://github.com/owncloud/ocis/pull/2690)
OCIS / Reva is not capable of resharing, yet. We've set the resharing capability to false, so
that clients have a chance to react accordingly.
https://github.com/owncloud/ocis/pull/2690
* Change - Make all insecure options configurable and change the default to false: [#2700](https://github.com/owncloud/ocis/issues/2700)
We had several hard-coded 'insecure' flags. These options are now configurable and default to
false. Also we changed all other 'insecure' flags with a previous default of true to false.
In development environments using self signed certs (the default) you now need to set these
flags:
``` PROXY_OIDC_INSECURE=true STORAGE_FRONTEND_APPPROVIDER_INSECURE=true
STORAGE_FRONTEND_ARCHIVER_INSECURE=true STORAGE_FRONTEND_OCDAV_INSECURE=true
STORAGE_HOME_DATAPROVIDER_INSECURE=true
STORAGE_METADATA_DATAPROVIDER_INSECURE=true STORAGE_OIDC_INSECURE=true
STORAGE_USERS_DATAPROVIDER_INSECURE=true THUMBNAILS_CS3SOURCE_INSECURE=true
THUMBNAILS_WEBDAVSOURCE_INSECURE=true ```
As an alternative you also can set a single flag, which configures all options together:
``` OCIS_INSECURE=true ```
https://github.com/owncloud/ocis/issues/2700
https://github.com/owncloud/ocis/pull/2745
* Change - Update ownCloud Web to v4.5.0: [#2780](https://github.com/owncloud/ocis/pull/2780)
Tags: web
We updated ownCloud Web to v4.5.0. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/2780
https://github.com/owncloud/web/releases/tag/v4.5.0
* Enhancement - Add API to list all spaces: [#2692](https://github.com/owncloud/ocis/pull/2692)
Added a graph endpoint to enable users with the `list-all-spaces` permission to list all
spaces.
https://github.com/owncloud/ocis/pull/2692
* Enhancement - Update REVA to v1.16.0: [#2737](https://github.com/owncloud/ocis/pull/2737)
Updated REVA to v1.16.0 This update includes:
* Fix [cs3org/reva#2245](https://github.com/cs3org/reva/pull/2245): Don't announce search-files capability
* Fix [cs3org/reva#2247](https://github.com/cs3org/reva/pull/2247): Merge user ACLs from EOS to sys ACLs
* Fix [cs3org/reva#2279](https://github.com/cs3org/reva/pull/2279): Return the inode of the version folder for files when listing in EOS
* Fix [cs3org/reva#2294](https://github.com/cs3org/reva/pull/2294): Fix HTTP return code when path is invalid
* Fix [cs3org/reva#2231](https://github.com/cs3org/reva/pull/2231): Fix share permission on a single file in sql share driver (cbox pkg)
* Fix [cs3org/reva#2230](https://github.com/cs3org/reva/pull/2230): Fix open by default app and expose default app
* Fix [cs3org/reva#2265](https://github.com/cs3org/reva/pull/2265): Fix nil pointer exception when resolving members of a group (rest driver)
* Fix [cs3org/reva#1214](https://github.com/cs3org/reva/pull/1214): Fix restoring versions
* Fix [cs3org/reva#2254](https://github.com/cs3org/reva/pull/2254): Fix spaces propfind
* Fix [cs3org/reva#2260](https://github.com/cs3org/reva/pull/2260): Fix unset quota xattr on darwin
* Fix [cs3org/reva#5776](https://github.com/cs3org/reva/pull/5776): Enforce permissions in public share apps
* Fix [cs3org/reva#2767](https://github.com/cs3org/reva/pull/2767): Fix status code for WebDAV mkcol requests where an ancestor is missing
* Fix [cs3org/reva#2287](https://github.com/cs3org/reva/pull/2287): Add public link access via mount-ID:token/relative-path to the scope
* Fix [cs3org/reva#2244](https://github.com/cs3org/reva/pull/2244): Fix the permissions response for shared files in the cbox sql driver
* Enh [cs3org/reva#2219](https://github.com/cs3org/reva/pull/2219): Add virtual view tests
* Enh [cs3org/reva#2230](https://github.com/cs3org/reva/pull/2230): Add priority to app providers
* Enh [cs3org/reva#2258](https://github.com/cs3org/reva/pull/2258): Improved error messages from the AppProviders
* Enh [cs3org/reva#2119](https://github.com/cs3org/reva/pull/2119): Add authprovider owncloudsql
* Enh [cs3org/reva#2211](https://github.com/cs3org/reva/pull/2211): Enhance the cbox share sql driver to store accepted group shares
* Enh [cs3org/reva#2212](https://github.com/cs3org/reva/pull/2212): Filter root path according to the agent that makes the request
* Enh [cs3org/reva#2237](https://github.com/cs3org/reva/pull/2237): Skip get user call in eosfs in case previous ones also failed
* Enh [cs3org/reva#2266](https://github.com/cs3org/reva/pull/2266): Callback for the EOS UID cache to retry fetch for failed keys
* Enh [cs3org/reva#2215](https://github.com/cs3org/reva/pull/2215): Aggregrate resource info properties for virtual views
* Enh [cs3org/reva#2271](https://github.com/cs3org/reva/pull/2271): Revamp the favorite manager and add the cbox sql driver
* Enh [cs3org/reva#2248](https://github.com/cs3org/reva/pull/2248): Cache whether a user home was created or not
* Enh [cs3org/reva#2282](https://github.com/cs3org/reva/pull/2282): Return a proper NOT_FOUND error when a user or group is not found
* Enh [cs3org/reva#2268](https://github.com/cs3org/reva/pull/2268): Add the reverseproxy http service
* Enh [cs3org/reva#2207](https://github.com/cs3org/reva/pull/2207): Enable users to list all spaces
* Enh [cs3org/reva#2286](https://github.com/cs3org/reva/pull/2286): Add trace ID to middleware loggers
* Enh [cs3org/reva#2251](https://github.com/cs3org/reva/pull/2251): Mentix service inference
* Enh [cs3org/reva#2218](https://github.com/cs3org/reva/pull/2218): Allow filtering of mime types supported by app providers
* Enh [cs3org/reva#2213](https://github.com/cs3org/reva/pull/2213): Add public link share type to propfind response
* Enh [cs3org/reva#2253](https://github.com/cs3org/reva/pull/2253): Support the file editor role for public links
* Enh [cs3org/reva#2208](https://github.com/cs3org/reva/pull/2208): Reduce redundant stat calls when statting by resource ID
* Enh [cs3org/reva#2235](https://github.com/cs3org/reva/pull/2235): Specify a list of allowed folders/files to be archived
* Enh [cs3org/reva#2267](https://github.com/cs3org/reva/pull/2267): Restrict the paths where share creation is allowed
* Enh [cs3org/reva#2252](https://github.com/cs3org/reva/pull/2252): Add the xattr sys.acl to SysACL (eosgrpc)
* Enh [cs3org/reva#2239](https://github.com/cs3org/reva/pull/2239): Update toml configs
https://github.com/owncloud/ocis/pull/2737
https://github.com/owncloud/ocis/pull/2726
https://github.com/owncloud/ocis/pull/2790
https://github.com/owncloud/ocis/pull/2797
# Changelog for [1.14.0] (2021-10-27)
The following sections list the changes for 1.14.0.
[1.14.0]: https://github.com/owncloud/ocis/compare/v1.13.0...v1.14.0
## Summary
* Security - Don't expose services by default: [#2612](https://github.com/owncloud/ocis/issues/2612)
* Bugfix - Create parent directories for idp configuration: [#2667](https://github.com/owncloud/ocis/issues/2667)
* Change - Configurable default quota: [#2621](https://github.com/owncloud/ocis/issues/2621)
* Change - New default data paths and easier configuration of the data path: [#2590](https://github.com/owncloud/ocis/pull/2590)
* Change - Split spaces webdav url and graph url in base and path: [#2660](https://github.com/owncloud/ocis/pull/2660)
* Change - Update ownCloud Web to v4.4.0: [#2681](https://github.com/owncloud/ocis/pull/2681)
* Enhancement - Add user setting capability: [#2655](https://github.com/owncloud/ocis/pull/2655)
* Enhancement - Broaden bufbuild/Buf usage: [#2630](https://github.com/owncloud/ocis/pull/2630)
* Enhancement - Replace fileb0x with go-embed: [#1199](https://github.com/owncloud/ocis/issues/1199)
* Enhancement - Upgrade to go-micro v4.1.0: [#2616](https://github.com/owncloud/ocis/pull/2616)
* Enhancement - Review and correct http header: [#2666](https://github.com/owncloud/ocis/pull/2666)
* Enhancement - Lower TUS max chunk size: [#2584](https://github.com/owncloud/ocis/pull/2584)
* Enhancement - Add sharees additional info paramater config to ocs: [#2637](https://github.com/owncloud/ocis/pull/2637)
* Enhancement - Add a middleware to authenticate public share requests: [#2536](https://github.com/owncloud/ocis/pull/2536)
* Enhancement - Report quota states: [#2628](https://github.com/owncloud/ocis/pull/2628)
* Enhancement - Start up a new machine auth provider in the storage service: [#2528](https://github.com/owncloud/ocis/pull/2528)
* Enhancement - Enforce permission on update space quota: [#2650](https://github.com/owncloud/ocis/pull/2650)
* Enhancement - Update lico to v0.51.1: [#2654](https://github.com/owncloud/ocis/pull/2654)
* Enhancement - Update reva to v1.15: [#2658](https://github.com/owncloud/ocis/pull/2658)
## Details
* Security - Don't expose services by default: [#2612](https://github.com/owncloud/ocis/issues/2612)
We've changed the bind behaviour for all non public facing services. Before this PR all
services would listen on all interfaces. After this PR, all services listen on 127.0.0.1 only,
except the proxy which is listening on 0.0.0.0:9200.
https://github.com/owncloud/ocis/issues/2612
* Bugfix - Create parent directories for idp configuration: [#2667](https://github.com/owncloud/ocis/issues/2667)
The parent directories of the identifier-registration.yaml config file might not exist when
starting idp. Create them, when that is the case.
https://github.com/owncloud/ocis/issues/2667
* Change - Configurable default quota: [#2621](https://github.com/owncloud/ocis/issues/2621)
When creating a new space a (configurable) default quota will be used (instead the hardcoded
one). One can set the EnvVar `GRAPH_SPACES_DEFAULT_QUOTA` to configure it
https://github.com/owncloud/ocis/issues/2621
https://jira.owncloud.com/browse/OCIS-2070
* Change - New default data paths and easier configuration of the data path: [#2590](https://github.com/owncloud/ocis/pull/2590)
We've changed the default data path for our release artifacts: - oCIS docker images will now
store all data in `/var/lib/ocis` instead in `/var/tmp/ocis` - binary releases will now store
all data in `~/.ocis` instead of `/var/tmp/ocis`
Also if you're a developer and you run oCIS from source, it will store all data in `~/.ocis` from
now on.
You can now easily change the data path for all extensions by setting the environment variable
`OCIS_BASE_DATA_PATH`.
If you want to package oCIS, you also can set the default data path at compile time, eg. by passing
`-X "github.com/owncloud/ocis/ocis-pkg/config/defaults.BaseDataPathType=path" -X
"github.com/owncloud/ocis/ocis-pkg/config/defaults.BaseDataPathValue=/var/lib/ocis"`
to your go build step.
https://github.com/owncloud/ocis/pull/2590
* Change - Split spaces webdav url and graph url in base and path: [#2660](https://github.com/owncloud/ocis/pull/2660)
We've fixed the behavior for the spaces webdav url and graph explorer graph url settings, so
that they respect the environment variable `OCIS_URL`. Previously oCIS admins needed to set
these URLs manually to make spaces and the graph explorer work.
https://github.com/owncloud/ocis/issues/2659
https://github.com/owncloud/ocis/pull/2660
* Change - Update ownCloud Web to v4.4.0: [#2681](https://github.com/owncloud/ocis/pull/2681)
Tags: web
We updated ownCloud Web to v4.4.0. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/2681
https://github.com/owncloud/web/releases/tag/v4.4.0
* Enhancement - Add user setting capability: [#2655](https://github.com/owncloud/ocis/pull/2655)
We've added a capability to communicate the existance of a user settings service to clients.
https://github.com/owncloud/web/issues/5926
https://github.com/owncloud/ocis/pull/2655
* Enhancement - Broaden bufbuild/Buf usage: [#2630](https://github.com/owncloud/ocis/pull/2630)
We've switched the usage of bufbuild/Buf from a protoc replacement only to also using it to
confige the outputs and pinning dependencies.
https://github.com/owncloud/ocis/pull/2630
https://github.com/owncloud/ocis/pull/2616
* Enhancement - Replace fileb0x with go-embed: [#1199](https://github.com/owncloud/ocis/issues/1199)
Go-embed already brings the functionality we need but with less code. We decided to use it
instead of 3rd party fileb0x
https://github.com/owncloud/ocis/issues/1199
https://github.com/owncloud/ocis/pull/2631
https://github.com/owncloud/ocis/pull/2649
* Enhancement - Upgrade to go-micro v4.1.0: [#2616](https://github.com/owncloud/ocis/pull/2616)
We've upgraded to go-micro v4.1.0
https://github.com/owncloud/ocis/pull/2616
* Enhancement - Review and correct http header: [#2666](https://github.com/owncloud/ocis/pull/2666)
Reviewed and corrected the necessary http headers. Made CORS configurable.
https://github.com/owncloud/ocis/pull/2666
* Enhancement - Lower TUS max chunk size: [#2584](https://github.com/owncloud/ocis/pull/2584)
We've lowered the TUS max chunk size from infinite to 0.1GB so that chunking actually happens.
https://github.com/owncloud/ocis/pull/2584
https://github.com/cs3org/reva/pull/2136
* Enhancement - Add sharees additional info paramater config to ocs: [#2637](https://github.com/owncloud/ocis/pull/2637)
https://github.com/owncloud/ocis/pull/2637
* Enhancement - Add a middleware to authenticate public share requests: [#2536](https://github.com/owncloud/ocis/pull/2536)
Added a new middleware to authenticate public share requests. This makes it possible to use
APIs which require an authenticated context with public shares.
https://github.com/owncloud/ocis/issues/2479
https://github.com/owncloud/ocis/pull/2536
https://github.com/owncloud/ocis/pull/2652
* Enhancement - Report quota states: [#2628](https://github.com/owncloud/ocis/pull/2628)
When listing the available spaces via the GraphAPI we now return quota states to make it easier
for the clients to add visual indicators.
https://github.com/owncloud/ocis/pull/2628
* Enhancement - Start up a new machine auth provider in the storage service: [#2528](https://github.com/owncloud/ocis/pull/2528)
This PR also adds the config to skip encoding user groups in reva tokens
https://github.com/owncloud/ocis/pull/2528
https://github.com/owncloud/ocis/pull/2529
* Enhancement - Enforce permission on update space quota: [#2650](https://github.com/owncloud/ocis/pull/2650)
Added a check that only users with the `set-space-quota` permission can update the space
quota.
https://github.com/owncloud/ocis/pull/2650
* Enhancement - Update lico to v0.51.1: [#2654](https://github.com/owncloud/ocis/pull/2654)
Updated lico to v0.51.1 This update includes: * Apply LibreGraph naming treewide * move to
go1.17 * Update 3rd party Go dependencies
https://github.com/owncloud/ocis/pull/2654
* Enhancement - Update reva to v1.15: [#2658](https://github.com/owncloud/ocis/pull/2658)
Updated reva to v1.15 This update includes:
* Fix [cs3org/reva#2168](https://github.com/cs3org/reva/pull/2168): Override provider if was previously registered
* Fix [cs3org/reva#2173](https://github.com/cs3org/reva/pull/2173): Fix archiver max size reached error
* Fix [cs3org/reva#2167](https://github.com/cs3org/reva/pull/2167): Handle nil quota in decomposedfs
* Fix [cs3org/reva#2153](https://github.com/cs3org/reva/pull/2153): Restrict EOS project spaces sharing permissions to admins and writers
* Fix [cs3org/reva#2179](https://github.com/cs3org/reva/pull/2179): Fix the returned permissions for webdav uploads
* Chg [cs3org/reva#2479](https://github.com/cs3org/reva/pull/2479): Make apps able to work with public shares
* Enh [cs3org/reva#2174](https://github.com/cs3org/reva/pull/2174): Inherit ACLs for files from parent directories
* Enh [cs3org/reva#2152](https://github.com/cs3org/reva/pull/2152): Add a reference parameter to the getQuota request
* Enh [cs3org/reva#2171](https://github.com/cs3org/reva/pull/2171): Add optional claim parameter to machine auth
* Enh [cs3org/reva#2135](https://github.com/cs3org/reva/pull/2135): Nextcloud test improvements
* Enh [cs3org/reva#2180](https://github.com/cs3org/reva/pull/2180): Remove OCDAV options namespace parameter
* Enh [cs3org/reva#2170](https://github.com/cs3org/reva/pull/2170): Handle propfind requests for existing files
* Enh [cs3org/reva#2165](https://github.com/cs3org/reva/pull/2165): Allow access to recycle bin for arbitrary paths outside homes
* Enh [cs3org/reva#2189](https://github.com/cs3org/reva/pull/2189): Add user settings capability
* Enh [cs3org/reva#2162](https://github.com/cs3org/reva/pull/2162): Implement the UpdateStorageSpace method
* Enh [cs3org/reva#2117](https://github.com/cs3org/reva/pull/2117): Add ocs cache warmup strategy for first request from the user
https://github.com/owncloud/ocis/pull/2658
https://github.com/owncloud/ocis/pull/2536
https://github.com/owncloud/ocis/pull/2650
https://github.com/owncloud/ocis/pull/2680
# Changelog for [1.13.0] (2021-10-13)
The following sections list the changes for 1.13.0.
[1.13.0]: https://github.com/owncloud/ocis/compare/v1.12.0...v1.13.0
## Summary
* Bugfix - Fix the account resolver middleware: [#2557](https://github.com/owncloud/ocis/pull/2557)
* Bugfix - Fix version information for extensions: [#2575](https://github.com/owncloud/ocis/pull/2575)
* Bugfix - Add the gatewaysvc to all shared configuration in REVA services: [#2597](https://github.com/owncloud/ocis/pull/2597)
* Bugfix - Use proper url path decode on the username: [#2511](https://github.com/owncloud/ocis/pull/2511)
* Bugfix - Remove notifications placeholder: [#2514](https://github.com/owncloud/ocis/pull/2514)
* Bugfix - Remove asset path configuration option from proxy: [#2576](https://github.com/owncloud/ocis/pull/2576)
* Bugfix - Race condition in config parsing: [#2574](https://github.com/owncloud/ocis/pull/2574)
* Change - Configure users and metadata storage separately: [#2598](https://github.com/owncloud/ocis/pull/2598)
* Change - Make the drives create method odata compliant: [#2531](https://github.com/owncloud/ocis/pull/2531)
* Change - Unify Envvar names configuring REVA gateway address: [#2587](https://github.com/owncloud/ocis/pull/2587)
* Change - Update ownCloud Web to v4.3.0: [#2589](https://github.com/owncloud/ocis/pull/2589)
* Enhancement - Updated MimeTypes configuration for AppRegistry: [#2603](https://github.com/owncloud/ocis/pull/2603)
* Enhancement - Add maximum files and size to archiver capabilities: [#2544](https://github.com/owncloud/ocis/pull/2544)
* Enhancement - Reduced repository size: [#2579](https://github.com/owncloud/ocis/pull/2579)
* Enhancement - Return the newly created space: [#2610](https://github.com/owncloud/ocis/pull/2610)
* Enhancement - Expose the reva archiver in OCIS: [#2509](https://github.com/owncloud/ocis/pull/2509)
* Enhancement - Favorites capability: [#2599](https://github.com/owncloud/ocis/pull/2599)
* Enhancement - Upgrade to GO 1.17: [#2605](https://github.com/owncloud/ocis/pull/2605)
* Enhancement - Make mimetype allow list configurable for app provider: [#2553](https://github.com/owncloud/ocis/pull/2553)
* Enhancement - Add allow_creation parameter to mime type config: [#2591](https://github.com/owncloud/ocis/pull/2591)
* Enhancement - Add option to skip generation of demo users and groups: [#2495](https://github.com/owncloud/ocis/pull/2495)
* Enhancement - Allow overriding the cookie based route by claim: [#2508](https://github.com/owncloud/ocis/pull/2508)
* Enhancement - Redirect invalid links to oC Web: [#2493](https://github.com/owncloud/ocis/pull/2493)
* Enhancement - Use reva's Authenticate method instead of spawning token managers: [#2528](https://github.com/owncloud/ocis/pull/2528)
* Enhancement - TLS config options for ldap in reva: [#2492](https://github.com/owncloud/ocis/pull/2492)
* Enhancement - Set reva JWT token expiration time to 24 hours by default: [#2527](https://github.com/owncloud/ocis/pull/2527)
* Enhancement - Update reva to v1.14.0: [#2615](https://github.com/owncloud/ocis/pull/2615)
## Details
* Bugfix - Fix the account resolver middleware: [#2557](https://github.com/owncloud/ocis/pull/2557)
The accounts resolver middleware put an empty token into the request when the user was already
present. Added a step to get the token for the user.
https://github.com/owncloud/ocis/pull/2557
* Bugfix - Fix version information for extensions: [#2575](https://github.com/owncloud/ocis/pull/2575)
We've fixed the behavior for `ocis version` which previously always showed `0.0.0` as version
for extensions. Now the real version of the extensions are shown.
https://github.com/owncloud/ocis/pull/2575
* Bugfix - Add the gatewaysvc to all shared configuration in REVA services: [#2597](https://github.com/owncloud/ocis/pull/2597)
We've fixed the configuration for REVA services which didn't have a gatewaysvc in their shared
configuration. This could lead to default gatewaysvc addresses in the auth middleware. Now it
is set everywhere.
https://github.com/owncloud/ocis/pull/2597
* Bugfix - Use proper url path decode on the username: [#2511](https://github.com/owncloud/ocis/pull/2511)
We now properly decode the username when reading it from a url parameter
https://github.com/owncloud/ocis/pull/2511
* Bugfix - Remove notifications placeholder: [#2514](https://github.com/owncloud/ocis/pull/2514)
Since Reva was communicating its notification capabilities incorrectly, oCIS relied on a
hardcoded string to overwrite them. This has been fixed in
[reva#1819](https://github.com/cs3org/reva/pull/1819) so we now removed the hardcoded
string and don't modify Reva's notification capabilities anymore in order to fix clients
having to poll a (non-existent) notifications endpoint.
https://github.com/owncloud/ocis/pull/2514
* Bugfix - Remove asset path configuration option from proxy: [#2576](https://github.com/owncloud/ocis/pull/2576)
We've remove the asset path configuration option (`--asset-path` or `PROXY_ASSET_PATH`)
since it didn't do anything at all.
https://github.com/owncloud/ocis/pull/2576
* Bugfix - Race condition in config parsing: [#2574](https://github.com/owncloud/ocis/pull/2574)
There was a race condition in the config parsing when configuring the storage services caused
by services overwriting a pointer to a config value. We fixed it by setting sane defaults.
https://github.com/owncloud/ocis/pull/2574
* Change - Configure users and metadata storage separately: [#2598](https://github.com/owncloud/ocis/pull/2598)
We've fixed the configuration behaviour of the user and metadata service writing in the same
directory when using oCIS storage.
Therefore we needed to separate the configuration of the users and metadata storage so that
they now can be configured totally separate.
https://github.com/owncloud/ocis/pull/2598
* Change - Make the drives create method odata compliant: [#2531](https://github.com/owncloud/ocis/pull/2531)
When creating a space on the graph API we now use the POST Body to provide the parameters.
https://github.com/owncloud/ocis/pull/2531
https://github.com/owncloud/ocis/pull/2535
https://www.odata.org/getting-started/basic-tutorial/#modifyData
* Change - Unify Envvar names configuring REVA gateway address: [#2587](https://github.com/owncloud/ocis/pull/2587)
We've renamed all envvars configuring REVA gateway address to `REVA_GATEWAY`, additionally
we renamed the cli parameters to `--reva-gateway-addr` and adjusted the description
https://github.com/owncloud/ocis/issues/2091
https://github.com/owncloud/ocis/pull/2587
* Change - Update ownCloud Web to v4.3.0: [#2589](https://github.com/owncloud/ocis/pull/2589)
Tags: web
We updated ownCloud Web to v4.3.0. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/2589
https://github.com/owncloud/web/releases/tag/v4.3.0
* Enhancement - Updated MimeTypes configuration for AppRegistry: [#2603](https://github.com/owncloud/ocis/pull/2603)
We updated the type of the mime types config to a list, to keep the order of mime types from the
config.
https://github.com/owncloud/ocis/pull/2603
* Enhancement - Add maximum files and size to archiver capabilities: [#2544](https://github.com/owncloud/ocis/pull/2544)
We added the maximum files count and maximum archive size of the archiver to the capabilities
endpoint. Clients can use this to generate warnings before the actual archive creation fails.
https://github.com/owncloud/ocis/issues/2537
https://github.com/owncloud/ocis/pull/2544
https://github.com/cs3org/reva/pull/2105
* Enhancement - Reduced repository size: [#2579](https://github.com/owncloud/ocis/pull/2579)
We removed leftover artifacts from the migration to a single repository.
https://github.com/owncloud/ocis/pull/2579
* Enhancement - Return the newly created space: [#2610](https://github.com/owncloud/ocis/pull/2610)
Changed the response of the CreateSpace method to include the newly created space.
https://github.com/owncloud/ocis/pull/2610
https://github.com/cs3org/reva/pull/2158
* Enhancement - Expose the reva archiver in OCIS: [#2509](https://github.com/owncloud/ocis/pull/2509)
The reva archiver can now be accessed through the storage frontend service
https://github.com/owncloud/ocis/pull/2509
* Enhancement - Favorites capability: [#2599](https://github.com/owncloud/ocis/pull/2599)
We've added a capability for the storage frontend which can be used to announce to clients
whether or not favorites are supported. By default this is disabled because the listing of
favorites doesn't survive service restarts at the moment.
https://github.com/owncloud/ocis/pull/2599
* Enhancement - Upgrade to GO 1.17: [#2605](https://github.com/owncloud/ocis/pull/2605)
We've upgraded the used GO version from 1.16 to 1.17.
https://github.com/owncloud/ocis/pull/2605
* Enhancement - Make mimetype allow list configurable for app provider: [#2553](https://github.com/owncloud/ocis/pull/2553)
We've added a configuration option to configure the mimetype allow list introduced in
cs3org/reva#2095. This also makes it possible to set one application per mime type as a
default.
https://github.com/owncloud/ocis/issues/2563
https://github.com/owncloud/ocis/pull/2553
https://github.com/cs3org/reva/pull/2095
* Enhancement - Add allow_creation parameter to mime type config: [#2591](https://github.com/owncloud/ocis/pull/2591)
https://github.com/owncloud/ocis/pull/2591
* Enhancement - Add option to skip generation of demo users and groups: [#2495](https://github.com/owncloud/ocis/pull/2495)
We've added a new environment variable to decide whether we should generate the demo users and
groups or not. This environment variable is set to `true` by default, so the demo users and
groups will get generated by default as long as oCIS is in its "technical preview" stage.
In any case, there are still some users and groups automatically generated: for users: Reva
IOP, Kopano IDP, admin; for groups: sysusers and users.
https://github.com/owncloud/ocis/pull/2495
* Enhancement - Allow overriding the cookie based route by claim: [#2508](https://github.com/owncloud/ocis/pull/2508)
When determining the routing policy we now let the claim override the cookie so that users are
routed to the correct backend after login.
https://github.com/owncloud/ocis/pull/2508
* Enhancement - Redirect invalid links to oC Web: [#2493](https://github.com/owncloud/ocis/pull/2493)
Invalid links (eg. https://foo.bar/index.php/apps/pdfviewer) will be redirect to
ownCloud Web instead of displaying a blank page with a "not found" message.
https://github.com/owncloud/ocis/pull/2493
https://github.com/owncloud/ocis/pull/2512
* Enhancement - Use reva's Authenticate method instead of spawning token managers: [#2528](https://github.com/owncloud/ocis/pull/2528)
When using the CS3 proxy backend, we previously obtained the user from reva's userprovider
service and minted the token ourselves. This required maintaining a shared JWT secret between
ocis and reva, as well duplication of logic. This PR delegates this logic by using the
`Authenticate` method provided by the reva gateway service to obtain this token, making it an
arbitrary, indestructible entry. Currently, the changes have been made to the proxy service
but will be extended to others as well.
https://github.com/owncloud/ocis/pull/2528
* Enhancement - TLS config options for ldap in reva: [#2492](https://github.com/owncloud/ocis/pull/2492)
We added the new config options "ldap-cacert" and "ldap-insecure" to the auth-, users- and
groups-provider services to be able to do proper TLS configuration for the LDAP clients.
"ldap-cacert" is by default configured to add the bundled glauth LDAP servers certificate to
the trusted set for the LDAP clients. "ldap-insecure" is set to "false" by default and can be
used to disable certificate checks (only advisable for development and test enviroments).
https://github.com/owncloud/ocis/pull/2492
* Enhancement - Set reva JWT token expiration time to 24 hours by default: [#2527](https://github.com/owncloud/ocis/pull/2527)
https://github.com/owncloud/ocis/pull/2527
* Enhancement - Update reva to v1.14.0: [#2615](https://github.com/owncloud/ocis/pull/2615)
This update includes:
* Bugfix [cs3org/reva#2103](https://github.com/cs3org/reva/pull/2103): AppProvider: propagate back errors reported by WOPI
* Bugfix [cs3org/reva#2149](https://github.com/cs3org/reva/pull/2149): Remove excess info from the http list app providers endpoint
* Bugfix [cs3org/reva#2114](https://github.com/cs3org/reva/pull/2114): Add as default app while registering and skip unset mimetypes
* Bugfix [cs3org/reva#2095](https://github.com/cs3org/reva/pull/2095): Fix app open when multiple app providers are present
* Bugfix [cs3org/reva#2135](https://github.com/cs3org/reva/pull/2135): Make TUS capabilities configurable
* Bugfix [cs3org/reva#2076](https://github.com/cs3org/reva/pull/2076): Fix chi routing
* Bugfix [cs3org/reva#2077](https://github.com/cs3org/reva/pull/2077): Fix concurrent registration of mimetypes
* Bugfix [cs3org/reva#2154](https://github.com/cs3org/reva/pull/2154): Return OK when trying to delete a non existing reference
* Bugfix [cs3org/reva#2078](https://github.com/cs3org/reva/pull/2078): Fix nil pointer exception in stat
* Bugfix [cs3org/reva#2073](https://github.com/cs3org/reva/pull/2073): Fix opening a readonly filetype with WOPI
* Bugfix [cs3org/reva#2140](https://github.com/cs3org/reva/pull/2140): Map GRPC error codes to REVA errors
* Bugfix [cs3org/reva#2147](https://github.com/cs3org/reva/pull/2147): Follow up of #2138: this is the new expected format
* Bugfix [cs3org/reva#2116](https://github.com/cs3org/reva/pull/2116): Differentiate share types when retrieving received shares in sql driver
* Bugfix [cs3org/reva#2074](https://github.com/cs3org/reva/pull/2074): Fix Stat() for EOS storage provider
* Bugfix [cs3org/reva#2151](https://github.com/cs3org/reva/pull/2151): Fix return code for webdav uploads when the token expired
* Change [cs3org/reva#2121](https://github.com/cs3org/reva/pull/2121): Sharemanager API change
* Enhancement [cs3org/reva#2090](https://github.com/cs3org/reva/pull/2090): Return space name during list storage spaces
* Enhancement [cs3org/reva#2138](https://github.com/cs3org/reva/pull/2138): Default AppProvider on top of the providers list
* Enhancement [cs3org/reva#2137](https://github.com/cs3org/reva/pull/2137): Revamp app registry and add parameter to control file creation
* Enhancement [cs3org/reva#145](https://github.com/cs3org/reva/pull/2137): UI improvements for the AppProviders
* Enhancement [cs3org/reva#2088](https://github.com/cs3org/reva/pull/2088): Add archiver and app provider to ocs capabilities
* Enhancement [cs3org/reva#2537](https://github.com/cs3org/reva/pull/2537): Add maximum files and size to archiver capabilities
* Enhancement [cs3org/reva#2100](https://github.com/cs3org/reva/pull/2100): Add support for resource id to the archiver
* Enhancement [cs3org/reva#2158](https://github.com/cs3org/reva/pull/2158): Augment the Id of new spaces
* Enhancement [cs3org/reva#2085](https://github.com/cs3org/reva/pull/2085): Make encoding user groups in access tokens configurable
* Enhancement [cs3org/reva#146](https://github.com/cs3org/reva/pull/146): Filter the denial shares (permission = 0) out of
* Enhancement [cs3org/reva#2141](https://github.com/cs3org/reva/pull/2141): Use golang v1.17
* Enhancement [cs3org/reva#2053](https://github.com/cs3org/reva/pull/2053): Safer defaults for TLS verification on LDAP connections
* Enhancement [cs3org/reva#2115](https://github.com/cs3org/reva/pull/2115): Reduce code duplication in LDAP related drivers
* Enhancement [cs3org/reva#1989](https://github.com/cs3org/reva/pull/1989): Add redirects from OC10 URL formats
* Enhancement [cs3org/reva#2479](https://github.com/cs3org/reva/pull/2479): Limit publicshare and resourceinfo scope content
* Enhancement [cs3org/reva#2071](https://github.com/cs3org/reva/pull/2071): Implement listing favorites via the dav report API
* Enhancement [cs3org/reva#2091](https://github.com/cs3org/reva/pull/2091): Nextcloud share managers
* Enhancement [cs3org/reva#2070](https://github.com/cs3org/reva/pull/2070): More unit tests for the Nextcloud storage provider
* Enhancement [cs3org/reva#2087](https://github.com/cs3org/reva/pull/2087): More unit tests for the Nextcloud auth and user managers
* Enhancement [cs3org/reva#2075](https://github.com/cs3org/reva/pull/2075): Make owncloudsql leverage existing filecache index
* Enhancement [cs3org/reva#2050](https://github.com/cs3org/reva/pull/2050): Add a share types filter to the OCS API
* Enhancement [cs3org/reva#2134](https://github.com/cs3org/reva/pull/2134): Use space Type from request
* Enhancement [cs3org/reva#2132](https://github.com/cs3org/reva/pull/2132): Align local tests with drone setup
* Enhancement [cs3org/reva#2095](https://github.com/cs3org/reva/pull/2095): Whitelisting for apps
* Enhancement [cs3org/reva#2155](https://github.com/cs3org/reva/pull/2155): Pass an extra query parameter to WOPI /openinapp with a
https://github.com/owncloud/ocis/pull/2615
https://github.com/owncloud/ocis/pull/2566
https://github.com/owncloud/ocis/pull/2520
# Changelog for [1.12.0] (2021-09-14)
The following sections list the changes for 1.12.0.
[1.12.0]: https://github.com/owncloud/ocis/compare/v1.11.0...v1.12.0
## Summary
* Bugfix - Remove non working proxy route and fix cs3 users example: [#2474](https://github.com/owncloud/ocis/pull/2474)
* Bugfix - Set English as default language in the dropdown in the settings page: [#2465](https://github.com/owncloud/ocis/pull/2465)
* Change - Remove OnlyOffice extension: [#2433](https://github.com/owncloud/ocis/pull/2433)
* Change - Remove OnlyOffice extension: [#2433](https://github.com/owncloud/ocis/pull/2433)
* Change - Update ownCloud Web to v4.2.0: [#2501](https://github.com/owncloud/ocis/pull/2501)
* Enhancement - Add app provider and app provider registry: [#2204](https://github.com/owncloud/ocis/pull/2204)
* Enhancement - Add the create space permission: [#2461](https://github.com/owncloud/ocis/pull/2461)
* Enhancement - Add set space quota permission: [#2459](https://github.com/owncloud/ocis/pull/2459)
* Enhancement - Create a Space using the Graph API: [#2471](https://github.com/owncloud/ocis/pull/2471)
* Enhancement - Update go-chi/chi to version 5.0.3: [#2429](https://github.com/owncloud/ocis/pull/2429)
* Enhancement - Upgrade go micro to v3.6.0: [#2451](https://github.com/owncloud/ocis/pull/2451)
* Enhancement - Update reva to v1.13.0: [#2477](https://github.com/owncloud/ocis/pull/2477)
## Details
@@ -44,6 +831,27 @@ The following sections list the changes for unreleased.
https://github.com/owncloud/ocis/pull/2433
* Change - Remove OnlyOffice extension: [#2433](https://github.com/owncloud/ocis/pull/2433)
Tags: OnlyOffice
We've removed the OnlyOffice extension in oCIS. OnlyOffice has their own web extension for
OC10 backend now with [a dedicated
guide](https://owncloud.dev/clients/web/deployments/oc10-app/#onlyoffice). In
oCIS, we will follow up with a guide on how to start a WOPI server providing OnlyOffice soon.
https://github.com/owncloud/ocis/pull/2433
* Change - Update ownCloud Web to v4.2.0: [#2501](https://github.com/owncloud/ocis/pull/2501)
Tags: web
We updated ownCloud Web to v4.2.0. Please refer to the changelog (linked) for details on the web
release.
https://github.com/owncloud/ocis/pull/2501
https://github.com/owncloud/web/releases/tag/v4.2.0
* Enhancement - Add app provider and app provider registry: [#2204](https://github.com/owncloud/ocis/pull/2204)
We added the app provider and app provider registry. Now the CS3org WOPI server can be
@@ -78,7 +886,7 @@ The following sections list the changes for unreleased.
* Enhancement - Update go-chi/chi to version 5.0.3: [#2429](https://github.com/owncloud/ocis/pull/2429)
Updated go-chi/chi to the lastest release
Updated go-chi/chi to the latest release
https://github.com/owncloud/ocis/pull/2429
@@ -87,6 +895,23 @@ The following sections list the changes for unreleased.
Go micro and all go micro plugins are now on v3.6.0
https://github.com/owncloud/ocis/pull/2451
* Enhancement - Update reva to v1.13.0: [#2477](https://github.com/owncloud/ocis/pull/2477)
This update includes:
* Bugfix [cs3org/reva#2054](https://github.com/cs3org/reva/pull/2054): Fix the response after deleting a share
* Bugfix [cs3org/reva#2026](https://github.com/cs3org/reva/pull/2026): Fix moving of a shared file
* Bugfix [cs3org/reva#1605](https://github.com/cs3org/reva/pull/1605): Allow to expose full paths in OCS API
* Bugfix [cs3org/reva#2033](https://github.com/cs3org/reva/pull/2033): Fix the storage id of shares
* Bugfix [cs3org/reva#1991](https://github.com/cs3org/reva/pull/1991): Remove share references when declining shares
* Enhancement [cs3org/reva#1994](https://github.com/cs3org/reva/pull/1994): Add owncloudsql driver for the userprovider
* Enhancement [cs3org/reva#2065](https://github.com/cs3org/reva/pull/2065): New sharing role Manager
* Enhancement [cs3org/reva#2015](https://github.com/cs3org/reva/pull/2015): Add spaces to the list of capabilities
* Enhancement [cs3org/reva#2041](https://github.com/cs3org/reva/pull/2041): Create operations for Spaces
* Enhancement [cs3org/reva#2029](https://github.com/cs3org/reva/pull/2029): Tracing agent configuration
https://github.com/owncloud/ocis/pull/2477
# Changelog for [1.11.0] (2021-08-24)
The following sections list the changes for 1.11.0.
+1 -1
View File
@@ -44,7 +44,7 @@ We also have a [Rocket Chat Server](https://talk.owncloud.com/channel/ocis) to a
### ownCloud is hosted on Github
To effectivly contribute to ownCloud Infinite Scale, you need a Github account. You can get that for free at [Github](https://github.com/join). You can find howtos on the internet, for example [here](https://www.wikihow.com/Create-an-Account-on-GitHub).
To effectively contribute to ownCloud Infinite Scale, you need a Github account. You can get that for free at [Github](https://github.com/join). You can find howtos on the internet, for example [here](https://www.wikihow.com/Create-an-Account-on-GitHub).
For other ways of contributing, for example with translations, other systems require you to have an account as well, for example [Transifex](https://www.transifex.com).
+27 -5
View File
@@ -1,10 +1,32 @@
FROM owncloudci/golang:1.16 as build
# Please use this Dockerfile only if
# you want to build an image from source without
# Yarn and Go installed on your dev machine.
# You can build oCIS using this Dockerfile
# by running following command:
# `docker build -t owncloud/ocis:custom .`
# In most other cases you might want to run the
# following command instead:
# `make -C ocis dev-docker`
# It will build a `owncloud/ocis:dev` image for you
# and use your local Yarn and Go caches and therefore
# is a lot faster than the below build steps.
FROM owncloudci/nodejs:14 as generate
COPY ./ /ocis/
WORKDIR /ocis/ocis
RUN make clean generate build
RUN make ci-node-generate
FROM owncloudci/golang:1.17 as build
COPY --from=generate /ocis /ocis
WORKDIR /ocis/ocis
RUN make ci-go-generate build
FROM alpine:3.13
@@ -15,9 +37,9 @@ RUN apk update && \
echo 'hosts: files dns' >| /etc/nsswitch.conf
LABEL maintainer="ownCloud GmbH <devops@owncloud.com>" \
org.label-schema.name="ownCloud Infinite Scale" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"
org.label-schema.name="ownCloud Infinite Scale" \
org.label-schema.vendor="ownCloud GmbH" \
org.label-schema.schema-version="1.0"
ENTRYPOINT ["/usr/bin/ocis"]
CMD ["server"]
+45 -9
View File
@@ -32,10 +32,19 @@ OCIS_MODULES = \
web \
webdav
ifneq (, $(shell which go 2> /dev/null)) # supress `command not found warnings` for non go targets in CI
# bin file definitions
PHP_CS_FIXER=php -d zend.enable_gc=0 vendor-bin/owncloud-codestyle/vendor/bin/php-cs-fixer
PHP_CODESNIFFER=vendor-bin/php_codesniffer/vendor/bin/phpcs
PHP_CODEBEAUTIFIER=vendor-bin/php_codesniffer/vendor/bin/phpcbf
PHAN=php -d zend.enable_gc=0 vendor-bin/phan/vendor/bin/phan
PHPSTAN=php -d zend.enable_gc=0 vendor-bin/phpstan/vendor/bin/phpstan
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include .bingo/Variables.mk
endif
include .make/recursion.mk
.PHONY: help
help:
@echo "Please use 'make <target>' where <target> is one of the following:"
@@ -64,6 +73,10 @@ help:
@echo -e "\tsee ./tests/acceptance/docker/Makefile"
@echo -e "\tor run ${YELLOW}make -C tests/acceptance/docker help${RESET}"
@echo
@echo -e "${GREEN}Tools for developing tests:\n${RESET}"
@echo -e "\tmake test-php-style\t\t${BLUE}run PHP code style checks${RESET}"
@echo -e "\tmake test-php-style-fix\t\t${BLUE}run PHP code style checks and fix any issues found${RESET}"
@echo
.PHONY: clean-tests
clean-tests:
@@ -119,9 +132,10 @@ ci-go-generate:
.PHONY: ci-node-generate
ci-node-generate:
@for mod in $(OCIS_MODULES); do \
@if [ $(MAKE_DEPTH) -le 1 ]; then \
for mod in $(OCIS_MODULES); do \
$(MAKE) --no-print-directory -C $$mod ci-node-generate; \
done
done; fi;
.PHONY: go-mod-tidy
go-mod-tidy:
@@ -150,7 +164,7 @@ protobuf:
.PHONY: bingo-update
bingo-update: $(BINGO)
$(BINGO) get -u
$(BINGO) get -l -u
CHANGELOG_VERSION =
@@ -164,33 +178,55 @@ endif
.PHONY: l10n-push
l10n-push:
@for extension in $(L10N_MODULES); do \
make -C $$extension l10n-push; \
$(MAKE) -C $$extension l10n-push; \
done
.PHONY: l10n-pull
l10n-pull:
@for extension in $(L10N_MODULES); do \
make -C $$extension l10n-pull; \
$(MAKE) -C $$extension l10n-pull; \
done
.PHONY: l10n-clean
l10n-clean:
@for extension in $(L10N_MODULES); do \
make -C $$extension l10n-clean; \
$(MAKE) -C $$extension l10n-clean; \
done
.PHONY: l10n-read
l10n-read:
@for extension in $(L10N_MODULES); do \
make -C $$extension l10n-read; \
$(MAKE) -C $$extension l10n-read; \
done
.PHONY: l10n-write
l10n-write:
@for extension in $(L10N_MODULES); do \
make -C $$extension l10n-write; \
$(MAKE) -C $$extension l10n-write; \
done
.PHONY: ci-format
ci-format: $(BUILDIFIER)
$(BUILDIFIER) --mode=fix .drone.star
.PHONY: test-php-style
test-php-style: vendor-bin/owncloud-codestyle/vendor vendor-bin/php_codesniffer/vendor
$(PHP_CS_FIXER) fix -v --diff --allow-risky yes --dry-run
$(PHP_CODESNIFFER) --cache --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance
.PHONY: test-php-style-fix
test-php-style-fix: vendor-bin/owncloud-codestyle/vendor
$(PHP_CS_FIXER) fix -v --diff --allow-risky yes
$(PHP_CODEBEAUTIFIER) --cache --runtime-set ignore_warnings_on_exit --standard=phpcs.xml tests/acceptance
vendor-bin/owncloud-codestyle/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/owncloud-codestyle/composer.lock
composer bin owncloud-codestyle install --no-progress
vendor-bin/owncloud-codestyle/composer.lock: vendor-bin/owncloud-codestyle/composer.json
@echo owncloud-codestyle composer.lock is not up to date.
vendor-bin/php_codesniffer/vendor: vendor/bamarni/composer-bin-plugin vendor-bin/php_codesniffer/composer.lock
composer bin php_codesniffer install --no-progress
vendor-bin/php_codesniffer/composer.lock: vendor-bin/php_codesniffer/composer.json
@echo php_codesniffer composer.lock is not up to date.
+17
View File
@@ -0,0 +1,17 @@
# yarn2 with Zero-Installs: https://yarnpkg.com/features/zero-installs
#.yarn/*
#!.yarn/cache
#!.yarn/patches
#!.yarn/plugins
#!.yarn/releases
#!.yarn/sdks
#!.yarn/versions
# yarn2 not using Zero-Installs: https://yarnpkg.com/features/zero-installs
.yarn/*
!.yarn/patches
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
+768
View File
File diff suppressed because one or more lines are too long
+6
View File
@@ -0,0 +1,6 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.1.0.cjs
enableScripts: false
enableTelemetry: false
-202
View File
@@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+5 -8
View File
@@ -1,13 +1,15 @@
SHELL := bash
NAME := accounts
include ../.make/recursion.mk
.PHONY: test-acceptance-webui
test-acceptance-webui:
./ui/tests/run-acceptance-test.sh $(FEATURE_PATH)
############ tooling ############
ifneq (, $(shell which go 2> /dev/null)) # supress `command not found warnings` for non go targets in CI
ifneq (, $(shell which go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI
include ../.bingo/Variables.mk
endif
@@ -32,7 +34,6 @@ include ../.make/generate.mk
.PHONY: ci-go-generate
ci-go-generate: protobuf # CI runs ci-node-generate automatically before this target
@go generate ./...
.PHONY: ci-node-generate
ci-node-generate: yarn-build
@@ -45,7 +46,7 @@ yarn-build: node_modules
.PHONY: node_modules
node_modules:
yarn install --frozen-lockfile
yarn install --immutable
############ protobuf ############
PROTO_VERSION := v0
@@ -54,8 +55,4 @@ PROTO_SRC := pkg/proto/$(PROTO_VERSION)
include ../.make/protobuf.mk
.PHONY: protobuf
protobuf: $(PROTO_SRC)/${NAME}.pb.go \
$(PROTO_SRC)/${NAME}.pb.micro.go \
$(PROTO_SRC)/${NAME}.pb.web.go \
$(PROTO_SRC)/${NAME}.swagger.json \
../docs/extensions/${NAME}/grpc.md
protobuf: buf-generate
+9
View File
@@ -0,0 +1,9 @@
package accounts
import (
"embed"
)
//go:generate make generate
//go:embed assets/*
var Assets embed.FS
View File
+29
View File
@@ -0,0 +1,29 @@
version: v1
plugins:
- name: go
path: ../.bingo/protoc-gen-go
out: pkg/
opt:
- paths=source_relative
- name: micro
path: ../.bingo/protoc-gen-micro
out: pkg/
opt:
- paths=source_relative
- name: microweb
path: ../.bingo/protoc-gen-microweb
out: pkg/
opt:
- paths=source_relative
- name: openapiv2
path: ../.bingo/protoc-gen-openapiv2
out: pkg/
- name: doc
path: ../.bingo/protoc-gen-doc
out: ../docs/extensions/accounts
opt:
- ./templates/GRPC.tmpl,grpc.md
+17
View File
@@ -0,0 +1,17 @@
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: googleapis
repository: googleapis
branch: main
commit: ca45b9d9c51849e898845743a28b0eb0
digest: b1--B2JdvzLV2KI5pYMG9AHJHFGznqXfZKjKwcqBuXhGgw=
create_time: 2021-10-14T15:09:30.598677Z
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
branch: main
commit: 462ede5f3dee45569df6317bda220b1b
digest: b1-4FNKWjnS2yafyeOdqW8u-s7w1pJBHjz0Z6CbOL-Ipk0=
create_time: 2021-10-14T01:55:03.476639Z
+10
View File
@@ -0,0 +1,10 @@
version: v1
lint:
use:
- DEFAULT
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
breaking:
use:
- FILE
+1 -1
View File
@@ -8,7 +8,7 @@ import (
)
func main() {
if err := command.Execute(config.New()); err != nil {
if err := command.Execute(config.DefaultConfig()); err != nil {
os.Exit(1)
}
}
File diff suppressed because one or more lines are too long
+5 -7
View File
@@ -1,11 +1,9 @@
const path = require('path')
const WEB_PATH = process.env.WEB_PATH
const TEST_INFRA_DIRECTORY = process.env.TEST_INFRA_DIRECTORY
const config = require(path.join(WEB_PATH, 'nightwatch.conf.js'))
const config = require(path.join(TEST_INFRA_DIRECTORY, 'nightwatch.conf.js'))
config.page_objects_path = [WEB_PATH + '/tests/acceptance/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = WEB_PATH + '/tests/acceptance/customCommands'
config.page_objects_path = [TEST_INFRA_DIRECTORY + '/pageObjects', 'ui/tests/acceptance/pageobjects']
config.custom_commands_path = TEST_INFRA_DIRECTORY + '/customCommands'
module.exports = {
...config
}
module.exports = config
+29 -27
View File
@@ -1,45 +1,54 @@
{
"private": true,
"name": "ocis-accounts",
"version": "0.0.0",
"private": true,
"description": "",
"homepage": "https://github.com/owncloud/ocis-accounts#readme",
"license": "Apache-2.0",
"author": "ownCloud GmbH <devops@owncloud.com>",
"repository": "https://github.com/owncloud/ocis-accounts.git",
"bugs": {
"url": "https://github.com/owncloud/ocis/issues",
"email": "support@owncloud.com"
},
"repository": "https://github.com/owncloud/ocis-accounts.git",
"license": "Apache-2.0",
"author": "ownCloud GmbH <devops@owncloud.com>",
"scripts": {
"lint": "eslint ui/**/*.vue ui/**/*.js --color --global requirejs --global require",
"acceptance-tests": "cucumber-js --retry 1 --require-module @babel/register --require-module @babel/polyfill --require ${TEST_INFRA_DIRECTORY}/setup.js --require ui/tests/acceptance/stepDefinitions --require ${TEST_INFRA_DIRECTORY}/stepDefinitions --format @cucumber/pretty-formatter -t \"${TEST_TAGS:-not @skip and not @skipOnOC10}\"",
"build": "rollup -c",
"watch": "rollup -c -w",
"test": "echo 'Not implemented'",
"generate-api": "node node_modules/swagger-vue-generator/bin/generate-api.js --package-version v0 --source pkg/proto/v0/accounts.swagger.json --moduleName accounts --destination ui/client/accounts/index.js",
"acceptance-tests": "cucumber-js --retry 1 --require-module @babel/register --require-module @babel/polyfill --require ${TEST_INFRA_DIRECTORY}/acceptance/setup.js --require ui/tests/acceptance/stepDefinitions --require ${TEST_INFRA_DIRECTORY}/acceptance/stepDefinitions --format node_modules/cucumber-pretty -t \"${TEST_TAGS:-not @skip and not @skipOnOC10}\""
"lint": "eslint ui/**/*.vue ui/**/*.js --color --global requirejs --global require",
"test": "echo 'Not implemented'",
"watch": "rollup -c -w"
},
"browserslist": [
"> 1%",
"not dead"
],
"dependencies": {
"axios": "^0.21.4",
"core-js": "^3.17.3",
"debounce": "^1.2.1",
"validator": "^13.1.1",
"vuex": "^3.5.1"
},
"devDependencies": {
"@babel/core": "^7.15.0",
"@babel/core": "^7.15.5",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-proposal-export-default-from": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.7",
"@babel/plugin-proposal-object-rest-spread": "^7.15.6",
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/plugin-transform-runtime": "^7.15.0",
"@babel/polyfill": "^7.10.1",
"@babel/preset-env": "^7.13.12",
"@babel/register": "^7.14.5",
"@cucumber/cucumber": "^7.3.1",
"@cucumber/pretty-formatter": "^1.0.0-alpha.1",
"@erquhart/rollup-plugin-node-builtins": "^2.1.5",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.0.1",
"@rollup/plugin-replace": "^2.3.0",
"archiver": "^5.3.0",
"axios": "^0.21.1",
"core-js": "^3.16.1",
"chromedriver": "^93.0.1",
"cross-env": "^7.0.3",
"cucumber": "^6.0.5",
"cucumber-pretty": ">=6.0.0",
"debounce": "^1.2.1",
"easygettext": "^2.17.0",
"eslint": "7.24.0",
"eslint-config-standard": "^16.0.2",
@@ -51,8 +60,8 @@
"fs-extra": "^9.0.1",
"join-path": "^1.1.1",
"ldapjs": "^2.2.3",
"nightwatch": "1.5.1",
"nightwatch-api": "3.0.1",
"nightwatch": "1.7.11",
"nightwatch-api": "3.0.2",
"nightwatch-vrt": "^0.2.10",
"node-fetch": "^2.6.1",
"qs": "^6.10.1",
@@ -68,17 +77,10 @@
"swagger-vue-generator": "^1.0.6",
"url-search-params-polyfill": "^8.1.0",
"vue-template-compiler": "^2.6.11",
"vuex": "^3.5.1",
"xml-js": "^1.6.11"
},
"browserslist": [
"> 1%",
"not dead"
],
"peerDependencies": {
"owncloud-design-system": "^9.3.0"
"owncloud-design-system": "^11.0.0"
},
"dependencies": {
"validator": "^13.1.1"
}
"packageManager": "yarn@3.1.0"
}
-66
View File
@@ -1,66 +0,0 @@
package assets
import (
"net/http"
"os"
"path"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
// Fake the import to make the dep tree happy.
_ "golang.org/x/net/context"
// Fake the import to make the dep tree happy.
_ "golang.org/x/net/webdav"
)
//go:generate make -C ../.. embed.yml
// assets gets initialized by New and provides the handler.
type assets struct {
logger log.Logger
config *config.Config
}
// Open just implements the HTTP filesystem interface.
func (a assets) Open(original string) (http.File, error) {
if a.config.Asset.Path != "" {
if stat, err := os.Stat(a.config.Asset.Path); err == nil && stat.IsDir() {
custom := path.Join(
a.config.Asset.Path,
original,
)
if _, err := os.Stat(custom); !os.IsNotExist(err) {
f, err := os.Open(custom)
if err != nil {
return nil, err
}
return f, nil
}
} else {
a.logger.Warn().
Str("path", a.config.Asset.Path).
Msg("Assets directory doesn't exist")
}
}
return FS.OpenFile(
CTX,
original,
os.O_RDONLY,
0644,
)
}
// New returns a new http filesystem to serve assets.
func New(opts ...Option) http.FileSystem {
options := newOptions(opts...)
return assets{
config: options.Config,
}
}
File diff suppressed because one or more lines are too long
-17
View File
@@ -1,17 +0,0 @@
---
pkg: "assets"
dest: "."
output: "embed.go"
fmt: true
noprefix: true
compression:
compress: true
custom:
- files:
- "../../assets/"
base: "../../assets/"
prefix: ""
...
+10
View File
@@ -1,10 +1,20 @@
package assets
import (
"net/http"
"github.com/owncloud/ocis/accounts"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/ocis-pkg/assetsfs"
"github.com/owncloud/ocis/ocis-pkg/log"
)
// New returns a new http filesystem to serve assets.
func New(opts ...Option) http.FileSystem {
options := newOptions(opts...)
return assetsfs.New(accounts.Assets, options.Config.Asset.Path, options.Logger)
}
// Option defines a single option function.
type Option func(o *Options)
+2 -2
View File
@@ -3,11 +3,11 @@ package command
import (
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/asim/go-micro/plugins/client/grpc/v4"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
)
// AddAccount command creates a new account
+4 -3
View File
@@ -5,12 +5,13 @@ import (
"os"
"strconv"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/asim/go-micro/plugins/client/grpc/v4"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
)
// InspectAccount command shows detailed information about a specific account.
+4 -3
View File
@@ -5,12 +5,13 @@ import (
"os"
"strconv"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/asim/go-micro/plugins/client/grpc/v4"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
)
// ListAccounts command lists all accounts
+3 -3
View File
@@ -4,11 +4,11 @@ import (
"context"
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/micro/cli/v2"
"github.com/asim/go-micro/plugins/client/grpc/v4"
"github.com/owncloud/ocis/accounts/pkg/config"
index "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
merrors "go-micro.dev/v4/errors"
)
// RebuildIndex rebuilds the entire configured index.
+4 -3
View File
@@ -4,11 +4,12 @@ import (
"fmt"
"os"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/asim/go-micro/plugins/client/grpc/v4"
"github.com/owncloud/ocis/accounts/pkg/config"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
)
// RemoveAccount command deletes an existing account.
+23 -68
View File
@@ -3,22 +3,14 @@ package command
import (
"context"
"os"
"strings"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/owncloud/ocis/accounts/pkg/version"
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocis-pkg/sync"
"github.com/spf13/viper"
"github.com/owncloud/ocis/ocis-pkg/version"
"github.com/thejerf/suture/v4"
)
var (
defaultConfigPaths = []string{"/etc/ocis", "$HOME/.ocis", "./config"}
defaultFilename = "accounts"
"github.com/urfave/cli/v2"
)
// Execute is the entry point for the ocis-accounts command.
@@ -28,16 +20,12 @@ func Execute(cfg *config.Config) error {
Version: version.String,
Usage: "Provide accounts and groups for oCIS",
Compiled: version.Compiled(),
Authors: []*cli.Author{
{
Name: "ownCloud GmbH",
Email: "support@owncloud.com",
},
},
Flags: flagset.RootWithConfig(cfg),
Before: func(c *cli.Context) error {
cfg.Server.Version = version.String
return ParseConfig(c, cfg)
@@ -68,60 +56,30 @@ func Execute(cfg *config.Config) error {
return app.Run(os.Args)
}
// NewLogger initializes a service-specific logger instance.
func NewLogger(cfg *config.Config) log.Logger {
return log.NewLogger(
log.Name("accounts"),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
)
}
// ParseConfig loads accounts configuration from Viper known paths.
// ParseConfig loads accounts configuration from known paths.
func ParseConfig(c *cli.Context, cfg *config.Config) error {
sync.ParsingViperConfig.Lock()
defer sync.ParsingViperConfig.Unlock()
logger := NewLogger(cfg)
conf, err := ociscfg.BindSourcesToStructs("accounts", cfg)
if err != nil {
return err
}
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvPrefix("ACCOUNTS")
viper.AutomaticEnv()
if c.IsSet("config-file") {
viper.SetConfigFile(c.String("config-file"))
} else {
viper.SetConfigName(defaultFilename)
for _, v := range defaultConfigPaths {
viper.AddConfigPath(v)
// provide with defaults for shared logging, since we need a valid destination address for BindEnv.
if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil {
cfg.Log = &shared.Log{
Level: cfg.Commons.Log.Level,
Pretty: cfg.Commons.Log.Pretty,
Color: cfg.Commons.Log.Color,
File: cfg.Commons.Log.File,
}
} else if cfg.Log == nil && cfg.Commons == nil {
cfg.Log = &shared.Log{}
}
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Err(err).
Msg("Unsupported config type")
default:
logger.Fatal().
Err(err).
Msg("Failed to read config")
}
}
// load all env variables relevant to the config in the current context.
conf.LoadOSEnv(config.GetEnv(cfg), false)
if err := viper.Unmarshal(&cfg); err != nil {
logger.Fatal().
Err(err).
Msg("Failed to parse config")
}
return nil
bindings := config.StructMappings(cfg)
return ociscfg.BindEnv(conf, bindings)
}
// SutureService allows for the accounts command to be embedded and supervised by a suture supervisor tree.
@@ -131,10 +89,7 @@ type SutureService struct {
// NewSutureService creates a new accounts.SutureService
func NewSutureService(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 {
cfg.Accounts.Supervised = true
}
cfg.Accounts.Log.File = cfg.Log.File
cfg.Accounts.Commons = cfg.Commons
return SutureService{
cfg: cfg.Accounts,
}
+8 -15
View File
@@ -4,17 +4,16 @@ import (
"context"
"strings"
"github.com/owncloud/ocis/ocis-pkg/sync"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/micro/cli/v2"
"github.com/oklog/run"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/owncloud/ocis/accounts/pkg/metrics"
"github.com/owncloud/ocis/accounts/pkg/server/grpc"
"github.com/owncloud/ocis/accounts/pkg/server/http"
svc "github.com/owncloud/ocis/accounts/pkg/service/v0"
"github.com/owncloud/ocis/accounts/pkg/tracing"
"github.com/urfave/cli/v2"
)
// Server is the entry point for the server command.
@@ -23,23 +22,21 @@ func Server(cfg *config.Config) *cli.Command {
Name: "server",
Usage: "Start ocis accounts service",
Description: "uses an LDAP server as the storage backend",
Flags: flagset.ServerWithConfig(cfg),
Before: func(ctx *cli.Context) error {
logger := NewLogger(cfg)
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
// When running on single binary mode the before hook from the root command won't get called. We manually
// call this before hook from ocis command, so the configuration can be loaded.
if !cfg.Supervised {
return ParseConfig(ctx, cfg)
cfg.Repo.Backend = strings.ToLower(cfg.Repo.Backend)
if err := ParseConfig(ctx, cfg); err != nil {
return err
}
logger.Debug().Str("service", "accounts").Msg("ignoring config file parsing when running supervised")
return nil
},
Action: func(c *cli.Context) error {
logger := NewLogger(cfg)
logger := log.LoggerFromConfig("accounts", *cfg.Log)
err := tracing.Configure(cfg)
if err != nil {
return err
@@ -86,10 +83,6 @@ func Server(cfg *config.Config) *cli.Command {
cancel()
})
if !cfg.Supervised {
sync.Trap(&gr, cancel)
}
return gr.Run()
},
}
+4 -4
View File
@@ -4,11 +4,12 @@ import (
"errors"
"fmt"
"github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/asim/go-micro/plugins/client/grpc/v4"
"github.com/owncloud/ocis/accounts/pkg/config"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/urfave/cli/v2"
"google.golang.org/genproto/protobuf/field_mask"
)
@@ -24,7 +25,6 @@ func UpdateAccount(cfg *config.Config) *cli.Command {
Flags: flagset.UpdateAccountWithConfig(cfg, a),
Before: func(c *cli.Context) error {
if len(c.StringSlice("password_policies")) > 0 {
// StringSliceFlag doesn't support Destination
a.PasswordProfile.PasswordPolicies = c.StringSlice("password_policies")
}
+1 -3
View File
@@ -6,10 +6,9 @@ import (
"github.com/owncloud/ocis/ocis-pkg/registry"
"github.com/micro/cli/v2"
tw "github.com/olekukonko/tablewriter"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/flagset"
"github.com/urfave/cli/v2"
)
// PrintVersion prints the service versions of all running instances.
@@ -17,7 +16,6 @@ func PrintVersion(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "version",
Usage: "Print the versions of the running instances",
Flags: flagset.ListAccountsWithConfig(cfg),
Action: func(c *cli.Context) error {
reg := registry.GetRegistry()
services, err := reg.GetService(cfg.GRPC.Namespace + "." + cfg.Server.Name)
+151 -65
View File
@@ -1,129 +1,141 @@
// Package config should be moved to internal
package config
import "context"
import (
"context"
"path"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
)
// LDAP defines the available ldap configuration.
type LDAP struct {
Hostname string
Port int
BaseDN string
UserFilter string
GroupFilter string
BindDN string
BindPassword string
IDP string
Schema LDAPSchema
Hostname string `ocisConfig:"hostname"`
Port int `ocisConfig:"port"`
BaseDN string `ocisConfig:"base_dn"`
UserFilter string `ocisConfig:"user_filter"`
GroupFilter string `ocisConfig:"group_filter"`
BindDN string `ocisConfig:"bind_dn"`
BindPassword string `ocisConfig:"bind_password"`
IDP string `ocisConfig:"idp"`
Schema LDAPSchema `ocisConfig:"schema"`
}
// LDAPSchema defines the available ldap schema configuration.
type LDAPSchema struct {
AccountID string
Identities string
Username string
DisplayName string
Mail string
Groups string
AccountID string `ocisConfig:"account_id"`
Identities string `ocisConfig:"identities"`
Username string `ocisConfig:"username"`
DisplayName string `ocisConfig:"display_name"`
Mail string `ocisConfig:"mail"`
Groups string `ocisConfig:"groups"`
}
// CORS defines the available cors configuration.
type CORS struct {
AllowedOrigins []string `ocisConfig:"allowed_origins"`
AllowedMethods []string `ocisConfig:"allowed_methods"`
AllowedHeaders []string `ocisConfig:"allowed_headers"`
AllowCredentials bool `ocisConfig:"allowed_credentials"`
}
// HTTP defines the available http configuration.
type HTTP struct {
Addr string
Namespace string
Root string
CacheTTL int
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
Root string `ocisConfig:"root"`
CacheTTL int `ocisConfig:"cache_ttl"`
CORS CORS `ocisConfig:"cors"`
}
// GRPC defines the available grpc configuration.
type GRPC struct {
Addr string
Namespace string
Addr string `ocisConfig:"addr"`
Namespace string `ocisConfig:"namespace"`
}
// Server configures a server.
type Server struct {
Version string
Name string
HashDifficulty int
Version string `ocisConfig:"version"`
Name string `ocisConfig:"name"`
HashDifficulty int `ocisConfig:"hash_difficulty"`
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups"`
}
// Asset defines the available asset configuration.
type Asset struct {
Path string
Path string `ocisConfig:"path"`
}
// TokenManager is the config for using the reva token manager
type TokenManager struct {
JWTSecret string
}
// Log defines the available logging configuration.
type Log struct {
Level string
Pretty bool
Color bool
File string
JWTSecret string `ocisConfig:"jwt_secret"`
}
// Repo defines which storage implementation is to be used.
type Repo struct {
Disk Disk
CS3 CS3
Backend string `ocisConfig:"backend"`
Disk Disk `ocisConfig:"disk"`
CS3 CS3 `ocisConfig:"cs3"`
}
// Disk is the local disk implementation of the storage.
type Disk struct {
Path string
Path string `ocisConfig:"path"`
}
// CS3 is the cs3 implementation of the storage.
type CS3 struct {
ProviderAddr string
DataURL string
DataPrefix string
JWTSecret string
ProviderAddr string `ocisConfig:"provider_addr"`
JWTSecret string `ocisConfig:"jwt_secret"`
}
// ServiceUser defines the user required for EOS.
type ServiceUser struct {
UUID string
Username string
UID int64
GID int64
UUID string `ocisConfig:"uuid"`
Username string `ocisConfig:"username"`
UID int64 `ocisConfig:"uid"`
GID int64 `ocisConfig:"gid"`
}
// Index defines config for indexes.
type Index struct {
UID, GID Bound
UID Bound `ocisConfig:"uid"`
GID Bound `ocisConfig:"gid"`
}
// Bound defines a lower and upper bound.
type Bound struct {
Lower, Upper int64
Lower int64 `ocisConfig:"lower"`
Upper int64 `ocisConfig:"upper"`
}
// Tracing defines the available tracing configuration.
type Tracing struct {
Enabled bool
Type string
Endpoint string
Collector string
Service string
Enabled bool `ocisConfig:"enabled"`
Type string `ocisConfig:"type"`
Endpoint string `ocisConfig:"endpoint"`
Collector string `ocisConfig:"collector"`
Service string `ocisConfig:"service"`
}
// Config merges all Account config parameters.
type Config struct {
LDAP LDAP
HTTP HTTP
GRPC GRPC
Server Server
Asset Asset
Log Log
TokenManager TokenManager
Repo Repo
Index Index
ServiceUser ServiceUser
Tracing Tracing
*shared.Commons
LDAP LDAP `ocisConfig:"ldap"`
HTTP HTTP `ocisConfig:"http"`
GRPC GRPC `ocisConfig:"grpc"`
Server Server `ocisConfig:"server"`
Asset Asset `ocisConfig:"asset"`
Log *shared.Log `ocisConfig:"log"`
TokenManager TokenManager `ocisConfig:"token_manager"`
Repo Repo `ocisConfig:"repo"`
Index Index `ocisConfig:"index"`
ServiceUser ServiceUser `ocisConfig:"service_user"`
Tracing Tracing `ocisConfig:"tracing"`
Context context.Context
Supervised bool
@@ -131,5 +143,79 @@ type Config struct {
// New returns a new config.
func New() *Config {
return &Config{}
return &Config{
Log: &shared.Log{},
}
}
func DefaultConfig() *Config {
return &Config{
LDAP: LDAP{},
HTTP: HTTP{
Addr: "127.0.0.1:9181",
Namespace: "com.owncloud.web",
Root: "/",
CacheTTL: 604800, // 7 days
CORS: CORS{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
AllowedHeaders: []string{"Authorization", "Origin", "Content-Type", "Accept", "X-Requested-With"},
AllowCredentials: true,
},
},
GRPC: GRPC{
Addr: "127.0.0.1:9180",
Namespace: "com.owncloud.api",
},
Server: Server{
Name: "accounts",
HashDifficulty: 11,
DemoUsersAndGroups: true,
},
Asset: Asset{},
TokenManager: TokenManager{
JWTSecret: "Pive-Fumkiu4",
},
Repo: Repo{
Backend: "CS3",
Disk: Disk{
Path: path.Join(defaults.BaseDataPath(), "accounts"),
},
CS3: CS3{
ProviderAddr: "localhost:9215",
JWTSecret: "Pive-Fumkiu4",
},
},
Index: Index{
UID: Bound{
Lower: 0,
Upper: 1000,
},
GID: Bound{
Lower: 0,
Upper: 1000,
},
},
ServiceUser: ServiceUser{
UUID: "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad",
Username: "",
UID: 0,
GID: 0,
},
Tracing: Tracing{
Type: "jaeger",
Service: "accounts",
},
}
}
// GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list
// with all the environment variables an extension supports.
func GetEnv(cfg *Config) []string {
var r = make([]string, len(structMappings(cfg)))
for i := range structMappings(cfg) {
r = append(r, structMappings(cfg)[i].EnvVars...)
}
return r
}
+140
View File
@@ -0,0 +1,140 @@
package config
import "github.com/owncloud/ocis/ocis-pkg/shared"
// StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the
// Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets
// us propagate changes easier.
func StructMappings(cfg *Config) []shared.EnvBinding {
return structMappings(cfg)
}
// structMappings binds a set of environment variables to a destination on cfg.
func structMappings(cfg *Config) []shared.EnvBinding {
return []shared.EnvBinding{
{
EnvVars: []string{"OCIS_LOG_FILE", "ACCOUNTS_LOG_FILE"},
Destination: &cfg.Log.File,
},
{
EnvVars: []string{"OCIS_LOG_COLOR", "ACCOUNTS_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
{
EnvVars: []string{"OCIS_LOG_PRETTY", "ACCOUNTS_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
{
EnvVars: []string{"OCIS_TRACING_ENABLED", "ACCOUNTS_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
{
EnvVars: []string{"OCIS_TRACING_TYPE", "ACCOUNTS_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
{
EnvVars: []string{"OCIS_TRACING_ENDPOINT", "ACCOUNTS_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
{
EnvVars: []string{"OCIS_TRACING_COLLECTOR", "ACCOUNTS_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
{
EnvVars: []string{"ACCOUNTS_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
{
EnvVars: []string{"ACCOUNTS_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
{
EnvVars: []string{"ACCOUNTS_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
{
EnvVars: []string{"ACCOUNTS_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
{
EnvVars: []string{"ACCOUNTS_CACHE_TTL"},
Destination: &cfg.HTTP.CacheTTL,
},
{
EnvVars: []string{"ACCOUNTS_GRPC_NAMESPACE"},
Destination: &cfg.GRPC.Namespace,
},
{
EnvVars: []string{"ACCOUNTS_GRPC_ADDR"},
Destination: &cfg.GRPC.Addr,
},
{
EnvVars: []string{"ACCOUNTS_NAME"},
Destination: &cfg.Server.Name,
},
{
EnvVars: []string{"ACCOUNTS_HASH_DIFFICULTY"},
Destination: &cfg.Server.HashDifficulty,
},
{
EnvVars: []string{"ACCOUNTS_DEMO_USERS_AND_GROUPS"},
Destination: &cfg.Server.DemoUsersAndGroups,
},
{
EnvVars: []string{"ACCOUNTS_ASSET_PATH"},
Destination: &cfg.Asset.Path,
},
{
EnvVars: []string{"OCIS_JWT_SECRET", "ACCOUNTS_JWT_SECRET"},
Destination: &cfg.TokenManager.JWTSecret,
},
{
EnvVars: []string{"ACCOUNTS_STORAGE_BACKEND"},
Destination: &cfg.Repo.Backend,
},
{
EnvVars: []string{"ACCOUNTS_STORAGE_DISK_PATH"},
Destination: &cfg.Repo.Disk.Path,
},
{
EnvVars: []string{"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"},
Destination: &cfg.Repo.CS3.ProviderAddr,
},
{
EnvVars: []string{"OCIS_JWT_SECRET", "ACCOUNTS_STORAGE_CS3_JWT_SECRET"},
Destination: &cfg.Repo.CS3.JWTSecret,
},
{
EnvVars: []string{"ACCOUNTS_SERVICE_USER_UUID"},
Destination: &cfg.ServiceUser.UUID,
},
{
EnvVars: []string{"ACCOUNTS_SERVICE_USER_USERNAME"},
Destination: &cfg.ServiceUser.Username,
},
{
EnvVars: []string{"ACCOUNTS_SERVICE_USER_UID"},
Destination: &cfg.ServiceUser.UID,
},
{
EnvVars: []string{"ACCOUNTS_SERVICE_USER_GID"},
Destination: &cfg.ServiceUser.GID,
},
{
EnvVars: []string{"ACCOUNTS_UID_INDEX_LOWER_BOUND"},
Destination: &cfg.Index.UID.Lower,
},
{
EnvVars: []string{"ACCOUNTS_GID_INDEX_LOWER_BOUND"},
Destination: &cfg.Index.GID.Lower,
},
{
EnvVars: []string{"ACCOUNTS_UID_INDEX_UPPER_BOUND"},
Destination: &cfg.Index.UID.Upper,
},
{
EnvVars: []string{"ACCOUNTS_GID_INDEX_UPPER_BOUND"},
Destination: &cfg.Index.GID.Upper,
},
}
}
+1 -240
View File
@@ -1,251 +1,12 @@
package flagset
import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/config"
accounts "github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/ocis-pkg/flags"
"github.com/urfave/cli/v2"
)
// RootWithConfig applies cfg to the root flagset
func RootWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "log-level",
Usage: "Set logging level",
EnvVars: []string{"ACCOUNTS_LOG_LEVEL", "OCIS_LOG_LEVEL"},
Destination: &cfg.Log.Level,
},
&cli.BoolFlag{
Name: "log-pretty",
Usage: "Enable pretty logging",
EnvVars: []string{"ACCOUNTS_LOG_PRETTY", "OCIS_LOG_PRETTY"},
Destination: &cfg.Log.Pretty,
},
&cli.BoolFlag{
Name: "log-color",
Usage: "Enable colored logging",
EnvVars: []string{"ACCOUNTS_LOG_COLOR", "OCIS_LOG_COLOR"},
Destination: &cfg.Log.Color,
},
&cli.StringFlag{
Name: "extensions",
Usage: "Run specific extensions during supervised mode",
},
}
}
// ServerWithConfig applies cfg to the root flagset
func ServerWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "log-file",
Usage: "Enable log to file",
EnvVars: []string{"ACCOUNTS_LOG_FILE", "OCIS_LOG_FILE"},
Destination: &cfg.Log.File,
},
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",
EnvVars: []string{"ACCOUNTS_TRACING_ENABLED", "OCIS_TRACING_ENABLED"},
Destination: &cfg.Tracing.Enabled,
},
&cli.StringFlag{
Name: "tracing-type",
Value: flags.OverrideDefaultString(cfg.Tracing.Type, "jaeger"),
Usage: "Tracing backend type",
EnvVars: []string{"ACCOUNTS_TRACING_TYPE", "OCIS_TRACING_TYPE"},
Destination: &cfg.Tracing.Type,
},
&cli.StringFlag{
Name: "tracing-endpoint",
Value: flags.OverrideDefaultString(cfg.Tracing.Endpoint, ""),
Usage: "Endpoint for the agent",
EnvVars: []string{"ACCOUNTS_TRACING_ENDPOINT", "OCIS_TRACING_ENDPOINT"},
Destination: &cfg.Tracing.Endpoint,
},
&cli.StringFlag{
Name: "tracing-collector",
Value: flags.OverrideDefaultString(cfg.Tracing.Collector, ""),
Usage: "Endpoint for the collector",
EnvVars: []string{"ACCOUNTS_TRACING_COLLECTOR", "OCIS_TRACING_COLLECTOR"},
Destination: &cfg.Tracing.Collector,
},
&cli.StringFlag{
Name: "tracing-service",
Value: flags.OverrideDefaultString(cfg.Tracing.Service, "accounts"),
Usage: "Service name for tracing",
EnvVars: []string{"ACCOUNTS_TRACING_SERVICE"},
Destination: &cfg.Tracing.Service,
},
&cli.StringFlag{
Name: "http-namespace",
Value: flags.OverrideDefaultString(cfg.HTTP.Namespace, "com.owncloud.web"),
Usage: "Set the base namespace for the http namespace",
EnvVars: []string{"ACCOUNTS_HTTP_NAMESPACE"},
Destination: &cfg.HTTP.Namespace,
},
&cli.StringFlag{
Name: "http-addr",
Value: flags.OverrideDefaultString(cfg.HTTP.Addr, "0.0.0.0:9181"),
Usage: "Address to bind http server",
EnvVars: []string{"ACCOUNTS_HTTP_ADDR"},
Destination: &cfg.HTTP.Addr,
},
&cli.StringFlag{
Name: "http-root",
Value: flags.OverrideDefaultString(cfg.HTTP.Root, "/"),
Usage: "Root path of http server",
EnvVars: []string{"ACCOUNTS_HTTP_ROOT"},
Destination: &cfg.HTTP.Root,
},
&cli.IntFlag{
Name: "http-cache-ttl",
Value: flags.OverrideDefaultInt(cfg.HTTP.CacheTTL, 604800),
Usage: "Set the static assets caching duration in seconds",
EnvVars: []string{"ACCOUNTS_CACHE_TTL"},
Destination: &cfg.HTTP.CacheTTL,
},
&cli.StringFlag{
Name: "grpc-namespace",
Value: flags.OverrideDefaultString(cfg.GRPC.Namespace, "com.owncloud.api"),
Usage: "Set the base namespace for the grpc namespace",
EnvVars: []string{"ACCOUNTS_GRPC_NAMESPACE"},
Destination: &cfg.GRPC.Namespace,
},
&cli.StringFlag{
Name: "grpc-addr",
Value: flags.OverrideDefaultString(cfg.GRPC.Addr, "0.0.0.0:9180"),
Usage: "Address to bind grpc server",
EnvVars: []string{"ACCOUNTS_GRPC_ADDR"},
Destination: &cfg.GRPC.Addr,
},
&cli.StringFlag{
Name: "name",
Value: flags.OverrideDefaultString(cfg.Server.Name, "accounts"),
Usage: "service name",
EnvVars: []string{"ACCOUNTS_NAME"},
Destination: &cfg.Server.Name,
},
&cli.IntFlag{
Name: "accounts-hash-difficulty",
Value: flags.OverrideDefaultInt(cfg.Server.HashDifficulty, 11),
Usage: "accounts password hash difficulty",
EnvVars: []string{"ACCOUNTS_HASH_DIFFICULTY"},
Destination: &cfg.Server.HashDifficulty,
},
&cli.StringFlag{
Name: "asset-path",
Value: flags.OverrideDefaultString(cfg.Asset.Path, ""),
Usage: "Path to custom assets",
EnvVars: []string{"ACCOUNTS_ASSET_PATH"},
Destination: &cfg.Asset.Path,
},
&cli.StringFlag{
Name: "jwt-secret",
Value: flags.OverrideDefaultString(cfg.TokenManager.JWTSecret, "Pive-Fumkiu4"),
Usage: "Used to create JWT to talk to reva, should equal reva's jwt-secret",
EnvVars: []string{"ACCOUNTS_JWT_SECRET", "OCIS_JWT_SECRET"},
Destination: &cfg.TokenManager.JWTSecret,
},
&cli.StringFlag{
Name: "storage-disk-path",
Value: flags.OverrideDefaultString(cfg.Repo.Disk.Path, ""),
Usage: "Path on the local disk, e.g. /var/tmp/ocis/accounts",
EnvVars: []string{"ACCOUNTS_STORAGE_DISK_PATH"},
Destination: &cfg.Repo.Disk.Path,
},
&cli.StringFlag{
Name: "storage-cs3-provider-addr",
Value: flags.OverrideDefaultString(cfg.Repo.CS3.ProviderAddr, "localhost:9215"),
Usage: "bind address for the metadata storage provider",
EnvVars: []string{"ACCOUNTS_STORAGE_CS3_PROVIDER_ADDR"},
Destination: &cfg.Repo.CS3.ProviderAddr,
},
&cli.StringFlag{
Name: "storage-cs3-data-url",
Value: flags.OverrideDefaultString(cfg.Repo.CS3.DataURL, "http://localhost:9216"),
Usage: "http endpoint of the metadata storage",
EnvVars: []string{"ACCOUNTS_STORAGE_CS3_DATA_URL"},
Destination: &cfg.Repo.CS3.DataURL,
},
&cli.StringFlag{
Name: "storage-cs3-data-prefix",
Value: flags.OverrideDefaultString(cfg.Repo.CS3.DataPrefix, "data"),
Usage: "path prefix for the http endpoint of the metadata storage, without leading slash",
EnvVars: []string{"ACCOUNTS_STORAGE_CS3_DATA_PREFIX"},
Destination: &cfg.Repo.CS3.DataPrefix,
},
&cli.StringFlag{
Name: "storage-cs3-jwt-secret",
Value: flags.OverrideDefaultString(cfg.Repo.CS3.JWTSecret, "Pive-Fumkiu4"),
Usage: "Used to create JWT to talk to reva, should equal reva's jwt-secret",
EnvVars: []string{"ACCOUNTS_STORAGE_CS3_JWT_SECRET", "OCIS_JWT_SECRET"},
Destination: &cfg.Repo.CS3.JWTSecret,
},
&cli.StringFlag{
Name: "service-user-uuid",
Value: flags.OverrideDefaultString(cfg.ServiceUser.UUID, "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad"),
Usage: "uuid of the internal service user (required on EOS)",
EnvVars: []string{"ACCOUNTS_SERVICE_USER_UUID"},
Destination: &cfg.ServiceUser.UUID,
},
&cli.StringFlag{
Name: "service-user-username",
Value: flags.OverrideDefaultString(cfg.ServiceUser.Username, ""),
Usage: "username of the internal service user (required on EOS)",
EnvVars: []string{"ACCOUNTS_SERVICE_USER_USERNAME"},
Destination: &cfg.ServiceUser.Username,
},
&cli.Int64Flag{
Name: "service-user-uid",
Value: flags.OverrideDefaultInt64(cfg.ServiceUser.UID, 0),
Usage: "uid of the internal service user (required on EOS)",
EnvVars: []string{"ACCOUNTS_SERVICE_USER_UID"},
Destination: &cfg.ServiceUser.UID,
},
&cli.Int64Flag{
Name: "service-user-gid",
Value: flags.OverrideDefaultInt64(cfg.ServiceUser.GID, 0),
Usage: "gid of the internal service user (required on EOS)",
EnvVars: []string{"ACCOUNTS_SERVICE_USER_GID"},
Destination: &cfg.ServiceUser.GID,
},
&cli.Int64Flag{
Name: "uid-index-lower-bound",
Value: flags.OverrideDefaultInt64(cfg.Index.UID.Lower, 0),
Usage: "define a starting point for the account UID",
EnvVars: []string{"ACCOUNTS_UID_INDEX_LOWER_BOUND"},
Destination: &cfg.Index.UID.Lower,
},
&cli.Int64Flag{
Name: "gid-index-lower-bound",
Value: flags.OverrideDefaultInt64(cfg.Index.GID.Lower, 1000),
Usage: "define a starting point for the account GID",
EnvVars: []string{"ACCOUNTS_GID_INDEX_LOWER_BOUND"},
Destination: &cfg.Index.GID.Lower,
},
&cli.Int64Flag{
Name: "uid-index-upper-bound",
Value: flags.OverrideDefaultInt64(cfg.Index.UID.Upper, 0),
Usage: "define an ending point for the account UID",
EnvVars: []string{"ACCOUNTS_UID_INDEX_UPPER_BOUND"},
Destination: &cfg.Index.UID.Upper,
},
&cli.Int64Flag{
Name: "gid-index-upper-bound",
Value: flags.OverrideDefaultInt64(cfg.Index.GID.Upper, 1000),
Usage: "define an ending point for the account GID",
EnvVars: []string{"ACCOUNTS_GID_INDEX_UPPER_BOUND"},
Destination: &cfg.Index.GID.Upper,
},
&cli.StringFlag{
Name: "extensions",
Usage: "Run specific extensions during supervised mode",
},
}
}
// UpdateAccountWithConfig applies update command flags to cfg
func UpdateAccountWithConfig(cfg *config.Config, a *accounts.Account) []cli.Flag {
if a.PasswordProfile == nil {
+3 -3
View File
@@ -3,13 +3,13 @@ package proto
import (
context "context"
client "github.com/asim/go-micro/v3/client"
empty "github.com/golang/protobuf/ptypes/empty"
client "go-micro.dev/v4/client"
empty "google.golang.org/protobuf/types/known/emptypb"
)
// MockAccountsService can be used to write tests
/*
To creata a mock overwrite the functions of an instance like this:
To create a mock overwrite the functions of an instance like this:
```go
func mockAccSvc(retErr bool) proto.AccountsService {
File diff suppressed because it is too large Load Diff
+34 -40
View File
@@ -1,24 +1,24 @@
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: accounts.proto
// source: proto/v0/accounts.proto
package proto
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
empty "github.com/golang/protobuf/ptypes/empty"
_ "github.com/golang/protobuf/ptypes/timestamp"
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/protobuf/field_mask"
proto "google.golang.org/protobuf/proto"
emptypb "google.golang.org/protobuf/types/known/emptypb"
_ "google.golang.org/protobuf/types/known/fieldmaskpb"
_ "google.golang.org/protobuf/types/known/timestamppb"
math "math"
)
import (
context "context"
api "github.com/asim/go-micro/v3/api"
client "github.com/asim/go-micro/v3/client"
server "github.com/asim/go-micro/v3/server"
api "go-micro.dev/v4/api"
client "go-micro.dev/v4/client"
server "go-micro.dev/v4/server"
)
// Reference imports to suppress errors if they are not otherwise used.
@@ -26,12 +26,6 @@ var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
// Reference imports to suppress errors if they are not otherwise used.
var _ api.Endpoint
var _ context.Context
@@ -42,35 +36,35 @@ var _ server.Option
func NewAccountsServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
&api.Endpoint{
{
Name: "AccountsService.ListAccounts",
Path: []string{"/api/v0/accounts/accounts-list"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "AccountsService.GetAccount",
Path: []string{"/api/v0/accounts/accounts-get"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "AccountsService.CreateAccount",
Path: []string{"/api/v0/accounts/accounts-create"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "AccountsService.UpdateAccount",
Path: []string{"/api/v0/accounts/accounts-update"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "AccountsService.DeleteAccount",
Path: []string{"/api/v0/accounts/accounts-delete"},
Method: []string{"POST"},
@@ -92,7 +86,7 @@ type AccountsService interface {
// Updates an account
UpdateAccount(ctx context.Context, in *UpdateAccountRequest, opts ...client.CallOption) (*Account, error)
// Deletes an account
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*empty.Empty, error)
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*emptypb.Empty, error)
}
type accountsService struct {
@@ -147,9 +141,9 @@ func (c *accountsService) UpdateAccount(ctx context.Context, in *UpdateAccountRe
return out, nil
}
func (c *accountsService) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*empty.Empty, error) {
func (c *accountsService) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "AccountsService.DeleteAccount", in)
out := new(empty.Empty)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
@@ -169,7 +163,7 @@ type AccountsServiceHandler interface {
// Updates an account
UpdateAccount(context.Context, *UpdateAccountRequest, *Account) error
// Deletes an account
DeleteAccount(context.Context, *DeleteAccountRequest, *empty.Empty) error
DeleteAccount(context.Context, *DeleteAccountRequest, *emptypb.Empty) error
}
func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler, opts ...server.HandlerOption) error {
@@ -178,7 +172,7 @@ func RegisterAccountsServiceHandler(s server.Server, hdlr AccountsServiceHandler
GetAccount(ctx context.Context, in *GetAccountRequest, out *Account) error
CreateAccount(ctx context.Context, in *CreateAccountRequest, out *Account) error
UpdateAccount(ctx context.Context, in *UpdateAccountRequest, out *Account) error
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *empty.Empty) error
DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *emptypb.Empty) error
}
type AccountsService struct {
accountsService
@@ -242,7 +236,7 @@ func (h *accountsServiceHandler) UpdateAccount(ctx context.Context, in *UpdateAc
return h.AccountsServiceHandler.UpdateAccount(ctx, in, out)
}
func (h *accountsServiceHandler) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *empty.Empty) error {
func (h *accountsServiceHandler) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, out *emptypb.Empty) error {
return h.AccountsServiceHandler.DeleteAccount(ctx, in, out)
}
@@ -250,56 +244,56 @@ func (h *accountsServiceHandler) DeleteAccount(ctx context.Context, in *DeleteAc
func NewGroupsServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
&api.Endpoint{
{
Name: "GroupsService.ListGroups",
Path: []string{"/api/v0/accounts/groups-list"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.GetGroup",
Path: []string{"/api/v0/accounts/groups-get"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.CreateGroup",
Path: []string{"/api/v0/accounts/groups-create"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.UpdateGroup",
Path: []string{"/api/v0/accounts/groups-update"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.DeleteGroup",
Path: []string{"/api/v0/accounts/groups-delete"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.AddMember",
Path: []string{"/api/v0/groups/{group_id=*}/members/$ref"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.RemoveMember",
Path: []string{"/api/v0/groups/{group_id=*}/members/{account_id}/$ref"},
Method: []string{"POST"},
Body: "*",
Handler: "rpc",
},
&api.Endpoint{
{
Name: "GroupsService.ListMembers",
Path: []string{"/api/v0/groups/{id=*}/members/$ref"},
Method: []string{"POST"},
@@ -321,7 +315,7 @@ type GroupsService interface {
// Updates a group
UpdateGroup(ctx context.Context, in *UpdateGroupRequest, opts ...client.CallOption) (*Group, error)
// Deletes a group
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*empty.Empty, error)
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*emptypb.Empty, error)
// group:addmember https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
AddMember(ctx context.Context, in *AddMemberRequest, opts ...client.CallOption) (*Group, error)
// group:removemember https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0
@@ -382,9 +376,9 @@ func (c *groupsService) UpdateGroup(ctx context.Context, in *UpdateGroupRequest,
return out, nil
}
func (c *groupsService) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*empty.Empty, error) {
func (c *groupsService) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, opts ...client.CallOption) (*emptypb.Empty, error) {
req := c.c.NewRequest(c.name, "GroupsService.DeleteGroup", in)
out := new(empty.Empty)
out := new(emptypb.Empty)
err := c.c.Call(ctx, req, out, opts...)
if err != nil {
return nil, err
@@ -434,7 +428,7 @@ type GroupsServiceHandler interface {
// Updates a group
UpdateGroup(context.Context, *UpdateGroupRequest, *Group) error
// Deletes a group
DeleteGroup(context.Context, *DeleteGroupRequest, *empty.Empty) error
DeleteGroup(context.Context, *DeleteGroupRequest, *emptypb.Empty) error
// group:addmember https://docs.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=http
AddMember(context.Context, *AddMemberRequest, *Group) error
// group:removemember https://docs.microsoft.com/en-us/graph/api/group-delete-members?view=graph-rest-1.0
@@ -449,7 +443,7 @@ func RegisterGroupsServiceHandler(s server.Server, hdlr GroupsServiceHandler, op
GetGroup(ctx context.Context, in *GetGroupRequest, out *Group) error
CreateGroup(ctx context.Context, in *CreateGroupRequest, out *Group) error
UpdateGroup(ctx context.Context, in *UpdateGroupRequest, out *Group) error
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *empty.Empty) error
DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *emptypb.Empty) error
AddMember(ctx context.Context, in *AddMemberRequest, out *Group) error
RemoveMember(ctx context.Context, in *RemoveMemberRequest, out *Group) error
ListMembers(ctx context.Context, in *ListMembersRequest, out *ListMembersResponse) error
@@ -537,7 +531,7 @@ func (h *groupsServiceHandler) UpdateGroup(ctx context.Context, in *UpdateGroupR
return h.GroupsServiceHandler.UpdateGroup(ctx, in, out)
}
func (h *groupsServiceHandler) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *empty.Empty) error {
func (h *groupsServiceHandler) DeleteGroup(ctx context.Context, in *DeleteGroupRequest, out *emptypb.Empty) error {
return h.GroupsServiceHandler.DeleteGroup(ctx, in, out)
}
@@ -557,7 +551,7 @@ func (h *groupsServiceHandler) ListMembers(ctx context.Context, in *ListMembersR
func NewIndexServiceEndpoints() []*api.Endpoint {
return []*api.Endpoint{
&api.Endpoint{
{
Name: "IndexService.RebuildIndex",
Path: []string{"/api/v0/index/rebuild"},
Method: []string{"POST"},
+11 -10
View File
@@ -10,18 +10,17 @@ import (
"path/filepath"
"testing"
mgrpcc "github.com/asim/go-micro/plugins/client/grpc/v3"
"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/golang/protobuf/ptypes/empty"
"github.com/owncloud/ocis/accounts/pkg/command"
mgrpcc "github.com/asim/go-micro/plugins/client/grpc/v4"
empty "github.com/golang/protobuf/ptypes/empty"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
svc "github.com/owncloud/ocis/accounts/pkg/service/v0"
oclog "github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
settings "github.com/owncloud/ocis/settings/pkg/proto/v0"
"github.com/stretchr/testify/assert"
"go-micro.dev/v4/client"
merrors "go-micro.dev/v4/errors"
"google.golang.org/genproto/protobuf/field_mask"
"google.golang.org/protobuf/types/known/timestamppb"
)
@@ -80,11 +79,13 @@ func init() {
)
cfg := config.New()
cfg.Repo.Backend = "disk"
cfg.Repo.Disk.Path = dataPath
cfg.Server.DemoUsersAndGroups = true
var hdlr *svc.Service
var err error
if hdlr, err = svc.New(svc.Logger(command.NewLogger(cfg)), svc.Config(cfg), svc.RoleService(buildRoleServiceMock())); err != nil {
if hdlr, err = svc.New(svc.Logger(oclog.LoggerFromConfig("accounts", *cfg.Log)), svc.Config(cfg), svc.RoleService(buildRoleServiceMock())); err != nil {
log.Fatalf("Could not create new service")
}
@@ -391,7 +392,7 @@ func deleteGroup(t *testing.T, id string) (*empty.Empty, error) {
// createTmpDir creates a temporary dir for tests data.
func createTmpDir() string {
name, err := ioutil.TempDir("/var/tmp", "ocis-accounts-store-")
name, err := ioutil.TempDir("/tmp", "ocis-accounts-store-")
if err != nil {
panic(err)
}
@@ -543,7 +544,7 @@ func TestUpdateAccount(t *testing.T) {
resp, err := updateAccount(t, tt.userAccount, updateMask)
if tt.expectedErrOnUpdate != nil {
assert.Error(t, err)
assert.Equal(t, tt.expectedErrOnUpdate, err)
assert.Equal(t, tt.expectedErrOnUpdate.Error(), err.Error())
} else {
assert.NoError(t, err)
assert.IsType(t, &proto.Account{}, resp)
@@ -616,7 +617,7 @@ func TestUpdateNonUpdatableFieldsInAccount(t *testing.T) {
errMsg := fmt.Sprintf("can not update field %s, either unknown or readonly", tt.updateMask[0])
assert.Equal(t, errMsg, e.Detail)
} else {
t.Fatal("Expected merror errors but found something else.")
t.Fatal("Expected merrors errors but found something else.")
}
})
}
+32 -62
View File
@@ -396,7 +396,13 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0AddMemberRequest"
"type": "object",
"properties": {
"accountId": {
"type": "string",
"title": "The account id to add"
}
}
}
}
],
@@ -443,7 +449,7 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0RemoveMemberRequest"
"type": "object"
}
}
],
@@ -483,7 +489,26 @@
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v0ListMembersRequest"
"type": "object",
"properties": {
"pageSize": {
"type": "integer",
"format": "int32"
},
"pageToken": {
"type": "string",
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
},
"fieldMask": {
"type": "string",
"description": "Optional. Used to specify a subset of fields that should be\nreturned by a get operation or modified by an update operation."
},
"query": {
"type": "string",
"description": "TODO update query language\nQuery expressions can be used to restrict results based upon\nthe account properties where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe string properties in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n* Query `display_name=Th*` returns accounts whose display_name\nstarts with \"Th\"\n* Query `display_name=\\\\\"Test String\\\\\"` returns groups with\ndisplay names that include both \"Test\" and \"String\"",
"title": "Optional. Search criteria used to select the groups to return.\nIf no search criteria is specified then all groups will be\nreturned"
}
}
}
}
],
@@ -529,14 +554,11 @@
"protobufAny": {
"type": "object",
"properties": {
"typeUrl": {
"@type": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
@@ -689,20 +711,7 @@
"description": "Any refresh tokens or sessions tokens (session cookies) issued before this time are invalid, and applications will get\nan error when using an invalid refresh or sessions token to acquire a delegated access token (to access APIs such as Microsoft Graph).\nIf this happens, the application will need to acquire a new refresh token by making a request to the authorize endpoint.\nRead-only. Use revokeSignInSessions to reset."
}
},
"title": "Account follows the properties of the ms graph api user resuorce.\nSee https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties"
},
"v0AddMemberRequest": {
"type": "object",
"properties": {
"groupId": {
"type": "string",
"title": "The id of the group to add a member to"
},
"accountId": {
"type": "string",
"title": "The account id to add"
}
}
"title": "Account follows the properties of the ms graph api user resource.\nSee https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties"
},
"v0CreateAccountRequest": {
"type": "object",
@@ -948,32 +957,6 @@
}
}
},
"v0ListMembersRequest": {
"type": "object",
"properties": {
"pageSize": {
"type": "integer",
"format": "int32"
},
"pageToken": {
"type": "string",
"title": "Optional. A pagination token returned from a previous call to `Get`\nthat indicates from where search should continue"
},
"fieldMask": {
"type": "string",
"description": "Optional. Used to specify a subset of fields that should be\nreturned by a get operation or modified by an update operation."
},
"query": {
"type": "string",
"description": "TODO update query language\nQuery expressions can be used to restrict results based upon\nthe account properties where the operators `=`, `NOT`, `AND` and `OR`\ncan be used along with the suffix wildcard symbol `*`.\n\nThe string properties in a query expression should use escaped quotes\nfor values that include whitespace to prevent unexpected behavior.\n\nSome example queries are:\n\n* Query `display_name=Th*` returns accounts whose display_name\nstarts with \"Th\"\n* Query `display_name=\\\\\"Test String\\\\\"` returns groups with\ndisplay names that include both \"Test\" and \"String\"",
"title": "Optional. Search criteria used to select the groups to return.\nIf no search criteria is specified then all groups will be\nreturned"
},
"id": {
"type": "string",
"title": "The id of the group to list members from"
}
}
},
"v0ListMembersResponse": {
"type": "object",
"properties": {
@@ -1047,19 +1030,6 @@
"v0RebuildIndexResponse": {
"type": "object"
},
"v0RemoveMemberRequest": {
"type": "object",
"properties": {
"groupId": {
"type": "string",
"title": "The id of the group to remove a member from"
},
"accountId": {
"type": "string",
"title": "The account id to remove"
}
}
},
"v0UpdateAccountRequest": {
"type": "object",
"properties": {
-1
View File
@@ -1 +0,0 @@
checks = ["all", "-ST1003", "-ST1000", "-SA1019"]
+1 -1
View File
@@ -3,11 +3,11 @@ package grpc
import (
"context"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/metrics"
svc "github.com/owncloud/ocis/accounts/pkg/service/v0"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/urfave/cli/v2"
)
// Option defines a single option function.
+1 -1
View File
@@ -3,11 +3,11 @@ package http
import (
"context"
"github.com/micro/cli/v2"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/metrics"
svc "github.com/owncloud/ocis/accounts/pkg/service/v0"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/urfave/cli/v2"
)
// Option defines a single option function.
+10 -3
View File
@@ -1,15 +1,16 @@
package http
import (
"github.com/asim/go-micro/v3"
"github.com/go-chi/chi/v5"
chimiddleware "github.com/go-chi/chi/v5/middleware"
"github.com/owncloud/ocis/accounts/pkg/assets"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/account"
"github.com/owncloud/ocis/ocis-pkg/cors"
"github.com/owncloud/ocis/ocis-pkg/middleware"
"github.com/owncloud/ocis/ocis-pkg/service/http"
"github.com/owncloud/ocis/ocis-pkg/version"
"go-micro.dev/v4"
)
// Server initializes the http service and server.
@@ -33,7 +34,13 @@ func Server(opts ...Option) http.Service {
mux.Use(chimiddleware.RequestID)
mux.Use(middleware.TraceContext)
mux.Use(middleware.NoCache)
mux.Use(middleware.Cors)
mux.Use(middleware.Cors(
cors.Logger(options.Logger),
cors.AllowedOrigins(options.Config.HTTP.CORS.AllowedOrigins),
cors.AllowedMethods(options.Config.HTTP.CORS.AllowedMethods),
cors.AllowedHeaders(options.Config.HTTP.CORS.AllowedHeaders),
cors.AllowCredentials(options.Config.HTTP.CORS.AllowCredentials),
))
mux.Use(middleware.Secure)
mux.Use(middleware.ExtractAccountUUID(
account.Logger(options.Logger),
+5 -5
View File
@@ -16,8 +16,6 @@ import (
"go.opentelemetry.io/otel/attribute"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/gofrs/uuid"
"github.com/golang/protobuf/ptypes/empty"
fieldmask_utils "github.com/mennanov/fieldmask-utils"
@@ -31,6 +29,8 @@ import (
settings "github.com/owncloud/ocis/settings/pkg/proto/v0"
settings_svc "github.com/owncloud/ocis/settings/pkg/service/v0"
"github.com/rs/zerolog"
merrors "go-micro.dev/v4/errors"
"go-micro.dev/v4/metadata"
"golang.org/x/crypto/bcrypt"
"google.golang.org/genproto/protobuf/field_mask"
p "google.golang.org/protobuf/proto"
@@ -276,7 +276,7 @@ func (s Service) ListAccounts(ctx context.Context, in *proto.ListAccountsRequest
}
func (s Service) findAccountsByQuery(ctx context.Context, query string) ([]string, error) {
return s.index.Query(&proto.Account{}, query)
return s.index.Query(ctx, &proto.Account{}, query)
}
// GetAccount implements the AccountsServiceHandler interface
@@ -625,7 +625,7 @@ func (s Service) UpdateAccount(ctx context.Context, in *proto.UpdateAccountReque
return
}
// whitelist of all paths/fields which can be updated by users themself
// whitelist of all paths/fields which can be updated by users themselves
var selfUpdatableAccountPaths = map[string]struct{}{
"DisplayName": {},
"Description": {},
@@ -741,7 +741,7 @@ func validateAccountEmail(serviceID string, a *proto.Account) error {
return nil
}
// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow intergration with our glauth LDAP service
// We want to allow email addresses as usernames so they show up when using them in ACLs on storages that allow integration with our glauth LDAP service
// so we are adding a few restrictions from https://stackoverflow.com/questions/6949667/what-are-the-real-rules-for-linux-usernames-on-centos-6-and-rhel-6
// names should not start with numbers
var usernameRegex = regexp.MustCompile("^[a-zA-Z_][a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*(@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)*$")
@@ -9,9 +9,6 @@ import (
"testing"
"time"
"github.com/asim/go-micro/v3/client"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/asim/go-micro/v3/metadata"
"github.com/golang/protobuf/ptypes/empty"
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
@@ -21,9 +18,12 @@ import (
settings "github.com/owncloud/ocis/settings/pkg/proto/v0"
ssvc "github.com/owncloud/ocis/settings/pkg/service/v0"
"github.com/stretchr/testify/assert"
"go-micro.dev/v4/client"
merrors "go-micro.dev/v4/errors"
"go-micro.dev/v4/metadata"
)
const dataPath = "/var/tmp/ocis-accounts-tests"
const dataPath = "/tmp/ocis-accounts-tests"
var (
roleServiceMock settings.RoleService
@@ -33,6 +33,7 @@ var (
func init() {
cfg := config.New()
cfg.Server.Name = "accounts"
cfg.Repo.Backend = "disk"
cfg.Repo.Disk.Path = dataPath
logger := olog.NewLogger(olog.Color(true), olog.Pretty(true))
roleServiceMock = buildRoleServiceMock()
+3 -3
View File
@@ -5,11 +5,11 @@ import (
"path"
"strconv"
merrors "github.com/asim/go-micro/v3/errors"
"github.com/gofrs/uuid"
"github.com/golang/protobuf/ptypes/empty"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
"github.com/owncloud/ocis/accounts/pkg/storage"
merrors "go-micro.dev/v4/errors"
p "google.golang.org/protobuf/proto"
)
@@ -88,7 +88,7 @@ func (s Service) ListGroups(ctx context.Context, in *proto.ListGroupsRequest, ou
return
}
func (s Service) findGroupsByQuery(ctx context.Context, query string) ([]string, error) {
return s.index.Query(&proto.Group{}, query)
return s.index.Query(ctx, &proto.Group{}, query)
}
// GetGroup implements the GroupsServiceHandler interface
@@ -270,7 +270,7 @@ func (s Service) AddMember(c context.Context, in *proto.AddMemberRequest, out *p
break
}
}
// only store the reference to prevent recurision when marshaling json
// only store the reference to prevent recursion when marshaling json
gref := &proto.Group{
Id: g.Id,
}
+81 -47
View File
@@ -2,13 +2,16 @@ package service
import (
"context"
"errors"
"path"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/owncloud/ocis/ocis-pkg/shared"
"github.com/pkg/errors"
"github.com/owncloud/ocis/ocis-pkg/service/grpc"
"github.com/owncloud/ocis/accounts/pkg/storage"
@@ -48,17 +51,22 @@ func New(opts ...Option) (s *Service, err error) {
roleManager = &m
}
storage, err := createMetadataStorage(cfg, logger)
if err != nil {
return nil, errors.Wrap(err, "could not create metadata storage")
}
s = &Service{
id: cfg.GRPC.Namespace + "." + cfg.Server.Name,
log: logger,
Config: cfg,
RoleService: roleService,
RoleManager: roleManager,
repo: createMetadataStorage(cfg, logger),
repo: storage,
}
r := oreg.GetRegistry()
if cfg.Repo.Disk.Path == "" {
if cfg.Repo.Backend == "cs3" {
if _, err := r.GetService("com.owncloud.storage.metadata"); err != nil {
logger.Error().Err(err).Msg("index: storage-metadata service not present")
return nil, err
@@ -73,11 +81,11 @@ func New(opts ...Option) (s *Service, err error) {
return nil, err
}
if err = s.createDefaultAccounts(); err != nil {
if err = s.createDefaultAccounts(cfg.Server.DemoUsersAndGroups); err != nil {
return nil, err
}
if err = s.createDefaultGroups(); err != nil {
if err = s.createDefaultGroups(cfg.Server.DemoUsersAndGroups); err != nil {
return nil, err
}
return
@@ -103,6 +111,10 @@ func (s Service) buildIndex() (*indexer.Indexer, error) {
func configFromSvc(cfg *config.Config) (*idxcfg.Config, error) {
c := idxcfg.New()
if cfg.Log == nil {
cfg.Log = &shared.Log{}
}
defer func(cfg *config.Config) {
l := log.NewLogger(log.Color(cfg.Log.Color), log.Pretty(cfg.Log.Pretty), log.Level(cfg.Log.Level))
if r := recover(); r != nil {
@@ -113,46 +125,45 @@ func configFromSvc(cfg *config.Config) (*idxcfg.Config, error) {
}
}(cfg)
if (config.Repo{}) != cfg.Repo {
if (config.Disk{}) != cfg.Repo.Disk {
c.Repo = idxcfg.Repo{
Disk: idxcfg.Disk{
Path: cfg.Repo.Disk.Path,
},
}
switch cfg.Repo.Backend {
case "disk":
c.Repo = idxcfg.Repo{
Backend: cfg.Repo.Backend,
Disk: idxcfg.Disk{
Path: cfg.Repo.Disk.Path,
},
}
case "cs3":
c.Repo = idxcfg.Repo{
Backend: cfg.Repo.Backend,
CS3: idxcfg.CS3{
ProviderAddr: cfg.Repo.CS3.ProviderAddr,
JWTSecret: cfg.Repo.CS3.JWTSecret,
},
}
default:
return nil, errors.New("index backend " + cfg.Repo.Backend + " is not supported")
}
if (config.CS3{}) != cfg.Repo.CS3 {
c.Repo = idxcfg.Repo{
CS3: idxcfg.CS3{
ProviderAddr: cfg.Repo.CS3.ProviderAddr,
DataURL: cfg.Repo.CS3.DataURL,
DataPrefix: cfg.Repo.CS3.DataPrefix,
JWTSecret: cfg.Repo.CS3.JWTSecret,
},
}
if (config.Index{}) != cfg.Index {
c.Index = idxcfg.Index{
UID: idxcfg.Bound{
Lower: cfg.Index.UID.Lower,
},
GID: idxcfg.Bound{
Lower: cfg.Index.GID.Lower,
},
}
}
if (config.Index{}) != cfg.Index {
c.Index = idxcfg.Index{
UID: idxcfg.Bound{
Lower: cfg.Index.UID.Lower,
},
GID: idxcfg.Bound{
Lower: cfg.Index.GID.Lower,
},
}
}
if (config.ServiceUser{}) != cfg.ServiceUser {
c.ServiceUser = cfg.ServiceUser
}
if (config.ServiceUser{}) != cfg.ServiceUser {
c.ServiceUser = cfg.ServiceUser
}
return c, nil
}
func (s Service) createDefaultAccounts() (err error) {
func (s Service) createDefaultAccounts(withDemoAccounts bool) (err error) {
accounts := []proto.Account{
{
Id: "4c510ada-c86b-4815-8820-42cdf82c3d51",
@@ -278,8 +289,19 @@ func (s Service) createDefaultAccounts() (err error) {
},
},
}
mustHaveAccounts := map[string]bool{
"bc596f3c-c955-4328-80a0-60d018b4ad57": true, // Reva IOP
"820ba2a1-3f54-4538-80a4-2d73007e30bf": true, // Kopano IDP
"ddc2004c-0977-11eb-9d3f-a793888cd0f8": true, // admin
}
// this only deals with the metadata service.
for i := range accounts {
if !withDemoAccounts && !mustHaveAccounts[accounts[i].Id] {
continue
}
a := &proto.Account{}
err := s.repo.LoadAccount(context.Background(), accounts[i].Id, a)
if !storage.IsNotFoundErr(err) {
@@ -323,7 +345,7 @@ func (s Service) createDefaultAccounts() (err error) {
return nil
}
func (s Service) createDefaultGroups() (err error) {
func (s Service) createDefaultGroups(withDemoGroups bool) (err error) {
groups := []proto.Group{
{Id: "34f38767-c937-4eb6-b847-1c175829a2a0", GidNumber: 15000, OnPremisesSamAccountName: "sysusers", DisplayName: "Technical users", Description: "A group for technical users. They should not show up in sharing dialogs.", Members: []*proto.Account{
{Id: "820ba2a1-3f54-4538-80a4-2d73007e30bf"}, // idp
@@ -358,7 +380,17 @@ func (s Service) createDefaultGroups() (err error) {
{Id: "932b4540-8d16-481e-8ef4-588e4b6b151c"}, // feynman
}},
}
mustHaveGroups := map[string]bool{
"34f38767-c937-4eb6-b847-1c175829a2a0": true, // sysusers
"509a9dcd-bb37-4f4f-a01a-19dca27d9cfa": true, // users
}
for i := range groups {
if !withDemoGroups && !mustHaveGroups[groups[i].Id] {
continue
}
g := &proto.Group{}
err := s.repo.LoadGroup(context.Background(), groups[i].Id, g)
if !storage.IsNotFoundErr(err) {
@@ -396,17 +428,19 @@ func (s Service) createDefaultGroups() (err error) {
return nil
}
func createMetadataStorage(cfg *config.Config, logger log.Logger) storage.Repo {
// for now we detect the used storage implementation based on which storage is configured
// the config with defaults needs to be checked last
if cfg.Repo.Disk.Path != "" {
return storage.NewDiskRepo(cfg, logger)
func createMetadataStorage(cfg *config.Config, logger log.Logger) (storage.Repo, error) {
switch cfg.Repo.Backend {
case "disk":
return storage.NewDiskRepo(cfg, logger), nil
case "cs3":
repo, err := storage.NewCS3Repo(cfg)
if err != nil {
return nil, errors.Wrap(err, "cs3 backend was configured but failed to start")
}
return repo, nil
default:
return nil, errors.New("backend type " + cfg.Repo.Backend + " is not supported")
}
repo, err := storage.NewCS3Repo(cfg)
if err != nil {
logger.Fatal().Err(err).Msg("cs3 storage was configured but failed to start")
}
return repo
}
// Service implements the AccountsServiceHandler interface
+56 -123
View File
@@ -1,15 +1,10 @@
package storage
import (
"bytes"
"context"
"encoding/json"
"io"
"io/ioutil"
"net/http"
"path"
"path/filepath"
"strings"
"github.com/cs3org/reva/pkg/auth/scope"
@@ -23,15 +18,20 @@ import (
"github.com/owncloud/ocis/accounts/pkg/config"
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
olog "github.com/owncloud/ocis/ocis-pkg/log"
metadatastorage "github.com/owncloud/ocis/ocis-pkg/metadata_storage"
"google.golang.org/grpc/metadata"
)
const (
storageMountPath = "/meta"
)
// CS3Repo provides a cs3 implementation of the Repo interface
type CS3Repo struct {
cfg *config.Config
tm token.Manager
storageProvider provider.ProviderAPIClient
dataProvider dataProviderClient // Used to create and download data via http, bypassing reva upload protocol
metadataStorage metadatastorage.MetadataStorage
}
// NewCS3Repo creates a new cs3 repo
@@ -49,26 +49,26 @@ func NewCS3Repo(cfg *config.Config) (Repo, error) {
return nil, err
}
ms, err := metadatastorage.NewMetadataStorage(cfg.Repo.CS3.ProviderAddr)
if err != nil {
return nil, err
}
return CS3Repo{
cfg: cfg,
tm: tokenManager,
storageProvider: client,
dataProvider: dataProviderClient{
client: http.Client{
Transport: http.DefaultTransport,
},
},
metadataStorage: ms,
}, nil
}
// WriteAccount writes an account via cs3 and modifies the provided account (e.g. with a generated id).
func (r CS3Repo) WriteAccount(ctx context.Context, a *proto.Account) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
if err := r.makeRootDirIfNotExist(ctx, accountsFolder); err != nil {
return err
}
@@ -78,37 +78,31 @@ func (r CS3Repo) WriteAccount(ctx context.Context, a *proto.Account) (err error)
return err
}
resp, err := r.dataProvider.put(r.accountURL(a.Id), bytes.NewReader(by), t)
if err != nil {
return err
}
if err = resp.Body.Close(); err != nil {
return err
}
return nil
err = r.metadataStorage.SimpleUpload(ctx, r.accountURL(a.Id), by)
return err
}
// LoadAccount loads an account via cs3 by id and writes it to the provided account
func (r CS3Repo) LoadAccount(ctx context.Context, id string, a *proto.Account) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
return r.loadAccount(id, t, a)
return r.loadAccount(ctx, id, a)
}
// LoadAccounts loads all the accounts from the cs3 api
func (r CS3Repo) LoadAccounts(ctx context.Context, a *[]*proto.Account) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
res, err := r.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{
Ref: &provider.Reference{
Path: path.Join("/meta", accountsFolder),
Path: path.Join(storageMountPath, accountsFolder),
},
})
if err != nil {
@@ -118,7 +112,7 @@ func (r CS3Repo) LoadAccounts(ctx context.Context, a *[]*proto.Account) (err err
log := olog.NewLogger(olog.Pretty(r.cfg.Log.Pretty), olog.Color(r.cfg.Log.Color), olog.Level(r.cfg.Log.Level))
for i := range res.Infos {
acc := &proto.Account{}
err := r.loadAccount(filepath.Base(res.Infos[i].Path), t, acc)
err := r.loadAccount(ctx, filepath.Base(res.Infos[i].Path), acc)
if err != nil {
log.Err(err).Msg("could not load account")
continue
@@ -128,38 +122,27 @@ func (r CS3Repo) LoadAccounts(ctx context.Context, a *[]*proto.Account) (err err
return nil
}
func (r CS3Repo) loadAccount(id string, t string, a *proto.Account) error {
resp, err := r.dataProvider.get(r.accountURL(id), t)
func (r CS3Repo) loadAccount(ctx context.Context, id string, a *proto.Account) error {
account, err := r.metadataStorage.SimpleDownload(ctx, r.accountURL(id))
if err != nil {
if metadatastorage.IsNotFoundErr(err) {
return &notFoundErr{"account", id}
}
return err
}
if resp.StatusCode != http.StatusOK {
return &notFoundErr{"account", id}
}
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
if err = resp.Body.Close(); err != nil {
return err
}
return json.Unmarshal(b, &a)
return json.Unmarshal(account, &a)
}
// DeleteAccount deletes an account via cs3 by id
func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{
Ref: &provider.Reference{
Path: path.Join("/meta", accountsFolder, id),
Path: path.Join(storageMountPath, accountsFolder, id),
},
})
@@ -177,12 +160,11 @@ func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) {
// WriteGroup writes a group via cs3 and modifies the provided group (e.g. with a generated id).
func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
if err := r.makeRootDirIfNotExist(ctx, groupsFolder); err != nil {
return err
}
@@ -192,37 +174,30 @@ func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) {
return err
}
resp, err := r.dataProvider.put(r.groupURL(g.Id), bytes.NewReader(by), t)
if err != nil {
return err
}
if err = resp.Body.Close(); err != nil {
return err
}
return nil
err = r.metadataStorage.SimpleUpload(ctx, r.groupURL(g.Id), by)
return err
}
// LoadGroup loads a group via cs3 by id and writes it to the provided group
func (r CS3Repo) LoadGroup(ctx context.Context, id string, g *proto.Group) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
return r.loadGroup(id, t, g)
return r.loadGroup(ctx, id, g)
}
// LoadGroups loads all the groups from the cs3 api
func (r CS3Repo) LoadGroups(ctx context.Context, g *[]*proto.Group) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
res, err := r.storageProvider.ListContainer(ctx, &provider.ListContainerRequest{
Ref: &provider.Reference{
Path: path.Join("/meta", groupsFolder),
Path: path.Join(storageMountPath, groupsFolder),
},
})
if err != nil {
@@ -232,7 +207,7 @@ func (r CS3Repo) LoadGroups(ctx context.Context, g *[]*proto.Group) (err error)
log := olog.NewLogger(olog.Pretty(r.cfg.Log.Pretty), olog.Color(r.cfg.Log.Color), olog.Level(r.cfg.Log.Level))
for i := range res.Infos {
grp := &proto.Group{}
err := r.loadGroup(filepath.Base(res.Infos[i].Path), t, grp)
err := r.loadGroup(ctx, filepath.Base(res.Infos[i].Path), grp)
if err != nil {
log.Err(err).Msg("could not load account")
continue
@@ -242,38 +217,27 @@ func (r CS3Repo) LoadGroups(ctx context.Context, g *[]*proto.Group) (err error)
return nil
}
func (r CS3Repo) loadGroup(id string, t string, g *proto.Group) error {
resp, err := r.dataProvider.get(r.groupURL(id), t)
func (r CS3Repo) loadGroup(ctx context.Context, id string, g *proto.Group) error {
group, err := r.metadataStorage.SimpleDownload(ctx, r.groupURL(id))
if err != nil {
if metadatastorage.IsNotFoundErr(err) {
return &notFoundErr{"group", id}
}
return err
}
if resp.StatusCode == http.StatusNotFound {
return &notFoundErr{"group", id}
}
b, err := ioutil.ReadAll(resp.Body)
if err != nil {
return err
}
if err = resp.Body.Close(); err != nil {
return err
}
return json.Unmarshal(b, &g)
return json.Unmarshal(group, &g)
}
// DeleteGroup deletes a group via cs3 by id
func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) {
t, err := r.authenticate(ctx)
ctx, err = r.getAuthenticatedContext(ctx)
if err != nil {
return err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
resp, err := r.storageProvider.Delete(ctx, &provider.DeleteRequest{
Ref: &provider.Reference{
Path: path.Join("/meta", groupsFolder, id),
Path: path.Join(storageMountPath, groupsFolder, id),
},
})
@@ -289,8 +253,13 @@ func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) {
return err
}
func (r CS3Repo) authenticate(ctx context.Context) (token string, err error) {
return AuthenticateCS3(ctx, r.cfg.ServiceUser, r.tm)
func (r CS3Repo) getAuthenticatedContext(ctx context.Context) (context.Context, error) {
t, err := AuthenticateCS3(ctx, r.cfg.ServiceUser, r.tm)
if err != nil {
return nil, err
}
ctx = metadata.AppendToOutgoingContext(ctx, revactx.TokenHeader, t)
return ctx, nil
}
// AuthenticateCS3 mints an auth token for communicating with cs3 storage based on a service user from config
@@ -298,6 +267,7 @@ func AuthenticateCS3(ctx context.Context, su config.ServiceUser, tm token.Manage
u := &user.User{
Id: &user.UserId{
OpaqueId: su.UUID,
Type: user.UserType_USER_TYPE_APPLICATION,
},
Groups: []string{},
UidNumber: su.UID,
@@ -311,11 +281,11 @@ func AuthenticateCS3(ctx context.Context, su config.ServiceUser, tm token.Manage
}
func (r CS3Repo) accountURL(id string) string {
return singleJoiningSlash(r.cfg.Repo.CS3.DataURL, path.Join(r.cfg.Repo.CS3.DataPrefix, accountsFolder, id))
return path.Join(accountsFolder, id)
}
func (r CS3Repo) groupURL(id string) string {
return singleJoiningSlash(r.cfg.Repo.CS3.DataURL, path.Join(r.cfg.Repo.CS3.DataPrefix, groupsFolder, id))
return path.Join(groupsFolder, id)
}
func (r CS3Repo) makeRootDirIfNotExist(ctx context.Context, folder string) error {
@@ -325,7 +295,7 @@ func (r CS3Repo) makeRootDirIfNotExist(ctx context.Context, folder string) error
// MakeDirIfNotExist will create a root node in the metadata storage. Requires an authenticated context.
func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, folder string) error {
var rootPathRef = &provider.Reference{
Path: path.Join("/meta", folder),
Path: path.Join(storageMountPath, folder),
}
resp, err := sp.Stat(ctx, &provider.StatRequest{
@@ -348,40 +318,3 @@ func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, folde
return nil
}
// TODO: this is copied from proxy. Find a better solution or move it to ocis-pkg
func singleJoiningSlash(a, b string) string {
aslash := strings.HasSuffix(a, "/")
bslash := strings.HasPrefix(b, "/")
switch {
case aslash && bslash:
return a + b[1:]
case !aslash && !bslash:
return a + "/" + b
}
return a + b
}
type dataProviderClient struct {
client http.Client
}
func (d dataProviderClient) put(url string, body io.Reader, token string) (*http.Response, error) {
req, err := http.NewRequest(http.MethodPut, url, body)
if err != nil {
return nil, err
}
req.Header.Add(revactx.TokenHeader, token)
return d.client.Do(req)
}
func (d dataProviderClient) get(url string, token string) (*http.Response, error) {
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
req.Header.Add(revactx.TokenHeader, token)
return d.client.Do(req)
}
-2
View File
@@ -17,8 +17,6 @@ package storage
// Repo: config.Repo{
// CS3: config.CS3{
// ProviderAddr: "0.0.0.0:9215",
// DataURL: "http://localhost:9216",
// DataPrefix: "data",
// },
// },
//}
+1 -1
View File
@@ -8,7 +8,7 @@ type notFoundErr struct {
typ, id string
}
func (e *notFoundErr) Error() string {
func (e notFoundErr) Error() string {
return fmt.Sprintf("%s with id %s not found", e.typ, e.id)
}
@@ -247,7 +247,7 @@ message DeleteAccountRequest {
string id = 1;
}
// Account follows the properties of the ms graph api user resuorce.
// Account follows the properties of the ms graph api user resource.
// See https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties
message Account {
@@ -383,7 +383,7 @@ message Account {
repeated OnPremisesProvisioningError on_premises_provisioning_errors = 29;
// TODO do we need to sync uidnumber and gidnumber from the external ldap? we may assign different numbers so eos has a non colliding namespace.
// we can sync them to the (uid|gid)_number fileds but what if they changed in the external ldap and now collide?
// we can sync them to the (uid|gid)_number fields but what if they changed in the external ldap and now collide?
// move those properties to a posixaccount message so we can exchange that part with an external (readonly or writeable) ldap server?
// For an external user invited to the tenant using the invitation API, this property represents the invited user's invitation status.
+2 -2
View File
@@ -45,9 +45,9 @@ If you prefer to configure the service with environment variables you can see th
If multiple variables are listed for one option, they are in order of precedence. This means the leftmost variable will always win if given.
### Commandline flags
### Command-line 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.
If you prefer to configure the service with command-line 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) -}}
+1 -1
View File
@@ -1,5 +1,5 @@
/**
* Asserts wheter the given object is empty
* Asserts whether the given object is empty
* @param {Object} obj Object to be checked
* @returns {Boolean}
*/
@@ -1,6 +1,6 @@
const assert = require('assert')
const { client } = require('nightwatch-api')
const { Given, When, Then } = require('cucumber')
const { Given, When, Then } = require('@cucumber/cucumber')
When('the user browses to the accounts page', function () {
return client.page.accountsPage().navigateAndWaitUntilMounted()
+2 -8
View File
@@ -6,12 +6,6 @@ then
exit 1
fi
if [ -z "$OCIS_SKELETON_DIR" ]
then
echo "OCIS_SKELETON_DIR env variable is not set, cannot find skeleton directory"
exit 1
fi
if [ -z "$WEB_UI_CONFIG" ]
then
echo "WEB_UI_CONFIG env variable is not set, cannot find web config file"
@@ -31,7 +25,7 @@ then
cleanup=true
testFolder=$(mktemp -d -p .)
printf "creating folder $testFolder for Test infrastructure setup\n\n"
export TEST_INFRA_DIRECTORY=$testFolder/tests
export TEST_INFRA_DIRECTORY=$(realpath $testFolder)
fi
clean_up() {
@@ -46,7 +40,7 @@ clean_up() {
trap clean_up SIGHUP SIGINT SIGTERM EXIT
cp -r "$WEB_PATH"/tests "$testFolder"
cp -r $(ls -d "$WEB_PATH"/tests/acceptance/* | grep -v 'node_modules') "$testFolder"
export SERVER_HOST=${SERVER_HOST:-https://localhost:9200}
export BACKEND_HOST=${BACKEND_HOST:-https://localhost:9200}
+11841 -8311
View File
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
Change: Remove OnlyOffice extension
Tags: OnlyOffice
We've removed the OnlyOffice extension in oCIS.
OnlyOffice has their own web extension for OC10 backend now with [a dedicated guide](https://owncloud.dev/clients/web/deployments/oc10-app/#onlyoffice).
In oCIS, we will follow up with a guide on how to start a WOPI server providing OnlyOffice soon.
https://github.com/owncloud/ocis/pull/2433
@@ -1,5 +1,5 @@
Enhancement: Update go-chi/chi to version 5.0.3
Updated go-chi/chi to the lastest release
Updated go-chi/chi to the latest release
https://github.com/owncloud/ocis/pull/2429
@@ -0,0 +1,16 @@
Enhancement: Update reva to v1.13.0
This update includes:
* Bugfix [cs3org/reva#2054](https://github.com/cs3org/reva/pull/2054): Fix the response after deleting a share
* Bugfix [cs3org/reva#2026](https://github.com/cs3org/reva/pull/2026): Fix moving of a shared file
* Bugfix [cs3org/reva#1605](https://github.com/cs3org/reva/pull/1605): Allow to expose full paths in OCS API
* Bugfix [cs3org/reva#2033](https://github.com/cs3org/reva/pull/2033): Fix the storage id of shares
* Bugfix [cs3org/reva#1991](https://github.com/cs3org/reva/pull/1991): Remove share references when declining shares
* Enhancement [cs3org/reva#1994](https://github.com/cs3org/reva/pull/1994): Add owncloudsql driver for the userprovider
* Enhancement [cs3org/reva#2065](https://github.com/cs3org/reva/pull/2065): New sharing role Manager
* Enhancement [cs3org/reva#2015](https://github.com/cs3org/reva/pull/2015): Add spaces to the list of capabilities
* Enhancement [cs3org/reva#2041](https://github.com/cs3org/reva/pull/2041): Create operations for Spaces
* Enhancement [cs3org/reva#2029](https://github.com/cs3org/reva/pull/2029): Tracing agent configuration
https://github.com/owncloud/ocis/pull/2477
@@ -0,0 +1,8 @@
Change: Update ownCloud Web to v4.2.0
Tags: web
We updated ownCloud Web to v4.2.0. Please refer to the changelog (linked) for details on the web release.
https://github.com/owncloud/ocis/pull/2501
https://github.com/owncloud/web/releases/tag/v4.2.0

Some files were not shown because too many files have changed in this diff Show More