Compare commits
305
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8abd60525 | ||
|
|
5dd03dd50a | ||
|
|
dbaefed8ee | ||
|
|
3ce88ceb95 | ||
|
|
84bb03acd6 | ||
|
|
0a22512488 | ||
|
|
a322f2362a | ||
|
|
9efa21bec3 | ||
|
|
ec0b3b10af | ||
|
|
61cd1a3e13 | ||
|
|
f66ee2c855 | ||
|
|
cdd72e3a3d | ||
|
|
a811a1f8a4 | ||
|
|
c34503ef53 | ||
|
|
c523ae80b5 | ||
|
|
f3e02e0954 | ||
|
|
9788b534dc | ||
|
|
ab00331db4 | ||
|
|
d04d93bc82 | ||
|
|
6be6c569ba | ||
|
|
e573990487 | ||
|
|
88e704ee07 | ||
|
|
35c17d71de | ||
|
|
88968c948e | ||
|
|
4a0592d248 | ||
|
|
8d13e11c7d | ||
|
|
7ecb7cc2e1 | ||
|
|
bc15db125f | ||
|
|
8e49026545 | ||
|
|
19bc15e124 | ||
|
|
83c13e3965 | ||
|
|
2b0d9aa9b0 | ||
|
|
cc7144d9d1 | ||
|
|
0f410479de | ||
|
|
3d4293c7a0 | ||
|
|
7f65dfba34 | ||
|
|
f67e6242ee | ||
|
|
5d19062075 | ||
|
|
a81ba03d55 | ||
|
|
551e38e21f | ||
|
|
3f64fb0cf9 | ||
|
|
4f16d470b4 | ||
|
|
53e57200e6 | ||
|
|
4c4ce98d9d | ||
|
|
a9e0ecf12e | ||
|
|
6fffe04120 | ||
|
|
5a8ea03312 | ||
|
|
981bd81fdc | ||
|
|
1d25f03deb | ||
|
|
6fe417e729 | ||
|
|
b2ac10e925 | ||
|
|
13e06bb18c | ||
|
|
44d85913f3 | ||
|
|
26040a0c15 | ||
|
|
49d275cb33 | ||
|
|
6acf998329 | ||
|
|
a4406805fe | ||
|
|
23571e7d47 | ||
|
|
3a0f43a4ab | ||
|
|
64f4a963cc | ||
|
|
4f13ac6fef | ||
|
|
90d5ef3c9d | ||
|
|
b0745e115f | ||
|
|
1024fe3e88 | ||
|
|
f4d338b825 | ||
|
|
cf67d2502b | ||
|
|
31f2bb778d | ||
|
|
02a9247e80 | ||
|
|
b2b11c4de8 | ||
|
|
e91cf64a7b | ||
|
|
a6b1bae29e | ||
|
|
1c2d8d97ad | ||
|
|
cf266429cd | ||
|
|
517356f176 | ||
|
|
1f185c1fe6 | ||
|
|
0f6308448a | ||
|
|
20125eff9d | ||
|
|
a99f725c00 | ||
|
|
1090d3c961 | ||
|
|
0e9c1e5a68 | ||
|
|
6c555e25d0 | ||
|
|
c049a3ecfb | ||
|
|
09021c02a1 | ||
|
|
763d294a9b | ||
|
|
10f190d7f4 | ||
|
|
081ad66b89 | ||
|
|
6d0ac681c8 | ||
|
|
17ca9c4165 | ||
|
|
536bf301f7 | ||
|
|
6571d42377 | ||
|
|
1271b67758 | ||
|
|
3f39567373 | ||
|
|
fd6b0016b4 | ||
|
|
213956c58f | ||
|
|
31f08da4a7 | ||
|
|
0b96121ea3 | ||
|
|
6eac77b7d7 | ||
|
|
3c16713869 | ||
|
|
cf0f096bb0 | ||
|
|
1265fd6bc2 | ||
|
|
a463984c56 | ||
|
|
e187072d38 | ||
|
|
10b3a61f43 | ||
|
|
e47466ca22 | ||
|
|
59770ef968 | ||
|
|
7bc6596924 | ||
|
|
ed417ea1c9 | ||
|
|
40062ca6d6 | ||
|
|
fd99aef90b | ||
|
|
4cc088d0ea | ||
|
|
e0a35d37c3 | ||
|
|
ae50a4d507 | ||
|
|
1e35c983a1 | ||
|
|
00f614497d | ||
|
|
ade7a1c675 | ||
|
|
6e2ebc068d | ||
|
|
781cd3d6a3 | ||
|
|
cd8c539cbb | ||
|
|
026b970c54 | ||
|
|
eec49616d0 | ||
|
|
0cf3810009 | ||
|
|
cc825d5658 | ||
|
|
7a0e28a420 | ||
|
|
439c20307d | ||
|
|
ec93e423bd | ||
|
|
0773b66325 | ||
|
|
6abf38dd3a | ||
|
|
661baaab67 | ||
|
|
3a59c7ec4c | ||
|
|
5bf1829231 | ||
|
|
b3a1a14740 | ||
|
|
380f1c9dcc | ||
|
|
1960080c59 | ||
|
|
ad6c2e1d6d | ||
|
|
e3e1c79bb5 | ||
|
|
c7b23e1956 | ||
|
|
e98b180c11 | ||
|
|
e39bb860ae | ||
|
|
3890ecd99d | ||
|
|
62824341b2 | ||
|
|
7d17d3f5a0 | ||
|
|
8550a4f07e | ||
|
|
5a67a2098c | ||
|
|
b0ea1deb91 | ||
|
|
58ac0ce367 | ||
|
|
100fb99d1a | ||
|
|
0309dd532c | ||
|
|
67b5458894 | ||
|
|
d54f75df8b | ||
|
|
b7c934b1b1 | ||
|
|
edf845225a | ||
|
|
65b3c97a6c | ||
|
|
51d1eb0182 | ||
|
|
899510b158 | ||
|
|
e5cae733b1 | ||
|
|
2d4d90ad3c | ||
|
|
6cd3827e2d | ||
|
|
417b112863 | ||
|
|
a7fe756004 | ||
|
|
7f02ab1652 | ||
|
|
5ea1cec83a | ||
|
|
50d3ef44a4 | ||
|
|
96ad1708fd | ||
|
|
6afa610f08 | ||
|
|
2d44e9e07b | ||
|
|
0d362aec3f | ||
|
|
6b3775af9c | ||
|
|
3964fc9aa9 | ||
|
|
5bd453c5a5 | ||
|
|
959bbbe9c7 | ||
|
|
a60c686de4 | ||
|
|
22bb75a5e4 | ||
|
|
f01263859b | ||
|
|
2fa08495f7 | ||
|
|
ef642ac135 | ||
|
|
5f5e935f7a | ||
|
|
41bdfb6668 | ||
|
|
a01cd1f0ee | ||
|
|
1a9d4462b6 | ||
|
|
43321cc2cf | ||
|
|
0de5dac34c | ||
|
|
c829dbe577 | ||
|
|
6aeb80f771 | ||
|
|
343fc0a73c | ||
|
|
46643b049e | ||
|
|
5f45e77967 | ||
|
|
7f0fff0806 | ||
|
|
c7952c247d | ||
|
|
9a4737d3ed | ||
|
|
0264f09b6c | ||
|
|
249d4eae97 | ||
|
|
351733c110 | ||
|
|
a9d713d267 | ||
|
|
5ac6bfa1be | ||
|
|
6b2953a357 | ||
|
|
fb5c3859eb | ||
|
|
2fa5788ca4 | ||
|
|
3a34e64dde | ||
|
|
4bafd761f4 | ||
|
|
a88c532e9c | ||
|
|
ab35492578 | ||
|
|
b69f3a0a7d | ||
|
|
911f648769 | ||
|
|
1bb17b19d7 | ||
|
|
a86176838d | ||
|
|
59eaf7c1b8 | ||
|
|
c7d6aa6186 | ||
|
|
77d9e77e91 | ||
|
|
9734b000b3 | ||
|
|
f2e8c90067 | ||
|
|
9283a0bc35 | ||
|
|
ee584bf865 | ||
|
|
bc3be2d640 | ||
|
|
77e3e5a900 | ||
|
|
002b77019b | ||
|
|
a01dbd789a | ||
|
|
3a854d8349 | ||
|
|
71235e1e2d | ||
|
|
3084fa8341 | ||
|
|
a1d170c9f7 | ||
|
|
4017d20cb2 | ||
|
|
3e2d1582a3 | ||
|
|
0edbf9147c | ||
|
|
f0954b2197 | ||
|
|
26abb6361b | ||
|
|
436399e8ea | ||
|
|
dc324b2e2b | ||
|
|
139e437b97 | ||
|
|
cb5e38f4cb | ||
|
|
7c85fafb54 | ||
|
|
95ae3b8762 | ||
|
|
70afcf52eb | ||
|
|
773ada6873 | ||
|
|
1609bb3a7c | ||
|
|
f0671015f8 | ||
|
|
0dcf9524f0 | ||
|
|
40cfa90b28 | ||
|
|
0487ed994f | ||
|
|
2f55febc52 | ||
|
|
8393a7789c | ||
|
|
c15738716f | ||
|
|
a12f228b71 | ||
|
|
9f8e7e8a93 | ||
|
|
f4619dbb47 | ||
|
|
7bfeb162bc | ||
|
|
64fdc09fc5 | ||
|
|
b7ce1c6815 | ||
|
|
c14903cfe7 | ||
|
|
eea1e23d1b | ||
|
|
37b56d920e | ||
|
|
d7d6a33aaf | ||
|
|
98e5a320a8 | ||
|
|
0af1c98d38 | ||
|
|
d8242232e4 | ||
|
|
429ed2ee76 | ||
|
|
1205d3489e | ||
|
|
1d98e4827e | ||
|
|
d6182a4ea1 | ||
|
|
fc5a67c45e | ||
|
|
6ff9df9f58 | ||
|
|
f1257a5a37 | ||
|
|
3892598bbb | ||
|
|
2ae4959afb | ||
|
|
0849563810 | ||
|
|
78962ec498 | ||
|
|
66f4198e12 | ||
|
|
b8aaed66a0 | ||
|
|
26852f1850 | ||
|
|
3a60056bb3 | ||
|
|
4306c22860 | ||
|
|
13600c2225 | ||
|
|
914e979d28 | ||
|
|
6c973fe10a | ||
|
|
396adf2306 | ||
|
|
634c69e2b8 | ||
|
|
d7e48b8721 | ||
|
|
da3fc4c898 | ||
|
|
8f10226963 | ||
|
|
ba698aa6d9 | ||
|
|
15ac5d8999 | ||
|
|
085dcd9a14 | ||
|
|
1cde2fa36b | ||
|
|
0d49316495 | ||
|
|
62ec3cf801 | ||
|
|
fd78a662fd | ||
|
|
7731de91f1 | ||
|
|
c80022b0c6 | ||
|
|
a647f56bb0 | ||
|
|
f64280188a | ||
|
|
7fcf6f5aa0 | ||
|
|
a873fdc942 | ||
|
|
492419ec7b | ||
|
|
4c22c07711 | ||
|
|
e23448f581 | ||
|
|
588a731d6d | ||
|
|
2452d01506 | ||
|
|
11a8b75b2e | ||
|
|
721026654d | ||
|
|
45c85f4237 | ||
|
|
a762e3cf69 | ||
|
|
25191fe7d7 | ||
|
|
297a0063ab | ||
|
|
0d4f8df2f6 | ||
|
|
534e561f2e | ||
|
|
59527e118d |
No files matched your search
@@ -47,12 +47,6 @@ $(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod
|
||||
@echo "(re)installing $(GOBIN)/golangci-lint-v1.43.0"
|
||||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.43.0 "github.com/golangci/golangci-lint/cmd/golangci-lint"
|
||||
|
||||
GOX := $(GOBIN)/gox-v1.0.1
|
||||
$(GOX): $(BINGO_DIR)/gox.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)/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.91.0
|
||||
$(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.
|
||||
@@ -106,4 +100,3 @@ $(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.1"
|
||||
@cd $(BINGO_DIR) && $(GO) build -mod=mod -modfile=reflex.mod -o=$(GOBIN)/reflex-v0.3.1 "github.com/cespare/reflex"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT
|
||||
|
||||
go 1.17
|
||||
|
||||
require github.com/mitchellh/gox v1.0.1
|
||||
@@ -1,6 +0,0 @@
|
||||
github.com/hashicorp/go-version v1.0.0 h1:21MVWPKDphxa7ineQQTrCU5brh7OuVVAzGOCnnCPtE8=
|
||||
github.com/hashicorp/go-version v1.0.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/mitchellh/gox v1.0.1 h1:x0jD3dcHk9a9xPSDN6YEL4xL6Qz0dvNYm8yZqui5chI=
|
||||
github.com/mitchellh/gox v1.0.1/go.mod h1:ED6BioOGXMswlXa2zxfh/xdd5QhwYliBFn9V18Ap4z4=
|
||||
github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY=
|
||||
github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY=
|
||||
@@ -18,8 +18,6 @@ CALENS="${GOBIN}/calens-v0.2.0"
|
||||
|
||||
GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.43.0"
|
||||
|
||||
GOX="${GOBIN}/gox-v1.0.1"
|
||||
|
||||
HUGO="${GOBIN}/hugo-v0.91.0"
|
||||
|
||||
MOCKERY="${GOBIN}/mockery-v2.9.4"
|
||||
@@ -37,4 +35,3 @@ PROTOC_GEN_MICROWEB="${GOBIN}/protoc-gen-microweb-v0.0.0-20211219183901-997c02ca
|
||||
PROTOC_GEN_OPENAPIV2="${GOBIN}/protoc-gen-openapiv2-v2.7.2"
|
||||
|
||||
REFLEX="${GOBIN}/reflex-v0.3.1"
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
# The test runner source for API tests
|
||||
CORE_COMMITID=4512f46e7196a8c1f1cfc56ec397628cbf540407
|
||||
CORE_COMMITID=df1a1eb2816775fe9c202c50ec8e8a1e01ecb256
|
||||
CORE_BRANCH=master
|
||||
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=b240ba9117e998edc0cd7d1d5586ba19591e1511
|
||||
WEB_BRANCH=master
|
||||
WEB_COMMITID=80d9bb6962cb034dc861116f59ae25f39fb3a52c
|
||||
WEB_BRANCH=no-shares-folder
|
||||
+83
-63
@@ -2,20 +2,48 @@
|
||||
"""
|
||||
|
||||
# images
|
||||
OC_CI_ALPINE = "owncloudci/alpine:latest"
|
||||
OC_CI_GOLANG = "owncloudci/golang:1.17"
|
||||
OC_CI_NODEJS = "owncloudci/nodejs:14"
|
||||
OC_CI_PHP = "owncloudci/php:7.4"
|
||||
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
|
||||
OC_TESTING_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.3.1"
|
||||
ALPINE_GIT = "alpine/git:latest"
|
||||
CHKO_DOCKER_PUSHRM = "chko/docker-pushrm:1"
|
||||
DRONE_CLI = "drone/cli:alpine"
|
||||
MARIADB = "mariadb:10.6"
|
||||
MELTWATER_DRONE_CACHE = "meltwater/drone-cache:v1"
|
||||
MINIO_MC = "minio/mc:RELEASE.2021-10-07T04-19-58Z"
|
||||
OC_CI_ALPINE = "owncloudci/alpine:latest"
|
||||
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier:latest"
|
||||
OC_CI_DRONE_ANSIBLE = "owncloudci/drone-ansible:latest"
|
||||
OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS = "owncloudci/drone-cancel-previous-builds"
|
||||
OC_CI_DRONE_SKIP_PIPELINE = "owncloudci/drone-skip-pipeline"
|
||||
OC_CI_GOLANG = "owncloudci/golang:1.17"
|
||||
OC_CI_NODEJS = "owncloudci/nodejs:%s"
|
||||
OC_CI_PHP = "owncloudci/php:%s"
|
||||
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
|
||||
OC_OC_TEST_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.3.1"
|
||||
OC_SERVER = "owncloud/server:10"
|
||||
OC_UBUNTU = "owncloud/ubuntu:18.04"
|
||||
OSIXIA_OPEN_LDAP = "osixia/openldap:latest"
|
||||
PLUGINS_CODACY = "plugins/codacy:1"
|
||||
PLUGINS_DOCKER = "plugins/docker:latest"
|
||||
PLUGINS_DOWNSTREAM = "plugins/downstream:latest"
|
||||
PLUGINS_GH_PAGES = "plugins/gh-pages:1"
|
||||
PLUGINS_GITHUB_RELEASE = "plugins/github-release:1"
|
||||
PLUGINS_GIT_ACTION = "plugins/git-action:1"
|
||||
PLUGINS_MANIFEST = "plugins/manifest:1"
|
||||
PLUGINS_S3 = "plugins/s3:latest"
|
||||
PLUGINS_SLACK = "plugins/slack:1"
|
||||
REDIS = "redis:6-alpine"
|
||||
SELENIUM_STANDALONE_CHROME_DEBUG = "selenium/standalone-chrome-debug:3.141.59"
|
||||
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:latest"
|
||||
THEGEEKLAB_DRONE_GITHUB_COMMENT = "thegeeklab/drone-github-comment:1"
|
||||
|
||||
DEFAULT_PHP_VERSION = "7.4"
|
||||
DEFAULT_NODEJS_VERSION = "14"
|
||||
|
||||
# configuration
|
||||
config = {
|
||||
"modules": [
|
||||
# if you add a module here please also add it to the root level Makefile
|
||||
"accounts",
|
||||
"audit",
|
||||
"glauth",
|
||||
"graph-explorer",
|
||||
"graph",
|
||||
@@ -217,7 +245,7 @@ def cancelPreviousBuilds():
|
||||
},
|
||||
"steps": [{
|
||||
"name": "cancel-previous-builds",
|
||||
"image": "owncloudci/drone-cancel-previous-builds",
|
||||
"image": OC_CI_DRONE_CANCEL_PREVIOUS_BUILDS,
|
||||
"settings": {
|
||||
"DRONE_TOKEN": {
|
||||
"from_secret": "drone_token",
|
||||
@@ -281,7 +309,7 @@ def testOcisModule(ctx, module):
|
||||
},
|
||||
{
|
||||
"name": "scan-result-cache",
|
||||
"image": "plugins/s3:latest",
|
||||
"image": PLUGINS_S3,
|
||||
"settings": {
|
||||
"endpoint": {
|
||||
"from_secret": "cache_s3_endpoint",
|
||||
@@ -378,7 +406,7 @@ def uploadScanResults(ctx):
|
||||
"steps": [
|
||||
{
|
||||
"name": "clone",
|
||||
"image": "alpine/git:latest",
|
||||
"image": ALPINE_GIT,
|
||||
"commands": [
|
||||
# Always use the owncloud/ocis repository as base to have an up to date default branch.
|
||||
# This is needed for the skipIfUnchanged step, since it references a commit on master (which could be absent on a fork)
|
||||
@@ -404,7 +432,7 @@ def uploadScanResults(ctx):
|
||||
},
|
||||
{
|
||||
"name": "codacy",
|
||||
"image": "plugins/codacy:1",
|
||||
"image": PLUGINS_CODACY,
|
||||
"settings": {
|
||||
"token": {
|
||||
"from_secret": "codacy_token",
|
||||
@@ -413,7 +441,7 @@ def uploadScanResults(ctx):
|
||||
},
|
||||
{
|
||||
"name": "sonarcloud",
|
||||
"image": "sonarsource/sonar-scanner-cli:latest",
|
||||
"image": SONARSOURCE_SONAR_SCANNER_CLI,
|
||||
"environment": sonar_env,
|
||||
},
|
||||
{
|
||||
@@ -454,7 +482,7 @@ def localApiTests(ctx, storage, suite, accounts_hash_difficulty = 4):
|
||||
cloneCoreRepos() + [
|
||||
{
|
||||
"name": "localApiTests-%s-%s" % (suite, storage),
|
||||
"image": OC_CI_PHP,
|
||||
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
|
||||
"environment": {
|
||||
"TEST_SERVER_URL": "https://ocis-server:9200",
|
||||
"OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""),
|
||||
@@ -503,7 +531,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac
|
||||
cloneCoreRepos() + [
|
||||
{
|
||||
"name": "oC10ApiTests-%s-storage-%s" % (storage, part_number),
|
||||
"image": OC_CI_PHP,
|
||||
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
|
||||
"environment": {
|
||||
"TEST_SERVER_URL": "https://ocis-server:9200",
|
||||
"OCIS_REVA_DATA_ROOT": "%s" % ("/srv/app/tmp/ocis/owncloud/data/" if storage == "owncloud" else ""),
|
||||
@@ -613,7 +641,7 @@ def uiTestPipeline(ctx, filterTags, early_fail, runPart = 1, numberOfParts = 1,
|
||||
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
|
||||
{
|
||||
"name": "webUITests",
|
||||
"image": OC_CI_NODEJS,
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"SERVER_HOST": "https://ocis-server:9200",
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
@@ -672,7 +700,7 @@ def accountsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
||||
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
|
||||
{
|
||||
"name": "WebUIAcceptanceTests",
|
||||
"image": OC_CI_NODEJS,
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"SERVER_HOST": "https://ocis-server:9200",
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
@@ -736,7 +764,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
||||
ocisServer(storage, accounts_hash_difficulty, [stepVolumeOC10Tests]) + waitForSeleniumService() + waitForMiddlewareService() + [
|
||||
{
|
||||
"name": "WebUIAcceptanceTests",
|
||||
"image": OC_CI_NODEJS,
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"SERVER_HOST": "https://ocis-server:9200",
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
@@ -772,7 +800,7 @@ def settingsUITests(ctx, storage = "ocis", accounts_hash_difficulty = 4):
|
||||
"services": [
|
||||
{
|
||||
"name": "redis",
|
||||
"image": "redis:6-alpine",
|
||||
"image": REDIS,
|
||||
},
|
||||
] + selenium() + middlewareService(),
|
||||
"volumes": [stepVolumeOC10Tests] +
|
||||
@@ -807,7 +835,7 @@ def failEarly(ctx, early_fail):
|
||||
return [
|
||||
{
|
||||
"name": "github-comment",
|
||||
"image": "thegeeklab/drone-github-comment:1",
|
||||
"image": THEGEEKLAB_DRONE_GITHUB_COMMENT,
|
||||
"settings": {
|
||||
"message": ":boom: Acceptance test [<strong>${DRONE_STAGE_NAME}</strong>](${DRONE_BUILD_LINK}/${DRONE_STAGE_NUMBER}/1) failed. Further test are cancelled...",
|
||||
"key": "pr-${DRONE_PULL_REQUEST}", #TODO: we could delete the comment after a successful CI run
|
||||
@@ -827,7 +855,7 @@ def failEarly(ctx, early_fail):
|
||||
},
|
||||
{
|
||||
"name": "stop-build",
|
||||
"image": "drone/cli:alpine",
|
||||
"image": DRONE_CLI,
|
||||
# # https://github.com/drone/runner-go/blob/0bd0f8fc31c489817572060d17c6e24aaa487470/pipeline/runtime/const.go#L95-L102
|
||||
# "failure": "fail-fast",
|
||||
# would be an alternative, but is currently broken
|
||||
@@ -894,7 +922,7 @@ def dockerRelease(ctx, arch):
|
||||
},
|
||||
{
|
||||
"name": "dryrun",
|
||||
"image": "plugins/docker:latest",
|
||||
"image": PLUGINS_DOCKER,
|
||||
"settings": {
|
||||
"dry_run": True,
|
||||
"context": "ocis",
|
||||
@@ -913,7 +941,7 @@ def dockerRelease(ctx, arch):
|
||||
},
|
||||
{
|
||||
"name": "docker",
|
||||
"image": "plugins/docker:latest",
|
||||
"image": PLUGINS_DOCKER,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
@@ -956,11 +984,16 @@ def binaryReleases(ctx):
|
||||
return pipelines
|
||||
|
||||
def binaryRelease(ctx, name):
|
||||
# uploads binary to https://download.owncloud.com/ocis/ocis/testing/
|
||||
target = "/ocis/%s/testing" % (ctx.repo.name.replace("ocis-", ""))
|
||||
# uploads binary to https://download.owncloud.com/ocis/ocis/daily/
|
||||
target = "/ocis/%s/daily" % (ctx.repo.name.replace("ocis-", ""))
|
||||
if ctx.build.event == "tag":
|
||||
# uploads binary to eg. https://download.owncloud.com/ocis/ocis/1.0.0-beta9/
|
||||
target = "/ocis/%s/%s" % (ctx.repo.name.replace("ocis-", ""), ctx.build.ref.replace("refs/tags/v", ""))
|
||||
folder = "stable"
|
||||
buildref = ctx.build.ref.replace("refs/tags/v", "")
|
||||
buildref = buildref.lower()
|
||||
if buildref.find("-") != -1: # "x.x.x-alpha", "x.x.x-beta", "x.x.x-rc"
|
||||
folder = "testing"
|
||||
target = "/ocis/%s/%s/%s" % (ctx.repo.name.replace("ocis-", ""), folder, buildref)
|
||||
|
||||
settings = {
|
||||
"endpoint": {
|
||||
@@ -1014,7 +1047,7 @@ def binaryRelease(ctx, name):
|
||||
},
|
||||
{
|
||||
"name": "upload",
|
||||
"image": "plugins/s3:latest",
|
||||
"image": PLUGINS_S3,
|
||||
"settings": settings,
|
||||
"when": {
|
||||
"ref": [
|
||||
@@ -1037,7 +1070,7 @@ def binaryRelease(ctx, name):
|
||||
},
|
||||
{
|
||||
"name": "release",
|
||||
"image": "plugins/github-release:1",
|
||||
"image": PLUGINS_GITHUB_RELEASE,
|
||||
"settings": {
|
||||
"api_key": {
|
||||
"from_secret": "github_token",
|
||||
@@ -1084,7 +1117,7 @@ def releaseSubmodule(ctx):
|
||||
"steps": [
|
||||
{
|
||||
"name": "release-submodule",
|
||||
"image": "plugins/github-release:1",
|
||||
"image": PLUGINS_GITHUB_RELEASE,
|
||||
"settings": {
|
||||
"api_key": {
|
||||
"from_secret": "github_token",
|
||||
@@ -1123,7 +1156,7 @@ def releaseDockerManifest(ctx):
|
||||
"steps": [
|
||||
{
|
||||
"name": "execute",
|
||||
"image": "plugins/manifest:1",
|
||||
"image": PLUGINS_MANIFEST,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
@@ -1178,7 +1211,7 @@ def changelog(ctx):
|
||||
},
|
||||
{
|
||||
"name": "publish",
|
||||
"image": "plugins/git-action:1",
|
||||
"image": PLUGINS_GIT_ACTION,
|
||||
"settings": {
|
||||
"actions": [
|
||||
"commit",
|
||||
@@ -1225,7 +1258,7 @@ def releaseDockerReadme(ctx):
|
||||
"steps": [
|
||||
{
|
||||
"name": "execute",
|
||||
"image": "chko/docker-pushrm:1",
|
||||
"image": CHKO_DOCKER_PUSHRM,
|
||||
"environment": {
|
||||
"DOCKER_USER": {
|
||||
"from_secret": "docker_username",
|
||||
@@ -1278,7 +1311,7 @@ def docs(ctx):
|
||||
},
|
||||
{
|
||||
"name": "publish",
|
||||
"image": "plugins/gh-pages:1",
|
||||
"image": PLUGINS_GH_PAGES,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "github_username",
|
||||
@@ -1307,7 +1340,7 @@ def docs(ctx):
|
||||
},
|
||||
{
|
||||
"name": "downstream",
|
||||
"image": "plugins/downstream:latest",
|
||||
"image": PLUGINS_DOWNSTREAM,
|
||||
"settings": {
|
||||
"server": "https://drone.owncloud.com/",
|
||||
"token": {
|
||||
@@ -1342,7 +1375,7 @@ def makeNodeGenerate(module):
|
||||
return [
|
||||
{
|
||||
"name": "generate nodejs",
|
||||
"image": OC_CI_NODEJS,
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"commands": [
|
||||
"%s ci-node-generate" % (make),
|
||||
],
|
||||
@@ -1377,7 +1410,7 @@ def notify(ctx):
|
||||
"steps": [
|
||||
{
|
||||
"name": "notify-rocketchat",
|
||||
"image": "plugins/slack:1",
|
||||
"image": PLUGINS_SLACK,
|
||||
"settings": {
|
||||
"webhook": {
|
||||
"from_secret": config["rocketchat"]["from_secret"],
|
||||
@@ -1421,7 +1454,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
|
||||
user = "33:33"
|
||||
environment = {
|
||||
# Keycloak IDP specific configuration
|
||||
"PROXY_OIDC_ISSUER": "https://keycloak/auth/realmsowncloud",
|
||||
"PROXY_OIDC_ISSUER": "https://keycloak/auth/realms/owncloud",
|
||||
"WEB_OIDC_AUTHORITY": "https://keycloak/auth/realms/owncloud",
|
||||
"WEB_OIDC_CLIENT_ID": "ocis-web",
|
||||
"WEB_OIDC_METADATA_URL": "https://keycloak/auth/realms/owncloud/.well-known/openid-configuration",
|
||||
@@ -1520,7 +1553,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
|
||||
},
|
||||
{
|
||||
"name": "wait-for-ocis-server",
|
||||
"image": "owncloudci/wait-for:latest",
|
||||
"image": OC_CI_WAIT_FOR,
|
||||
"commands": [
|
||||
"wait-for -it ocis-server:9200 -t 300",
|
||||
],
|
||||
@@ -1531,7 +1564,7 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
|
||||
def middlewareService():
|
||||
return [{
|
||||
"name": "middleware",
|
||||
"image": OC_TESTING_MIDDLEWARE,
|
||||
"image": OC_OC_TEST_MIDDLEWARE,
|
||||
"environment": {
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
"OCIS_REVA_DATA_ROOT": "/srv/app/tmp/ocis/storage/owncloud/",
|
||||
@@ -1593,7 +1626,7 @@ def selenium():
|
||||
return [
|
||||
{
|
||||
"name": "selenium",
|
||||
"image": "selenium/standalone-chrome-debug:3.141.59",
|
||||
"image": SELENIUM_STANDALONE_CHROME_DEBUG,
|
||||
"volumes": [{
|
||||
"name": "uploads",
|
||||
"path": "/uploads",
|
||||
@@ -1653,8 +1686,7 @@ def skipIfUnchanged(ctx, type):
|
||||
|
||||
return [{
|
||||
"name": "skip-if-unchanged",
|
||||
"image": "owncloudci/drone-skip-pipeline",
|
||||
"pull": "always",
|
||||
"image": OC_CI_DRONE_SKIP_PIPELINE,
|
||||
"settings": {
|
||||
"ALLOW_SKIP_CHANGED": skip,
|
||||
},
|
||||
@@ -1713,7 +1745,7 @@ def deploy(ctx, config, rebuild):
|
||||
"steps": [
|
||||
{
|
||||
"name": "clone continuous deployment playbook",
|
||||
"image": "alpine/git:latest",
|
||||
"image": ALPINE_GIT,
|
||||
"commands": [
|
||||
"cd deployments/continuous-deployment-config",
|
||||
"git clone https://github.com/owncloud-devops/continuous-deployment.git",
|
||||
@@ -1721,7 +1753,7 @@ def deploy(ctx, config, rebuild):
|
||||
},
|
||||
{
|
||||
"name": "deploy",
|
||||
"image": "owncloudci/drone-ansible:latest",
|
||||
"image": OC_CI_DRONE_ANSIBLE,
|
||||
"failure": "ignore",
|
||||
"environment": {
|
||||
"CONTINUOUS_DEPLOY_SERVERS_CONFIG": "../%s" % (config),
|
||||
@@ -1760,14 +1792,14 @@ def checkStarlark():
|
||||
"steps": [
|
||||
{
|
||||
"name": "format-check-starlark",
|
||||
"image": "owncloudci/bazel-buildifier:latest",
|
||||
"image": OC_CI_BAZEL_BUILDIFIER,
|
||||
"commands": [
|
||||
"buildifier --mode=check .drone.star",
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "show-diff",
|
||||
"image": "owncloudci/bazel-buildifier:latest",
|
||||
"image": OC_CI_BAZEL_BUILDIFIER,
|
||||
"commands": [
|
||||
"buildifier --mode=fix .drone.star",
|
||||
"git diff",
|
||||
@@ -1799,7 +1831,7 @@ def genericCache(name, action, mounts, cache_key):
|
||||
|
||||
step = {
|
||||
"name": "%s_%s" % (action, name),
|
||||
"image": "meltwater/drone-cache:v1",
|
||||
"image": MELTWATER_DRONE_CACHE,
|
||||
"environment": {
|
||||
"AWS_ACCESS_KEY_ID": {
|
||||
"from_secret": "cache_s3_access_key",
|
||||
@@ -1948,12 +1980,6 @@ def pipelineSanityChecks(ctx, pipelines):
|
||||
"""Parallel Deployment configs
|
||||
"""
|
||||
|
||||
#images
|
||||
OC_OC10 = "owncloud/server:10"
|
||||
OC_UBUNTU = "owncloud/ubuntu:18.04"
|
||||
MARIADB = "mariadb:10.6"
|
||||
OSIXIA_OPENLDAP = "osixia/openldap:latest"
|
||||
|
||||
# configs
|
||||
OCIS_URL = "https://ocis-server:9200"
|
||||
OCIS_DOMAIN = "ocis-server:9200"
|
||||
@@ -2118,7 +2144,7 @@ def parallelAcceptance(env):
|
||||
|
||||
return [{
|
||||
"name": "acceptance-tests",
|
||||
"image": OC_CI_PHP,
|
||||
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
|
||||
"environment": environment,
|
||||
"commands": [
|
||||
"make test-paralleldeployment-api",
|
||||
@@ -2135,8 +2161,7 @@ def parallelDeploymentOC10Server():
|
||||
return [
|
||||
{
|
||||
"name": "oc10",
|
||||
"image": OC_OC10,
|
||||
"pull": "always",
|
||||
"image": OC_SERVER,
|
||||
"detach": True,
|
||||
"environment": {
|
||||
# can be switched to "web"
|
||||
@@ -2204,8 +2229,7 @@ def parallelDeploymentOC10Server():
|
||||
def ldapService():
|
||||
return [{
|
||||
"name": "openldap",
|
||||
"image": OSIXIA_OPENLDAP,
|
||||
"pull": "always",
|
||||
"image": OSIXIA_OPEN_LDAP,
|
||||
"environment": {
|
||||
"LDAP_TLS_VERIFY_CLIENT": "never",
|
||||
"LDAP_DOMAIN": "owncloud.com",
|
||||
@@ -2227,7 +2251,6 @@ def oc10DbService():
|
||||
{
|
||||
"name": "oc10-db",
|
||||
"image": MARIADB,
|
||||
"pull": "always",
|
||||
"environment": {
|
||||
"MYSQL_ROOT_PASSWORD": "owncloud",
|
||||
"MYSQL_USER": "owncloud",
|
||||
@@ -2245,12 +2268,11 @@ def oc10DbService():
|
||||
def copyConfigs():
|
||||
return [{
|
||||
"name": "copy-configs",
|
||||
"image": OC_OC10,
|
||||
"pull": "always",
|
||||
"image": OC_SERVER,
|
||||
"commands": [
|
||||
# ocis proxy config
|
||||
"mkdir -p /etc/ocis",
|
||||
"cp %s/ocis/proxy.json /etc/ocis/proxy.json" % (PARALLEL_DEPLOY_CONFIG_PATH),
|
||||
"cp %s/ocis/proxy.yaml /etc/ocis/proxy.yaml" % (PARALLEL_DEPLOY_CONFIG_PATH),
|
||||
# oc10 configs
|
||||
"mkdir -p /etc/templates",
|
||||
"mkdir -p /etc/pre_server.d",
|
||||
@@ -2269,7 +2291,6 @@ def owncloudLog():
|
||||
return [{
|
||||
"name": "owncloud-log",
|
||||
"image": OC_UBUNTU,
|
||||
"pull": "always",
|
||||
"detach": True,
|
||||
"commands": [
|
||||
"tail -f /mnt/data/owncloud.log",
|
||||
@@ -2283,8 +2304,7 @@ def owncloudLog():
|
||||
def fixSharedDataPermissions():
|
||||
return [{
|
||||
"name": "fix-shared-data-permissions",
|
||||
"image": OC_CI_PHP,
|
||||
"pull": "always",
|
||||
"image": OC_CI_PHP % DEFAULT_PHP_VERSION,
|
||||
"commands": [
|
||||
"chown -R 33:33 /var/www/owncloud", # www-data user
|
||||
"chmod -R 777 /var/www/owncloud",
|
||||
|
||||
@@ -10,7 +10,7 @@ repository:
|
||||
private: false
|
||||
has_issues: true
|
||||
has_projects: false
|
||||
has_wiki: true
|
||||
has_wiki: false
|
||||
has_downloads: false
|
||||
|
||||
default_branch: master
|
||||
@@ -35,7 +35,7 @@ labels:
|
||||
color: "#3F7A62"
|
||||
- name: Storage:ownCloudSQL
|
||||
color: "#3F7A62"
|
||||
|
||||
|
||||
teams:
|
||||
- name: ci
|
||||
permission: admin
|
||||
@@ -65,3 +65,4 @@ branches:
|
||||
- employees
|
||||
|
||||
...
|
||||
|
||||
+104
-12
@@ -11,26 +11,118 @@ release-dirs:
|
||||
|
||||
# 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-amd64: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-amd64' \
|
||||
./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)
|
||||
release-linux-docker-arm: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
@# https://github.com/golang/go/issues/50405
|
||||
@# -buildmode=pie not easily doable for arm
|
||||
|
||||
release-linux-docker-arm64: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS) $(DOCKER_LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm64' \
|
||||
./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: release-dirs
|
||||
GOOS=linux \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-amd64' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=386 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-386' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm64' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=linux \
|
||||
GOARCH=arm \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-linux-arm' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
@# https://github.com/golang/go/issues/50405
|
||||
@# -buildmode=pie not easily doable for arm
|
||||
|
||||
.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)
|
||||
release-windows: release-dirs
|
||||
GOOS=windows \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '-extldflags "-static" $(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-windows-amd64' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-darwin
|
||||
release-darwin: $(GOX) release-dirs
|
||||
@$(GOX) -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64 arm64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME)
|
||||
release-darwin: release-dirs
|
||||
GOOS=darwin \
|
||||
GOARCH=amd64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '$(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-darwin-amd64' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
GOOS=darwin \
|
||||
GOARCH=arm64 \
|
||||
go build \
|
||||
-tags 'netgo $(TAGS)' \
|
||||
-buildmode=pie \
|
||||
-trimpath \
|
||||
-ldflags '$(LDFLAGS)' \
|
||||
-o '$(DIST)/binaries/$(EXECUTABLE)-darwin-arm64' \
|
||||
./cmd/$(NAME)
|
||||
|
||||
.PHONY: release-copy
|
||||
release-copy:
|
||||
|
||||
+175
-2
@@ -2,7 +2,180 @@
|
||||
|
||||
The following sections list the changes for unreleased.
|
||||
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v1.17.0...master
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v1.18.0...master
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Network configuration in individiual_services example: [#3238](https://github.com/owncloud/ocis/pull/3238)
|
||||
* Bugfix - Improve gif thumbnails: [#3305](https://github.com/owncloud/ocis/pull/3305)
|
||||
* Bugfix - Fix error handling in GraphAPI GetUsers call: [#3357](https://github.com/owncloud/ocis/pull/3357)
|
||||
* Bugfix - Fix request validation on GraphAPI User updates: [#3167](https://github.com/owncloud/ocis/issues/3167)
|
||||
* Bugfix - Replace public mountpoint fileid with grant fileid: [#3349](https://github.com/owncloud/ocis/pull/3349)
|
||||
* Change - Add remote item to mountpoint and fix spaceID: [#3365](https://github.com/owncloud/ocis/pull/3365)
|
||||
* Change - Switch NATS backend: [#3192](https://github.com/owncloud/ocis/pull/3192)
|
||||
* Change - Drop json config file support: [#3366](https://github.com/owncloud/ocis/pull/3366)
|
||||
* Change - Settings service now stores its data via metadata service: [#3232](https://github.com/owncloud/ocis/pull/3232)
|
||||
* Enhancement - Audit logger will now log file events: [#3332](https://github.com/owncloud/ocis/pull/3332)
|
||||
* Enhancement - Add password reset link to login page: [#3329](https://github.com/owncloud/ocis/pull/3329)
|
||||
* Enhancement - Log sharing events in audit service: [#3301](https://github.com/owncloud/ocis/pull/3301)
|
||||
* Enhancement - Add space aliases: [#3283](https://github.com/owncloud/ocis/pull/3283)
|
||||
* Enhancement - Include etags in drives listing: [#3267](https://github.com/owncloud/ocis/pull/3267)
|
||||
* Enhancement - Improve thumbnails API: [#3272](https://github.com/owncloud/ocis/pull/3272)
|
||||
* Enhancement - Update reva to v2.1.0: [#3330](https://github.com/owncloud/ocis/pull/3330)
|
||||
* Enhancement - Update ownCloud Web to v5.3.0: [#6561](https://github.com/owncloud/web/pull/6561)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Network configuration in individiual_services example: [#3238](https://github.com/owncloud/ocis/pull/3238)
|
||||
|
||||
Tidy up the deployments/examples/ocis_individual_services example so that the
|
||||
instructions work.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3238
|
||||
|
||||
* Bugfix - Improve gif thumbnails: [#3305](https://github.com/owncloud/ocis/pull/3305)
|
||||
|
||||
Improved the gif thumbnail generation for gifs with different disposal strategies.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3305
|
||||
|
||||
* Bugfix - Fix error handling in GraphAPI GetUsers call: [#3357](https://github.com/owncloud/ocis/pull/3357)
|
||||
|
||||
A missing return statement caused GetUsers to return misleading results when the identity
|
||||
backend returned an error.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3357
|
||||
|
||||
* Bugfix - Fix request validation on GraphAPI User updates: [#3167](https://github.com/owncloud/ocis/issues/3167)
|
||||
|
||||
Fix PATCH on graph/v1.0/users when no 'mail' attribute is present in the request body
|
||||
|
||||
https://github.com/owncloud/ocis/issues/3167
|
||||
|
||||
* Bugfix - Replace public mountpoint fileid with grant fileid: [#3349](https://github.com/owncloud/ocis/pull/3349)
|
||||
|
||||
We now show the same resoucre id for resources when accessing them via a public links as when
|
||||
using a logged in user. This allows the web ui to start a WOPI session with the correct resource
|
||||
id.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3349
|
||||
|
||||
* Change - Add remote item to mountpoint and fix spaceID: [#3365](https://github.com/owncloud/ocis/pull/3365)
|
||||
|
||||
A mountpoint represents the mounted share on the share receivers side. The original resource
|
||||
is located where the grant has been set. This item is now shown as libregraph remoteItem on the
|
||||
mountpoint. While adding this, we fixed the spaceID for mountpoints.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3365
|
||||
|
||||
* Change - Switch NATS backend: [#3192](https://github.com/owncloud/ocis/pull/3192)
|
||||
|
||||
We've switched the NATS backend from Streaming to JetStream, since NATS Streaming is
|
||||
depreciated.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3192
|
||||
https://github.com/cs3org/reva/pull/2574
|
||||
|
||||
* Change - Drop json config file support: [#3366](https://github.com/owncloud/ocis/pull/3366)
|
||||
|
||||
We've remove the support to configure oCIS and it's service with a json file. From now on we only
|
||||
support yaml configuration files, since they have the possibility to add comments.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3366
|
||||
|
||||
* Change - Settings service now stores its data via metadata service: [#3232](https://github.com/owncloud/ocis/pull/3232)
|
||||
|
||||
Instead of writing files to disk it will use metadata service to do so
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3232
|
||||
|
||||
* Enhancement - Audit logger will now log file events: [#3332](https://github.com/owncloud/ocis/pull/3332)
|
||||
|
||||
See full list of supported events in `audit/pkg/types/types.go`
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3332
|
||||
|
||||
* Enhancement - Add password reset link to login page: [#3329](https://github.com/owncloud/ocis/pull/3329)
|
||||
|
||||
Added a configurable passwort reset link to the login page. It can be set via
|
||||
`IDP_PASSWORD_RESET_URI`. If the option is not set the link will not be shown.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3329
|
||||
|
||||
* Enhancement - Log sharing events in audit service: [#3301](https://github.com/owncloud/ocis/pull/3301)
|
||||
|
||||
Contains sharing related events. See full list in audit/pkg/types/events.go
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3301
|
||||
|
||||
* Enhancement - Add space aliases: [#3283](https://github.com/owncloud/ocis/pull/3283)
|
||||
|
||||
Space aliases can be used to resolve spaceIDs in a client.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3283
|
||||
|
||||
* Enhancement - Include etags in drives listing: [#3267](https://github.com/owncloud/ocis/pull/3267)
|
||||
|
||||
Added etags in the response of list drives.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3267
|
||||
|
||||
* Enhancement - Improve thumbnails API: [#3272](https://github.com/owncloud/ocis/pull/3272)
|
||||
|
||||
Changed the thumbnails API to no longer transfer images via GRPC. GRPC has a limited message
|
||||
size and isn't very efficient with large binary data. The new API transports the images over
|
||||
HTTP.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3272
|
||||
|
||||
* Enhancement - Update reva to v2.1.0: [#3330](https://github.com/owncloud/ocis/pull/3330)
|
||||
|
||||
Updated reva to version 2.1.0. This update includes:
|
||||
|
||||
* Fix [cs3org/reva#2636](https://github.com/cs3org/reva/pull/2636): Delay reconnect log for events
|
||||
* Fix [cs3org/reva#2645](https://github.com/cs3org/reva/pull/2645): Avoid warning about missing .flock files
|
||||
* Fix [cs3org/reva#2625](https://github.com/cs3org/reva/pull/2625): Fix locking on publik links and the decomposed filesystem
|
||||
* Fix [cs3org/reva#2643](https://github.com/cs3org/reva/pull/2643): Emit linkaccessfailed event when share is nil
|
||||
* Fix [cs3org/reva#2646](https://github.com/cs3org/reva/pull/2646): Replace public mountpoint fileid with grant fileid in ocdav
|
||||
* Fix [cs3org/reva#2612](https://github.com/cs3org/reva/pull/2612): Adjust the scope handling to support the spaces architecture
|
||||
* Fix [cs3org/reva#2621](https://github.com/cs3org/reva/pull/2621): Send events only if response code is `OK`
|
||||
* Chg [cs3org/reva#2574](https://github.com/cs3org/reva/pull/2574): Switch NATS backend
|
||||
* Chg [cs3org/reva#2667](https://github.com/cs3org/reva/pull/2667): Allow LDAP groups to have no gidNumber
|
||||
* Chg [cs3org/reva#3233](https://github.com/cs3org/reva/pull/3233): Improve quota handling
|
||||
* Chg [cs3org/reva#2600](https://github.com/cs3org/reva/pull/2600): Use the cs3 share api to manage spaces
|
||||
* Enh [cs3org/reva#2644](https://github.com/cs3org/reva/pull/2644): Add new public share manager
|
||||
* Enh [cs3org/reva#2626](https://github.com/cs3org/reva/pull/2626): Add new share manager
|
||||
* Enh [cs3org/reva#2624](https://github.com/cs3org/reva/pull/2624): Add etags to virtual spaces
|
||||
* Enh [cs3org/reva#2639](https://github.com/cs3org/reva/pull/2639): File Events
|
||||
* Enh [cs3org/reva#2627](https://github.com/cs3org/reva/pull/2627): Add events for sharing action
|
||||
* Enh [cs3org/reva#2664](https://github.com/cs3org/reva/pull/2664): Add grantID to mountpoint
|
||||
* Enh [cs3org/reva#2622](https://github.com/cs3org/reva/pull/2622): Allow listing shares in spaces via the OCS API
|
||||
* Enh [cs3org/reva#2623](https://github.com/cs3org/reva/pull/2623): Add space aliases
|
||||
* Enh [cs3org/reva#2647](https://github.com/cs3org/reva/pull/2647): Add space specific events
|
||||
* Enh [cs3org/reva#3345](https://github.com/cs3org/reva/pull/3345): Add the spaceid to propfind responses
|
||||
* Enh [cs3org/reva#2616](https://github.com/cs3org/reva/pull/2616): Add etag to spaces response
|
||||
* Enh [cs3org/reva#2628](https://github.com/cs3org/reva/pull/2628): Add spaces aware trash-bin API
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3330
|
||||
https://github.com/owncloud/ocis/pull/3405
|
||||
https://github.com/owncloud/ocis/pull/3416
|
||||
|
||||
* Enhancement - Update ownCloud Web to v5.3.0: [#6561](https://github.com/owncloud/web/pull/6561)
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v5.3.0. Please refer to the changelog (linked) for details on the web
|
||||
release.
|
||||
|
||||
https://github.com/owncloud/web/pull/6561
|
||||
https://github.com/owncloud/ocis/pull/3291
|
||||
https://github.com/owncloud/ocis/pull/3375
|
||||
https://github.com/owncloud/web/releases/tag/v5.3.0
|
||||
# Changelog for [1.18.0] (2022-03-03)
|
||||
|
||||
The following sections list the changes for 1.18.0.
|
||||
|
||||
[1.18.0]: https://github.com/owncloud/ocis/compare/v1.17.0...v1.18.0
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -197,7 +370,7 @@ The following sections list the changes for unreleased.
|
||||
* Enh [cs3org/reva#2526](https://github.com/cs3org/reva/pull/2526) : Upgrade ginkgo to v2
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3231
|
||||
https://github.com/owncloud/ocis/pull/3231
|
||||
https://github.com/owncloud/ocis/pull/3258
|
||||
|
||||
* Enhancement - Update ownCloud Web to v5.2.0: [#6506](https://github.com/owncloud/web/pull/6506)
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ L10N_MODULES := $(shell find . -path '*.tx*' -name 'config' | sed 's|/[^/]*$$||'
|
||||
# if you add a module here please also add it to the .drone.star file
|
||||
OCIS_MODULES = \
|
||||
accounts \
|
||||
audit \
|
||||
glauth \
|
||||
graph \
|
||||
graph-explorer \
|
||||
|
||||
@@ -4,11 +4,11 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/owncloud/ocis/accounts/pkg/command"
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/config/defaults"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := command.Execute(config.DefaultConfig()); err != nil {
|
||||
if err := command.Execute(defaults.DefaultConfig()); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
accountsdefaults "github.com/owncloud/ocis/accounts/pkg/config/defaults"
|
||||
idpdefaults "github.com/owncloud/ocis/idp/pkg/config/defaults"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
fn1 := accountsdefaults.FullDefaultConfig
|
||||
fn2 := idpdefaults.FullDefaultConfig
|
||||
|
||||
b, err := yaml.Marshal(fn1())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(string(b))
|
||||
|
||||
b, err = yaml.Marshal(fn2())
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
|
||||
Service Service
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
|
||||
Tracing *Tracing `ocisConfig:"tracing"`
|
||||
Log *Log `ocisConfig:"log"`
|
||||
@@ -28,7 +28,7 @@ type Config struct {
|
||||
HashDifficulty int `ocisConfig:"hash_difficulty" env:"ACCOUNTS_HASH_DIFFICULTY" desc:"The hash difficulty makes sure that validating a password takes at least a certain amount of time."`
|
||||
DemoUsersAndGroups bool `ocisConfig:"demo_users_and_groups" env:"ACCOUNTS_DEMO_USERS_AND_GROUPS" desc:"If this flag is set the service will setup the demo users and groups."`
|
||||
|
||||
Context context.Context
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
}
|
||||
|
||||
// Asset defines the available asset configuration.
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"path"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
)
|
||||
|
||||
func DefaultConfig() *Config {
|
||||
return &Config{
|
||||
Debug: Debug{
|
||||
Addr: "127.0.0.1:9182",
|
||||
Token: "",
|
||||
Pprof: false,
|
||||
Zpages: false,
|
||||
},
|
||||
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",
|
||||
},
|
||||
Service: Service{
|
||||
Name: "accounts",
|
||||
},
|
||||
Asset: Asset{},
|
||||
TokenManager: TokenManager{
|
||||
JWTSecret: "Pive-Fumkiu4",
|
||||
},
|
||||
HashDifficulty: 11,
|
||||
DemoUsersAndGroups: true,
|
||||
Repo: Repo{
|
||||
Backend: "CS3",
|
||||
Disk: Disk{
|
||||
Path: path.Join(defaults.BaseDataPath(), "accounts"),
|
||||
},
|
||||
CS3: CS3{
|
||||
ProviderAddr: "localhost:9215",
|
||||
},
|
||||
},
|
||||
Index: Index{
|
||||
UID: UIDBound{
|
||||
Lower: 0,
|
||||
Upper: 1000,
|
||||
},
|
||||
GID: GIDBound{
|
||||
Lower: 0,
|
||||
Upper: 1000,
|
||||
},
|
||||
},
|
||||
ServiceUser: ServiceUser{
|
||||
UUID: "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad",
|
||||
Username: "",
|
||||
UID: 0,
|
||||
GID: 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/defaults"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
cfg := DefaultConfig()
|
||||
|
||||
EnsureDefaults(cfg)
|
||||
Sanitize(cfg)
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
func DefaultConfig() *config.Config {
|
||||
return &config.Config{
|
||||
Debug: config.Debug{
|
||||
Addr: "127.0.0.1:9182",
|
||||
Token: "",
|
||||
Pprof: false,
|
||||
Zpages: false,
|
||||
},
|
||||
HTTP: config.HTTP{
|
||||
Addr: "127.0.0.1:9181",
|
||||
Namespace: "com.owncloud.web",
|
||||
Root: "/",
|
||||
CacheTTL: 604800, // 7 days
|
||||
CORS: config.CORS{
|
||||
AllowedOrigins: []string{"*"},
|
||||
AllowedMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"},
|
||||
AllowedHeaders: []string{"Authorization", "Origin", "Content-Type", "Accept", "X-Requested-With"},
|
||||
AllowCredentials: true,
|
||||
},
|
||||
},
|
||||
GRPC: config.GRPC{
|
||||
Addr: "127.0.0.1:9180",
|
||||
Namespace: "com.owncloud.api",
|
||||
},
|
||||
Service: config.Service{
|
||||
Name: "accounts",
|
||||
},
|
||||
Asset: config.Asset{},
|
||||
TokenManager: config.TokenManager{
|
||||
JWTSecret: "Pive-Fumkiu4",
|
||||
},
|
||||
HashDifficulty: 11,
|
||||
DemoUsersAndGroups: true,
|
||||
Repo: config.Repo{
|
||||
Backend: "CS3",
|
||||
Disk: config.Disk{
|
||||
Path: path.Join(defaults.BaseDataPath(), "accounts"),
|
||||
},
|
||||
CS3: config.CS3{
|
||||
ProviderAddr: "localhost:9215",
|
||||
},
|
||||
},
|
||||
Index: config.Index{
|
||||
UID: config.UIDBound{
|
||||
Lower: 0,
|
||||
Upper: 1000,
|
||||
},
|
||||
GID: config.GIDBound{
|
||||
Lower: 0,
|
||||
Upper: 1000,
|
||||
},
|
||||
},
|
||||
ServiceUser: config.ServiceUser{
|
||||
UUID: "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad",
|
||||
Username: "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad",
|
||||
UID: 0,
|
||||
GID: 0,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func EnsureDefaults(cfg *config.Config) {
|
||||
// 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 = &config.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.Log = &config.Log{}
|
||||
}
|
||||
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
|
||||
if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil {
|
||||
cfg.Tracing = &config.Tracing{
|
||||
Enabled: cfg.Commons.Tracing.Enabled,
|
||||
Type: cfg.Commons.Tracing.Type,
|
||||
Endpoint: cfg.Commons.Tracing.Endpoint,
|
||||
Collector: cfg.Commons.Tracing.Collector,
|
||||
}
|
||||
} else if cfg.Tracing == nil {
|
||||
cfg.Tracing = &config.Tracing{}
|
||||
}
|
||||
}
|
||||
|
||||
func Sanitize(cfg *config.Config) {
|
||||
// sanitize config
|
||||
if cfg.HTTP.Root != "/" {
|
||||
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
|
||||
}
|
||||
cfg.Repo.Backend = strings.ToLower(cfg.Repo.Backend)
|
||||
}
|
||||
@@ -3,5 +3,5 @@ package config
|
||||
// GRPC defines the available grpc configuration.
|
||||
type GRPC struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_GRPC_ADDR" desc:"The address of the grpc service."`
|
||||
Namespace string
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
}
|
||||
@@ -3,10 +3,10 @@ package config
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `ocisConfig:"addr" env:"ACCOUNTS_HTTP_ADDR" desc:"The address of the http service."`
|
||||
Namespace string
|
||||
Namespace string `ocisConfig:"-" yaml:"-"`
|
||||
Root string `ocisConfig:"root" env:"ACCOUNTS_HTTP_ROOT" desc:"The root path of the http service."`
|
||||
CacheTTL int `ocisConfig:"cache_ttl" env:"ACCOUNTS_CACHE_TTL" desc:"The cache time for the static assets."`
|
||||
CORS CORS
|
||||
CORS CORS `ocisConfig:"cors"`
|
||||
}
|
||||
|
||||
// CORS defines the available cors configuration.
|
||||
|
||||
@@ -2,11 +2,11 @@ package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
defaults "github.com/owncloud/ocis/accounts/pkg/config/defaults"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/envdecode"
|
||||
)
|
||||
|
||||
@@ -17,28 +17,7 @@ func ParseConfig(cfg *config.Config) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// 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 = &config.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.Log = &config.Log{}
|
||||
}
|
||||
// provide with defaults for shared tracing, since we need a valid destination address for BindEnv.
|
||||
if cfg.Tracing == nil && cfg.Commons != nil && cfg.Commons.Tracing != nil {
|
||||
cfg.Tracing = &config.Tracing{
|
||||
Enabled: cfg.Commons.Tracing.Enabled,
|
||||
Type: cfg.Commons.Tracing.Type,
|
||||
Endpoint: cfg.Commons.Tracing.Endpoint,
|
||||
Collector: cfg.Commons.Tracing.Collector,
|
||||
}
|
||||
} else if cfg.Tracing == nil {
|
||||
cfg.Tracing = &config.Tracing{}
|
||||
}
|
||||
defaults.EnsureDefaults(cfg)
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
if err := envdecode.Decode(cfg); err != nil {
|
||||
@@ -48,11 +27,7 @@ func ParseConfig(cfg *config.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
// sanitize config
|
||||
if cfg.HTTP.Root != "/" {
|
||||
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
|
||||
}
|
||||
cfg.Repo.Backend = strings.ToLower(cfg.Repo.Backend)
|
||||
defaults.Sanitize(cfg)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -2,5 +2,5 @@ package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
}
|
||||
@@ -99,33 +99,6 @@ func (s Service) hasSelfManagementPermissions(ctx context.Context) bool {
|
||||
return s.RoleManager.FindPermissionByID(ctx, roleIDs, SelfManagementPermissionID) != nil
|
||||
}
|
||||
|
||||
// serviceUserToIndex temporarily adds a service user to the index, which is supposed to be removed before the lock on the handler function is released
|
||||
func (s Service) serviceUserToIndex() (teardownServiceUser func()) {
|
||||
if s.Config.ServiceUser.Username != "" && s.Config.ServiceUser.UUID != "" {
|
||||
_, err := s.index.Add(s.getInMemoryServiceUser())
|
||||
if err != nil {
|
||||
s.log.Logger.Err(err).Msg("service user was configured but failed to be added to the index")
|
||||
} else {
|
||||
return func() {
|
||||
_ = s.index.Delete(s.getInMemoryServiceUser())
|
||||
}
|
||||
}
|
||||
}
|
||||
return func() {}
|
||||
}
|
||||
|
||||
func (s Service) getInMemoryServiceUser() accountsmsg.Account {
|
||||
return accountsmsg.Account{
|
||||
AccountEnabled: true,
|
||||
Id: s.Config.ServiceUser.UUID,
|
||||
PreferredName: s.Config.ServiceUser.Username,
|
||||
OnPremisesSamAccountName: s.Config.ServiceUser.Username,
|
||||
DisplayName: s.Config.ServiceUser.Username,
|
||||
UidNumber: s.Config.ServiceUser.UID,
|
||||
GidNumber: s.Config.ServiceUser.GID,
|
||||
}
|
||||
}
|
||||
|
||||
// ListAccounts implements the AccountsServiceHandler interface
|
||||
// the query contains account properties
|
||||
func (s Service) ListAccounts(ctx context.Context, in *accountssvc.ListAccountsRequest, out *accountssvc.ListAccountsResponse) (err error) {
|
||||
@@ -145,8 +118,6 @@ func (s Service) ListAccounts(ctx context.Context, in *accountssvc.ListAccountsR
|
||||
}
|
||||
onlySelf := hasSelf && !hasManagement
|
||||
|
||||
teardownServiceUser := s.serviceUserToIndex()
|
||||
defer teardownServiceUser()
|
||||
match, authRequest := getAuthQueryMatch(in.Query)
|
||||
if authRequest {
|
||||
password := match[2]
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
accountssvc "github.com/owncloud/ocis/protogen/gen/ocis/services/accounts/v0"
|
||||
|
||||
"github.com/golang/protobuf/ptypes/empty"
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
config "github.com/owncloud/ocis/accounts/pkg/config/defaults"
|
||||
olog "github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/ocis-pkg/middleware"
|
||||
"github.com/owncloud/ocis/ocis-pkg/roles"
|
||||
|
||||
@@ -86,9 +86,33 @@ func New(opts ...Option) (s *Service, err error) {
|
||||
if err = s.createDefaultGroups(cfg.DemoUsersAndGroups); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
s.serviceUserToIndex()
|
||||
return
|
||||
}
|
||||
|
||||
// serviceUserToIndex temporarily adds a service user to the index, which is supposed to be removed before the lock on the handler function is released
|
||||
func (s Service) serviceUserToIndex() {
|
||||
if s.Config.ServiceUser.Username != "" && s.Config.ServiceUser.UUID != "" {
|
||||
_, err := s.index.Add(s.getInMemoryServiceUser())
|
||||
if err != nil {
|
||||
s.log.Logger.Err(err).Msg("service user was configured but failed to be added to the index")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s Service) getInMemoryServiceUser() accountsmsg.Account {
|
||||
return accountsmsg.Account{
|
||||
AccountEnabled: true,
|
||||
Id: s.Config.ServiceUser.UUID,
|
||||
PreferredName: s.Config.ServiceUser.Username,
|
||||
OnPremisesSamAccountName: s.Config.ServiceUser.Username,
|
||||
DisplayName: s.Config.ServiceUser.Username,
|
||||
UidNumber: s.Config.ServiceUser.UID,
|
||||
GidNumber: s.Config.ServiceUser.GID,
|
||||
}
|
||||
}
|
||||
|
||||
func (s Service) buildIndex() (*indexer.Indexer, error) {
|
||||
var indexcfg *idxcfg.Config
|
||||
|
||||
@@ -253,6 +277,25 @@ func (s Service) createDefaultAccounts(withDemoAccounts bool) (err error) {
|
||||
{Id: "509a9dcd-bb37-4f4f-a01a-19dca27d9cfa"}, // users
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "534bb038-6f9d-4093-946f-133be61fa4e7",
|
||||
PreferredName: "katherine",
|
||||
OnPremisesSamAccountName: "katherine",
|
||||
Mail: "katherine@example.org",
|
||||
DisplayName: "Katherine Johnson",
|
||||
UidNumber: 20005,
|
||||
GidNumber: 30000,
|
||||
PasswordProfile: &accountsmsg.PasswordProfile{
|
||||
Password: "$2a$11$6SIBlZ.8BzjBsDTRrThUyuz6OvP.XLo7101oFiwHHB.jufKGS9.Ji",
|
||||
},
|
||||
AccountEnabled: true,
|
||||
MemberOf: []*accountsmsg.Group{
|
||||
{Id: "509a9dcd-bb37-4f4f-a01a-19dca27d9cfa"}, // users
|
||||
{Id: "6040aa17-9c64-4fef-9bd0-77234d71bad0"}, // sailing-lovers
|
||||
{Id: "a1726108-01f8-4c30-88df-2b1a9d1cba1a"}, // quantum-lovers
|
||||
{Id: "262982c1-2362-4afa-bfdf-8cbfef64a06e"}, // physics-lovers
|
||||
},
|
||||
},
|
||||
// technical users for kopano and reva
|
||||
{
|
||||
Id: "820ba2a1-3f54-4538-80a4-2d73007e30bf",
|
||||
@@ -353,9 +396,11 @@ func (s Service) createDefaultGroups(withDemoGroups bool) (err error) {
|
||||
{Id: "4c510ada-c86b-4815-8820-42cdf82c3d51"}, // einstein
|
||||
{Id: "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"}, // marie
|
||||
{Id: "932b4540-8d16-481e-8ef4-588e4b6b151c"}, // feynman
|
||||
{Id: "534bb038-6f9d-4093-946f-133be61fa4e7"}, // katherine
|
||||
}},
|
||||
{Id: "6040aa17-9c64-4fef-9bd0-77234d71bad0", GidNumber: 30001, OnPremisesSamAccountName: "sailing-lovers", DisplayName: "Sailing lovers", Members: []*accountsmsg.Account{
|
||||
{Id: "4c510ada-c86b-4815-8820-42cdf82c3d51"}, // einstein
|
||||
{Id: "534bb038-6f9d-4093-946f-133be61fa4e7"}, // katherine
|
||||
}},
|
||||
{Id: "dd58e5ec-842e-498b-8800-61f2ec6f911f", GidNumber: 30002, OnPremisesSamAccountName: "violin-haters", DisplayName: "Violin haters", Members: []*accountsmsg.Account{
|
||||
{Id: "4c510ada-c86b-4815-8820-42cdf82c3d51"}, // einstein
|
||||
@@ -368,6 +413,7 @@ func (s Service) createDefaultGroups(withDemoGroups bool) (err error) {
|
||||
}},
|
||||
{Id: "a1726108-01f8-4c30-88df-2b1a9d1cba1a", GidNumber: 30005, OnPremisesSamAccountName: "quantum-lovers", DisplayName: "Quantum lovers", Members: []*accountsmsg.Account{
|
||||
{Id: "932b4540-8d16-481e-8ef4-588e4b6b151c"}, // feynman
|
||||
{Id: "534bb038-6f9d-4093-946f-133be61fa4e7"}, // katherine
|
||||
}},
|
||||
{Id: "167cbee2-0518-455a-bfb2-031fe0621e5d", GidNumber: 30006, OnPremisesSamAccountName: "philosophy-haters", DisplayName: "Philosophy haters", Members: []*accountsmsg.Account{
|
||||
{Id: "932b4540-8d16-481e-8ef4-588e4b6b151c"}, // feynman
|
||||
@@ -376,6 +422,7 @@ func (s Service) createDefaultGroups(withDemoGroups bool) (err error) {
|
||||
{Id: "4c510ada-c86b-4815-8820-42cdf82c3d51"}, // einstein
|
||||
{Id: "f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"}, // marie
|
||||
{Id: "932b4540-8d16-481e-8ef4-588e4b6b151c"}, // feynman
|
||||
{Id: "534bb038-6f9d-4093-946f-133be61fa4e7"}, // katherine
|
||||
}},
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
SHELL := bash
|
||||
NAME := audit
|
||||
|
||||
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)) # suppress `command not found warnings` for non go targets in CI
|
||||
include ../.bingo/Variables.mk
|
||||
endif
|
||||
|
||||
############ go tooling ############
|
||||
include ../.make/go.mk
|
||||
|
||||
############ release ############
|
||||
include ../.make/release.mk
|
||||
|
||||
############ docs generate ############
|
||||
include ../.make/docs.mk
|
||||
|
||||
############ l10n ############
|
||||
include ../.make/l10n.mk
|
||||
|
||||
.PHONY: docs-generate
|
||||
docs-generate: config-docs-generate \
|
||||
grpc-docs-generate
|
||||
|
||||
############ generate ############
|
||||
include ../.make/generate.mk
|
||||
|
||||
.PHONY: ci-go-generate
|
||||
ci-go-generate: protobuf # CI runs ci-node-generate automatically before this target
|
||||
|
||||
.PHONY: ci-node-generate
|
||||
ci-node-generate: yarn-build
|
||||
|
||||
.PHONY: yarn-build
|
||||
yarn-build: node_modules
|
||||
yarn lint
|
||||
yarn test
|
||||
yarn build
|
||||
|
||||
.PHONY: node_modules
|
||||
node_modules:
|
||||
yarn install --immutable
|
||||
|
||||
############ protobuf ############
|
||||
include ../.make/protobuf.mk
|
||||
|
||||
.PHONY: protobuf
|
||||
protobuf: buf-generate
|
||||
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/owncloud/ocis/audit/pkg/command"
|
||||
"github.com/owncloud/ocis/audit/pkg/config/defaults"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := command.Execute(defaults.DefaultConfig()); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Health is the entrypoint for the health command.
|
||||
func Health(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "health",
|
||||
Usage: "Check health status",
|
||||
Action: func(c *cli.Context) error {
|
||||
// Not implemented
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/clihelper"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
"github.com/thejerf/suture/v4"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// GetCommands provides all commands for this service
|
||||
func GetCommands(cfg *config.Config) cli.Commands {
|
||||
return []*cli.Command{
|
||||
// start this service
|
||||
Server(cfg),
|
||||
|
||||
// interaction with this service
|
||||
|
||||
// infos about this service
|
||||
Health(cfg),
|
||||
Version(cfg),
|
||||
}
|
||||
}
|
||||
|
||||
// Execute is the entry point for the audit command.
|
||||
func Execute(cfg *config.Config) error {
|
||||
app := clihelper.DefaultApp(&cli.App{
|
||||
Name: "audit",
|
||||
Usage: "starts audit service",
|
||||
Commands: GetCommands(cfg),
|
||||
})
|
||||
|
||||
cli.HelpFlag = &cli.BoolFlag{
|
||||
Name: "help,h",
|
||||
Usage: "Show the help",
|
||||
}
|
||||
|
||||
return app.Run(os.Args)
|
||||
}
|
||||
|
||||
// SutureService allows for the audit command to be embedded and supervised by a suture supervisor tree.
|
||||
type SutureService struct {
|
||||
cfg *config.Config
|
||||
}
|
||||
|
||||
// NewSutureService creates a new audit.SutureService
|
||||
func NewSutureService(cfg *ociscfg.Config) suture.Service {
|
||||
cfg.Settings.Commons = cfg.Commons
|
||||
return SutureService{
|
||||
cfg: cfg.Audit,
|
||||
}
|
||||
}
|
||||
|
||||
func (s SutureService) Serve(ctx context.Context) error {
|
||||
s.cfg.Context = ctx
|
||||
if err := Execute(s.cfg); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/asim/go-micro/plugins/events/natsjs/v4"
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
"github.com/cs3org/reva/v2/pkg/events/server"
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/owncloud/ocis/audit/pkg/config/parser"
|
||||
"github.com/owncloud/ocis/audit/pkg/logging"
|
||||
svc "github.com/owncloud/ocis/audit/pkg/service"
|
||||
"github.com/owncloud/ocis/audit/pkg/types"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Server is the entrypoint for the server command.
|
||||
func Server(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "server",
|
||||
Usage: fmt.Sprintf("start %s extension without runtime (unsupervised mode)", cfg.Service.Name),
|
||||
Category: "server",
|
||||
Before: func(c *cli.Context) error {
|
||||
return parser.ParseConfig(cfg)
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
logger := logging.Configure(cfg.Service.Name, cfg.Log)
|
||||
|
||||
ctx := cfg.Context
|
||||
if ctx == nil {
|
||||
ctx = context.Background()
|
||||
}
|
||||
ctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
|
||||
evtsCfg := cfg.Events
|
||||
client, err := server.NewNatsStream(
|
||||
natsjs.Address(evtsCfg.Endpoint),
|
||||
natsjs.ClusterID(evtsCfg.Cluster),
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
evts, err := events.Consume(client, evtsCfg.ConsumerGroup, types.RegisteredEvents()...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
svc.AuditLoggerFromConfig(ctx, cfg.Auditlog, evts, logger)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// Version prints the service versions of all running instances.
|
||||
func Version(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "version",
|
||||
Usage: "print the version of this binary and the running extension instances",
|
||||
Category: "info",
|
||||
Action: func(c *cli.Context) error {
|
||||
// not implemented
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
||||
)
|
||||
|
||||
// Config combines all available configuration parts.
|
||||
type Config struct {
|
||||
*shared.Commons `ocisConfig:"-" yaml:"-"`
|
||||
|
||||
Service Service `ocisConfig:"-" yaml:"-"`
|
||||
|
||||
Log *Log `ocisConfig:"log"`
|
||||
Debug Debug `ocisConfig:"debug"`
|
||||
|
||||
Events Events `ocisConfig:"events"`
|
||||
Auditlog Auditlog `ocisConfig:"auditlog"`
|
||||
|
||||
Context context.Context `ocisConfig:"-" yaml:"-"`
|
||||
}
|
||||
|
||||
// Events combines the configuration options for the event bus.
|
||||
type Events struct {
|
||||
Endpoint string `ocisConfig:"events_endpoint" env:"AUDIT_EVENTS_ENDPOINT" desc:"the address of the streaming service"`
|
||||
Cluster string `ocisConfig:"events_cluster" env:"AUDIT_EVENTS_CLUSTER" desc:"the clusterID of the streaming service. Mandatory when using nats"`
|
||||
ConsumerGroup string `ocisConfig:"events_group" env:"AUDIT_EVENTS_GROUP" desc:"the customergroup of the service. One group will only get one vopy of an event"`
|
||||
}
|
||||
|
||||
// Auditlog holds audit log information
|
||||
type Auditlog struct {
|
||||
LogToConsole bool `ocisConfig:"log_to_console" env:"AUDIT_LOG_TO_CONSOLE" desc:"logs to Stdout if true"`
|
||||
LogToFile bool `ocisConfig:"log_to_file" env:"AUDIT_LOG_TO_FILE" desc:"logs to file if true"`
|
||||
FilePath string `ocisConfig:"filepath" env:"AUDIT_FILEPATH" desc:"filepath to the logfile. Mandatory if LogToFile is true"`
|
||||
Format string `ocisConfig:"format" env:"AUDIT_FORMAT" desc:"log format. using json is advised"`
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
// Debug defines the available debug configuration.
|
||||
type Debug struct {
|
||||
Addr string `ocisConfig:"addr" env:"AUDIT_DEBUG_ADDR"`
|
||||
Token string `ocisConfig:"token" env:"AUDIT_DEBUG_TOKEN"`
|
||||
Pprof bool `ocisConfig:"pprof" env:"AUDIT_DEBUG_PPROF"`
|
||||
Zpages bool `ocisConfig:"zpages" env:"AUDIT_DEBUG_ZPAGES"`
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package defaults
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
)
|
||||
|
||||
func FullDefaultConfig() *config.Config {
|
||||
cfg := DefaultConfig()
|
||||
|
||||
EnsureDefaults(cfg)
|
||||
Sanitize(cfg)
|
||||
|
||||
return cfg
|
||||
}
|
||||
|
||||
func DefaultConfig() *config.Config {
|
||||
return &config.Config{
|
||||
Service: config.Service{
|
||||
Name: "audit",
|
||||
},
|
||||
Events: config.Events{
|
||||
Endpoint: "127.0.0.1:9233",
|
||||
Cluster: "ocis-cluster",
|
||||
ConsumerGroup: "audit",
|
||||
},
|
||||
Auditlog: config.Auditlog{
|
||||
LogToConsole: true,
|
||||
Format: "json",
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func EnsureDefaults(cfg *config.Config) {
|
||||
// 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 = &config.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.Log = &config.Log{}
|
||||
}
|
||||
}
|
||||
|
||||
func Sanitize(cfg *config.Config) {
|
||||
// sanitize config
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package config
|
||||
|
||||
// Log defines the available log configuration.
|
||||
type Log struct {
|
||||
Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;AUDIT_LOG_LEVEL"`
|
||||
Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;AUDIT_LOG_PRETTY"`
|
||||
Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;AUDIT_LOG_COLOR"`
|
||||
File string `mapstructure:"file" env:"OCIS_LOG_FILE;AUDIT_LOG_FILE"`
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package parser
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/owncloud/ocis/audit/pkg/config/defaults"
|
||||
ociscfg "github.com/owncloud/ocis/ocis-pkg/config"
|
||||
|
||||
"github.com/owncloud/ocis/ocis-pkg/config/envdecode"
|
||||
)
|
||||
|
||||
// ParseConfig loads accounts configuration from known paths.
|
||||
func ParseConfig(cfg *config.Config) error {
|
||||
_, err := ociscfg.BindSourcesToStructs(cfg.Service.Name, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
defaults.EnsureDefaults(cfg)
|
||||
|
||||
// load all env variables relevant to the config in the current context.
|
||||
if err := envdecode.Decode(cfg); err != nil {
|
||||
// no environment variable set for this config is an expected "error"
|
||||
if !errors.Is(err, envdecode.ErrNoTargetFieldsAreSet) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
defaults.Sanitize(cfg)
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package config
|
||||
|
||||
// Service defines the available service configuration.
|
||||
type Service struct {
|
||||
Name string `ocisConfig:"-" yaml:"-"`
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
)
|
||||
|
||||
// LoggerFromConfig initializes a service-specific logger instance.
|
||||
func Configure(name string, cfg *config.Log) log.Logger {
|
||||
return log.NewLogger(
|
||||
log.Name(name),
|
||||
log.Level(cfg.Level),
|
||||
log.Pretty(cfg.Pretty),
|
||||
log.Color(cfg.Color),
|
||||
log.File(cfg.File),
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package svc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
"github.com/owncloud/ocis/audit/pkg/config"
|
||||
"github.com/owncloud/ocis/audit/pkg/types"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
)
|
||||
|
||||
// Log is used to log to different outputs
|
||||
type Log func([]byte)
|
||||
|
||||
// Marshaller is used to marshal events
|
||||
type Marshaller func(interface{}) ([]byte, error)
|
||||
|
||||
// AuditLoggerFromConfig will start a new AuditLogger generated from the config
|
||||
func AuditLoggerFromConfig(ctx context.Context, cfg config.Auditlog, ch <-chan interface{}, log log.Logger) {
|
||||
var logs []Log
|
||||
|
||||
if cfg.LogToConsole {
|
||||
logs = append(logs, WriteToStdout())
|
||||
}
|
||||
|
||||
if cfg.LogToFile {
|
||||
logs = append(logs, WriteToFile(cfg.FilePath, log))
|
||||
}
|
||||
|
||||
StartAuditLogger(ctx, ch, log, Marshal(cfg.Format, log), logs...)
|
||||
|
||||
}
|
||||
|
||||
// StartAuditLogger will block. run in seperate go routine
|
||||
func StartAuditLogger(ctx context.Context, ch <-chan interface{}, log log.Logger, marshaller Marshaller, logto ...Log) {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case i := <-ch:
|
||||
var auditEvent interface{}
|
||||
switch ev := i.(type) {
|
||||
case events.ShareCreated:
|
||||
auditEvent = types.ShareCreated(ev)
|
||||
case events.LinkCreated:
|
||||
auditEvent = types.LinkCreated(ev)
|
||||
case events.ShareUpdated:
|
||||
auditEvent = types.ShareUpdated(ev)
|
||||
case events.LinkUpdated:
|
||||
auditEvent = types.LinkUpdated(ev)
|
||||
case events.ShareRemoved:
|
||||
auditEvent = types.ShareRemoved(ev)
|
||||
case events.LinkRemoved:
|
||||
auditEvent = types.LinkRemoved(ev)
|
||||
case events.ReceivedShareUpdated:
|
||||
auditEvent = types.ReceivedShareUpdated(ev)
|
||||
case events.LinkAccessed:
|
||||
auditEvent = types.LinkAccessed(ev)
|
||||
case events.LinkAccessFailed:
|
||||
auditEvent = types.LinkAccessFailed(ev)
|
||||
case events.FileUploaded:
|
||||
auditEvent = types.FileUploaded(ev)
|
||||
case events.FileDownloaded:
|
||||
auditEvent = types.FileDownloaded(ev)
|
||||
case events.ItemMoved:
|
||||
auditEvent = types.ItemMoved(ev)
|
||||
case events.ItemTrashed:
|
||||
auditEvent = types.ItemTrashed(ev)
|
||||
case events.ItemPurged:
|
||||
auditEvent = types.ItemPurged(ev)
|
||||
case events.ItemRestored:
|
||||
auditEvent = types.ItemRestored(ev)
|
||||
case events.FileVersionRestored:
|
||||
auditEvent = types.FileVersionRestored(ev)
|
||||
case events.SpaceCreated:
|
||||
auditEvent = types.SpaceCreated(ev)
|
||||
case events.SpaceRenamed:
|
||||
auditEvent = types.SpaceRenamed(ev)
|
||||
case events.SpaceDisabled:
|
||||
auditEvent = types.SpaceDisabled(ev)
|
||||
case events.SpaceEnabled:
|
||||
auditEvent = types.SpaceEnabled(ev)
|
||||
case events.SpaceDeleted:
|
||||
auditEvent = types.SpaceDeleted(ev)
|
||||
default:
|
||||
log.Error().Interface("event", ev).Msg(fmt.Sprintf("can't handle event of type '%T'", ev))
|
||||
continue
|
||||
|
||||
}
|
||||
|
||||
b, err := marshaller(auditEvent)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error marshaling the event")
|
||||
continue
|
||||
}
|
||||
|
||||
for _, l := range logto {
|
||||
l(b)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// WriteToFile returns a Log function writing to a file
|
||||
func WriteToFile(path string, log log.Logger) Log {
|
||||
return func(content []byte) {
|
||||
file, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msgf("error opening file '%s'", path)
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
if _, err := fmt.Fprintln(file, string(content)); err != nil {
|
||||
log.Error().Err(err).Msgf("error writing to file '%s'", path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// WriteToStdout return a Log function writing to Stdout
|
||||
func WriteToStdout() Log {
|
||||
return func(content []byte) {
|
||||
fmt.Println(string(content))
|
||||
}
|
||||
}
|
||||
|
||||
// Marshal returns a Marshaller from the `format` string
|
||||
func Marshal(format string, log log.Logger) Marshaller {
|
||||
switch format {
|
||||
default:
|
||||
log.Error().Msgf("unknown format '%s'", format)
|
||||
return nil
|
||||
case "json":
|
||||
return json.Marshal
|
||||
case "minimal":
|
||||
return func(ev interface{}) ([]byte, error) {
|
||||
b, err := json.Marshal(ev)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
m := make(map[string]interface{})
|
||||
if err := json.Unmarshal(b, &m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
format := fmt.Sprintf("%s)\n %s", m["Action"], m["Message"])
|
||||
return []byte(format), nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,635 @@
|
||||
package svc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
"github.com/owncloud/ocis/audit/pkg/types"
|
||||
"github.com/owncloud/ocis/ocis-pkg/log"
|
||||
"github.com/test-go/testify/require"
|
||||
|
||||
group "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
|
||||
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
collaboration "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1"
|
||||
link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
rtypes "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
)
|
||||
|
||||
var testCases = []struct {
|
||||
Alias string
|
||||
SystemEvent interface{}
|
||||
CheckAuditEvent func(*testing.T, []byte)
|
||||
}{
|
||||
{
|
||||
Alias: "ShareCreated - user",
|
||||
SystemEvent: events.ShareCreated{
|
||||
Sharer: userID("sharing-userid"),
|
||||
GranteeUserID: userID("beshared-userid"),
|
||||
GranteeGroupID: nil,
|
||||
ItemID: resourceID("storage-1", "itemid-1"),
|
||||
CTime: timestamp(0),
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareCreated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "sharing-userid", "1970-01-01T00:00:00Z", "user 'sharing-userid' shared file 'itemid-1' with 'beshared-userid'", "file_shared")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "")
|
||||
// AuditEventShareCreated fields
|
||||
require.Equal(t, "", ev.ItemType)
|
||||
require.Equal(t, "", ev.ExpirationDate)
|
||||
require.Equal(t, false, ev.SharePass)
|
||||
//require.Equal(t, "stat:true ", ev.Permissions) // TODO: BUG! Should work
|
||||
require.Equal(t, "user", ev.ShareType)
|
||||
require.Equal(t, "beshared-userid", ev.ShareWith)
|
||||
require.Equal(t, "sharing-userid", ev.ShareOwner)
|
||||
require.Equal(t, "", ev.ShareToken)
|
||||
},
|
||||
}, {
|
||||
Alias: "ShareCreated - group",
|
||||
SystemEvent: events.ShareCreated{
|
||||
Sharer: userID("sharing-userid"),
|
||||
GranteeUserID: nil,
|
||||
GranteeGroupID: groupID("beshared-groupid"),
|
||||
ItemID: resourceID("storage-1", "itemid-1"),
|
||||
CTime: timestamp(10e8),
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareCreated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "sharing-userid", "2001-09-09T01:46:40Z", "user 'sharing-userid' shared file 'itemid-1' with 'beshared-groupid'", "file_shared")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "")
|
||||
// AuditEventShareCreated fields
|
||||
require.Equal(t, "", ev.ItemType)
|
||||
require.Equal(t, "", ev.ExpirationDate)
|
||||
require.Equal(t, false, ev.SharePass)
|
||||
//require.Equal(t, "stat:true ", ev.Permissions) // TODO: BUG! Should work
|
||||
require.Equal(t, "group", ev.ShareType)
|
||||
require.Equal(t, "beshared-groupid", ev.ShareWith)
|
||||
require.Equal(t, "sharing-userid", ev.ShareOwner)
|
||||
require.Equal(t, "", ev.ShareToken)
|
||||
|
||||
},
|
||||
}, {
|
||||
Alias: "ShareUpdated",
|
||||
SystemEvent: events.ShareUpdated{
|
||||
ShareID: shareID("shareid"),
|
||||
Sharer: userID("sharing-userid"),
|
||||
GranteeUserID: nil,
|
||||
GranteeGroupID: groupID("beshared-groupid"),
|
||||
ItemID: resourceID("storage-1", "itemid-1"),
|
||||
Permissions: sharePermissions("stat", "get_quota"),
|
||||
MTime: timestamp(10e8),
|
||||
Updated: "permissions",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareUpdated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "sharing-userid", "2001-09-09T01:46:40Z", "user 'sharing-userid' updated field 'permissions' of share 'shareid'", "share_permission_updated")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "", ev.ExpirationDate) // no expiration for shares
|
||||
require.Equal(t, false, ev.SharePass)
|
||||
require.Equal(t, "get_quota:true stat:true ", ev.Permissions)
|
||||
require.Equal(t, "group", ev.ShareType)
|
||||
require.Equal(t, "beshared-groupid", ev.ShareWith)
|
||||
require.Equal(t, "sharing-userid", ev.ShareOwner)
|
||||
require.Equal(t, "", ev.ShareToken) // token not filled for shares
|
||||
},
|
||||
}, {
|
||||
Alias: "LinkUpdated - permissions",
|
||||
SystemEvent: events.LinkUpdated{
|
||||
ShareID: linkID("shareid"),
|
||||
Sharer: userID("sharing-userid"),
|
||||
ItemID: resourceID("storage-1", "itemid-1"),
|
||||
Permissions: linkPermissions("stat"),
|
||||
CTime: timestamp(10e8),
|
||||
DisplayName: "link",
|
||||
Expiration: timestamp(10e8 + 10e5),
|
||||
PasswordProtected: true,
|
||||
Token: "token-123",
|
||||
FieldUpdated: "permissions",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareUpdated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "sharing-userid", "2001-09-09T01:46:40Z", "user 'sharing-userid' updated field 'permissions' of public link 'shareid'", "share_permission_updated")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "2001-09-20T15:33:20Z", ev.ExpirationDate)
|
||||
require.Equal(t, true, ev.SharePass)
|
||||
require.Equal(t, "stat:true ", ev.Permissions)
|
||||
require.Equal(t, "link", ev.ShareType)
|
||||
require.Equal(t, "", ev.ShareWith) // not filled on links
|
||||
require.Equal(t, "sharing-userid", ev.ShareOwner)
|
||||
require.Equal(t, "token-123", ev.ShareToken)
|
||||
},
|
||||
}, {
|
||||
Alias: "ShareRemoved",
|
||||
SystemEvent: events.ShareRemoved{
|
||||
ShareID: shareID("shareid"),
|
||||
ShareKey: nil,
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareRemoved{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "share id:'shareid' uid:'' item-id:'' was removed", "file_unshared")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "", "", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "", ev.ShareType)
|
||||
require.Equal(t, "", ev.ShareWith) // not filled on links
|
||||
},
|
||||
}, {
|
||||
Alias: "LinkRemoved - id",
|
||||
SystemEvent: events.LinkRemoved{
|
||||
ShareID: linkID("shareid"),
|
||||
ShareToken: "",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareRemoved{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "public link id:'shareid' was removed", "file_unshared")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "", "", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "link", ev.ShareType)
|
||||
require.Equal(t, "", ev.ShareWith) // not filled on links
|
||||
},
|
||||
}, {
|
||||
Alias: "LinkRemoved - token",
|
||||
SystemEvent: events.LinkRemoved{
|
||||
ShareID: nil,
|
||||
ShareToken: "token-123",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventShareRemoved{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "public link id:'token-123' was removed", "file_unshared")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "", "", "token-123")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "link", ev.ShareType)
|
||||
require.Equal(t, "", ev.ShareWith) // not filled on links
|
||||
},
|
||||
}, {
|
||||
Alias: "Share accepted",
|
||||
SystemEvent: events.ReceivedShareUpdated{
|
||||
ShareID: shareID("shareid"),
|
||||
ItemID: resourceID("storageid-1", "itemid-1"),
|
||||
Permissions: sharePermissions("get_quota"),
|
||||
GranteeUserID: userID("beshared-userid"),
|
||||
GranteeGroupID: nil,
|
||||
Sharer: userID("sharing-userid"),
|
||||
MTime: timestamp(10e8),
|
||||
State: "SHARE_STATE_ACCEPTED",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventReceivedShareUpdated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "beshared-userid", "2001-09-09T01:46:40Z", "user 'beshared-userid' accepted share 'shareid' from user 'sharing-userid'", "share_accepted")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType)
|
||||
require.Equal(t, "user", ev.ShareType)
|
||||
require.Equal(t, "beshared-userid", ev.ShareWith)
|
||||
},
|
||||
}, {
|
||||
Alias: "Share declined",
|
||||
SystemEvent: events.ReceivedShareUpdated{
|
||||
ShareID: shareID("shareid"),
|
||||
ItemID: resourceID("storageid-1", "itemid-1"),
|
||||
Permissions: sharePermissions("get_quota"),
|
||||
GranteeUserID: userID("beshared-userid"),
|
||||
GranteeGroupID: nil,
|
||||
Sharer: userID("sharing-userid"),
|
||||
MTime: timestamp(10e8),
|
||||
State: "SHARE_STATE_DECLINED",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventReceivedShareUpdated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "beshared-userid", "2001-09-09T01:46:40Z", "user 'beshared-userid' declined share 'shareid' from user 'sharing-userid'", "share_declined")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType)
|
||||
require.Equal(t, "user", ev.ShareType)
|
||||
require.Equal(t, "beshared-userid", ev.ShareWith)
|
||||
},
|
||||
}, {
|
||||
Alias: "Link accessed - success",
|
||||
SystemEvent: events.LinkAccessed{
|
||||
ShareID: linkID("shareid"),
|
||||
Sharer: userID("sharing-userid"),
|
||||
ItemID: resourceID("storage-1", "itemid-1"),
|
||||
Permissions: linkPermissions("stat"),
|
||||
DisplayName: "link",
|
||||
Expiration: timestamp(10e8 + 10e5),
|
||||
PasswordProtected: true,
|
||||
CTime: timestamp(10e8),
|
||||
Token: "token-123",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventLinkAccessed{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "sharing-userid", "2001-09-09T01:46:40Z", "link 'shareid' was accessed. Success: true", "public_link_accessed")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "itemid-1", "sharing-userid", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "token-123", ev.ShareToken)
|
||||
require.Equal(t, true, ev.Success)
|
||||
},
|
||||
}, {
|
||||
Alias: "Link accessed - failure",
|
||||
SystemEvent: events.LinkAccessFailed{
|
||||
ShareID: linkID("shareid"),
|
||||
Token: "token-123",
|
||||
Status: 8,
|
||||
Message: "access denied",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventLinkAccessed{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "link 'shareid' was accessed. Success: false", "public_link_accessed")
|
||||
// AuditEventSharing fields
|
||||
checkSharingAuditEvent(t, ev.AuditEventSharing, "", "", "shareid")
|
||||
// AuditEventShareUpdated fields
|
||||
require.Equal(t, "", ev.ItemType) // not implemented atm
|
||||
require.Equal(t, "token-123", ev.ShareToken)
|
||||
require.Equal(t, false, ev.Success)
|
||||
},
|
||||
}, {
|
||||
Alias: "File created",
|
||||
SystemEvent: events.FileUploaded{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileCreated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was created", "file_create")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
},
|
||||
}, {
|
||||
Alias: "File read",
|
||||
SystemEvent: events.FileDownloaded{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileRead{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was read", "file_read")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
},
|
||||
}, {
|
||||
Alias: "File trashed",
|
||||
SystemEvent: events.ItemTrashed{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileDeleted{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was trashed", "file_delete")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
},
|
||||
}, {
|
||||
Alias: "File renamed",
|
||||
SystemEvent: events.ItemMoved{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
OldReference: reference("sto-123", "iid-123", "./anotheritem"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileRenamed{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was moved from './anotheritem' to './item'", "file_rename")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
// AuditEventFileRenamed fields
|
||||
require.Equal(t, "./anotheritem", ev.OldPath)
|
||||
|
||||
},
|
||||
}, {
|
||||
Alias: "File purged",
|
||||
SystemEvent: events.ItemPurged{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFilePurged{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was removed from trashbin", "file_trash_delete")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
},
|
||||
}, {
|
||||
Alias: "File restored",
|
||||
SystemEvent: events.ItemRestored{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
OldReference: reference("sto-123", "sto-123!iid-123/item", "./oldpath"),
|
||||
Key: "",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileRestored{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was restored from trashbin to './item'", "file_trash_restore")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
// AuditEventFileRestored fields
|
||||
require.Equal(t, "./oldpath", ev.OldPath)
|
||||
|
||||
},
|
||||
}, {
|
||||
Alias: "File version restored",
|
||||
SystemEvent: events.FileVersionRestored{
|
||||
FileID: reference("sto-123", "iid-123", "./item"),
|
||||
Owner: userID("uid-123"), // NOTE: owner not yet implemented in reva
|
||||
Key: "v1",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventFileVersionRestored{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "uid-123", "", "File 'sto-123!iid-123/item' was restored in version 'v1'", "file_version_restore")
|
||||
// AuditEventSharing fields
|
||||
checkFilesAuditEvent(t, ev.AuditEventFiles, "sto-123!iid-123/item", "uid-123", "./item")
|
||||
// AuditEventFileRestored fields
|
||||
require.Equal(t, "v1", ev.Key)
|
||||
|
||||
},
|
||||
}, {
|
||||
Alias: "Space created",
|
||||
SystemEvent: events.SpaceCreated{
|
||||
ID: &provider.StorageSpaceId{OpaqueId: "space-123"},
|
||||
Owner: userID("uid-123"),
|
||||
Root: resourceID("sto-123", "iid-123"),
|
||||
Name: "test-space",
|
||||
Type: "project",
|
||||
Quota: nil, // Quota not interesting atm
|
||||
MTime: timestamp(10e9),
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventSpaceCreated{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "2286-11-20T17:46:40Z", "Space 'space-123' with name 'test-space' was created", "space_created")
|
||||
// AuditEventSpaces fields
|
||||
checkSpacesAuditEvent(t, ev.AuditEventSpaces, "space-123")
|
||||
// AuditEventFileRestored fields
|
||||
require.Equal(t, "uid-123", ev.Owner)
|
||||
require.Equal(t, "sto-123!iid-123", ev.RootItem)
|
||||
require.Equal(t, "test-space", ev.Name)
|
||||
require.Equal(t, "project", ev.Type)
|
||||
},
|
||||
}, {
|
||||
Alias: "Space renamed",
|
||||
SystemEvent: events.SpaceRenamed{
|
||||
ID: &provider.StorageSpaceId{OpaqueId: "space-123"},
|
||||
Owner: userID("uid-123"),
|
||||
Name: "new-name",
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventSpaceRenamed{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "Space 'space-123' was renamed to 'new-name'", "space_renamed")
|
||||
// AuditEventSpaces fields
|
||||
checkSpacesAuditEvent(t, ev.AuditEventSpaces, "space-123")
|
||||
// AuditEventSpaceRenamed fields
|
||||
require.Equal(t, "new-name", ev.NewName)
|
||||
},
|
||||
}, {
|
||||
Alias: "Space disabled",
|
||||
SystemEvent: events.SpaceDisabled{
|
||||
ID: &provider.StorageSpaceId{OpaqueId: "space-123"},
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventSpaceDisabled{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "Space 'space-123' was disabled", "space_disabled")
|
||||
// AuditEventSpaces fields
|
||||
checkSpacesAuditEvent(t, ev.AuditEventSpaces, "space-123")
|
||||
},
|
||||
}, {
|
||||
Alias: "Space enabled",
|
||||
SystemEvent: events.SpaceEnabled{
|
||||
ID: &provider.StorageSpaceId{OpaqueId: "space-123"},
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventSpaceEnabled{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "Space 'space-123' was (re-) enabled", "space_enabled")
|
||||
// AuditEventSpaces fields
|
||||
checkSpacesAuditEvent(t, ev.AuditEventSpaces, "space-123")
|
||||
},
|
||||
}, {
|
||||
Alias: "Space deleted",
|
||||
SystemEvent: events.SpaceDeleted{
|
||||
ID: &provider.StorageSpaceId{OpaqueId: "space-123"},
|
||||
},
|
||||
CheckAuditEvent: func(t *testing.T, b []byte) {
|
||||
ev := types.AuditEventSpaceDeleted{}
|
||||
require.NoError(t, json.Unmarshal(b, &ev))
|
||||
|
||||
// AuditEvent fields
|
||||
checkBaseAuditEvent(t, ev.AuditEvent, "", "", "Space 'space-123' was deleted", "space_deleted")
|
||||
// AuditEventSpaces fields
|
||||
checkSpacesAuditEvent(t, ev.AuditEventSpaces, "space-123")
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func TestAuditLogging(t *testing.T) {
|
||||
log := log.NewLogger()
|
||||
|
||||
inch := make(chan interface{})
|
||||
defer close(inch)
|
||||
|
||||
outch := make(chan []byte)
|
||||
defer close(outch)
|
||||
|
||||
ctx, cancel := context.WithCancel(context.TODO())
|
||||
defer cancel()
|
||||
|
||||
go StartAuditLogger(ctx, inch, log, Marshal("json", log), func(b []byte) {
|
||||
outch <- b
|
||||
})
|
||||
|
||||
for i := range testCases {
|
||||
tc := testCases[i]
|
||||
t.Run(tc.Alias, func(t *testing.T) {
|
||||
inch <- tc.SystemEvent
|
||||
tc.CheckAuditEvent(t, <-outch)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func checkBaseAuditEvent(t *testing.T, ev types.AuditEvent, user string, time string, message string, action string) {
|
||||
require.Equal(t, "", ev.RemoteAddr) // not implemented atm
|
||||
require.Equal(t, user, ev.User)
|
||||
require.Equal(t, "", ev.URL) // not implemented atm
|
||||
require.Equal(t, "", ev.Method) // not implemented atm
|
||||
require.Equal(t, "", ev.UserAgent) // not implemented atm
|
||||
require.Equal(t, time, ev.Time)
|
||||
require.Equal(t, "admin_audit", ev.App)
|
||||
require.Equal(t, message, ev.Message)
|
||||
require.Equal(t, action, ev.Action)
|
||||
require.Equal(t, false, ev.CLI) // not implemented atm
|
||||
require.Equal(t, 1, ev.Level)
|
||||
}
|
||||
|
||||
func checkSharingAuditEvent(t *testing.T, ev types.AuditEventSharing, itemID string, owner string, shareID string) {
|
||||
require.Equal(t, itemID, ev.FileID)
|
||||
require.Equal(t, owner, ev.Owner)
|
||||
require.Equal(t, "", ev.Path) // not implemented atm
|
||||
require.Equal(t, shareID, ev.ShareID)
|
||||
}
|
||||
|
||||
func checkFilesAuditEvent(t *testing.T, ev types.AuditEventFiles, itemID string, owner string, path string) {
|
||||
require.Equal(t, itemID, ev.FileID)
|
||||
require.Equal(t, owner, ev.Owner)
|
||||
require.Equal(t, path, ev.Path)
|
||||
}
|
||||
|
||||
func checkSpacesAuditEvent(t *testing.T, ev types.AuditEventSpaces, spaceID string) {
|
||||
require.Equal(t, spaceID, ev.SpaceID)
|
||||
}
|
||||
func shareID(id string) *collaboration.ShareId {
|
||||
return &collaboration.ShareId{
|
||||
OpaqueId: id,
|
||||
}
|
||||
}
|
||||
|
||||
func linkID(id string) *link.PublicShareId {
|
||||
return &link.PublicShareId{
|
||||
OpaqueId: id,
|
||||
}
|
||||
}
|
||||
|
||||
func userID(id string) *user.UserId {
|
||||
return &user.UserId{
|
||||
OpaqueId: id,
|
||||
Idp: "idp",
|
||||
}
|
||||
}
|
||||
|
||||
func groupID(id string) *group.GroupId {
|
||||
return &group.GroupId{
|
||||
OpaqueId: id,
|
||||
Idp: "idp",
|
||||
}
|
||||
}
|
||||
|
||||
func resourceID(sid, oid string) *provider.ResourceId {
|
||||
return &provider.ResourceId{
|
||||
StorageId: sid,
|
||||
OpaqueId: oid,
|
||||
}
|
||||
}
|
||||
|
||||
func reference(sid, oid, path string) *provider.Reference {
|
||||
return &provider.Reference{
|
||||
ResourceId: resourceID(sid, oid),
|
||||
Path: path,
|
||||
}
|
||||
}
|
||||
|
||||
func timestamp(seconds uint64) *rtypes.Timestamp {
|
||||
return &rtypes.Timestamp{
|
||||
Seconds: seconds,
|
||||
Nanos: 0,
|
||||
}
|
||||
}
|
||||
|
||||
func sharePermissions(perms ...string) *collaboration.SharePermissions {
|
||||
return &collaboration.SharePermissions{
|
||||
Permissions: permissions(perms...),
|
||||
}
|
||||
}
|
||||
|
||||
func linkPermissions(perms ...string) *link.PublicSharePermissions {
|
||||
return &link.PublicSharePermissions{
|
||||
Permissions: permissions(perms...),
|
||||
}
|
||||
}
|
||||
|
||||
func permissions(permissions ...string) *provider.ResourcePermissions {
|
||||
perms := &provider.ResourcePermissions{}
|
||||
|
||||
for _, p := range permissions {
|
||||
switch p {
|
||||
case "stat":
|
||||
perms.Stat = true
|
||||
case "get_path":
|
||||
perms.GetPath = true
|
||||
case "list_container":
|
||||
perms.ListContainer = true
|
||||
case "get_quota":
|
||||
perms.GetQuota = true
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return perms
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package types
|
||||
|
||||
import "fmt"
|
||||
|
||||
// short identifiers for audit actions
|
||||
const (
|
||||
// Sharing
|
||||
ActionShareCreated = "file_shared"
|
||||
ActionSharePermissionUpdated = "share_permission_updated"
|
||||
ActionShareDisplayNameUpdated = "share_name_updated"
|
||||
ActionSharePasswordUpdated = "share_password_updated"
|
||||
ActionShareExpirationUpdated = "share_expiration_updated"
|
||||
ActionShareRemoved = "file_unshared"
|
||||
ActionShareAccepted = "share_accepted"
|
||||
ActionShareDeclined = "share_declined"
|
||||
ActionLinkAccessed = "public_link_accessed"
|
||||
|
||||
// Files
|
||||
ActionFileCreated = "file_create"
|
||||
ActionFileRead = "file_read"
|
||||
ActionFileTrashed = "file_delete"
|
||||
ActionFileRenamed = "file_rename"
|
||||
ActionFilePurged = "file_trash_delete"
|
||||
ActionFileRestored = "file_trash_restore"
|
||||
ActionFileVersionRestored = "file_version_restore"
|
||||
|
||||
// Spaces
|
||||
ActionSpaceCreated = "space_created"
|
||||
ActionSpaceRenamed = "space_renamed"
|
||||
ActionSpaceDisabled = "space_disabled"
|
||||
ActionSpaceEnabled = "space_enabled"
|
||||
ActionSpaceDeleted = "space_deleted"
|
||||
)
|
||||
|
||||
// MessageShareCreated returns the human readable string that describes the action
|
||||
func MessageShareCreated(sharer, item, grantee string) string {
|
||||
return fmt.Sprintf("user '%s' shared file '%s' with '%s'", sharer, item, grantee)
|
||||
}
|
||||
|
||||
// MessageLinkCreated returns the human readable string that describes the action
|
||||
func MessageLinkCreated(sharer, item, shareid string) string {
|
||||
return fmt.Sprintf("user '%s' created a public to file '%s' with id '%s'", sharer, item, shareid)
|
||||
}
|
||||
|
||||
// MessageShareUpdated returns the human readable string that describes the action
|
||||
func MessageShareUpdated(sharer, shareID, fieldUpdated string) string {
|
||||
return fmt.Sprintf("user '%s' updated field '%s' of share '%s'", sharer, fieldUpdated, shareID)
|
||||
}
|
||||
|
||||
// MessageLinkUpdated returns the human readable string that describes the action
|
||||
func MessageLinkUpdated(sharer, shareid, fieldUpdated string) string {
|
||||
return fmt.Sprintf("user '%s' updated field '%s' of public link '%s'", sharer, fieldUpdated, shareid)
|
||||
}
|
||||
|
||||
// MessageShareRemoved returns the human readable string that describes the action
|
||||
func MessageShareRemoved(sharer, shareid, itemid string) string {
|
||||
return fmt.Sprintf("share id:'%s' uid:'%s' item-id:'%s' was removed", shareid, sharer, itemid)
|
||||
}
|
||||
|
||||
// MessageLinkRemoved returns the human readable string that describes the action
|
||||
func MessageLinkRemoved(shareid string) string {
|
||||
return fmt.Sprintf("public link id:'%s' was removed", shareid)
|
||||
}
|
||||
|
||||
// MessageShareAccepted returns the human readable string that describes the action
|
||||
func MessageShareAccepted(userid, shareid, sharerid string) string {
|
||||
return fmt.Sprintf("user '%s' accepted share '%s' from user '%s'", userid, shareid, sharerid)
|
||||
}
|
||||
|
||||
// MessageShareDeclined returns the human readable string that describes the action
|
||||
func MessageShareDeclined(userid, shareid, sharerid string) string {
|
||||
return fmt.Sprintf("user '%s' declined share '%s' from user '%s'", userid, shareid, sharerid)
|
||||
}
|
||||
|
||||
// MessageLinkAccessed returns the human readable string that describes the action
|
||||
func MessageLinkAccessed(linkid string, success bool) string {
|
||||
return fmt.Sprintf("link '%s' was accessed. Success: %v", linkid, success)
|
||||
}
|
||||
|
||||
// MessageFileCreated returns the human readable string that describes the action
|
||||
func MessageFileCreated(item string) string {
|
||||
return fmt.Sprintf("File '%s' was created", item)
|
||||
}
|
||||
|
||||
// MessageFileRead returns the human readable string that describes the action
|
||||
func MessageFileRead(item string) string {
|
||||
return fmt.Sprintf("File '%s' was read", item)
|
||||
}
|
||||
|
||||
// MessageFileTrashed returns the human readable string that describes the action
|
||||
func MessageFileTrashed(item string) string {
|
||||
return fmt.Sprintf("File '%s' was trashed", item)
|
||||
}
|
||||
|
||||
// MessageFileRenamed returns the human readable string that describes the action
|
||||
func MessageFileRenamed(item, oldpath, newpath string) string {
|
||||
return fmt.Sprintf("File '%s' was moved from '%s' to '%s'", item, oldpath, newpath)
|
||||
}
|
||||
|
||||
// MessageFilePurged returns the human readable string that describes the action
|
||||
func MessageFilePurged(item string) string {
|
||||
return fmt.Sprintf("File '%s' was removed from trashbin", item)
|
||||
}
|
||||
|
||||
// MessageFileRestored returns the human readable string that describes the action
|
||||
func MessageFileRestored(item, path string) string {
|
||||
return fmt.Sprintf("File '%s' was restored from trashbin to '%s'", item, path)
|
||||
}
|
||||
|
||||
// MessageFileVersionRestored returns the human readable string that describes the action
|
||||
func MessageFileVersionRestored(item string, version string) string {
|
||||
return fmt.Sprintf("File '%s' was restored in version '%s'", item, version)
|
||||
}
|
||||
|
||||
// MessageSpaceCreated returns the human readable string that describes the action
|
||||
func MessageSpaceCreated(spaceID string, name string) string {
|
||||
return fmt.Sprintf("Space '%s' with name '%s' was created", spaceID, name)
|
||||
}
|
||||
|
||||
// MessageSpaceRenamed returns the human readable string that describes the action
|
||||
func MessageSpaceRenamed(spaceID string, name string) string {
|
||||
return fmt.Sprintf("Space '%s' was renamed to '%s'", spaceID, name)
|
||||
}
|
||||
|
||||
// MessageSpaceDisabled returns the human readable string that describes the action
|
||||
func MessageSpaceDisabled(spaceID string) string {
|
||||
return fmt.Sprintf("Space '%s' was disabled", spaceID)
|
||||
}
|
||||
|
||||
// MessageSpaceEnabled returns the human readable string that describes the action
|
||||
func MessageSpaceEnabled(spaceID string) string {
|
||||
return fmt.Sprintf("Space '%s' was (re-) enabled", spaceID)
|
||||
}
|
||||
|
||||
// MessageSpaceDeleted returns the human readable string that describes the action
|
||||
func MessageSpaceDeleted(spaceID string) string {
|
||||
return fmt.Sprintf("Space '%s' was deleted", spaceID)
|
||||
}
|
||||
@@ -0,0 +1,422 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
"github.com/cs3org/reva/v2/pkg/utils"
|
||||
|
||||
group "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1"
|
||||
user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
)
|
||||
|
||||
// BasicAuditEvent creates an AuditEvent from given values
|
||||
func BasicAuditEvent(uid string, ctime string, msg string, action string) AuditEvent {
|
||||
return AuditEvent{
|
||||
User: uid,
|
||||
Time: ctime,
|
||||
App: "admin_audit",
|
||||
Message: msg,
|
||||
Action: action,
|
||||
Level: 1,
|
||||
|
||||
// NOTE: those values are not in the events and can therefore not be filled at the moment
|
||||
RemoteAddr: "",
|
||||
URL: "",
|
||||
Method: "",
|
||||
UserAgent: "",
|
||||
CLI: false,
|
||||
}
|
||||
}
|
||||
|
||||
// SharingAuditEvent creates an AuditEventSharing from given values
|
||||
func SharingAuditEvent(shareid string, fileid string, uid string, base AuditEvent) AuditEventSharing {
|
||||
return AuditEventSharing{
|
||||
AuditEvent: base,
|
||||
FileID: fileid,
|
||||
Owner: uid,
|
||||
ShareID: shareid,
|
||||
|
||||
// NOTE: those values are not in the events and can therefore not be filled at the moment
|
||||
Path: "",
|
||||
}
|
||||
}
|
||||
|
||||
// ShareCreated converts a ShareCreated Event to an AuditEventShareCreated
|
||||
func ShareCreated(ev events.ShareCreated) AuditEventShareCreated {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
with, typ := extractGrantee(ev.GranteeUserID, ev.GranteeGroupID)
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageShareCreated(uid, ev.ItemID.OpaqueId, with), ActionShareCreated)
|
||||
return AuditEventShareCreated{
|
||||
AuditEventSharing: SharingAuditEvent("", ev.ItemID.OpaqueId, uid, base),
|
||||
ShareOwner: uid,
|
||||
ShareWith: with,
|
||||
ShareType: typ,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
ExpirationDate: "",
|
||||
SharePass: false,
|
||||
Permissions: "",
|
||||
ShareToken: "",
|
||||
}
|
||||
}
|
||||
|
||||
// LinkCreated converts a ShareCreated Event to an AuditEventShareCreated
|
||||
func LinkCreated(ev events.LinkCreated) AuditEventShareCreated {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
with, typ := "", "link"
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkCreated(uid, ev.ItemID.OpaqueId, ev.ShareID.OpaqueId), ActionShareCreated)
|
||||
return AuditEventShareCreated{
|
||||
AuditEventSharing: SharingAuditEvent("", ev.ItemID.OpaqueId, uid, base),
|
||||
ShareOwner: uid,
|
||||
ShareWith: with,
|
||||
ShareType: typ,
|
||||
ExpirationDate: formatTime(ev.Expiration),
|
||||
SharePass: ev.PasswordProtected,
|
||||
Permissions: ev.Permissions.String(),
|
||||
ShareToken: ev.Token,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// ShareUpdated converts a ShareUpdated event to an AuditEventShareUpdated
|
||||
func ShareUpdated(ev events.ShareUpdated) AuditEventShareUpdated {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
with, typ := extractGrantee(ev.GranteeUserID, ev.GranteeGroupID)
|
||||
base := BasicAuditEvent(uid, formatTime(ev.MTime), MessageShareUpdated(uid, ev.ShareID.OpaqueId, ev.Updated), updateType(ev.Updated))
|
||||
return AuditEventShareUpdated{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), ev.ItemID.OpaqueId, uid, base),
|
||||
ShareOwner: uid,
|
||||
ShareWith: with,
|
||||
ShareType: typ,
|
||||
Permissions: ev.Permissions.Permissions.String(),
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
ExpirationDate: "",
|
||||
SharePass: false,
|
||||
ShareToken: "",
|
||||
}
|
||||
}
|
||||
|
||||
// LinkUpdated converts a LinkUpdated event to an AuditEventShareUpdated
|
||||
func LinkUpdated(ev events.LinkUpdated) AuditEventShareUpdated {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
with, typ := "", "link"
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkUpdated(uid, ev.ShareID.OpaqueId, ev.FieldUpdated), updateType(ev.FieldUpdated))
|
||||
return AuditEventShareUpdated{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), ev.ItemID.OpaqueId, uid, base),
|
||||
ShareOwner: uid,
|
||||
ShareWith: with,
|
||||
ShareType: typ,
|
||||
Permissions: ev.Permissions.Permissions.String(),
|
||||
ExpirationDate: formatTime(ev.Expiration),
|
||||
SharePass: ev.PasswordProtected,
|
||||
ShareToken: ev.Token,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// ShareRemoved converts a ShareRemoved event to an AuditEventShareRemoved
|
||||
func ShareRemoved(ev events.ShareRemoved) AuditEventShareRemoved {
|
||||
sid, uid, iid, with, typ := "", "", "", "", ""
|
||||
if ev.ShareID != nil {
|
||||
sid = ev.ShareID.GetOpaqueId()
|
||||
}
|
||||
|
||||
if ev.ShareKey != nil {
|
||||
uid = ev.ShareKey.GetOwner().GetOpaqueId()
|
||||
iid = ev.ShareKey.GetResourceId().GetOpaqueId()
|
||||
with, typ = extractGrantee(ev.ShareKey.GetGrantee().GetUserId(), ev.ShareKey.GetGrantee().GetGroupId())
|
||||
}
|
||||
base := BasicAuditEvent(uid, "", MessageShareRemoved(uid, sid, iid), ActionShareRemoved)
|
||||
return AuditEventShareRemoved{
|
||||
AuditEventSharing: SharingAuditEvent(sid, iid, uid, base),
|
||||
ShareWith: with,
|
||||
ShareType: typ,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// LinkRemoved converts a LinkRemoved event to an AuditEventShareRemoved
|
||||
func LinkRemoved(ev events.LinkRemoved) AuditEventShareRemoved {
|
||||
uid, sid, typ := "", "", "link"
|
||||
if ev.ShareID != nil {
|
||||
sid = ev.ShareID.GetOpaqueId()
|
||||
} else {
|
||||
sid = ev.ShareToken
|
||||
}
|
||||
|
||||
base := BasicAuditEvent(uid, "", MessageLinkRemoved(sid), ActionShareRemoved)
|
||||
return AuditEventShareRemoved{
|
||||
AuditEventSharing: SharingAuditEvent(sid, "", uid, base),
|
||||
ShareWith: "",
|
||||
ShareType: typ,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// ReceivedShareUpdated converts a ReceivedShareUpdated event to an AuditEventReceivedShareUpdated
|
||||
func ReceivedShareUpdated(ev events.ReceivedShareUpdated) AuditEventReceivedShareUpdated {
|
||||
uid := ev.Sharer.GetOpaqueId()
|
||||
sid := ev.ShareID.GetOpaqueId()
|
||||
with, typ := extractGrantee(ev.GranteeUserID, ev.GranteeGroupID)
|
||||
itemID := ev.ItemID.GetOpaqueId()
|
||||
|
||||
msg, utype := "", ""
|
||||
switch ev.State {
|
||||
case "SHARE_STATE_ACCEPTED":
|
||||
msg = MessageShareAccepted(with, sid, uid)
|
||||
utype = ActionShareAccepted
|
||||
case "SHARE_STATE_DECLINED":
|
||||
msg = MessageShareDeclined(with, sid, uid)
|
||||
utype = ActionShareDeclined
|
||||
}
|
||||
base := BasicAuditEvent(with, formatTime(ev.MTime), msg, utype)
|
||||
return AuditEventReceivedShareUpdated{
|
||||
AuditEventSharing: SharingAuditEvent(sid, itemID, uid, base),
|
||||
ShareType: typ,
|
||||
ShareWith: with,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// LinkAccessed converts a LinkAccessed event to an AuditEventLinkAccessed
|
||||
func LinkAccessed(ev events.LinkAccessed) AuditEventLinkAccessed {
|
||||
uid := ev.Sharer.OpaqueId
|
||||
base := BasicAuditEvent(uid, formatTime(ev.CTime), MessageLinkAccessed(ev.ShareID.GetOpaqueId(), true), ActionLinkAccessed)
|
||||
return AuditEventLinkAccessed{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), ev.ItemID.OpaqueId, uid, base),
|
||||
ShareToken: ev.Token,
|
||||
Success: true,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// LinkAccessFailed converts a LinkAccessFailed event to an AuditEventLinkAccessed
|
||||
func LinkAccessFailed(ev events.LinkAccessFailed) AuditEventLinkAccessed {
|
||||
base := BasicAuditEvent("", "", MessageLinkAccessed(ev.ShareID.GetOpaqueId(), false), ActionLinkAccessed)
|
||||
return AuditEventLinkAccessed{
|
||||
AuditEventSharing: SharingAuditEvent(ev.ShareID.GetOpaqueId(), "", "", base),
|
||||
ShareToken: ev.Token,
|
||||
Success: false,
|
||||
|
||||
// NOTE: those values are not in the event and can therefore not be filled at the moment
|
||||
ItemType: "",
|
||||
}
|
||||
}
|
||||
|
||||
// FilesAuditEvent creates an AuditEventFiles from the given values
|
||||
func FilesAuditEvent(base AuditEvent, itemid, owner, path string) AuditEventFiles {
|
||||
return AuditEventFiles{
|
||||
AuditEvent: base,
|
||||
FileID: itemid,
|
||||
Owner: owner,
|
||||
Path: path,
|
||||
}
|
||||
}
|
||||
|
||||
// FileUploaded converts a FileUploaded event to an AuditEventFileCreated
|
||||
func FileUploaded(ev events.FileUploaded) AuditEventFileCreated {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
base := BasicAuditEvent(uid, "", MessageFileCreated(iid), ActionFileCreated)
|
||||
return AuditEventFileCreated{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
}
|
||||
}
|
||||
|
||||
// FileDownloaded converts a FileDownloaded event to an AuditEventFileRead
|
||||
func FileDownloaded(ev events.FileDownloaded) AuditEventFileRead {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
base := BasicAuditEvent(uid, "", MessageFileRead(iid), ActionFileRead)
|
||||
return AuditEventFileRead{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
}
|
||||
}
|
||||
|
||||
// ItemMoved converts a ItemMoved event to an AuditEventFileRenamed
|
||||
func ItemMoved(ev events.ItemMoved) AuditEventFileRenamed {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
|
||||
oldpath := ""
|
||||
if ev.OldReference != nil {
|
||||
oldpath = ev.OldReference.GetPath()
|
||||
}
|
||||
|
||||
base := BasicAuditEvent(uid, "", MessageFileRenamed(iid, oldpath, path), ActionFileRenamed)
|
||||
return AuditEventFileRenamed{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
OldPath: oldpath,
|
||||
}
|
||||
}
|
||||
|
||||
// ItemTrashed converts a ItemTrashed event to an AuditEventFileDeleted
|
||||
func ItemTrashed(ev events.ItemTrashed) AuditEventFileDeleted {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
base := BasicAuditEvent(uid, "", MessageFileTrashed(iid), ActionFileTrashed)
|
||||
return AuditEventFileDeleted{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
}
|
||||
}
|
||||
|
||||
// ItemPurged converts a ItemPurged event to an AuditEventFilePurged
|
||||
func ItemPurged(ev events.ItemPurged) AuditEventFilePurged {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
base := BasicAuditEvent(uid, "", MessageFilePurged(iid), ActionFilePurged)
|
||||
return AuditEventFilePurged{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
}
|
||||
}
|
||||
|
||||
// ItemRestored converts a ItemRestored event to an AuditEventFileRestored
|
||||
func ItemRestored(ev events.ItemRestored) AuditEventFileRestored {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
|
||||
oldpath := ""
|
||||
if ev.OldReference != nil {
|
||||
oldpath = ev.OldReference.GetPath()
|
||||
}
|
||||
|
||||
base := BasicAuditEvent(uid, "", MessageFileRestored(iid, path), ActionFileRestored)
|
||||
return AuditEventFileRestored{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
OldPath: oldpath,
|
||||
}
|
||||
}
|
||||
|
||||
// FileVersionRestored converts a FileVersionRestored event to an AuditEventFileVersionRestored
|
||||
func FileVersionRestored(ev events.FileVersionRestored) AuditEventFileVersionRestored {
|
||||
iid, path, uid := extractFileDetails(ev.FileID, ev.Owner)
|
||||
base := BasicAuditEvent(uid, "", MessageFileVersionRestored(iid, ev.Key), ActionFileVersionRestored)
|
||||
return AuditEventFileVersionRestored{
|
||||
AuditEventFiles: FilesAuditEvent(base, iid, uid, path),
|
||||
Key: ev.Key,
|
||||
}
|
||||
}
|
||||
|
||||
// SpacesAuditEvent creates an AuditEventSpaces from the given values
|
||||
func SpacesAuditEvent(base AuditEvent, spaceID string) AuditEventSpaces {
|
||||
return AuditEventSpaces{
|
||||
AuditEvent: base,
|
||||
SpaceID: spaceID,
|
||||
}
|
||||
}
|
||||
|
||||
// SpaceCreated converts a SpaceCreated event to an AuditEventSpaceCreated
|
||||
func SpaceCreated(ev events.SpaceCreated) AuditEventSpaceCreated {
|
||||
sid := ev.ID.GetOpaqueId()
|
||||
iid, _, owner := extractFileDetails(&provider.Reference{ResourceId: ev.Root}, ev.Owner)
|
||||
base := BasicAuditEvent("", formatTime(ev.MTime), MessageSpaceCreated(sid, ev.Name), ActionSpaceCreated)
|
||||
return AuditEventSpaceCreated{
|
||||
AuditEventSpaces: SpacesAuditEvent(base, sid),
|
||||
Owner: owner,
|
||||
RootItem: iid,
|
||||
Name: ev.Name,
|
||||
Type: ev.Type,
|
||||
}
|
||||
}
|
||||
|
||||
// SpaceRenamed converts a SpaceRenamed event to an AuditEventSpaceRenamed
|
||||
func SpaceRenamed(ev events.SpaceRenamed) AuditEventSpaceRenamed {
|
||||
sid := ev.ID.GetOpaqueId()
|
||||
base := BasicAuditEvent("", "", MessageSpaceRenamed(sid, ev.Name), ActionSpaceRenamed)
|
||||
return AuditEventSpaceRenamed{
|
||||
AuditEventSpaces: SpacesAuditEvent(base, sid),
|
||||
NewName: ev.Name,
|
||||
}
|
||||
}
|
||||
|
||||
// SpaceDisabled converts a SpaceDisabled event to an AuditEventSpaceDisabled
|
||||
func SpaceDisabled(ev events.SpaceDisabled) AuditEventSpaceDisabled {
|
||||
sid := ev.ID.GetOpaqueId()
|
||||
base := BasicAuditEvent("", "", MessageSpaceDisabled(sid), ActionSpaceDisabled)
|
||||
return AuditEventSpaceDisabled{
|
||||
AuditEventSpaces: SpacesAuditEvent(base, sid),
|
||||
}
|
||||
}
|
||||
|
||||
// SpaceEnabled converts a SpaceEnabled event to an AuditEventSpaceEnabled
|
||||
func SpaceEnabled(ev events.SpaceEnabled) AuditEventSpaceEnabled {
|
||||
sid := ev.ID.GetOpaqueId()
|
||||
base := BasicAuditEvent("", "", MessageSpaceEnabled(sid), ActionSpaceEnabled)
|
||||
return AuditEventSpaceEnabled{
|
||||
AuditEventSpaces: SpacesAuditEvent(base, sid),
|
||||
}
|
||||
}
|
||||
|
||||
// SpaceDeleted converts a SpaceDeleted event to an AuditEventSpaceDeleted
|
||||
func SpaceDeleted(ev events.SpaceDeleted) AuditEventSpaceDeleted {
|
||||
sid := ev.ID.GetOpaqueId()
|
||||
base := BasicAuditEvent("", "", MessageSpaceDeleted(sid), ActionSpaceDeleted)
|
||||
return AuditEventSpaceDeleted{
|
||||
AuditEventSpaces: SpacesAuditEvent(base, sid),
|
||||
}
|
||||
}
|
||||
|
||||
func extractGrantee(uid *user.UserId, gid *group.GroupId) (string, string) {
|
||||
switch {
|
||||
case uid != nil && uid.OpaqueId != "":
|
||||
return uid.OpaqueId, "user"
|
||||
case gid != nil && gid.OpaqueId != "":
|
||||
return gid.OpaqueId, "group"
|
||||
}
|
||||
|
||||
return "", ""
|
||||
}
|
||||
|
||||
func extractFileDetails(ref *provider.Reference, owner *user.UserId) (string, string, string) {
|
||||
id, path := "", ""
|
||||
if ref != nil {
|
||||
path = ref.GetPath()
|
||||
id, _ = utils.FormatStorageSpaceReference(ref)
|
||||
}
|
||||
|
||||
uid := ""
|
||||
if owner != nil {
|
||||
uid = owner.GetOpaqueId()
|
||||
}
|
||||
return id, path, uid
|
||||
}
|
||||
|
||||
func formatTime(t *types.Timestamp) string {
|
||||
if t == nil {
|
||||
return ""
|
||||
}
|
||||
return time.Unix(int64(t.Seconds), int64(t.Nanos)).UTC().Format(time.RFC3339)
|
||||
}
|
||||
|
||||
func updateType(u string) string {
|
||||
switch {
|
||||
case u == "permissions":
|
||||
return ActionSharePermissionUpdated
|
||||
case u == "displayname":
|
||||
return ActionShareDisplayNameUpdated
|
||||
case u == "TYPE_PERMISSIONS":
|
||||
return ActionSharePermissionUpdated
|
||||
case u == "TYPE_DISPLAYNAME":
|
||||
return ActionShareDisplayNameUpdated
|
||||
case u == "TYPE_PASSWORD":
|
||||
return ActionSharePasswordUpdated
|
||||
case u == "TYPE_EXPIRATION":
|
||||
return ActionShareExpirationUpdated
|
||||
default:
|
||||
fmt.Println("Unknown update type", u)
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"github.com/cs3org/reva/v2/pkg/events"
|
||||
)
|
||||
|
||||
// RegisteredEvents returns the events the service is registered for
|
||||
func RegisteredEvents() []events.Unmarshaller {
|
||||
return []events.Unmarshaller{
|
||||
events.ShareCreated{},
|
||||
events.ShareUpdated{},
|
||||
events.LinkCreated{},
|
||||
events.LinkUpdated{},
|
||||
events.ShareRemoved{},
|
||||
events.LinkRemoved{},
|
||||
events.ReceivedShareUpdated{},
|
||||
events.LinkAccessed{},
|
||||
events.LinkAccessFailed{},
|
||||
events.FileUploaded{},
|
||||
events.FileDownloaded{},
|
||||
events.ItemTrashed{},
|
||||
events.ItemMoved{},
|
||||
events.ItemPurged{},
|
||||
events.ItemRestored{},
|
||||
events.FileVersionRestored{},
|
||||
events.SpaceCreated{},
|
||||
events.SpaceRenamed{},
|
||||
events.SpaceEnabled{},
|
||||
events.SpaceDisabled{},
|
||||
events.SpaceDeleted{},
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,199 @@
|
||||
package types
|
||||
|
||||
// AuditEvent is the basic audit event
|
||||
type AuditEvent struct {
|
||||
RemoteAddr string // the remote client IP
|
||||
User string // the UID of the user performing the action. Or "IP x.x.x.x.", "cron", "CLI", "unknown"
|
||||
URL string // the process request URI
|
||||
Method string // the HTTP request method
|
||||
UserAgent string // the HTTP request user agent
|
||||
Time string // the time of the event eg: 2018-05-08T08:26:00+00:00
|
||||
App string // always 'admin_audit'
|
||||
Message string // sentence explaining the action
|
||||
Action string // unique action identifier eg: file_delete or public_link_created
|
||||
CLI bool // if the action was performed from the CLI
|
||||
Level int // the log level of the entry (usually 1 for audit events)
|
||||
}
|
||||
|
||||
/*
|
||||
Sharing
|
||||
*/
|
||||
|
||||
// AuditEventSharing is the basic audit event for shares
|
||||
type AuditEventSharing struct {
|
||||
AuditEvent
|
||||
|
||||
FileID string // The file identifier for the item shared.
|
||||
Owner string // The UID of the owner of the shared item.
|
||||
Path string // The path to the shared item.
|
||||
ShareID string // The sharing identifier. (not available for public_link_accessed or when recipient unshares)
|
||||
}
|
||||
|
||||
// AuditEventShareCreated is the event logged when a share is created
|
||||
type AuditEventShareCreated struct {
|
||||
AuditEventSharing
|
||||
|
||||
ItemType string // file or folder
|
||||
ExpirationDate string // The text expiration date in format 'yyyy-mm-dd'
|
||||
SharePass bool // If the share is password protected.
|
||||
Permissions string // The permissions string eg: "READ"
|
||||
ShareType string // group user or link
|
||||
ShareWith string // The UID or GID of the share recipient. (not available for public link)
|
||||
ShareOwner string // The UID of the share owner.
|
||||
ShareToken string // For link shares the unique token, else null
|
||||
}
|
||||
|
||||
// AuditEventShareUpdated is the event logged when a share is updated
|
||||
type AuditEventShareUpdated struct {
|
||||
AuditEventSharing
|
||||
|
||||
ItemType string // file or folder
|
||||
ExpirationDate string // The text expiration date in format 'yyyy-mm-dd'
|
||||
SharePass bool // If the share is password protected.
|
||||
Permissions string // The permissions string eg: "READ"
|
||||
ShareType string // group user or link
|
||||
ShareWith string // The UID or GID of the share recipient. (not available for public link)
|
||||
ShareOwner string // The UID of the share owner.
|
||||
ShareToken string // For link shares the unique token, else null
|
||||
}
|
||||
|
||||
// AuditEventShareRemoved is the event logged when a share is removed
|
||||
type AuditEventShareRemoved struct {
|
||||
AuditEventSharing
|
||||
ItemType string // file or folder
|
||||
ShareType string // group user or link
|
||||
ShareWith string // The UID or GID of the share recipient.
|
||||
}
|
||||
|
||||
// AuditEventReceivedShareUpdated is the event logged when a share is accepted or declined
|
||||
type AuditEventReceivedShareUpdated struct {
|
||||
AuditEventSharing
|
||||
ItemType string // file or folder
|
||||
ShareType string // group user or link
|
||||
ShareWith string // The UID or GID of the share recipient.
|
||||
}
|
||||
|
||||
// AuditEventLinkAccessed is the event logged when a link is accessed
|
||||
type AuditEventLinkAccessed struct {
|
||||
AuditEventSharing
|
||||
ShareToken string // The share token.
|
||||
Success bool // If the request was successful.
|
||||
ItemType string // file or folder
|
||||
}
|
||||
|
||||
/*
|
||||
Files
|
||||
*/
|
||||
|
||||
// AuditEventFiles is the basic audit event for files
|
||||
type AuditEventFiles struct {
|
||||
AuditEvent
|
||||
|
||||
Path string // The full path to the create file.
|
||||
Owner string // The UID of the owner of the file.
|
||||
FileID string // The newly created files identifier.
|
||||
}
|
||||
|
||||
// AuditEventFileCreated is the event logged when a file is created
|
||||
type AuditEventFileCreated struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileRead is the event logged when a file is read (aka downloaded)
|
||||
type AuditEventFileRead struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileUpdated is the event logged when a file is updated
|
||||
// TODO: How to differentiate between new uploads and new version uploads?
|
||||
// FIXME: implement
|
||||
type AuditEventFileUpdated struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileDeleted is the event logged when a file is deleted (aka trashed)
|
||||
type AuditEventFileDeleted struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileCopied is the event logged when a file is copied
|
||||
// TODO: copy is a download&upload for now. How to know it was a copy?
|
||||
// FIXME: implement
|
||||
type AuditEventFileCopied struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileRenamed is the event logged when a file is renamed (moved)
|
||||
type AuditEventFileRenamed struct {
|
||||
AuditEventFiles
|
||||
|
||||
OldPath string
|
||||
}
|
||||
|
||||
// AuditEventFilePurged is the event logged when a file is purged (deleted from trashbin)
|
||||
type AuditEventFilePurged struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
// AuditEventFileRestored is the event logged when a file is restored (from trashbin)
|
||||
type AuditEventFileRestored struct {
|
||||
AuditEventFiles
|
||||
|
||||
OldPath string
|
||||
}
|
||||
|
||||
// AuditEventFileVersionRestored is the event logged when a file version is restored
|
||||
type AuditEventFileVersionRestored struct {
|
||||
AuditEventFiles
|
||||
|
||||
Key string
|
||||
}
|
||||
|
||||
// AuditEventFileVersionDeleted is the event logged when a file version is deleted
|
||||
// TODO: is this even possible?
|
||||
type AuditEventFileVersionDeleted struct {
|
||||
AuditEventFiles
|
||||
}
|
||||
|
||||
/*
|
||||
Spaces
|
||||
*/
|
||||
|
||||
// AuditEventSpaces is the basic audit event for spaces
|
||||
type AuditEventSpaces struct {
|
||||
AuditEvent
|
||||
|
||||
SpaceID string
|
||||
}
|
||||
|
||||
// AuditEventSpaceCreated is the event logged when a space is created
|
||||
type AuditEventSpaceCreated struct {
|
||||
AuditEventSpaces
|
||||
|
||||
Owner string
|
||||
RootItem string
|
||||
Name string
|
||||
Type string
|
||||
}
|
||||
|
||||
// AuditEventSpaceRenamed is the event logged when a space is renamed
|
||||
type AuditEventSpaceRenamed struct {
|
||||
AuditEventSpaces
|
||||
|
||||
NewName string
|
||||
}
|
||||
|
||||
// AuditEventSpaceDisabled is the event logged when a space is disabled
|
||||
type AuditEventSpaceDisabled struct {
|
||||
AuditEventSpaces
|
||||
}
|
||||
|
||||
// AuditEventSpaceEnabled is the event logged when a space is (re-)enabled
|
||||
type AuditEventSpaceEnabled struct {
|
||||
AuditEventSpaces
|
||||
}
|
||||
|
||||
// AuditEventSpaceDeleted is the event logged when a space is deleted
|
||||
type AuditEventSpaceDeleted struct {
|
||||
AuditEventSpaces
|
||||
}
|
||||
@@ -96,5 +96,4 @@ We updated reva to the version 2.0.0.
|
||||
* Enh [cs3org/reva#2526](https://github.com/cs3org/reva/pull/2526) : Upgrade ginkgo to v2
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3231
|
||||
https://github.com/owncloud/ocis/pull/3231
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3258
|
||||
@@ -0,0 +1,5 @@
|
||||
Change: Add remote item to mountpoint and fix spaceID
|
||||
|
||||
A mountpoint represents the mounted share on the share receivers side. The original resource is located where the grant has been set. This item is now shown as libregraph remoteItem on the mountpoint. While adding this, we fixed the spaceID for mountpoints.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3365
|
||||
@@ -0,0 +1,6 @@
|
||||
Change: Switch NATS backend
|
||||
|
||||
We've switched the NATS backend from Streaming to JetStream, since NATS Streaming is depreciated.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3192
|
||||
https://github.com/cs3org/reva/pull/2574
|
||||
@@ -0,0 +1,7 @@
|
||||
Change: Drop json config file support
|
||||
|
||||
We've remove the support to configure oCIS and it's service with a json file.
|
||||
From now on we only support yaml configuration files, since they have the possibility
|
||||
to add comments.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3366
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Audit logger will now log file events
|
||||
|
||||
See full list of supported events in `audit/pkg/types/types.go`
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3332
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Network configuration in individiual_services example
|
||||
|
||||
Tidy up the deployments/examples/ocis_individual_services example so that the instructions work.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3238
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Improve gif thumbnails
|
||||
|
||||
Improved the gif thumbnail generation for gifs with different disposal strategies.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3305
|
||||
@@ -0,0 +1,6 @@
|
||||
Bugfix: Fix error handling in GraphAPI GetUsers call
|
||||
|
||||
A missing return statement caused GetUsers to return misleading results when
|
||||
the identity backend returned an error.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3357
|
||||
@@ -0,0 +1,6 @@
|
||||
Bugfix: Fix request validation on GraphAPI User updates
|
||||
|
||||
Fix PATCH on graph/v1.0/users when no 'mail' attribute
|
||||
is present in the request body
|
||||
|
||||
https://github.com/owncloud/ocis/issues/3167
|
||||
@@ -0,0 +1,7 @@
|
||||
Enhancement: Add password reset link to login page
|
||||
|
||||
Added a configurable passwort reset link to the login page.
|
||||
It can be set via `IDP_PASSWORD_RESET_URI`. If the option is not set
|
||||
the link will not be shown.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3329
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: replace public mountpoint fileid with grant fileid
|
||||
|
||||
We now show the same resoucre id for resources when accessing them via a public links as when using a logged in user. This allows the web ui to start a WOPI session with the correct resource id.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3349
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: log sharing events in audit service
|
||||
|
||||
Contains sharing related events. See full list in audit/pkg/types/events.go
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3301
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Add space aliases
|
||||
|
||||
Space aliases can be used to resolve spaceIDs in a client.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3283
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Include etags in drives listing
|
||||
|
||||
Added etags in the response of list drives.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3267
|
||||
@@ -0,0 +1,5 @@
|
||||
Change: settings service now stores its data via metadata service
|
||||
|
||||
Instead of writing files to disk it will use metadata service to do so
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3232
|
||||
@@ -0,0 +1,7 @@
|
||||
Enhancement: Improve thumbnails API
|
||||
|
||||
Changed the thumbnails API to no longer transfer images via GRPC.
|
||||
GRPC has a limited message size and isn't very efficient with large binary data.
|
||||
The new API transports the images over HTTP.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3272
|
||||
@@ -0,0 +1,31 @@
|
||||
Enhancement: update reva to v2.1.0
|
||||
|
||||
Updated reva to version 2.1.0. This update includes:
|
||||
|
||||
* Fix [cs3org/reva#2636](https://github.com/cs3org/reva/pull/2636): Delay reconnect log for events
|
||||
* Fix [cs3org/reva#2645](https://github.com/cs3org/reva/pull/2645): Avoid warning about missing .flock files
|
||||
* Fix [cs3org/reva#2625](https://github.com/cs3org/reva/pull/2625): Fix locking on publik links and the decomposed filesystem
|
||||
* Fix [cs3org/reva#2643](https://github.com/cs3org/reva/pull/2643): Emit linkaccessfailed event when share is nil
|
||||
* Fix [cs3org/reva#2646](https://github.com/cs3org/reva/pull/2646): Replace public mountpoint fileid with grant fileid in ocdav
|
||||
* Fix [cs3org/reva#2612](https://github.com/cs3org/reva/pull/2612): Adjust the scope handling to support the spaces architecture
|
||||
* Fix [cs3org/reva#2621](https://github.com/cs3org/reva/pull/2621): Send events only if response code is `OK`
|
||||
* Chg [cs3org/reva#2574](https://github.com/cs3org/reva/pull/2574): Switch NATS backend
|
||||
* Chg [cs3org/reva#2667](https://github.com/cs3org/reva/pull/2667): Allow LDAP groups to have no gidNumber
|
||||
* Chg [cs3org/reva#3233](https://github.com/cs3org/reva/pull/3233): Improve quota handling
|
||||
* Chg [cs3org/reva#2600](https://github.com/cs3org/reva/pull/2600): Use the cs3 share api to manage spaces
|
||||
* Enh [cs3org/reva#2644](https://github.com/cs3org/reva/pull/2644): Add new public share manager
|
||||
* Enh [cs3org/reva#2626](https://github.com/cs3org/reva/pull/2626): Add new share manager
|
||||
* Enh [cs3org/reva#2624](https://github.com/cs3org/reva/pull/2624): Add etags to virtual spaces
|
||||
* Enh [cs3org/reva#2639](https://github.com/cs3org/reva/pull/2639): File Events
|
||||
* Enh [cs3org/reva#2627](https://github.com/cs3org/reva/pull/2627): Add events for sharing action
|
||||
* Enh [cs3org/reva#2664](https://github.com/cs3org/reva/pull/2664): Add grantID to mountpoint
|
||||
* Enh [cs3org/reva#2622](https://github.com/cs3org/reva/pull/2622): Allow listing shares in spaces via the OCS API
|
||||
* Enh [cs3org/reva#2623](https://github.com/cs3org/reva/pull/2623): Add space aliases
|
||||
* Enh [cs3org/reva#2647](https://github.com/cs3org/reva/pull/2647): Add space specific events
|
||||
* Enh [cs3org/reva#3345](https://github.com/cs3org/reva/pull/3345): Add the spaceid to propfind responses
|
||||
* Enh [cs3org/reva#2616](https://github.com/cs3org/reva/pull/2616): Add etag to spaces response
|
||||
* Enh [cs3org/reva#2628](https://github.com/cs3org/reva/pull/2628): Add spaces aware trash-bin API
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3330
|
||||
https://github.com/owncloud/ocis/pull/3405
|
||||
https://github.com/owncloud/ocis/pull/3416
|
||||
@@ -0,0 +1,10 @@
|
||||
Enhancement: Update ownCloud Web to v5.3.0
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v5.3.0. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
https://github.com/owncloud/web/pull/6561
|
||||
https://github.com/owncloud/ocis/pull/3291
|
||||
https://github.com/owncloud/ocis/pull/3375
|
||||
https://github.com/owncloud/web/releases/tag/v5.3.0
|
||||
@@ -1,109 +0,0 @@
|
||||
{
|
||||
"log": {
|
||||
"level": "PROXY_LOG_LEVEL"
|
||||
},
|
||||
"policy_selector": {
|
||||
"claims": {
|
||||
"default_policy": "oc10",
|
||||
"unauthenticated_policy": "oc10"
|
||||
}
|
||||
},
|
||||
"policies": [
|
||||
{
|
||||
"name": "ocis",
|
||||
"routes": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"backend": "http://localhost:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/.well-known/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"endpoint": "/ocs/v[12].php/cloud/user/signing-key",
|
||||
"backend": "http://localhost:9110"
|
||||
},
|
||||
{
|
||||
"endpoint": "/ocs/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"type": "query",
|
||||
"endpoint": "/remote.php/?preview=1",
|
||||
"backend": "http://localhost:9115"
|
||||
},
|
||||
{
|
||||
"endpoint": "/remote.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/dav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/webdav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/status.php",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/index.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/index.php/login",
|
||||
"backend": "http://localhost:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/login",
|
||||
"backend": "http://localhost:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/data",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph/",
|
||||
"backend": "http://localhost:9120"
|
||||
},
|
||||
{
|
||||
"endpoint": "/app/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/archiver",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph-explorer/",
|
||||
"backend": "http://localhost:9135"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/settings",
|
||||
"backend": "http://localhost:9190"
|
||||
},
|
||||
{
|
||||
"endpoint": "/settings.js",
|
||||
"backend": "http://localhost:9190"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "oc10",
|
||||
"routes": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"backend": "http://oc10:8080"
|
||||
},
|
||||
{
|
||||
"endpoint": "/data",
|
||||
"backend": "http://localhost:9140"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
---
|
||||
policy_selector:
|
||||
claims:
|
||||
default_policy: oc10
|
||||
unauthenticated_policy: oc10
|
||||
policies:
|
||||
- name: ocis
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://localhost:9100
|
||||
- endpoint: "/.well-known/"
|
||||
backend: http://localhost:9130
|
||||
- type: regex
|
||||
endpoint: "/ocs/v[12].php/cloud/user/signing-key"
|
||||
backend: http://localhost:9110
|
||||
- endpoint: "/ocs/"
|
||||
backend: http://localhost:9140
|
||||
- type: query
|
||||
endpoint: "/remote.php/?preview=1"
|
||||
backend: http://localhost:9115
|
||||
- endpoint: "/remote.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/dav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/webdav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/status.php"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/index.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/index.php/login"
|
||||
backend: http://localhost:9100
|
||||
- endpoint: "/login"
|
||||
backend: http://localhost:9100
|
||||
- endpoint: "/data"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/graph/"
|
||||
backend: http://localhost:9120
|
||||
- endpoint: "/app/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/archiver"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/graph-explorer/"
|
||||
backend: http://localhost:9135
|
||||
- endpoint: "/api/v0/settings"
|
||||
backend: http://localhost:9190
|
||||
- endpoint: "/settings.js"
|
||||
backend: http://localhost:9190
|
||||
- name: oc10
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://oc10:8080
|
||||
- endpoint: "/data"
|
||||
backend: http://localhost:9140
|
||||
@@ -116,7 +116,6 @@ services:
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose
|
||||
OCIS_URL: https://${CLOUD_DOMAIN:-cloud.owncloud.test}
|
||||
PROXY_TLS: "false" # do not use SSL between Traefik and oCIS
|
||||
PROXY_CONFIG_FILE: "/var/tmp/ocis/.config/proxy-config.json"
|
||||
# change default secrets
|
||||
OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4}
|
||||
STORAGE_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret}
|
||||
@@ -126,7 +125,7 @@ services:
|
||||
# basic auth (not recommended, but needed for eg. WebDav clients that do not support OpenID Connect)
|
||||
PROXY_ENABLE_BASIC_AUTH: "${PROXY_ENABLE_BASIC_AUTH:-false}"
|
||||
volumes:
|
||||
- ./config/ocis/proxy.json:/etc/ocis/proxy.json
|
||||
- ./config/ocis/proxy.yaml:/etc/ocis/proxy.yaml
|
||||
- ocis-data:/var/lib/ocis
|
||||
# shared volume with oC10
|
||||
- oc10-data:/mnt/data
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
{
|
||||
"HTTP": {
|
||||
"Namespace": "com.owncloud"
|
||||
},
|
||||
"policy_selector": {
|
||||
"static": {
|
||||
"policy": "ocis"
|
||||
}
|
||||
},
|
||||
"policies": [
|
||||
{
|
||||
"name": "ocis",
|
||||
"routes": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"backend": "http://localhost:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/.well-known/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/konnect/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/signin/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"endpoint": "/ocs/v[12].php/cloud/(users?|groups)",
|
||||
"backend": "http://localhost:9110"
|
||||
},
|
||||
{
|
||||
"endpoint": "/ocs/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"type": "query",
|
||||
"endpoint": "/remote.php/?preview=1",
|
||||
"backend": "http://localhost:9115"
|
||||
},
|
||||
{
|
||||
"endpoint": "/remote.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/dav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/webdav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/status.php",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/index.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/data",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/app/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/archiver",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph/",
|
||||
"backend": "http://localhost:9120"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph-explorer/",
|
||||
"backend": "http://localhost:9135"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/accounts",
|
||||
"backend": "http://localhost:9181"
|
||||
},
|
||||
{
|
||||
"endpoint": "/accounts.js",
|
||||
"backend": "http://localhost:9181"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/settings",
|
||||
"backend": "http://localhost:9190"
|
||||
},
|
||||
{
|
||||
"endpoint": "/settings.js",
|
||||
"backend": "http://localhost:9190"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/greet",
|
||||
"backend": "http://ocis-hello:9105"
|
||||
},
|
||||
{
|
||||
"endpoint": "/hello.js",
|
||||
"backend": "http://ocis-hello:9105"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
policy_selector:
|
||||
static:
|
||||
policy: ocis
|
||||
policies:
|
||||
- name: ocis
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://localhost:9100
|
||||
- endpoint: "/.well-known/"
|
||||
backend: http://localhost:9130
|
||||
- endpoint: "/konnect/"
|
||||
backend: http://localhost:9130
|
||||
- endpoint: "/signin/"
|
||||
backend: http://localhost:9130
|
||||
- type: regex
|
||||
endpoint: "/ocs/v[12].php/cloud/(users?|groups)"
|
||||
backend: http://localhost:9110
|
||||
- endpoint: "/ocs/"
|
||||
backend: http://localhost:9140
|
||||
- type: query
|
||||
endpoint: "/remote.php/?preview=1"
|
||||
backend: http://localhost:9115
|
||||
- endpoint: "/remote.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/dav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/webdav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/status.php"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/index.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/data"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/app/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/archiver"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/graph/"
|
||||
backend: http://localhost:9120
|
||||
- endpoint: "/graph-explorer/"
|
||||
backend: http://localhost:9135
|
||||
- endpoint: "/api/v0/accounts"
|
||||
backend: http://localhost:9181
|
||||
- endpoint: "/accounts.js"
|
||||
backend: http://localhost:9181
|
||||
- endpoint: "/api/v0/settings"
|
||||
backend: http://localhost:9190
|
||||
- endpoint: "/settings.js"
|
||||
backend: http://localhost:9190
|
||||
- endpoint: "/api/v0/greet"
|
||||
backend: http://ocis-hello:9105
|
||||
- endpoint: "/hello.js"
|
||||
backend: http://ocis-hello:9105
|
||||
@@ -71,7 +71,7 @@ services:
|
||||
volumes:
|
||||
- ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/ocis/web-config.dist.json:/config/web-config.dist.json
|
||||
- ./config/ocis/proxy.json:/etc/ocis/proxy.json
|
||||
- ./config/ocis/proxy.yaml:/etc/ocis/proxy.yaml
|
||||
- ocis-data:/var/lib/ocis
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
{
|
||||
"HTTP": {
|
||||
"Namespace": "com.owncloud"
|
||||
},
|
||||
"policy_selector": {
|
||||
"static": {
|
||||
"policy": "ocis"
|
||||
}
|
||||
},
|
||||
"policies": [
|
||||
{
|
||||
"name": "ocis",
|
||||
"routes": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"backend": "http://web:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/.well-known/",
|
||||
"backend": "http://idp:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/konnect/",
|
||||
"backend": "http://idp:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/signin/",
|
||||
"backend": "http://idp:9130"
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"endpoint": "/ocs/v[12].php/cloud/(users?|groups)",
|
||||
"backend": "http://ocs:9110"
|
||||
},
|
||||
{
|
||||
"endpoint": "/ocs/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"type": "query",
|
||||
"endpoint": "/remote.php/?preview=1",
|
||||
"backend": "http://webdav:9115"
|
||||
},
|
||||
{
|
||||
"endpoint": "/remote.php/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/dav/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/webdav/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/status.php",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/index.php/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/data",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/app/",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/archiver",
|
||||
"backend": "http://storage-frontend:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph/",
|
||||
"backend": "http://graph:9120"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph-explorer/",
|
||||
"backend": "http://graph-explorer:9135"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/accounts",
|
||||
"backend": "http://accounts:9181"
|
||||
},
|
||||
{
|
||||
"endpoint": "/accounts.js",
|
||||
"backend": "http://accounts:9181"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/settings",
|
||||
"backend": "http://settings:9190"
|
||||
},
|
||||
{
|
||||
"endpoint": "/settings.js",
|
||||
"backend": "http://settings:9190"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
policy_selector:
|
||||
static:
|
||||
policy: ocis
|
||||
policies:
|
||||
- name: ocis
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://web:9100
|
||||
- endpoint: "/.well-known/"
|
||||
backend: http://idp:9130
|
||||
- endpoint: "/konnect/"
|
||||
backend: http://idp:9130
|
||||
- endpoint: "/signin/"
|
||||
backend: http://idp:9130
|
||||
- type: regex
|
||||
endpoint: "/ocs/v[12].php/cloud/(users?|groups)"
|
||||
backend: http://ocs:9110
|
||||
- endpoint: "/ocs/"
|
||||
backend: http://storage-frontend:9140
|
||||
- type: query
|
||||
endpoint: "/remote.php/?preview=1"
|
||||
backend: http://webdav:9115
|
||||
- endpoint: "/remote.php/"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/dav/"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/webdav/"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/status.php"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/index.php/"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/data"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/app/"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/archiver"
|
||||
backend: http://storage-frontend:9140
|
||||
- endpoint: "/graph/"
|
||||
backend: http://graph:9120
|
||||
- endpoint: "/graph-explorer/"
|
||||
backend: http://graph-explorer:9135
|
||||
- endpoint: "/api/v0/accounts"
|
||||
backend: http://accounts:9181
|
||||
- endpoint: "/accounts.js"
|
||||
backend: http://accounts:9181
|
||||
- endpoint: "/api/v0/settings"
|
||||
backend: http://settings:9190
|
||||
- endpoint: "/settings.js"
|
||||
backend: http://settings:9190
|
||||
@@ -47,7 +47,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- proxy
|
||||
@@ -72,7 +72,7 @@ services:
|
||||
|
||||
PROXY_HTTP_ADDR: 0.0.0.0:9200
|
||||
volumes:
|
||||
- "./config/proxy/proxy.json:/etc/ocis/proxy.json"
|
||||
- "./config/proxy/proxy.yaml:/etc/ocis/proxy.yaml"
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.ocis.entrypoints=https"
|
||||
@@ -90,7 +90,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- nats-server
|
||||
@@ -111,7 +111,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
@@ -145,7 +145,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- glauth
|
||||
@@ -168,7 +168,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- idp
|
||||
@@ -194,7 +194,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- ocs
|
||||
@@ -222,7 +222,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- settings
|
||||
@@ -247,7 +247,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- store
|
||||
@@ -269,7 +269,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- thumbnails
|
||||
@@ -296,7 +296,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- web
|
||||
@@ -320,7 +320,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- webdav
|
||||
@@ -343,7 +343,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- graph
|
||||
@@ -369,7 +369,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-metadata
|
||||
@@ -402,7 +402,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-auth-basic
|
||||
@@ -426,7 +426,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-auth-machine
|
||||
@@ -450,7 +450,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-auth-bearer
|
||||
@@ -474,7 +474,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-shares
|
||||
@@ -501,7 +501,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-users
|
||||
@@ -535,7 +535,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-public-link
|
||||
@@ -559,7 +559,7 @@ services:
|
||||
deploy:
|
||||
replicas: 1
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-sharing
|
||||
@@ -592,7 +592,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-userprovider
|
||||
@@ -623,7 +623,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-groupprovider
|
||||
@@ -654,7 +654,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-frontend
|
||||
@@ -684,7 +684,7 @@ services:
|
||||
deploy:
|
||||
replicas: ${OCIS_SCALE:-1}
|
||||
networks:
|
||||
ocis-net: null
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- ocis
|
||||
- storage-gateway
|
||||
@@ -731,4 +731,3 @@ volumes:
|
||||
|
||||
networks:
|
||||
ocis-net:
|
||||
external: true
|
||||
@@ -1,95 +0,0 @@
|
||||
{
|
||||
"HTTP": {
|
||||
"Namespace": "com.owncloud"
|
||||
},
|
||||
"policy_selector": {
|
||||
"static": {
|
||||
"policy": "ocis"
|
||||
}
|
||||
},
|
||||
"policies": [
|
||||
{
|
||||
"name": "ocis",
|
||||
"routes": [
|
||||
{
|
||||
"endpoint": "/",
|
||||
"backend": "http://localhost:9100"
|
||||
},
|
||||
{
|
||||
"endpoint": "/.well-known/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/konnect/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"endpoint": "/signin/",
|
||||
"backend": "http://localhost:9130"
|
||||
},
|
||||
{
|
||||
"type": "regex",
|
||||
"endpoint": "/ocs/v[12].php/cloud/user/signing-key",
|
||||
"backend": "http://localhost:9110"
|
||||
},
|
||||
{
|
||||
"endpoint": "/ocs/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"type": "query",
|
||||
"endpoint": "/remote.php/?preview=1",
|
||||
"backend": "http://localhost:9115"
|
||||
},
|
||||
{
|
||||
"endpoint": "/remote.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/dav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/webdav/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/status.php",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/index.php/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/app/",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/archiver",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/data",
|
||||
"backend": "http://localhost:9140"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph/",
|
||||
"backend": "http://localhost:9120"
|
||||
},
|
||||
{
|
||||
"endpoint": "/graph-explorer/",
|
||||
"backend": "http://localhost:9135"
|
||||
},
|
||||
{
|
||||
"endpoint": "/api/v0/settings",
|
||||
"backend": "http://localhost:9190"
|
||||
},
|
||||
{
|
||||
"endpoint": "/settings.js",
|
||||
"backend": "http://localhost:9190"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
policy_selector:
|
||||
static:
|
||||
policy: ocis
|
||||
policies:
|
||||
- name: ocis
|
||||
routes:
|
||||
- endpoint: "/"
|
||||
backend: http://localhost:9100
|
||||
- endpoint: "/.well-known/"
|
||||
backend: http://localhost:9130
|
||||
- endpoint: "/konnect/"
|
||||
backend: http://localhost:9130
|
||||
- endpoint: "/signin/"
|
||||
backend: http://localhost:9130
|
||||
- type: regex
|
||||
endpoint: "/ocs/v[12].php/cloud/user/signing-key"
|
||||
backend: http://localhost:9110
|
||||
- endpoint: "/ocs/"
|
||||
backend: http://localhost:9140
|
||||
- type: query
|
||||
endpoint: "/remote.php/?preview=1"
|
||||
backend: http://localhost:9115
|
||||
- endpoint: "/remote.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/dav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/webdav/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/status.php"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/index.php/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/app/"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/archiver"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/data"
|
||||
backend: http://localhost:9140
|
||||
- endpoint: "/graph/"
|
||||
backend: http://localhost:9120
|
||||
- endpoint: "/graph-explorer/"
|
||||
backend: http://localhost:9135
|
||||
- endpoint: "/api/v0/settings"
|
||||
backend: http://localhost:9190
|
||||
- endpoint: "/settings.js"
|
||||
backend: http://localhost:9190
|
||||
@@ -91,7 +91,7 @@ services:
|
||||
volumes:
|
||||
- ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/ocis/web-config.dist.json:/config/web-config.dist.json
|
||||
- ./config/ocis/proxy.json:/etc/ocis/proxy.json
|
||||
- ./config/ocis/proxy.yaml:/etc/ocis/proxy.yaml
|
||||
- ocis-data:/var/lib/ocis
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
|
||||
@@ -12,7 +12,7 @@ geekdocCollapseSection: true
|
||||
## WebDAV with Basic Authentication
|
||||
|
||||
{{< hint danger >}}
|
||||
Basic Authentication is disabled by default in oCIS because of security considerations. In order to make the following Rclone commands work the oCIS administrator needs to enable Basic Authentication eg. by setting the the environment variable `PROXY_ENABLE_BASIC_AUTH` to `true`.
|
||||
Basic Authentication is disabled by default in oCIS because of security considerations. In order to make the following Rclone commands work the oCIS administrator needs to enable Basic Authentication e.g. by setting the environment variable `PROXY_ENABLE_BASIC_AUTH` to `true`.
|
||||
|
||||
Please consider to use [Rclone with OpenID Connect]({{< ref "webdav-sync-oidc.md" >}}) instead.
|
||||
{{< /hint >}}
|
||||
@@ -43,4 +43,4 @@ We now can use Rclone to sync the local folder `/tmp/test` to `/test` in your oC
|
||||
rclone sync :local:/tmp :webdav:/test
|
||||
```
|
||||
|
||||
If your oCIS doesn't use valid SSL certificates, you may need to use `rclone --no-check-certificate sync ...`.
|
||||
If your oCIS doesn't use valid SSL certificates, you may need to use `rclone --no-check-certificate sync ...`.
|
||||
@@ -1 +1,2 @@
|
||||
*_configvars.md
|
||||
*-example.yaml
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/accounts-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/accounts_configvars.md" >}}
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: Audit
|
||||
date: 2022-03-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/audit
|
||||
geekdocFilePath: _index.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Abstract
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
{{< toc-tree >}}
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Service Configuration
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/audit
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
|
||||
{{< include file="extensions/_includes/audit_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/glauth-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/glauth_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/graph-explorer-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/graph-explorer_configvars.md" >}}
|
||||
@@ -7,6 +7,8 @@ geekdocEditPath: edit/master/docs/extensions/graph
|
||||
geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/graph-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/graph_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/idm-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/idm_configvars.md" >}}
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: Service Setup
|
||||
date: 2022-03-22T00:00:00+00:00
|
||||
weight: 20
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions/idm
|
||||
geekdocFilePath: setup.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
{{< toc >}}
|
||||
|
||||
## Using ocis with libregraph/idm
|
||||
|
||||
Currently, oCIS still runs the accounts and glauth services to manage users. Until the default is switched
|
||||
to libregraph/idm, oCIS has to be started with a custom configuration in order to use libregraph/idm as
|
||||
the users and groups backend (this setup also disables the glauth and accounts service):
|
||||
|
||||
|
||||
```
|
||||
export GRAPH_IDENTITY_BACKEND=ldap
|
||||
export GRAPH_LDAP_URI=ldaps://localhost:9235
|
||||
export GRAPH_LDAP_BIND_DN="uid=libregraph,ou=sysusers,o=libregraph-idm"
|
||||
export GRAPH_LDAP_BIND_PASSWORD=idm
|
||||
export GRAPH_LDAP_USER_EMAIL_ATTRIBUTE=mail
|
||||
export GRAPH_LDAP_USER_NAME_ATTRIBUTE=uid
|
||||
export GRAPH_LDAP_USER_BASE_DN="ou=users,o=libregraph-idm"
|
||||
export GRAPH_LDAP_GROUP_BASE_DN="ou=groups,o=libregraph-idm"
|
||||
export GRAPH_LDAP_SERVER_WRITE_ENABLED="true"
|
||||
export IDP_INSECURE="true"
|
||||
export IDP_LDAP_FILTER="(&(objectclass=inetOrgPerson)(objectClass=owncloud))"
|
||||
export IDP_LDAP_URI=ldaps://localhost:9235
|
||||
export IDP_LDAP_BIND_DN="uid=idp,ou=sysusers,o=libregraph-idm"
|
||||
export IDP_LDAP_BIND_PASSWORD="idp"
|
||||
export IDP_LDAP_BASE_DN="ou=users,o=libregraph-idm"
|
||||
export IDP_LDAP_LOGIN_ATTRIBUTE=uid
|
||||
export IDP_LDAP_UUID_ATTRIBUTE="ownclouduuid"
|
||||
export IDP_LDAP_UUID_ATTRIBUTE_TYPE=binary
|
||||
export PROXY_ACCOUNT_BACKEND_TYPE=cs3
|
||||
export OCS_ACCOUNT_BACKEND_TYPE=cs3
|
||||
export STORAGE_LDAP_HOSTNAME=localhost
|
||||
export STORAGE_LDAP_PORT=9235
|
||||
export STORAGE_LDAP_INSECURE="true"
|
||||
export STORAGE_LDAP_BASE_DN="o=libregraph-idm"
|
||||
export STORAGE_LDAP_BIND_DN="uid=reva,ou=sysusers,o=libregraph-idm"
|
||||
export STORAGE_LDAP_BIND_PASSWORD=reva
|
||||
export STORAGE_LDAP_LOGINFILTER='(&(objectclass=inetOrgPerson)(objectclass=owncloud)(|(uid={{login}})(mail={{login}})))'
|
||||
export STORAGE_LDAP_USERFILTER='(&(objectclass=inetOrgPerson)(objectclass=owncloud)(|(ownclouduuid={{.OpaqueId}})(uid={{.OpaqueId}})))'
|
||||
export STORAGE_LDAP_USERATTRIBUTEFILTER='(&(objectclass=owncloud)({{attr}}={{value}}))'
|
||||
export STORAGE_LDAP_USERFINDFILTER='(&(objectclass=owncloud)(|(uid={{query}}*)(cn={{query}}*)(displayname={{query}}*)(mail={{query}}*)(description={{query}}*)))'
|
||||
export STORAGE_LDAP_USERGROUPFILER='(&(objectclass=groupOfNames)(member={{query}}*))'
|
||||
export STORAGE_LDAP_GROUPFILTER='(&(objectclass=groupOfNames)(objectclass=owncloud)(ownclouduuid={{.OpaqueId}}*))'
|
||||
export OCIS_RUN_EXTENSIONS=settings,storage-metadata,graph,graph-explorer,ocs,store,thumbnails,web,webdav,storage-frontend,storage-gateway,storage-userprovider,storage-groupprovider,storage-authbasic,storage-authbearer,storage-authmachine,storage-users,storage-shares,storage-public-link,storage-appprovider,storage-sharing,proxy,idp,nats,idm
|
||||
export OCIS_INSECURE=true
|
||||
bin/ocis server
|
||||
```
|
||||
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/idp-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/idp_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/nats-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/nats_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/notifications-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/notifications_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/ocs-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/ocs_configvars.md" >}}
|
||||
@@ -0,0 +1,200 @@
|
||||
---
|
||||
title: Port Ranges
|
||||
date: 2018-05-02T00:00:00+00:00
|
||||
weight: 0
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/docs/extensions
|
||||
geekdocFilePath: port-ranges.go
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
oCIS extensions often need a port to expose their services to other services or the outside world.
|
||||
As users may have many different extensions running on the same machine, we should track port usage in the oCIS ecosystem. In the best case we ensure that each extension uses a non colliding port range, to make life of users easier.
|
||||
|
||||
This page tracks the knowingly used port ranges.
|
||||
|
||||
Feel free to "reserve" a free port range when you're developing an extension by adding your extension to the list (see the edit button in the top right corner).
|
||||
|
||||
If you're developing a non-public extension, we recommend using ports outside of the ranges listed below.
|
||||
|
||||
We also suggest to use the last port in your extensions' range as a debug/metrics port.
|
||||
|
||||
|
||||
## Allocations
|
||||
|
||||
| Port range | Service |
|
||||
| ---------- | ----------------------------------------------------------------------------- |
|
||||
| 9000-9010 | [ocis](https://github.com/owncloud/ocis) |
|
||||
| 9100-9104 | [web](https://github.com/owncloud/ocis/tree/master/web) |
|
||||
| 9105-9109 | [hello](https://github.com/owncloud/ocis-hello) |
|
||||
| 9110-9114 | [ocs](https://github.com/owncloud/ocis/tree/master/ocs) |
|
||||
| 9115-9119 | [webdav](https://github.com/owncloud/ocis/tree/master/webdav) |
|
||||
| 9120-9124 | [graph](https://github.com/owncloud/ocis/tree/master/graph) |
|
||||
| 9125-9129 | [glauth](https://github.com/owncloud/ocis/tree/master/devldap) |
|
||||
| 9130-9134 | [konnectd](https://github.com/owncloud/ocis/tree/master/konnectd) |
|
||||
| 9135-9139 | [graph-explorer](https://github.com/owncloud/ocis/tree/master/graph-explorer) |
|
||||
| 9140-9179 | [reva/storage](https://github.com/owncloud/ocis/tree/master/storage) |
|
||||
| 9180-9184 | [accounts](https://github.com/owncloud/ocis/tree/master/accounts) |
|
||||
| 9185-9189 | [thumbnails](https://github.com/owncloud/ocis/tree/master/thumbnails) |
|
||||
| 9190-9194 | [settings](https://github.com/owncloud/ocis/tree/master/settings) |
|
||||
| 9195-9199 | [store](https://github.com/owncloud/ocis/tree/master/store) |
|
||||
| 9200-9204 | [proxy](https://github.com/owncloud/ocis/tree/master/proxy) |
|
||||
| 9205-9209 | [markdown-editor](https://github.com/owncloud/ocis-markdown-editor) |
|
||||
| 9210-9214 | [reva](https://github.com/owncloud/ocis-reva) unused? |
|
||||
| 9215-9219 | reva metadata storage |
|
||||
| 9220-9224 | FREE |
|
||||
| 9225-9229 | photoprism (state: PoC) |
|
||||
| 9230-9234 | [nats](https://github.com/owncloud/ocis/tree/master/nats) |
|
||||
| 9235-9239 | idm TBD |
|
||||
| 9240-9244 | FREE |
|
||||
| 9245-9249 | FREE |
|
||||
| 9250-9254 | oCIS Runtime |
|
||||
| 9255-9259 | FREE |
|
||||
| 9260-9264 | FREE |
|
||||
| 9265-9269 | FREE |
|
||||
| 9270-9274 | FREE |
|
||||
| 9275-9279 | FREE |
|
||||
| 9280-9284 | FREE |
|
||||
| 9285-9289 | FREE |
|
||||
| 9290-9294 | FREE |
|
||||
| 9295-9299 | FREE |
|
||||
| 9300-9304 | FREE |
|
||||
| 9305-9309 | FREE |
|
||||
| 9310-9314 | FREE |
|
||||
| 9315-9319 | FREE |
|
||||
| 9320-9324 | FREE |
|
||||
| 9325-9329 | FREE |
|
||||
| 9330-9334 | FREE |
|
||||
| 9335-9339 | FREE |
|
||||
| 9340-9344 | FREE |
|
||||
| 9345-9349 | FREE |
|
||||
| 9350-9354 | FREE |
|
||||
| 9355-9359 | FREE |
|
||||
| 9360-9364 | FREE |
|
||||
| 9365-9369 | FREE |
|
||||
| 9370-9374 | FREE |
|
||||
| 9375-9379 | FREE |
|
||||
| 9380-9384 | FREE |
|
||||
| 9385-9389 | FREE |
|
||||
| 9390-9394 | FREE |
|
||||
| 9395-9399 | FREE |
|
||||
| 9400-9404 | FREE |
|
||||
| 9405-9409 | FREE |
|
||||
| 9410-9414 | FREE |
|
||||
| 9415-9419 | FREE |
|
||||
| 9420-9424 | FREE |
|
||||
| 9425-9429 | FREE |
|
||||
| 9430-9434 | FREE |
|
||||
| 9435-9439 | FREE |
|
||||
| 9440-9444 | FREE |
|
||||
| 9445-9449 | FREE |
|
||||
| 9450-9454 | FREE |
|
||||
| 9455-9459 | FREE |
|
||||
| 9460-9464 | FREE |
|
||||
| 9465-9469 | FREE |
|
||||
| 9470-9474 | FREE |
|
||||
| 9475-9479 | FREE |
|
||||
| 9480-9484 | FREE |
|
||||
| 9485-9489 | FREE |
|
||||
| 9490-9494 | FREE |
|
||||
| 9495-9499 | FREE |
|
||||
| 9500-9504 | FREE |
|
||||
| 9505-9509 | FREE |
|
||||
| 9510-9514 | FREE |
|
||||
| 9515-9519 | FREE |
|
||||
| 9520-9524 | FREE |
|
||||
| 9525-9529 | FREE |
|
||||
| 9530-9534 | FREE |
|
||||
| 9535-9539 | FREE |
|
||||
| 9540-9544 | FREE |
|
||||
| 9545-9549 | FREE |
|
||||
| 9550-9554 | FREE |
|
||||
| 9555-9559 | FREE |
|
||||
| 9560-9564 | FREE |
|
||||
| 9565-9569 | FREE |
|
||||
| 9570-9574 | FREE |
|
||||
| 9575-9579 | FREE |
|
||||
| 9580-9584 | FREE |
|
||||
| 9585-9589 | FREE |
|
||||
| 9590-9594 | FREE |
|
||||
| 9595-9599 | FREE |
|
||||
| 9600-9604 | FREE |
|
||||
| 9605-9609 | FREE |
|
||||
| 9610-9614 | FREE |
|
||||
| 9615-9619 | FREE |
|
||||
| 9620-9624 | FREE |
|
||||
| 9625-9629 | FREE |
|
||||
| 9630-9634 | FREE |
|
||||
| 9635-9639 | FREE |
|
||||
| 9640-9644 | FREE |
|
||||
| 9645-9649 | FREE |
|
||||
| 9650-9654 | FREE |
|
||||
| 9655-9659 | FREE |
|
||||
| 9660-9664 | FREE |
|
||||
| 9665-9669 | FREE |
|
||||
| 9670-9674 | FREE |
|
||||
| 9675-9679 | FREE |
|
||||
| 9680-9684 | FREE |
|
||||
| 9685-9689 | FREE |
|
||||
| 9690-9694 | FREE |
|
||||
| 9695-9699 | FREE |
|
||||
| 9700-9704 | FREE |
|
||||
| 9705-9709 | FREE |
|
||||
| 9710-9714 | FREE |
|
||||
| 9715-9719 | FREE |
|
||||
| 9720-9724 | FREE |
|
||||
| 9725-9729 | FREE |
|
||||
| 9730-9734 | FREE |
|
||||
| 9735-9739 | FREE |
|
||||
| 9740-9744 | FREE |
|
||||
| 9745-9749 | FREE |
|
||||
| 9750-9754 | FREE |
|
||||
| 9755-9759 | FREE |
|
||||
| 9760-9764 | FREE |
|
||||
| 9765-9769 | FREE |
|
||||
| 9770-9774 | FREE |
|
||||
| 9775-9779 | FREE |
|
||||
| 9780-9784 | FREE |
|
||||
| 9785-9789 | FREE |
|
||||
| 9790-9794 | FREE |
|
||||
| 9795-9799 | FREE |
|
||||
| 9800-9804 | FREE |
|
||||
| 9805-9809 | FREE |
|
||||
| 9810-9814 | FREE |
|
||||
| 9815-9819 | FREE |
|
||||
| 9820-9824 | FREE |
|
||||
| 9825-9829 | FREE |
|
||||
| 9830-9834 | FREE |
|
||||
| 9835-9839 | FREE |
|
||||
| 9840-9844 | FREE |
|
||||
| 9845-9849 | FREE |
|
||||
| 9850-9854 | FREE |
|
||||
| 9855-9859 | FREE |
|
||||
| 9860-9864 | FREE |
|
||||
| 9865-9869 | FREE |
|
||||
| 9870-9874 | FREE |
|
||||
| 9875-9879 | FREE |
|
||||
| 9880-9884 | FREE |
|
||||
| 9885-9889 | FREE |
|
||||
| 9890-9894 | FREE |
|
||||
| 9895-9899 | FREE |
|
||||
| 9900-9904 | FREE |
|
||||
| 9905-9909 | FREE |
|
||||
| 9910-9914 | FREE |
|
||||
| 9915-9919 | FREE |
|
||||
| 9920-9924 | FREE |
|
||||
| 9925-9929 | FREE |
|
||||
| 9930-9934 | FREE |
|
||||
| 9935-9939 | FREE |
|
||||
| 9940-9944 | FREE |
|
||||
| 9945-9949 | FREE |
|
||||
| 9950-9954 | FREE |
|
||||
| 9955-9959 | FREE |
|
||||
| 9960-9964 | FREE |
|
||||
| 9965-9969 | FREE |
|
||||
| 9970-9974 | FREE |
|
||||
| 9975-9979 | FREE |
|
||||
| 9980-9984 | FREE |
|
||||
| 9985-9989 | FREE |
|
||||
| 9990-9994 | FREE |
|
||||
| 9995-9999 | FREE |
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/proxy-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/proxy_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/settings-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/settings_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/store-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/store_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/thumbnails-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/thumbnails_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/web-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/web_configvars.md" >}}
|
||||
@@ -8,5 +8,8 @@ geekdocFilePath: configuration.md
|
||||
geekdocCollapseSection: true
|
||||
---
|
||||
|
||||
## Example YAML Config
|
||||
|
||||
{{< include file="extensions/_includes/webdav-config-example.yaml" language="yaml" >}}
|
||||
|
||||
{{< include file="extensions/_includes/webdav_configvars.md" >}}
|
||||
@@ -6,14 +6,20 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var targets = map[string]string{
|
||||
"example-config-generator.go.tmpl": "output/exampleconfig/example-config-generator.go",
|
||||
"extractor.go.tmpl": "output/env/runner.go",
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("Getting relevant packages")
|
||||
paths, err := filepath.Glob("../../*/pkg/config/defaultconfig.go")
|
||||
paths, err := filepath.Glob("../../*/pkg/config/defaults/defaultconfig.go")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -24,27 +30,36 @@ func main() {
|
||||
for i := range paths {
|
||||
paths[i] = replacer.Replace(paths[i])
|
||||
}
|
||||
content, err := ioutil.ReadFile("extractor.go.tmpl")
|
||||
|
||||
for template, output := range targets {
|
||||
GenerateIntermediateCode(template, output, paths)
|
||||
RunIntermediateCode(output)
|
||||
}
|
||||
fmt.Println("Cleaning up")
|
||||
os.RemoveAll("output")
|
||||
}
|
||||
|
||||
func GenerateIntermediateCode(templatePath string, intermediateCodePath string, paths []string) {
|
||||
content, err := ioutil.ReadFile(templatePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println("Generating intermediate go code")
|
||||
fmt.Println("Generating intermediate go code for " + intermediateCodePath + " using template " + templatePath)
|
||||
tpl := template.Must(template.New("").Parse(string(content)))
|
||||
os.Mkdir("output", 0700)
|
||||
runner, err := os.Create("output/runner.go")
|
||||
os.MkdirAll(path.Dir(intermediateCodePath), 0700)
|
||||
runner, err := os.Create(intermediateCodePath)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
tpl.Execute(runner, paths)
|
||||
fmt.Println("Running intermediate go code")
|
||||
os.Chdir("output")
|
||||
}
|
||||
|
||||
func RunIntermediateCode(intermediateCodePath string) {
|
||||
fmt.Println("Running intermediate go code for " + intermediateCodePath)
|
||||
os.Setenv("OCIS_BASE_DATA_PATH", "~/.ocis")
|
||||
out, err := exec.Command("go", "run", "runner.go").Output()
|
||||
out, err := exec.Command("go", "run", intermediateCodePath).Output()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Println(string(out))
|
||||
fmt.Println("Cleaning up")
|
||||
os.Chdir("../")
|
||||
os.RemoveAll("output")
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
{{- range $key, $value := .}}
|
||||
pkg{{$key}} "{{$value}}"
|
||||
{{- end}}
|
||||
)
|
||||
|
||||
func main() {
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/", "",
|
||||
"/pkg/config/defaults", "",
|
||||
)
|
||||
cfg := map[string]string{
|
||||
{{- range $key, $value := .}}
|
||||
replacer.Replace("{{$value}}"): func() string {
|
||||
fmt.Println("Generating example YAML config for {{ $value -}}")
|
||||
c := pkg{{$key}}.DefaultConfig()
|
||||
pkg{{$key}}.EnsureDefaults(c)
|
||||
pkg{{$key}}.Sanitize(c)
|
||||
yml, err := yaml.Marshal(c)
|
||||
if err != nil {
|
||||
log.Fatalf("Marshalling yaml for pkg0 failed: %s\n", err)
|
||||
}
|
||||
return "# Autogenerated\n" + string(yml)
|
||||
}(),
|
||||
{{- end}}
|
||||
}
|
||||
for pkg, yml := range cfg {
|
||||
targetFolders := []string{
|
||||
// TODO: comment in when it is clear how to commit this to the structure of the master|main branch
|
||||
// filepath.Join("../../", pkg, "/config"),
|
||||
"../../docs/extensions/_includes/",
|
||||
}
|
||||
for _, targetFolder := range targetFolders {
|
||||
os.MkdirAll(targetFolder, 0700)
|
||||
targetYamlFile, err := os.Create(filepath.Join(targetFolder, replacer.Replace(pkg) + "-config-example.yaml"))
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to create target file for : %s", err)
|
||||
}
|
||||
defer targetYamlFile.Close()
|
||||
targetYamlFile.WriteString(yml)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ type ConfigField struct {
|
||||
|
||||
func main() {
|
||||
fmt.Println("Generating documentation for environment variables:")
|
||||
content, err := ioutil.ReadFile("../../../docs/templates/CONFIGURATION.tmpl")
|
||||
content, err := ioutil.ReadFile("../../docs/templates/CONFIGURATION.tmpl")
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
replacer := strings.NewReplacer(
|
||||
"github.com/owncloud/ocis/", "",
|
||||
"/pkg/config", "",
|
||||
"/pkg/config/defaults", "",
|
||||
)
|
||||
var fields []ConfigField
|
||||
var targetFile *os.File
|
||||
@@ -41,7 +41,7 @@ m := map[string]interface{}{
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
targetFolder := "../../../docs/extensions/_includes/"
|
||||
targetFolder := "../../docs/extensions/_includes/"
|
||||
for pkg, conf := range m {
|
||||
fields = GetAnnotatedVariables(conf)
|
||||
if len(fields) > 0 {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ title: "Configuration"
|
||||
date: "2021-11-09T00:03:16+0100"
|
||||
weight: 2
|
||||
geekdocRepo: https://github.com/owncloud/ocis
|
||||
geekdocEditPath: edit/master/ocis/templates
|
||||
geekdocEditPath: edit/master/docs/ocis
|
||||
geekdocFilePath: config.md
|
||||
---
|
||||
|
||||
|
||||
@@ -15,10 +15,12 @@ If you need to access oCIS running in a docker container, on a VM or a remote ma
|
||||
|
||||
## Start the oCIS fullstack server from binary
|
||||
|
||||
Upon first start of the oCIS fullstack server with `./bin/ocis server` it will generate a file `identifier-registration.yml` in the config folder in your current working directory. This file is used to configure the built-in identity provider and therefore contains the OpenID Connect issuer and also information about relying parties, for example ownCloud Web and our desktop and mobile applications.
|
||||
Upon first start of the oCIS fullstack server with `./bin/ocis server` it will generate a directory tree skeleton in `$HOME/.ocis`. If that is already existing it will not be overwritten as it contains all relevant data for oCIS.
|
||||
|
||||
In `$HOME/.ocis/idp` is a file `identifier-registration.yaml`. It is used to configure the built-in identity provider and therefore contains the OpenID Connect issuer and also information about relying parties, for example ownCloud Web and our desktop and mobile applications.
|
||||
|
||||
{{< hint warning >}}
|
||||
The `identifier-registration.yml` file will only be generated if it does not exist yet. If you want to change certain environment variables like `OCIS_URL`, please delete this file first before doing so. Otherwise your changes will not be applied correctly and you will run into errors.
|
||||
The `identifier-registration.yaml` file will only be generated if it does not exist yet. If you want to change certain environment variables like `OCIS_URL`, please delete this file first before doing so. Otherwise your changes will not be applied correctly and you will run into errors.
|
||||
{{< /hint >}}
|
||||
|
||||
{{< hint warning >}}
|
||||
|
||||
@@ -92,9 +92,9 @@ basedn = "dc=ocis,dc=test" # base dn to construct
|
||||
|
||||
{{< hint >}}
|
||||
There is a bug in the config merging for environment variables, cli flags and config files causing log settings not to be picked up from the config file when specifying `--extensions`. That is why I will
|
||||
* configure most of the config in a file,
|
||||
* configure most of the config in a file,
|
||||
* adjust logging using `OCIS_LOG_*` environment variables and
|
||||
* specify which extension to run using `ocis/bin/ocis server --extensions "comma, separated, list, of, extensions"`.
|
||||
* specify which extension to run using `ocis/bin/ocis server --extensions "comma, separated, list, of, extensions"`.
|
||||
{{< /hint >}}
|
||||
|
||||
#### Run it!
|
||||
@@ -129,7 +129,7 @@ To configure LDAP to use our glauth we add this section to the config file:
|
||||
```toml
|
||||
[storage.reva.ldap]
|
||||
idp = "https://ocis.ocis.test"
|
||||
basedn = "dc=ocis,dc=test"
|
||||
basedn = "dc=ocis,dc=test"
|
||||
binddn = "cn=admin,dc=ocis,dc=test" # an admin user in your oc10
|
||||
bindpassword = "secret"
|
||||
userschema = { uid = "uid", displayname = "givenname" } # TODO make glauth return an ownclouduuid and displayname attribute
|
||||
@@ -158,7 +158,7 @@ Please use `exit` or `Ctrl-D` to exit this program.
|
||||
username: jfd
|
||||
password: OK
|
||||
>> whoami
|
||||
id:<idp:"https://ocis.ocis.test" opaque_id:"jfd" type:USER_TYPE_PRIMARY > username:"jfd" mail:"jfd@butonic.de" display_name:"J\303\266rn" uid_number:99 gid_number:99
|
||||
id:<idp:"https://ocis.ocis.test" opaque_id:"jfd" type:USER_TYPE_PRIMARY > username:"jfd" mail:"jfd@butonic.de" display_name:"J\303\266rn" uid_number:99 gid_number:99
|
||||
>> exit
|
||||
```
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ Basically we have two sources for feature tests and test suites:
|
||||
|
||||
At the moment both can be applied to oCIS since the api of oCIS is designed to be compatible to ownCloud.
|
||||
|
||||
Since we have to offer an migration path to existing users of ownCloud, you can use your existing ownCloud as storage backend for oCIS. As another storage backend we offer oCIS native storage, also called "oCIS". This stores files directly on disk. Which storage backend is used is also reflected in the tests, there are always different tests for oCIS storage and ownCloud storage.
|
||||
Since we have to offer a migration path to existing users of ownCloud, you can use your existing ownCloud as storage backend for oCIS. As another storage backend we offer oCIS native storage, also called "oCIS". This stores files directly on disk. Which storage backend is used is also reflected in the tests, there are always different tests for oCIS storage and ownCloud storage.
|
||||
|
||||
You can invoke two types of test suite runs:
|
||||
|
||||
@@ -55,7 +55,7 @@ This must be pointing to a valid feature definition.
|
||||
|
||||
### oCIS image to be tested (or: skip build and take existing image)
|
||||
|
||||
By default the tests will be run against docker image built from your current working state of the oCIS repository. For some purposes it might also be handy to use a oCIS image from Docker Hub. Therefore you can provide the optional flag `OCIS_IMAGE_TAG=...` which must contain an available docker tag of the [owncloud/ocis registry on Docker Hub](https://hub.docker.com/r/owncloud/ocis) (eg. 'latest').
|
||||
By default, the tests will be run against the docker image built from your current working state of the oCIS repository. For some purposes it might also be handy to use a oCIS image from Docker Hub. Therefore you can provide the optional flag `OCIS_IMAGE_TAG=...` which must contain an available docker tag of the [owncloud/ocis registry on Docker Hub](https://hub.docker.com/r/owncloud/ocis) (eg. 'latest').
|
||||
|
||||
```
|
||||
make -C tests/acceptance/docker localApiTests-apiAccountsHashDifficulty-ocis OCIS_IMAGE_TAG=latest
|
||||
@@ -75,7 +75,7 @@ The log output is opened in `less`. You can navigate up and down with your curso
|
||||
|
||||
### Cleanup
|
||||
|
||||
During testing we start an redis and oCIS docker container. These will not be stopped automatically. You can stop them with:
|
||||
During testing we start a redis and oCIS docker container. These will not be stopped automatically. You can stop them with:
|
||||
|
||||
```
|
||||
make -C tests/acceptance/docker clean
|
||||
|
||||
@@ -22,7 +22,7 @@ We are distributing oCIS as binaries and Docker images.
|
||||
{{< hint warning >}}
|
||||
The examples in this document assume that oCIS is accessed from the same host as it is running on (`localhost`). If you would like
|
||||
to access oCIS remotely please refer to the [Basic Remote Setup]({{< ref "../deployment/basic-remote-setup" >}}) section. Especially
|
||||
to the notes about setting the `PROXY_HTTP_ADDR` and `OCIS_URL` enviroment variables.
|
||||
to the notes about setting the `PROXY_HTTP_ADDR` and `OCIS_URL` environment variables.
|
||||
{{< /hint >}}
|
||||
|
||||
You can find more deployment examples in the [deployment section]({{< ref "../deployment" >}}).
|
||||
@@ -113,7 +113,7 @@ The version command prints the version of your installed oCIS.
|
||||
ocis --version
|
||||
{{< / highlight >}}
|
||||
|
||||
The health command is used to execute a health check, if the exit code equals zero the service should be up and running, if the exist code is greater than zero the service is not in a healthy state. Generally this command is used within our Docker containers, it could also be used within Kubernetes.
|
||||
The health command is used to execute a health check, if the exit code equals zero the service should be up and running, if the exit code is greater than zero the service is not in a healthy state. Generally this command is used within our Docker containers, it could also be used within Kubernetes.
|
||||
|
||||
{{< highlight txt >}}
|
||||
ocis health --help
|
||||
|
||||
Loaded 100 of 330 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user