Compare commits
135
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e126ea94bc | ||
|
|
9fc5d89bc7 | ||
|
|
d046d5e726 | ||
|
|
552941184a | ||
|
|
3e40c278a7 | ||
|
|
a2e642aead | ||
|
|
58447b3e96 | ||
|
|
2fbb6c9933 | ||
|
|
c04f3dad0d | ||
|
|
89754fd412 | ||
|
|
ef277d3267 | ||
|
|
94aee2d367 | ||
|
|
ed48814009 | ||
|
|
42e7220528 | ||
|
|
db41f46697 | ||
|
|
621ec66baf | ||
|
|
690175236c | ||
|
|
2b755c39bf | ||
|
|
204ff6574b | ||
|
|
8a1241bb3c | ||
|
|
39ef9d92e1 | ||
|
|
7678fa2f92 | ||
|
|
caecf781e3 | ||
|
|
66c1249921 | ||
|
|
a701bbc8db | ||
|
|
c262be77ec | ||
|
|
79f929236c | ||
|
|
105df0c8e4 | ||
|
|
b4f5957e71 | ||
|
|
263921591b | ||
|
|
5d1059e4ff | ||
|
|
0497062d0d | ||
|
|
23329bc86a | ||
|
|
6496fec15b | ||
|
|
69bdc34b6e | ||
|
|
7d8fe2c44d | ||
|
|
93b14bc454 | ||
|
|
0f89f2b7fd | ||
|
|
0c97d3edd0 | ||
|
|
9355cc5912 | ||
|
|
53553a9bfd | ||
|
|
315f52328d | ||
|
|
f8e5175df5 | ||
|
|
077e56e2c7 | ||
|
|
624f681ce6 | ||
|
|
214491134f | ||
|
|
4a57e98780 | ||
|
|
c443dc68a0 | ||
|
|
f47c387133 | ||
|
|
4e1e529ef0 | ||
|
|
4decd85767 | ||
|
|
4722b63514 | ||
|
|
c74c8d31f3 | ||
|
|
6c246fb56d | ||
|
|
d661296c04 | ||
|
|
a10cfe188d | ||
|
|
5f89a7de98 | ||
|
|
b77ef1a4b2 | ||
|
|
8b846ca1c8 | ||
|
|
63121b7f37 | ||
|
|
f6bd1ad16e | ||
|
|
10c189d86c | ||
|
|
87c3384ab1 | ||
|
|
4ab23b0df5 | ||
|
|
6446f513bb | ||
|
|
14db9274c8 | ||
|
|
58c3caae07 | ||
|
|
c6aab01486 | ||
|
|
dc5b59688d | ||
|
|
f2f558bfa7 | ||
|
|
380435aab4 | ||
|
|
482591ecd1 | ||
|
|
48ab941943 | ||
|
|
4537755ca0 | ||
|
|
47a593766b | ||
|
|
f06d683b70 | ||
|
|
887f41cc3b | ||
|
|
3812f50eba | ||
|
|
959695e8fe | ||
|
|
b35314fb0a | ||
|
|
9b90219a2d | ||
|
|
7756ab9a66 | ||
|
|
2a6b1de60f | ||
|
|
3a1988c351 | ||
|
|
472650d41d | ||
|
|
5a86cf03b2 | ||
|
|
a9bce7c4e3 | ||
|
|
3de2be5caa | ||
|
|
447967b985 | ||
|
|
67f86499ef | ||
|
|
8b9dcc6a84 | ||
|
|
9d02a5a291 | ||
|
|
e97b4592aa | ||
|
|
ed4c69fabd | ||
|
|
b2a4e806c5 | ||
|
|
a85e174c35 | ||
|
|
31e1d03a38 | ||
|
|
e10d5822bb | ||
|
|
b95f4a05cf | ||
|
|
1128490ba0 | ||
|
|
698f9ba93d | ||
|
|
81bac5e97f | ||
|
|
dfb53fc52b | ||
|
|
a2d4db4ae0 | ||
|
|
bc5ab41402 | ||
|
|
a4eb34628f | ||
|
|
328579186a | ||
|
|
819cf505f8 | ||
|
|
86ec03dac5 | ||
|
|
0eeee16b1d | ||
|
|
0da7a4c668 | ||
|
|
743b10c323 | ||
|
|
d72e21bf2b | ||
|
|
6f327cc2ae | ||
|
|
7992a495eb | ||
|
|
af437186fc | ||
|
|
2f2f4d574d | ||
|
|
c75d47a75d | ||
|
|
62b7f45026 | ||
|
|
df545583d1 | ||
|
|
ce92021fea | ||
|
|
caa83ab952 | ||
|
|
be983bb96b | ||
|
|
e3c48f164a | ||
|
|
b74af1e785 | ||
|
|
dff6990e15 | ||
|
|
08c6f41fc8 | ||
|
|
a544de75c4 | ||
|
|
8e0f3b9e1c | ||
|
|
f54a6e424d | ||
|
|
dd3ad75c00 | ||
|
|
e6894474be | ||
|
|
032f5afd58 | ||
|
|
5d41175b12 | ||
|
|
ff856b3f30 |
No files matched your search
+1
-1
@@ -1,3 +1,3 @@
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=97a5cf669626ed83acaeb2f7e8aaf542d42100c2
|
||||
WEB_COMMITID=2095462acf3163569802daef1eba0bc9b17710f4
|
||||
WEB_BRANCH=stable-8.0
|
||||
+153
-257
@@ -18,7 +18,6 @@ OC_CI_PHP = "owncloudci/php:%s"
|
||||
OC_CI_WAIT_FOR = "owncloudci/wait-for:latest"
|
||||
OC_CS3_API_VALIDATOR = "owncloud/cs3api-validator:0.2.1"
|
||||
OC_LITMUS = "owncloudci/litmus:latest"
|
||||
OC_OC_TEST_MIDDLEWARE = "owncloud/owncloud-test-middleware:1.8.8"
|
||||
OC_UBUNTU = "owncloud/ubuntu:20.04"
|
||||
PLUGINS_CODACY = "plugins/codacy:1"
|
||||
PLUGINS_DOCKER = "plugins/docker:latest"
|
||||
@@ -30,10 +29,9 @@ PLUGINS_S3 = "plugins/s3:latest"
|
||||
PLUGINS_S3_CACHE = "plugins/s3-cache:1"
|
||||
PLUGINS_SLACK = "plugins/slack:1"
|
||||
REDIS = "redis:6-alpine"
|
||||
SELENIUM_STANDALONE_CHROME = "selenium/standalone-chrome:104.0-20220812"
|
||||
SONARSOURCE_SONAR_SCANNER_CLI = "sonarsource/sonar-scanner-cli:5.0"
|
||||
|
||||
DEFAULT_PHP_VERSION = "7.4"
|
||||
DEFAULT_PHP_VERSION = "8.2"
|
||||
DEFAULT_NODEJS_VERSION = "18"
|
||||
|
||||
dirs = {
|
||||
@@ -134,16 +132,20 @@ config = {
|
||||
"skip": False,
|
||||
"skipExceptParts": [],
|
||||
},
|
||||
"uiTests": {
|
||||
"filterTags": "@ocisSmokeTest",
|
||||
"skip": False,
|
||||
"skipExceptParts": [],
|
||||
},
|
||||
"e2eTests": {
|
||||
"skip": False,
|
||||
"basic": {
|
||||
"skip": False,
|
||||
"totalParts": 4, # divide and run all suites in parts (divide pipelines)
|
||||
"xsuites": ["search", "app-provider"], # suites to skip
|
||||
},
|
||||
"search": {
|
||||
"skip": False,
|
||||
"suites": ["search"], # suites to run
|
||||
"tikaNeeded": True,
|
||||
},
|
||||
},
|
||||
"rocketchat": {
|
||||
"channel": "infinitescale",
|
||||
"channel": "builds",
|
||||
"channel_cron": "builds",
|
||||
"from_secret": "rocketchat_talk_webhook",
|
||||
},
|
||||
@@ -238,18 +240,17 @@ def main(ctx):
|
||||
|
||||
pipelines = []
|
||||
|
||||
build_release_helpers = [
|
||||
changelog(),
|
||||
docs(),
|
||||
licenseCheck(ctx),
|
||||
]
|
||||
build_release_helpers = \
|
||||
changelog() + \
|
||||
docs() + \
|
||||
licenseCheck(ctx)
|
||||
|
||||
test_pipelines = \
|
||||
codestyle(ctx) + \
|
||||
checkTestSuitesInExpectedFailures(ctx) + \
|
||||
buildWebCache(ctx) + \
|
||||
getGoBinForTesting(ctx) + \
|
||||
[buildOcisBinaryForTesting(ctx)] + \
|
||||
buildOcisBinaryForTesting(ctx) + \
|
||||
checkStarlark() + \
|
||||
build_release_helpers + \
|
||||
testOcisAndUploadResults(ctx) + \
|
||||
@@ -320,11 +321,19 @@ def buildWebCache(ctx):
|
||||
def testOcisAndUploadResults(ctx):
|
||||
pipeline = testOcis(ctx)
|
||||
|
||||
######################################################################
|
||||
# The triggers have been disabled for now, since the govulncheck can #
|
||||
# not silence single, acceptable vulnerabilities. #
|
||||
# See https://github.com/owncloud/ocis/issues/9527 for more details. #
|
||||
# FIXME: RE-ENABLE THIS ASAP!!! #
|
||||
######################################################################
|
||||
|
||||
scan_result_upload = uploadScanResults(ctx)
|
||||
scan_result_upload["depends_on"] = getPipelineNames([pipeline])
|
||||
|
||||
security_scan = scanOcis(ctx)
|
||||
return [security_scan, pipeline, scan_result_upload]
|
||||
#security_scan = scanOcis(ctx)
|
||||
#return [security_scan, pipeline, scan_result_upload]
|
||||
return [pipeline, scan_result_upload]
|
||||
|
||||
def testPipelines(ctx):
|
||||
pipelines = []
|
||||
@@ -342,11 +351,7 @@ def testPipelines(ctx):
|
||||
if "skip" not in config["apiTests"] or not config["apiTests"]["skip"]:
|
||||
pipelines += apiTests(ctx)
|
||||
|
||||
if "skip" not in config["uiTests"] or not config["uiTests"]["skip"]:
|
||||
pipelines += uiTests(ctx)
|
||||
|
||||
if "skip" not in config["e2eTests"] or not config["e2eTests"]["skip"]:
|
||||
pipelines += e2eTests(ctx)
|
||||
pipelines += e2eTestPipeline(ctx)
|
||||
|
||||
return pipelines
|
||||
|
||||
@@ -543,7 +548,7 @@ def scanOcis(ctx):
|
||||
}
|
||||
|
||||
def buildOcisBinaryForTesting(ctx):
|
||||
return {
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "build_ocis_binary_for_testing",
|
||||
@@ -563,7 +568,7 @@ def buildOcisBinaryForTesting(ctx):
|
||||
],
|
||||
},
|
||||
"volumes": [pipelineVolumeGo],
|
||||
}
|
||||
}]
|
||||
|
||||
def uploadScanResults(ctx):
|
||||
sonar_env = {
|
||||
@@ -817,7 +822,7 @@ def localApiTestPipeline(ctx):
|
||||
localApiTests(suite, storage, params["extraEnvironment"]) +
|
||||
logRequests(),
|
||||
"services": emailService() if params["emailNeeded"] else [] + clamavService() if params["antivirusNeeded"] else [],
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
@@ -877,7 +882,7 @@ def cs3ApiTests(ctx, storage, accounts_hash_difficulty = 4):
|
||||
],
|
||||
},
|
||||
],
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
@@ -949,7 +954,7 @@ def wopiValidatorTests(ctx, storage, accounts_hash_difficulty = 4):
|
||||
[
|
||||
{
|
||||
"name": "wopiserver",
|
||||
"image": "cs3org/wopiserver:v10.3.0",
|
||||
"image": "cs3org/wopiserver:v10.4.0",
|
||||
"detach": True,
|
||||
"commands": [
|
||||
"cp %s/tests/config/drone/wopiserver.conf /etc/wopi/wopiserver.conf" % (dirs["base"]),
|
||||
@@ -984,7 +989,7 @@ def wopiValidatorTests(ctx, storage, accounts_hash_difficulty = 4):
|
||||
},
|
||||
] +
|
||||
validatorTests,
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
@@ -1033,7 +1038,7 @@ def coreApiTests(ctx, part_number = 1, number_of_parts = 1, storage = "ocis", ac
|
||||
] +
|
||||
logRequests(),
|
||||
"services": redisForOCStorage(storage),
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
@@ -1052,134 +1057,13 @@ def apiTests(ctx):
|
||||
|
||||
return pipelines
|
||||
|
||||
def uiTests(ctx):
|
||||
default = {
|
||||
"filterTags": "",
|
||||
def e2eTestPipeline(ctx):
|
||||
defaults = {
|
||||
"skip": False,
|
||||
# only used if 'full-ci' is in build title or if run by cron
|
||||
"numberOfParts": 20,
|
||||
"skipExceptParts": [],
|
||||
}
|
||||
params = {}
|
||||
pipelines = []
|
||||
|
||||
for item in default:
|
||||
params[item] = config["uiTests"][item] if item in config["uiTests"] else default[item]
|
||||
|
||||
filterTags = params["filterTags"]
|
||||
|
||||
if ("full-ci" in ctx.build.title.lower() or ctx.build.event == "cron"):
|
||||
numberOfParts = params["numberOfParts"]
|
||||
skipExceptParts = params["skipExceptParts"]
|
||||
debugPartsEnabled = (len(skipExceptParts) != 0)
|
||||
|
||||
for runPart in range(1, numberOfParts + 1):
|
||||
if (not debugPartsEnabled or (debugPartsEnabled and runPart in skipExceptParts)):
|
||||
pipelines.append(uiTestPipeline(ctx, "", runPart, numberOfParts))
|
||||
|
||||
# For ordinary PRs, always run the "minimal" UI test pipeline
|
||||
# That has its own expected-failures file, and we always want to know that it is correct,
|
||||
if (ctx.build.event != "tag"):
|
||||
pipelines.append(uiTestPipeline(ctx, filterTags, 1, 2, "ocis", "smoke"))
|
||||
pipelines.append(uiTestPipeline(ctx, filterTags, 2, 2, "ocis", "smoke"))
|
||||
|
||||
return pipelines
|
||||
|
||||
def uiTestPipeline(ctx, filterTags, runPart = 1, numberOfParts = 1, storage = "ocis", uniqueName = "", accounts_hash_difficulty = 4):
|
||||
standardFilterTags = "not @skipOnOCIS and not @skip and not @notToImplementOnOCIS and not @federated-server-needed"
|
||||
if filterTags == "":
|
||||
finalFilterTags = standardFilterTags
|
||||
expectedFailuresFileFilterTags = ""
|
||||
else:
|
||||
finalFilterTags = filterTags + " and " + standardFilterTags
|
||||
expectedFailuresFileFilterTags = "-" + filterTags.lstrip("@")
|
||||
|
||||
if uniqueName == "":
|
||||
uniqueNameString = ""
|
||||
else:
|
||||
finalFilterTags = filterTags + " and " + standardFilterTags
|
||||
uniqueNameString = "-" + uniqueName
|
||||
|
||||
if numberOfParts == 1:
|
||||
pipelineName = "Web-Tests-ocis%s-%s-storage" % (uniqueNameString, storage)
|
||||
else:
|
||||
pipelineName = "Web-Tests-ocis%s-%s-storage-%s" % (uniqueNameString, storage, runPart)
|
||||
|
||||
extra_server_environment = {
|
||||
"OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD": False,
|
||||
"OCIS_PASSWORD_POLICY_MIN_CHARACTERS": 1,
|
||||
"OCIS_PASSWORD_POLICY_MIN_LOWERCASE_CHARACTERS": 0,
|
||||
"OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS": 0,
|
||||
"OCIS_PASSWORD_POLICY_MIN_DIGITS": 0,
|
||||
"OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS": 0,
|
||||
}
|
||||
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": pipelineName,
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": "amd64",
|
||||
},
|
||||
"steps": skipIfUnchanged(ctx, "acceptance-tests") +
|
||||
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin") +
|
||||
restoreWebCache() +
|
||||
restoreWebPnpmCache() +
|
||||
ocisServer(storage, accounts_hash_difficulty, extra_server_environment = extra_server_environment) +
|
||||
waitForSeleniumService() +
|
||||
waitForMiddlewareService() +
|
||||
[
|
||||
{
|
||||
"name": "webUITests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"SERVER_HOST": "https://ocis-server:9200",
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
"OCIS_REVA_DATA_ROOT": "%s" % dirs["ocisRevaDataRoot"],
|
||||
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["ocisConfig"]),
|
||||
"TEST_TAGS": finalFilterTags,
|
||||
"LOCAL_UPLOAD_DIR": "/uploads",
|
||||
"NODE_TLS_REJECT_UNAUTHORIZED": 0,
|
||||
"RUN_PART": runPart,
|
||||
"DIVIDE_INTO_NUM_PARTS": numberOfParts,
|
||||
"EXPECTED_FAILURES_FILE": "/%s/tests/acceptance/expected-failures-webUI-on-%s-storage%s.md" % (dirs["base"], storage.upper(), expectedFailuresFileFilterTags),
|
||||
"MIDDLEWARE_HOST": "http://middleware:3000",
|
||||
},
|
||||
"commands": [
|
||||
"cd %s/tests/acceptance" % dirs["web"],
|
||||
"./run.sh",
|
||||
],
|
||||
},
|
||||
],
|
||||
"services": selenium() + middlewareService(),
|
||||
"volumes": [{
|
||||
"name": "uploads",
|
||||
"temp": {},
|
||||
}],
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
def e2eTests(ctx):
|
||||
test_suites = {
|
||||
"suite1": {
|
||||
"path": "tests/e2e/cucumber/features/{smoke,journeys}/*.feature",
|
||||
"tikaNeeded": False,
|
||||
},
|
||||
"suite2": {
|
||||
"path": "tests/e2e/cucumber/features/smoke/{spaces,admin-settings}/*.feature",
|
||||
"tikaNeeded": False,
|
||||
},
|
||||
"suite3": {
|
||||
"path": "tests/e2e/cucumber/features/smoke/{search,shares}/*.feature",
|
||||
"tikaNeeded": True,
|
||||
},
|
||||
"suites": [],
|
||||
"xsuites": [],
|
||||
"totalParts": 0,
|
||||
"tikaNeeded": False,
|
||||
}
|
||||
|
||||
extra_server_environment = {
|
||||
@@ -1208,41 +1092,81 @@ def e2eTests(ctx):
|
||||
pipelines = []
|
||||
|
||||
if ("skip-e2e" in ctx.build.title.lower()):
|
||||
return []
|
||||
return pipelines
|
||||
|
||||
for name, suite in test_suites.items():
|
||||
steps = \
|
||||
if (ctx.build.event == "tag"):
|
||||
return pipelines
|
||||
|
||||
for name, suite in config["e2eTests"].items():
|
||||
if "skip" in suite and suite["skip"]:
|
||||
return pipelines
|
||||
|
||||
params = {}
|
||||
for item in defaults:
|
||||
params[item] = suite[item] if item in suite else defaults[item]
|
||||
|
||||
e2e_args = ""
|
||||
if params["totalParts"] > 0:
|
||||
e2e_args = "--total-parts %d" % params["totalParts"]
|
||||
elif params["suites"]:
|
||||
e2e_args = "--suites %s" % ",".join(params["suites"])
|
||||
|
||||
# suites to skip
|
||||
if params["xsuites"]:
|
||||
e2e_args += " --xsuites %s" % ",".join(params["xsuites"])
|
||||
|
||||
steps_before = \
|
||||
skipIfUnchanged(ctx, "e2e-tests") + \
|
||||
restoreBuildArtifactCache(ctx, "ocis-binary-amd64", "ocis/bin/ocis") + \
|
||||
restoreWebCache() + \
|
||||
restoreWebPnpmCache() + \
|
||||
(tikaService() if suite["tikaNeeded"] else []) + \
|
||||
ocisServer("ocis", 4, [], extra_server_environment = extra_server_environment, tika_enabled = suite["tikaNeeded"]) + \
|
||||
[{
|
||||
"name": "e2e-tests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"BASE_URL_OCIS": "ocis-server:9200",
|
||||
"HEADLESS": "true",
|
||||
"RETRY": "1",
|
||||
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["ocisConfig"]),
|
||||
"LOCAL_UPLOAD_DIR": "/uploads",
|
||||
},
|
||||
"commands": [
|
||||
"cd %s" % dirs["web"],
|
||||
"pnpm test:e2e:cucumber %s" % suite["path"],
|
||||
],
|
||||
}] + \
|
||||
uploadTracingResult(ctx) + \
|
||||
logTracingResults()
|
||||
(tikaService() if params["tikaNeeded"] else []) + \
|
||||
ocisServer("ocis", 4, [], extra_server_environment = extra_server_environment, tika_enabled = params["tikaNeeded"])
|
||||
|
||||
if (ctx.build.event != "tag"):
|
||||
step_e2e = {
|
||||
"name": "e2e-tests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"BASE_URL_OCIS": "ocis-server:9200",
|
||||
"HEADLESS": "true",
|
||||
"RETRY": "1",
|
||||
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["ocisConfig"]),
|
||||
"LOCAL_UPLOAD_DIR": "/uploads",
|
||||
},
|
||||
"commands": [
|
||||
"cd %s/tests/e2e" % dirs["web"],
|
||||
],
|
||||
}
|
||||
|
||||
steps_after = uploadTracingResult(ctx) + \
|
||||
logTracingResults()
|
||||
|
||||
if params["totalParts"]:
|
||||
for index in range(params["totalParts"]):
|
||||
run_part = index + 1
|
||||
run_e2e = {}
|
||||
run_e2e.update(step_e2e)
|
||||
run_e2e["commands"] = [
|
||||
"cd %s/tests/e2e" % dirs["web"],
|
||||
"bash run-e2e.sh %s --run-part %d" % (e2e_args, run_part),
|
||||
]
|
||||
pipelines.append({
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "e2e-tests-%s-%s" % (name, run_part),
|
||||
"steps": steps_before + [run_e2e] + steps_after,
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx) + buildWebCache(ctx)),
|
||||
"trigger": e2e_trigger,
|
||||
"volumes": e2e_volumes,
|
||||
})
|
||||
else:
|
||||
step_e2e["commands"].append("bash run-e2e.sh %s" % e2e_args)
|
||||
pipelines.append({
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "e2e-tests-%s" % name,
|
||||
"steps": steps,
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)] + buildWebCache(ctx)),
|
||||
"steps": steps_before + [step_e2e] + steps_after,
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx) + buildWebCache(ctx)),
|
||||
"trigger": e2e_trigger,
|
||||
"volumes": e2e_volumes,
|
||||
})
|
||||
@@ -1310,7 +1234,7 @@ def dockerReleases(ctx):
|
||||
for arch in config["dockerReleases"]["architectures"]:
|
||||
pipelines.append(dockerRelease(ctx, arch))
|
||||
|
||||
manifest = releaseDockerManifest()
|
||||
manifest = releaseDockerManifest(ctx)
|
||||
manifest["depends_on"] = getPipelineNames(pipelines)
|
||||
pipelines.append(manifest)
|
||||
|
||||
@@ -1323,7 +1247,7 @@ def dockerReleases(ctx):
|
||||
def dockerRelease(ctx, arch):
|
||||
build_args = [
|
||||
"REVISION=%s" % (ctx.build.commit),
|
||||
"VERSION=%s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "latest"),
|
||||
"VERSION=%s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "stable"),
|
||||
]
|
||||
depends_on = getPipelineNames(testOcisAndUploadResults(ctx) + testPipelines(ctx))
|
||||
|
||||
@@ -1564,7 +1488,7 @@ def licenseCheck(ctx):
|
||||
"target": target,
|
||||
}
|
||||
|
||||
return {
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "check-licenses",
|
||||
@@ -1664,20 +1588,30 @@ def licenseCheck(ctx):
|
||||
],
|
||||
},
|
||||
"volumes": [pipelineVolumeGo],
|
||||
}
|
||||
}]
|
||||
|
||||
def releaseDockerManifest():
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "manifest",
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": "amd64",
|
||||
def releaseDockerManifest(ctx):
|
||||
spec_latest = "manifest-latest.tmpl"
|
||||
steps = [{
|
||||
"name": "execute",
|
||||
"image": PLUGINS_MANIFEST,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"spec": "ocis/docker/manifest.tmpl",
|
||||
"auto_tag": True,
|
||||
"ignore_missing": True,
|
||||
},
|
||||
"steps": [
|
||||
}]
|
||||
|
||||
if len(ctx.build.ref.split("-")) == 2:
|
||||
steps.append(
|
||||
{
|
||||
"name": "execute",
|
||||
"name": "execute-latest",
|
||||
"image": PLUGINS_MANIFEST,
|
||||
"settings": {
|
||||
"username": {
|
||||
@@ -1686,12 +1620,27 @@ def releaseDockerManifest():
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"spec": "ocis/docker/manifest.tmpl",
|
||||
"spec": "ocis/docker/%s" % spec_latest,
|
||||
"auto_tag": True,
|
||||
"ignore_missing": True,
|
||||
},
|
||||
},
|
||||
],
|
||||
"when": {
|
||||
"ref": [
|
||||
"refs/tags/v*",
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "manifest",
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": "amd64",
|
||||
},
|
||||
"steps": steps,
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/tags/v*",
|
||||
@@ -1700,7 +1649,7 @@ def releaseDockerManifest():
|
||||
}
|
||||
|
||||
def changelog():
|
||||
return {
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "changelog",
|
||||
@@ -1766,7 +1715,7 @@ def changelog():
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
}
|
||||
}]
|
||||
|
||||
def releaseDockerReadme(ctx):
|
||||
return {
|
||||
@@ -1802,7 +1751,7 @@ def releaseDockerReadme(ctx):
|
||||
}
|
||||
|
||||
def docs():
|
||||
return {
|
||||
return [{
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "docs",
|
||||
@@ -1871,7 +1820,7 @@ def docs():
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
}
|
||||
}]
|
||||
|
||||
def makeNodeGenerate(module):
|
||||
if module == "":
|
||||
@@ -2035,38 +1984,6 @@ def ocisServer(storage, accounts_hash_difficulty = 4, volumes = [], depends_on =
|
||||
wait_for_ocis,
|
||||
]
|
||||
|
||||
def middlewareService():
|
||||
return [{
|
||||
"name": "middleware",
|
||||
"image": OC_OC_TEST_MIDDLEWARE,
|
||||
"environment": {
|
||||
"BACKEND_HOST": "https://ocis-server:9200",
|
||||
"OCIS_REVA_DATA_ROOT": "%s/storage/owncloud/" % dirs["ocis"],
|
||||
"RUN_ON_OCIS": "true",
|
||||
"HOST": "middleware",
|
||||
"REMOTE_UPLOAD_DIR": "/uploads",
|
||||
"NODE_TLS_REJECT_UNAUTHORIZED": "0",
|
||||
"MIDDLEWARE_HOST": "middleware",
|
||||
"TEST_WITH_GRAPH_API": "true",
|
||||
},
|
||||
"volumes": [{
|
||||
"name": "uploads",
|
||||
"path": "/uploads",
|
||||
}, {
|
||||
"name": "gopath",
|
||||
"path": "/srv/app",
|
||||
}],
|
||||
}]
|
||||
|
||||
def waitForMiddlewareService():
|
||||
return [{
|
||||
"name": "wait-for-middleware-service",
|
||||
"image": OC_CI_WAIT_FOR,
|
||||
"commands": [
|
||||
"wait-for -it middleware:3000 -t 300",
|
||||
],
|
||||
}]
|
||||
|
||||
def redis():
|
||||
return [
|
||||
{
|
||||
@@ -2081,27 +1998,6 @@ def redisForOCStorage(storage = "ocis"):
|
||||
else:
|
||||
return
|
||||
|
||||
def selenium():
|
||||
return [
|
||||
{
|
||||
"name": "selenium",
|
||||
"image": SELENIUM_STANDALONE_CHROME,
|
||||
"volumes": [{
|
||||
"name": "uploads",
|
||||
"path": "/uploads",
|
||||
}],
|
||||
},
|
||||
]
|
||||
|
||||
def waitForSeleniumService():
|
||||
return [{
|
||||
"name": "wait-for-selenium-service",
|
||||
"image": OC_CI_WAIT_FOR,
|
||||
"commands": [
|
||||
"wait-for -it selenium:4444 -t 300",
|
||||
],
|
||||
}]
|
||||
|
||||
def build():
|
||||
return [
|
||||
{
|
||||
@@ -2582,7 +2478,7 @@ def litmus(ctx, storage):
|
||||
},
|
||||
],
|
||||
"services": redisForOCStorage(storage),
|
||||
"depends_on": getPipelineNames([buildOcisBinaryForTesting(ctx)]),
|
||||
"depends_on": getPipelineNames(buildOcisBinaryForTesting(ctx)),
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/stable-*",
|
||||
|
||||
+265
-22
@@ -1,6 +1,11 @@
|
||||
# Table of Contents
|
||||
|
||||
* [Changelog for unreleased](#changelog-for-unreleased-unreleased)
|
||||
* [Changelog for 5.0.6](#changelog-for-506-2024-07-17)
|
||||
* [Changelog for 5.0.5](#changelog-for-505-2024-05-22)
|
||||
* [Changelog for 5.0.4](#changelog-for-504-2024-05-13)
|
||||
* [Changelog for 5.0.3](#changelog-for-503-2024-05-02)
|
||||
* [Changelog for 5.0.2](#changelog-for-502-2024-04-17)
|
||||
* [Changelog for 5.0.1](#changelog-for-501-2024-04-10)
|
||||
* [Changelog for 5.0.0](#changelog-for-500-2024-03-18)
|
||||
* [Changelog for 4.0.6](#changelog-for-406-2024-02-07)
|
||||
@@ -13,8 +18,8 @@
|
||||
* [Changelog for 3.0.0](#changelog-for-300-2023-06-06)
|
||||
* [Changelog for 2.0.0](#changelog-for-200-2022-11-30)
|
||||
* [Changelog for 1.20.0](#changelog-for-1200-2022-04-13)
|
||||
* [Changelog for 1.19.1](#changelog-for-1191-2022-03-29)
|
||||
* [Changelog for 1.19.0](#changelog-for-1190-2022-03-29)
|
||||
* [Changelog for 1.19.1](#changelog-for-1191-2022-03-29)
|
||||
* [Changelog for 1.18.0](#changelog-for-1180-2022-03-03)
|
||||
* [Changelog for 1.17.0](#changelog-for-1170-2022-02-16)
|
||||
* [Changelog for 1.16.0](#changelog-for-1160-2021-12-10)
|
||||
@@ -39,7 +44,245 @@
|
||||
|
||||
The following sections list the changes for unreleased.
|
||||
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v5.0.1...master
|
||||
[unreleased]: https://github.com/owncloud/ocis/compare/v5.0.6...master
|
||||
|
||||
## Summary
|
||||
|
||||
* Enhancement - Add virus filter to sessions command: [#9041](https://github.com/owncloud/ocis/pull/9041)
|
||||
* Enhancement - Assimilate `clean` into `sessions` command: [#9828](https://github.com/owncloud/ocis/pull/9828)
|
||||
* Enhancement - Update web to v8.0.5: [#9958](https://github.com/owncloud/ocis/pull/9958)
|
||||
|
||||
## Details
|
||||
|
||||
* Enhancement - Add virus filter to sessions command: [#9041](https://github.com/owncloud/ocis/pull/9041)
|
||||
|
||||
Allow filtering upload session by virus status (has-virus=true/false)
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9041
|
||||
|
||||
* Enhancement - Assimilate `clean` into `sessions` command: [#9828](https://github.com/owncloud/ocis/pull/9828)
|
||||
|
||||
We deprecated `ocis storage-user uploads clean` and added the same logic to
|
||||
`ocis storage-users uploads session --clean`
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9828
|
||||
|
||||
* Enhancement - Update web to v8.0.5: [#9958](https://github.com/owncloud/ocis/pull/9958)
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.5. Please refer to the changelog (linked) for
|
||||
details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#11395](https://github.com/owncloud/web/pull/11395):
|
||||
Missing space members for group memberships - Bugfix
|
||||
[owncloud/web#11263](https://github.com/owncloud/web/pull/11263): Show more
|
||||
toggle in space members view not reactive - Bugfix
|
||||
[owncloud/web#11263](https://github.com/owncloud/web/pull/11263): Space show
|
||||
links from other spaces - Bugfix
|
||||
[owncloud/web#11303](https://github.com/owncloud/web/pull/11303): Uploading
|
||||
nested folders
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9958
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.5
|
||||
|
||||
# Changelog for [5.0.6] (2024-07-17)
|
||||
|
||||
The following sections list the changes for 5.0.6.
|
||||
|
||||
[5.0.6]: https://github.com/owncloud/ocis/compare/v5.0.5...v5.0.6
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Allow all uploads to restart: [#9506](https://github.com/owncloud/ocis/pull/9506)
|
||||
* Bugfix - Fix the email notification service: [#9514](https://github.com/owncloud/ocis/pull/9514)
|
||||
* Enhancement - Limit concurrent thumbnail requests: [#9199](https://github.com/owncloud/ocis/pull/9199)
|
||||
* Enhancement - Update web to v8.0.4: [#9429](https://github.com/owncloud/ocis/pull/9429)
|
||||
* Enhancement - Add cli to purge revisions: [#9497](https://github.com/owncloud/ocis/pull/9497)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Allow all uploads to restart: [#9506](https://github.com/owncloud/ocis/pull/9506)
|
||||
|
||||
On postprocessing-restart, allow all uploads to restart even if one fails.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9506
|
||||
|
||||
* Bugfix - Fix the email notification service: [#9514](https://github.com/owncloud/ocis/pull/9514)
|
||||
|
||||
We fixed an error in the notification service that caused the email notification
|
||||
to fail when the user's display name contained special characters.
|
||||
|
||||
https://github.com/owncloud/ocis/issues/9402
|
||||
https://github.com/owncloud/ocis/pull/9514
|
||||
|
||||
* Enhancement - Limit concurrent thumbnail requests: [#9199](https://github.com/owncloud/ocis/pull/9199)
|
||||
|
||||
The number of concurrent requests to the thumbnail service can be limited now to
|
||||
have more control over the consumed system resources.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9199
|
||||
|
||||
* Enhancement - Update web to v8.0.4: [#9429](https://github.com/owncloud/ocis/pull/9429)
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.4. Please refer to the changelog (linked) for
|
||||
details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#10814](https://github.com/owncloud/web/issues/10814):
|
||||
Vertical scroll for OcModal on small screens - Bugfix
|
||||
[owncloud/web#10918](https://github.com/owncloud/web/issues/10918): Resource
|
||||
deselection on right-click - Bugfix
|
||||
[owncloud/web#10920](https://github.com/owncloud/web/pull/10920): Resources with
|
||||
name consist of number won't show up in trash bin - Bugfix
|
||||
[owncloud/web#10941](https://github.com/owncloud/web/issues/10941): Space not
|
||||
updating on navigation - Bugfix
|
||||
[owncloud/web#11063](https://github.com/owncloud/web/issues/11063): Enforce
|
||||
shortcut URL protocol - Bugfix
|
||||
[owncloud/web#11092](https://github.com/owncloud/web/issues/11092): Browser
|
||||
confirmation dialog after closing editor - Bugfix
|
||||
[owncloud/web#11091](https://github.com/owncloud/web/issues/11091): Button focus
|
||||
when closing editor - Bugfix
|
||||
[owncloud/web#10942](https://github.com/owncloud/web/issues/10942): Keyboard
|
||||
navigation breaking - Bugfix
|
||||
[owncloud/web#11086](https://github.com/owncloud/web/pull/11086): Opening public
|
||||
links with an expired token
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9429
|
||||
https://github.com/owncloud/ocis/pull/9510
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.3
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.4
|
||||
|
||||
* Enhancement - Add cli to purge revisions: [#9497](https://github.com/owncloud/ocis/pull/9497)
|
||||
|
||||
Adds a cli that allows removing all revisions for a storage-provider.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9497
|
||||
|
||||
# Changelog for [5.0.5] (2024-05-22)
|
||||
|
||||
The following sections list the changes for 5.0.5.
|
||||
|
||||
[5.0.5]: https://github.com/owncloud/ocis/compare/v5.0.4...v5.0.5
|
||||
|
||||
## Summary
|
||||
|
||||
* Enhancement - Update web to v8.0.2: [#9153](https://github.com/owncloud/ocis/pull/9153)
|
||||
|
||||
## Details
|
||||
|
||||
* Enhancement - Update web to v8.0.2: [#9153](https://github.com/owncloud/ocis/pull/9153)
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.2. Please refer to the changelog (linked) for
|
||||
details on the web release.
|
||||
|
||||
* Bugfix [owncloud/web#10515](https://github.com/owncloud/web/issues/10515): Folder replace
|
||||
* Bugfix [owncloud/web#10598](https://github.com/owncloud/web/issues/10598): Hidden right sidebar on small screens
|
||||
* Bugfix [owncloud/web#10634](https://github.com/owncloud/web/issues/10634): Scope loss when showing search results
|
||||
* Bugfix [owncloud/web#10657](https://github.com/owncloud/web/issues/10657): Theme loading without matching theme
|
||||
* Bugfix [owncloud/web#10763](https://github.com/owncloud/web/pull/10763): Flickering loading indicator
|
||||
* Bugfix [owncloud/web#10810](https://github.com/owncloud/web/issues/10810): Download files with special chars in name
|
||||
* Bugfix [owncloud/web#10881](https://github.com/owncloud/web/pull/10881): IDP logout issues
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9153
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.2
|
||||
|
||||
# Changelog for [5.0.4] (2024-05-13)
|
||||
|
||||
The following sections list the changes for 5.0.4.
|
||||
|
||||
[5.0.4]: https://github.com/owncloud/ocis/compare/v5.0.3...v5.0.4
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Update reva to v2.19.7: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
* Bugfix - Service startup of WOPI example: [#9127](https://github.com/owncloud/ocis/pull/9127)
|
||||
* Bugfix - Nats reconnects: [#9139](https://github.com/owncloud/ocis/pull/9139)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Update reva to v2.19.7: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
|
||||
We updated reva to v2.19.7
|
||||
|
||||
* Enhancement [cs3org/reva#4673](https://github.com/cs3org/reva/pull/4673): Add virus filter to list uploads sessions
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
|
||||
* Bugfix - Service startup of WOPI example: [#9127](https://github.com/owncloud/ocis/pull/9127)
|
||||
|
||||
We fixed a bug in the service startup of the appprovider-onlyoffice in the
|
||||
ocis_wopi deployment example.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9127
|
||||
|
||||
* Bugfix - Nats reconnects: [#9139](https://github.com/owncloud/ocis/pull/9139)
|
||||
|
||||
We fixed the reconnect handling of the natjs kv registry.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9139
|
||||
https://github.com/owncloud/ocis/pull/8880
|
||||
|
||||
# Changelog for [5.0.3] (2024-05-02)
|
||||
|
||||
The following sections list the changes for 5.0.3.
|
||||
|
||||
[5.0.3]: https://github.com/owncloud/ocis/compare/v5.0.2...v5.0.3
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Update the admin user role assignment to enforce the config: [#8918](https://github.com/owncloud/ocis/pull/8918)
|
||||
* Bugfix - Crash when processing crafted TIFF files: [#8981](https://github.com/owncloud/ocis/pull/8981)
|
||||
* Bugfix - Update reva to v2.19.6: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
* Bugfix - Fix infected file handling: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Update the admin user role assignment to enforce the config: [#8918](https://github.com/owncloud/ocis/pull/8918)
|
||||
|
||||
The admin user role assigment was not updated after the first assignment. We now
|
||||
read the assigned role during init and update the admin user ID accordingly if
|
||||
the role is not assigned. This is especially needed when the OCIS_ADMIN_USER_ID
|
||||
is set after the autoprovisioning of the admin user when it originates from an
|
||||
external Identity Provider.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/8918
|
||||
https://github.com/owncloud/ocis/pull/8897
|
||||
|
||||
* Bugfix - Crash when processing crafted TIFF files: [#8981](https://github.com/owncloud/ocis/pull/8981)
|
||||
|
||||
Fix for a vulnerability with low severity in disintegration/imaging.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/8981
|
||||
https://github.com/advisories/GHSA-q7pp-wcgr-pffx
|
||||
|
||||
* Bugfix - Update reva to v2.19.6: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
|
||||
We updated reva to v2.19.6
|
||||
|
||||
* Bugfix [cs3org/reva#4654](https://github.com/cs3org/reva/pull/4654): Write blob based on session id
|
||||
* Bugfix [cs3org/reva#4666](https://github.com/cs3org/reva/pull/4666): Fix uploading via a public link
|
||||
* Bugfix [cs3org/reva#4665](https://github.com/cs3org/reva/pull/4665): Fix creating documents in nested folders of public shares
|
||||
* Enhancement [cs3org/reva#4655](https://github.com/cs3org/reva/pull/4655): Bump mockery to v2.40.2
|
||||
* Enhancement [cs3org/reva#4664](https://github.com/cs3org/reva/pull/4664): Add ScanData to Uploadsession
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
|
||||
* Bugfix - Fix infected file handling: [#9011](https://github.com/owncloud/ocis/pull/9011)
|
||||
|
||||
Reworks virus handling. Shows scandate and outcome on ocis storage-users uploads
|
||||
sessions. Avoids retrying infected files on ocis postprocessing restart.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
|
||||
# Changelog for [5.0.2] (2024-04-17)
|
||||
|
||||
The following sections list the changes for 5.0.2.
|
||||
|
||||
[5.0.2]: https://github.com/owncloud/ocis/compare/v5.0.1...v5.0.2
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -7330,7 +7573,7 @@ The following sections list the changes for 2.0.0.
|
||||
|
||||
The following sections list the changes for 1.20.0.
|
||||
|
||||
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.20.0
|
||||
[1.20.0]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.20.0
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -7504,29 +7747,11 @@ The following sections list the changes for 1.20.0.
|
||||
https://github.com/owncloud/ocis/pull/3509
|
||||
https://github.com/owncloud/web/releases/tag/v5.4.0
|
||||
|
||||
# Changelog for [1.19.1] (2022-03-29)
|
||||
|
||||
The following sections list the changes for 1.19.1.
|
||||
|
||||
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.19.0...v1.19.1
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
|
||||
|
||||
URLs for Special items (space image, readme) were broken.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3419
|
||||
|
||||
# Changelog for [1.19.0] (2022-03-29)
|
||||
|
||||
The following sections list the changes for 1.19.0.
|
||||
|
||||
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.0
|
||||
[1.19.0]: https://github.com/owncloud/ocis/compare/v1.19.1...v1.19.0
|
||||
|
||||
## Summary
|
||||
|
||||
@@ -7700,6 +7925,24 @@ The following sections list the changes for 1.19.0.
|
||||
https://github.com/owncloud/ocis/pull/3375
|
||||
https://github.com/owncloud/web/releases/tag/v5.3.0
|
||||
|
||||
# Changelog for [1.19.1] (2022-03-29)
|
||||
|
||||
The following sections list the changes for 1.19.1.
|
||||
|
||||
[1.19.1]: https://github.com/owncloud/ocis/compare/v1.18.0...v1.19.1
|
||||
|
||||
## Summary
|
||||
|
||||
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
|
||||
|
||||
## Details
|
||||
|
||||
* Bugfix - Return correct special item urls: [#3419](https://github.com/owncloud/ocis/pull/3419)
|
||||
|
||||
URLs for Special items (space image, readme) were broken.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/3419
|
||||
|
||||
# Changelog for [1.18.0] (2022-03-03)
|
||||
|
||||
The following sections list the changes for 1.18.0.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Crash when processing crafted TIFF files
|
||||
|
||||
Fix for a vulnerability with low severity in disintegration/imaging.
|
||||
|
||||
https://github.com/advisories/GHSA-q7pp-wcgr-pffx
|
||||
https://github.com/owncloud/ocis/pull/8981
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Bugfix: Update reva to v2.19.6
|
||||
|
||||
We updated reva to v2.19.6
|
||||
|
||||
* Bugfix [cs3org/reva#4654](https://github.com/cs3org/reva/pull/4654): Write blob based on session id
|
||||
* Bugfix [cs3org/reva#4666](https://github.com/cs3org/reva/pull/4666): Fix uploading via a public link
|
||||
* Bugfix [cs3org/reva#4665](https://github.com/cs3org/reva/pull/4665): Fix creating documents in nested folders of public shares
|
||||
* Enhancement [cs3org/reva#4655](https://github.com/cs3org/reva/pull/4655): Bump mockery to v2.40.2
|
||||
* Enhancement [cs3org/reva#4664](https://github.com/cs3org/reva/pull/4664): Add ScanData to Uploadsession
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Update the admin user role assignment to enforce the config
|
||||
|
||||
The admin user role assigment was not updated after the first assignment. We now read the assigned role during init and update the admin user ID accordingly if the role is not assigned.
|
||||
This is especially needed when the OCIS_ADMIN_USER_ID is set after the autoprovisioning of the admin user when it originates from an external Identity Provider.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/8918
|
||||
https://github.com/owncloud/ocis/pull/8897
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Fix infected file handling
|
||||
|
||||
Reworks virus handling. Shows scandate and outcome on ocis storage-users uploads sessions. Avoids retrying infected files on ocis postprocessing restart.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Update reva to v2.19.7
|
||||
|
||||
We updated reva to v2.19.7
|
||||
|
||||
* Enhancement [cs3org/reva#4673](https://github.com/cs3org/reva/pull/4673): Add virus filter to list uploads sessions
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9011
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Service startup of WOPI example
|
||||
|
||||
We fixed a bug in the service startup of the appprovider-onlyoffice in the ocis_wopi deployment example.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9127
|
||||
@@ -0,0 +1,6 @@
|
||||
Bugfix: Nats reconnects
|
||||
|
||||
We fixed the reconnect handling of the natjs kv registry.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9139
|
||||
https://github.com/owncloud/ocis/pull/8880
|
||||
@@ -0,0 +1,16 @@
|
||||
Enhancement: Update web to v8.0.2
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.2. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
* Bugfix [owncloud/web#10515](https://github.com/owncloud/web/issues/10515): Folder replace
|
||||
* Bugfix [owncloud/web#10598](https://github.com/owncloud/web/issues/10598): Hidden right sidebar on small screens
|
||||
* Bugfix [owncloud/web#10634](https://github.com/owncloud/web/issues/10634): Scope loss when showing search results
|
||||
* Bugfix [owncloud/web#10657](https://github.com/owncloud/web/issues/10657): Theme loading without matching theme
|
||||
* Bugfix [owncloud/web#10763](https://github.com/owncloud/web/pull/10763): Flickering loading indicator
|
||||
* Bugfix [owncloud/web#10810](https://github.com/owncloud/web/issues/10810): Download files with special chars in name
|
||||
* Bugfix [owncloud/web#10881](https://github.com/owncloud/web/pull/10881): IDP logout issues
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9153
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.2
|
||||
@@ -0,0 +1,7 @@
|
||||
Bugfix: Fix the email notification service
|
||||
|
||||
We fixed an error in the notification service that caused the email notification to fail when the user's display name contained special characters.
|
||||
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9514
|
||||
https://github.com/owncloud/ocis/issues/9402
|
||||
@@ -0,0 +1,5 @@
|
||||
Bugfix: Allow all uploads to restart
|
||||
|
||||
On postprocessing-restart, allow all uploads to restart even if one fails.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9506
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Add cli to purge revisions
|
||||
|
||||
Adds a cli that allows removing all revisions for a storage-provider.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9497
|
||||
@@ -0,0 +1,6 @@
|
||||
Enhancement: Limit concurrent thumbnail requests
|
||||
|
||||
The number of concurrent requests to the thumbnail service can be limited now
|
||||
to have more control over the consumed system resources.
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9199
|
||||
@@ -0,0 +1,20 @@
|
||||
Enhancement: Update web to v8.0.4
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.4. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#10814](https://github.com/owncloud/web/issues/10814): Vertical scroll for OcModal on small screens
|
||||
- Bugfix [owncloud/web#10918](https://github.com/owncloud/web/issues/10918): Resource deselection on right-click
|
||||
- Bugfix [owncloud/web#10920](https://github.com/owncloud/web/pull/10920): Resources with name consist of number won't show up in trash bin
|
||||
- Bugfix [owncloud/web#10941](https://github.com/owncloud/web/issues/10941): Space not updating on navigation
|
||||
- Bugfix [owncloud/web#11063](https://github.com/owncloud/web/issues/11063): Enforce shortcut URL protocol
|
||||
- Bugfix [owncloud/web#11092](https://github.com/owncloud/web/issues/11092): Browser confirmation dialog after closing editor
|
||||
- Bugfix [owncloud/web#11091](https://github.com/owncloud/web/issues/11091): Button focus when closing editor
|
||||
- Bugfix [owncloud/web#10942](https://github.com/owncloud/web/issues/10942): Keyboard navigation breaking
|
||||
- Bugfix [owncloud/web#11086](https://github.com/owncloud/web/pull/11086): Opening public links with an expired token
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9429
|
||||
https://github.com/owncloud/ocis/pull/9510
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.3
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.4
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Add virus filter to sessions command
|
||||
|
||||
Allow filtering upload session by virus status (has-virus=true/false)
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9041
|
||||
@@ -0,0 +1,5 @@
|
||||
Enhancement: Assimilate `clean` into `sessions` command
|
||||
|
||||
We deprecated `ocis storage-user uploads clean` and added the same logic to `ocis storage-users uploads session --clean`
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9828
|
||||
@@ -0,0 +1,13 @@
|
||||
Enhancement: Update web to v8.0.5
|
||||
|
||||
Tags: web
|
||||
|
||||
We updated ownCloud Web to v8.0.5. Please refer to the changelog (linked) for details on the web release.
|
||||
|
||||
- Bugfix [owncloud/web#11395](https://github.com/owncloud/web/pull/11395): Missing space members for group memberships
|
||||
- Bugfix [owncloud/web#11263](https://github.com/owncloud/web/pull/11263): Show more toggle in space members view not reactive
|
||||
- Bugfix [owncloud/web#11263](https://github.com/owncloud/web/pull/11263): Space show links from other spaces
|
||||
- Bugfix [owncloud/web#11303](https://github.com/owncloud/web/pull/11303): Uploading nested folders
|
||||
|
||||
https://github.com/owncloud/ocis/pull/9958
|
||||
https://github.com/owncloud/web/releases/tag/v8.0.5
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"name": "owncloud/ocis",
|
||||
"config" : {
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
"php": "8.2"
|
||||
},
|
||||
"vendor-dir": "./vendor-php",
|
||||
"allow-plugins": {
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
env:
|
||||
INSECURE: "false"
|
||||
TRAEFIK_ACME_MAIL: mbarz@owncloud.com
|
||||
OCIS_DOCKER_TAG: 5.0.1
|
||||
OCIS_DOCKER_TAG: 5.0.5
|
||||
OCIS_DOMAIN: ocis.ocis-keycloak.released.owncloud.works
|
||||
KEYCLOAK_DOMAIN: keycloak.ocis-keycloak.released.owncloud.works
|
||||
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
env:
|
||||
INSECURE: "false"
|
||||
TRAEFIK_ACME_MAIL: mbarz@owncloud.com
|
||||
OCIS_DOCKER_TAG: 5.0.1
|
||||
OCIS_DOCKER_TAG: 5.0.5
|
||||
OCIS_DOMAIN: ocis.ocis-ldap.released.owncloud.works
|
||||
LDAP_MANAGER_DOMAIN: ldap.ocis-ldap.released.owncloud.works
|
||||
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
env:
|
||||
INSECURE: "false"
|
||||
TRAEFIK_ACME_MAIL: mbarz@owncloud.com
|
||||
OCIS_DOCKER_TAG: 5.0.1
|
||||
OCIS_DOCKER_TAG: 5.0.5
|
||||
OCIS_DOMAIN: ocis.ocis-traefik.released.owncloud.works
|
||||
DEMO_USERS: "true"
|
||||
INBUCKET_DOMAIN: mail.ocis-traefik.released.owncloud.works
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
env:
|
||||
INSECURE: "false"
|
||||
TRAEFIK_ACME_MAIL: mbarz@owncloud.com
|
||||
OCIS_DOCKER_TAG: 5.0.2-rc.1
|
||||
OCIS_DOCKER_TAG: 5.0.5
|
||||
OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works
|
||||
COMPANION_DOMAIN: companion.ocis-wopi.released.owncloud.works
|
||||
COMPANION_IMAGE: owncloud/uppy-companion:3.12.13-owncloud
|
||||
|
||||
@@ -1,66 +1,214 @@
|
||||
# If you're on a internet facing server please comment out following line.
|
||||
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
|
||||
# Define the docker compose log driver used.
|
||||
# Defaults to local
|
||||
LOG_DRIVER=
|
||||
|
||||
# If you're on an internet facing server. comment out following line.
|
||||
# It skips certificate validation for various parts of Infinite Scale and is
|
||||
# needed when self signed certificates are used.
|
||||
INSECURE=true
|
||||
|
||||
### Traefik settings ###
|
||||
# Serve Traefik dashboard. Defaults to "false".
|
||||
|
||||
### Traefik Settings ###
|
||||
|
||||
# Serve Traefik dashboard.
|
||||
# Defaults to "false".
|
||||
TRAEFIK_DASHBOARD=
|
||||
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
|
||||
|
||||
# Domain of Traefik, where you can find the dashboard.
|
||||
# Defaults to "traefik.owncloud.test"
|
||||
TRAEFIK_DOMAIN=
|
||||
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin" (written as: "admin:admin").
|
||||
|
||||
# Basic authentication for the traefik dashboard.
|
||||
# Defaults to user "admin" and password "admin" (written as: "admin:admin").
|
||||
TRAEFIK_BASIC_AUTH_USERS=
|
||||
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
|
||||
|
||||
# Email address for obtaining LetsEncrypt certificates.
|
||||
# Needs only be changed if this is a public facing server.
|
||||
TRAEFIK_ACME_MAIL=
|
||||
|
||||
### oCIS settings ###
|
||||
# oCIS version. Defaults to "latest"
|
||||
# Set to the following for testing to check the certificate process:
|
||||
# "https://acme-staging-v02.api.letsencrypt.org/directory"
|
||||
# With staging configured, there will be an SSL error in the browser.
|
||||
# When certificates are displayed and are emitted by # "Fake LE Intermediate X1",
|
||||
# the process went well and the envvar can be reset to empty to get valid certificates.
|
||||
TRAEFIK_ACME_CASERVER=
|
||||
|
||||
|
||||
### Infinite Scale Settings ###
|
||||
|
||||
# Beside Traefik, this service must stay enabled.
|
||||
# Disable only for testing purposes.
|
||||
OCIS=:ocis.yml
|
||||
|
||||
# The oCIS container image.
|
||||
# Defaults to "owncloud/ocis" which contains the production releases.
|
||||
OCIS_DOCKER_IMAGE=
|
||||
|
||||
# The oCIS container version.
|
||||
# Defaults to "latest". This will point to the latest production tag.
|
||||
OCIS_DOCKER_TAG=
|
||||
# Domain of oCIS, where you can find the frontend. Defaults to "ocis.owncloud.test"
|
||||
|
||||
# Domain of oCIS, where you can find the frontend.
|
||||
# Defaults to "ocis.owncloud.test"
|
||||
OCIS_DOMAIN=
|
||||
|
||||
# oCIS admin user password. Defaults to "admin".
|
||||
ADMIN_PASSWORD=
|
||||
# The demo users should not be created on a production instance
|
||||
|
||||
# Demo users should not be created on a production instance,
|
||||
# because their passwords are public. Defaults to "false".
|
||||
# Also see: https://doc.owncloud.com/ocis/latest/deployment/general/general-info.html#demo-users-and-groups
|
||||
DEMO_USERS=
|
||||
|
||||
### Wopi server settings ###
|
||||
# cs3org wopi server version. Defaults to "v8.3.3"
|
||||
WOPISERVER_DOCKER_TAG=
|
||||
# cs3org wopi server domain. Defaults to "wopiserver.owncloud.test"
|
||||
WOPISERVER_DOMAIN=
|
||||
# JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "LoremIpsum567"
|
||||
WOPI_JWT_SECRET=
|
||||
# Define the loglevel used.
|
||||
# For more details see:
|
||||
# https://doc.owncloud.com/ocis/latest/deployment/services/env-vars-special-scope.html
|
||||
LOG_LEVEL=
|
||||
|
||||
### Collabora settings ###
|
||||
# Domain of Collabora, where you can find the frontend. Defaults to "collabora.owncloud.test"
|
||||
COLLABORA_DOMAIN=
|
||||
# Admin user for Collabora. Defaults to blank, provide one to enable access. Collabora Admin Panel URL: https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html
|
||||
COLLABORA_ADMIN_USER=
|
||||
# Admin password for Collabora. Defaults to blank, provide one to enable access
|
||||
COLLABORA_ADMIN_PASSWORD=
|
||||
# Define the oCIS storage location. Set the paths for config and data to a local path.
|
||||
# Note that especially the data directory can grow big.
|
||||
# Leaving it default stores data in docker internal volumes.
|
||||
# For more details see:
|
||||
# https://doc.owncloud.com/ocis/next/deployment/general/general-info.html#default-paths
|
||||
# OCIS_CONFIG_DIR=/your/local/ocis/config
|
||||
# OCIS_DATA_DIR=/your/local/ocis/data
|
||||
|
||||
### OnlyOffice settings ###
|
||||
# Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test"
|
||||
ONLYOFFICE_DOMAIN=
|
||||
# Define SMPT settings if you would like to send Infinite Scale email notifications.
|
||||
# For more details see:
|
||||
# https://doc.owncloud.com/ocis/latest/deployment/services/s-list/notifications.html
|
||||
|
||||
### Email / Inbucket settings ###
|
||||
# Inbucket / Mail domain. Defaults to "mail.owncloud.test"
|
||||
INBUCKET_DOMAIN=
|
||||
# SMTP host to connect to.
|
||||
SMTP_HOST=
|
||||
|
||||
### Apache Tika Content analysis toolkit ###
|
||||
# Set the desired docker image tag or digest, defaults to "latest"
|
||||
# Port of the SMTP host to connect to.
|
||||
SMTP_PORT=
|
||||
|
||||
# An eMail address that is used for sending Infinite Scale notification eMails
|
||||
# like "ocis notifications <noreply@yourdomain.com>".
|
||||
SMTP_SENDER=
|
||||
|
||||
# Username for the SMTP host to connect to.
|
||||
SMTP_USERNAME=
|
||||
|
||||
# Password for the SMTP host to connect to.
|
||||
SMTP_PASSWORD=
|
||||
|
||||
# Authentication method for the SMTP communication.
|
||||
SMTP_AUTHENTICATION=
|
||||
|
||||
# Allow insecure connections to the SMTP server. Defaults to false.
|
||||
SMTP_INSECURE=
|
||||
|
||||
|
||||
## Default Enabled Services ##
|
||||
|
||||
### Apache Tika Content Analysis Toolkit ###
|
||||
|
||||
# Tika (search) is enabled by default, comment if not required.
|
||||
# the leading colon is required to enable the service
|
||||
TIKA=:tika.yml
|
||||
|
||||
# Set the desired docker image tag or digest.
|
||||
# Defaults to "latest"
|
||||
TIKA_IMAGE=
|
||||
|
||||
# If you want to use debugging and tracing with this stack,
|
||||
# you need uncomment following line. Please see documentation at
|
||||
# https://owncloud.dev/ocis/deployment/monitoring-tracing/
|
||||
#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
### Uppy Companion settings ###
|
||||
# Domain of Uppy Companion. Defaults to "companion.owncloud.test"
|
||||
### Wopi Server Settings ###
|
||||
|
||||
# Wopi Server is enabled by default, comment if not required.
|
||||
# Note that without the wopiserver, office apps will fail to start.
|
||||
# the leading colon is required to enable the service
|
||||
WOPISERVER=:wopiserver.yml
|
||||
|
||||
# cs3org WOPI Server Version.
|
||||
# Defaults to "v10.5.0"
|
||||
WOPISERVER_DOCKER_TAG=
|
||||
|
||||
# cs3org WOPI Server Domain. Defaults to "wopiserver.owncloud.test"
|
||||
WOPISERVER_DOMAIN=
|
||||
|
||||
# JWT secret which is used for the documents to be requested by the WOPI client
|
||||
# from the cs3org WOPI server. Must be changed in order to have a secure WOPI server.
|
||||
# Defaults to "LoremIpsum567"
|
||||
WOPI_JWT_SECRET=
|
||||
|
||||
|
||||
### Collabora Settings ###
|
||||
|
||||
# Collabora web office is default enabled, comment if not required.
|
||||
# the leading colon is required to enable the service
|
||||
COLLABORA=:collabora.yml
|
||||
|
||||
# Domain of Collabora, where you can find the frontend.
|
||||
# Defaults to "collabora.owncloud.test"
|
||||
COLLABORA_DOMAIN=
|
||||
|
||||
# Admin user for Collabora.
|
||||
# Defaults to blank. Provide one to enable access.
|
||||
# Collabora Admin Panel URL:
|
||||
# https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html
|
||||
COLLABORA_ADMIN_USER=
|
||||
|
||||
# Admin password for Collabora.
|
||||
# Defaults to blank, provide one to enable access
|
||||
COLLABORA_ADMIN_PASSWORD=
|
||||
|
||||
|
||||
### Supplemental Configurations ###
|
||||
# If you want to use supplemental configurations,
|
||||
# you need to uncomment lines containing :path/file.yml
|
||||
# and configure the service if required.
|
||||
|
||||
|
||||
## Debugging - Monitoring ##
|
||||
# Please see documentation at: https://owncloud.dev/ocis/deployment/monitoring-tracing/
|
||||
# Only enable if you have Collabora AND OnlyOffice enabled
|
||||
#MONITORING=:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
|
||||
## Uppy Companion Settings ##
|
||||
# the leading colon is required to enable the service
|
||||
#COMPANION=:companion.yml
|
||||
|
||||
COMPANION_IMAGE=
|
||||
|
||||
# Domain of Uppy Companion. Defaults to "companion.owncloud.test"
|
||||
COMPANION_DOMAIN=
|
||||
COMPANION_WEB_CONFIG_FILE_NAME=
|
||||
# Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference. Empty by default, which disables providers.
|
||||
|
||||
# Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference.
|
||||
# Empty by default, which disables providers.
|
||||
COMPANION_ONEDRIVE_KEY=
|
||||
COMPANION_ONEDRIVE_SECRET=
|
||||
|
||||
|
||||
## OnlyOffice Settings ##
|
||||
# the leading colon is required to enable the service
|
||||
#ONLYOFFICE=:onlyoffice.yml
|
||||
|
||||
# Domain for OnlyOffice. Defaults to "onlyoffice.owncloud.test"
|
||||
ONLYOFFICE_DOMAIN=
|
||||
|
||||
|
||||
## Inbucket Settings ##
|
||||
#INBUCKET=:inbucket.yml
|
||||
|
||||
# email server (in this case inbucket acts as mail catcher)
|
||||
# Domain for Inbucket. Defaults to "mail.owncloud.test"
|
||||
INBUCKET_DOMAIN=
|
||||
|
||||
# Mutually exclusive with ocis settings, only uncomment when the ocis settings are NOT set
|
||||
#SMTP_HOST=inbucket
|
||||
#SMTP_PORT=2500
|
||||
#SMTP_SENDER="oCIS notifications <notifications@${OCIS_DOMAIN:-ocis.owncloud.test}>"
|
||||
#SMTP_USERNAME="notifications@${OCIS_DOMAIN:-ocis.owncloud.test}"
|
||||
# the mail catcher uses self signed certificates
|
||||
#SMTP_INSECURE: "true"
|
||||
|
||||
|
||||
### IMPORTANT ###
|
||||
# This MUST be the last line as it assembles the supplemental compose files to be used.
|
||||
# ALL supplemental configs must be added here, whether commented or not.
|
||||
# Each var must either be empty or contain :path/file.yml
|
||||
COMPOSE_FILE=docker-compose.yml${OCIS:-}${TIKA:-}${WOPISERVER:-}${COLLABORA:-}${MONITORING:-}${COMPANION:-}${ONLYOFFICE:-}${INBUCKET:-}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
---
|
||||
document this deployment example in: docs/ocis/deployment/ocis_wopi.md
|
||||
---
|
||||
Please refer to our [admin documentation](https://doc.owncloud.com/ocis/latest/depl-examples/ubuntu-compose/ubuntu-compose-prod.html) for instructions on how to deploy this scenario.
|
||||
|
||||
Note: This deployment setup is highly configurable. At minimum, it starts `traefik`, `ocis`, `tika`, the `wopiserver` and `collabora`. Additional services can be started by removing the respective comment in the `.env` file. Depending on the service added, related variables need to be configured.
|
||||
|
||||
Please refer to [our documentation](https://owncloud.dev/ocis/deployment/ocis_wopi/)
|
||||
for instructions on how to deploy this scenario.
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${COLLABORA_DOMAIN:-collabora.owncloud.test}
|
||||
|
||||
collabora:
|
||||
# collabora can currently NOT be updated to: 24.x due to a bug in collabora
|
||||
# this is the latest tested and functional collabora version
|
||||
image: collabora/code:23.05.10.1.1
|
||||
networks:
|
||||
- ocis-net
|
||||
environment:
|
||||
aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}:443
|
||||
DONT_GEN_SSL_CERT: "YES"
|
||||
extra_params: --o:ssl.enable=false --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
username: ${COLLABORA_ADMIN_USER}
|
||||
password: ${COLLABORA_ADMIN_PASSWORD}
|
||||
cap_add:
|
||||
- MKNOD
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.collabora.entrypoints=https"
|
||||
- "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN:-collabora.owncloud.test}`)"
|
||||
- "traefik.http.routers.collabora.tls.certresolver=http"
|
||||
- "traefik.http.routers.collabora.service=collabora"
|
||||
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:9980/hosting/discovery"]
|
||||
|
||||
ocis-appprovider-collabora:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
command: app-provider server
|
||||
environment:
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info}
|
||||
# use the internal service name of the gateway
|
||||
APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164
|
||||
# configure the service name to avoid collision with other apps like onlyoffice
|
||||
APP_PROVIDER_SERVICE_NAME: app-provider-collabora
|
||||
# use the internal service name
|
||||
APP_PROVIDER_EXTERNAL_ADDR: com.owncloud.api.app-provider-collabora
|
||||
APP_PROVIDER_DRIVER: wopi
|
||||
APP_PROVIDER_WOPI_APP_NAME: Collabora
|
||||
APP_PROVIDER_WOPI_APP_ICON_URI: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}/favicon.ico
|
||||
APP_PROVIDER_WOPI_APP_URL: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}
|
||||
APP_PROVIDER_WOPI_INSECURE: "${INSECURE:-false}"
|
||||
APP_PROVIDER_WOPI_WOPI_SERVER_EXTERNAL_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
APP_PROVIDER_WOPI_FOLDER_URL_BASE_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
# share the registry with the ocis container
|
||||
MICRO_REGISTRY_ADDRESS: ocis:9233
|
||||
volumes:
|
||||
# configure the .env file to use own paths instead of docker internal volumes
|
||||
- ${OCIS_CONFIG_DIR:-ocis-config}:/etc/ocis
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
depends_on:
|
||||
ocis:
|
||||
condition: service_started
|
||||
collabora:
|
||||
condition: service_healthy
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${COMPANION_DOMAIN:-companion.owncloud.test}
|
||||
|
||||
companion:
|
||||
# companion could be updated to: 4.14.0 <-- needs checking
|
||||
image: ${COMPANION_IMAGE:-transloadit/companion:4.5.1}
|
||||
networks:
|
||||
- ocis-net
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
COMPANION_DATADIR: /tmp/companion/
|
||||
COMPANION_DOMAIN: ${COMPANION_DOMAIN:-companion.owncloud.test}
|
||||
COMPANION_PROTOCOL: https
|
||||
COMPANION_UPLOAD_URLS: "^https://${OCIS_DOMAIN:-ocis.owncloud.test}/"
|
||||
COMPANION_ONEDRIVE_KEY: "${COMPANION_ONEDRIVE_KEY}"
|
||||
COMPANION_ONEDRIVE_SECRET: "${COMPANION_ONEDRIVE_SECRET}"
|
||||
volumes:
|
||||
- companion-data:/tmp/companion/
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.companion.entrypoints=https"
|
||||
- "traefik.http.routers.companion.rule=Host(`${COMPANION_DOMAIN:-companion.owncloud.test}`)"
|
||||
- "traefik.http.routers.companion.tls.certresolver=http"
|
||||
- "traefik.http.routers.companion.service=companion"
|
||||
- "traefik.http.services.companion.loadbalancer.server.port=3020"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
companion-data:
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
apk add curl
|
||||
|
||||
#TODO: app driver itself should try again until OnlyOffice is up...
|
||||
|
||||
retries=10
|
||||
while [[ $retries -gt 0 ]]; do
|
||||
if curl --silent --show-error --fail http://onlyoffice/hosting/discovery > /dev/null; then
|
||||
ocis app-provider server
|
||||
else
|
||||
echo "OnlyOffice is not yet available, trying again in 10 seconds"
|
||||
sleep 10
|
||||
retries=$((retries - 1))
|
||||
fi
|
||||
done
|
||||
echo 'OnlyOffice was not available after 100 seconds'
|
||||
exit 1
|
||||
@@ -1,18 +0,0 @@
|
||||
web:
|
||||
config:
|
||||
external_apps:
|
||||
- id: preview
|
||||
path: web-app-preview
|
||||
config:
|
||||
mimeTypes:
|
||||
- image/tiff
|
||||
- image/bmp
|
||||
- image/x-ms-bmp
|
||||
- id: importer
|
||||
path: web-app-importer
|
||||
config:
|
||||
companionUrl: https://companion.ocis-wopi.latest.owncloud.works
|
||||
supportedClouds:
|
||||
- WebdavPublicLink
|
||||
#- OneDrive # needs a client id and secret
|
||||
#- GoogleDrive # needs a client id and secret and an addition to the DNS zone
|
||||
@@ -1,18 +0,0 @@
|
||||
web:
|
||||
config:
|
||||
external_apps:
|
||||
- id: preview
|
||||
path: web-app-preview
|
||||
config:
|
||||
mimeTypes:
|
||||
- image/tiff
|
||||
- image/bmp
|
||||
- image/x-ms-bmp
|
||||
- id: importer
|
||||
path: web-app-importer
|
||||
config:
|
||||
companionUrl: https://companion.ocis-wopi.released.owncloud.works
|
||||
supportedClouds:
|
||||
- WebdavPublicLink
|
||||
#- OneDrive # needs a client id and secret
|
||||
#- GoogleDrive # needs a client id and secret and an addition to the DNS zone
|
||||
+1
-1
@@ -11,7 +11,7 @@ web:
|
||||
- id: importer
|
||||
path: web-app-importer
|
||||
config:
|
||||
companionUrl: https://companion.ocis-wopi.daily.owncloud.works
|
||||
companionUrl: https://${COMPANION_DOMAIN|companion.owncloud.test}
|
||||
supportedClouds:
|
||||
- WebdavPublicLink
|
||||
#- OneDrive # needs a client id and secret
|
||||
@@ -1,23 +1,16 @@
|
||||
---
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v2.9.1
|
||||
image: traefik:v3.0.3
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
- ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
- ${COLLABORA_DOMAIN:-collabora.owncloud.test}
|
||||
- ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
|
||||
- ${COMPANION_DOMAIN:-companion.owncloud.test}
|
||||
- ocis-net
|
||||
command:
|
||||
- "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}"
|
||||
# letsencrypt configuration
|
||||
- "--certificatesResolvers.http.acme.email=${TRAEFIK_ACME_MAIL:-example@example.org}"
|
||||
- "--certificatesResolvers.http.acme.storage=/certs/acme.json"
|
||||
- "--certificatesResolvers.http.acme.httpChallenge.entryPoint=http"
|
||||
- "--certificatesresolvers.http.acme.caserver=${TRAEFIK_ACME_CASERVER:-https://acme-v02.api.letsencrypt.org/directory}"
|
||||
# enable dashboard
|
||||
- "--api.dashboard=true"
|
||||
# define entrypoints
|
||||
@@ -36,272 +29,24 @@ services:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock:ro"
|
||||
- "${DOCKER_SOCKET_PATH:-/var/run/docker.sock}:/var/run/docker.sock:ro"
|
||||
- "certs:/certs"
|
||||
labels:
|
||||
- "traefik.enable=${TRAEFIK_DASHBOARD:-false}"
|
||||
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$$apr1$$4vqie50r$$YQAmQdtmz5n9rEALhxJ4l.}" # defaults to admin:admin
|
||||
# basic authentication for the traefik dashboard, defaults to admin:admin
|
||||
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_BASIC_AUTH_USERS:-admin:$$apr1$$4vqie50r$$YQAmQdtmz5n9rEALhxJ4l.}"
|
||||
- "traefik.http.routers.traefik.entrypoints=https"
|
||||
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:-traefik.owncloud.test}`)"
|
||||
- "traefik.http.routers.traefik.middlewares=traefik-auth"
|
||||
- "traefik.http.routers.traefik.tls.certresolver=http"
|
||||
- "traefik.http.routers.traefik.service=api@internal"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
ocis:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
# run ocis init to initialize a configuration file with random secrets
|
||||
# it will fail on subsequent runs, because the config file already exists
|
||||
# therefore we ignore the error and then start the ocis server
|
||||
command: ["-c", "ocis init || true; ocis server"]
|
||||
environment:
|
||||
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info}
|
||||
OCIS_LOG_COLOR: "${OCIS_LOG_COLOR:-false}"
|
||||
PROXY_TLS: "false" # do not use SSL between Traefik and oCIS
|
||||
GATEWAY_GRPC_ADDR: 0.0.0.0:9142 # make the REVA gateway accessible to the app drivers
|
||||
# INSECURE: needed if oCIS / Traefik is using self generated certificates
|
||||
OCIS_INSECURE: "${INSECURE:-false}"
|
||||
# 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}"
|
||||
# admin user password
|
||||
IDM_ADMIN_PASSWORD: "${ADMIN_PASSWORD:-admin}" # this overrides the admin password from the configuration file
|
||||
# demo users
|
||||
IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}"
|
||||
# fulltext search
|
||||
SEARCH_EXTRACTOR_TYPE: tika
|
||||
SEARCH_EXTRACTOR_TIKA_TIKA_URL: http://tika:9998
|
||||
FRONTEND_FULL_TEXT_SEARCH_ENABLED: "true"
|
||||
# email server (in this case inbucket acts as mail catcher)
|
||||
NOTIFICATIONS_SMTP_HOST: inbucket
|
||||
NOTIFICATIONS_SMTP_PORT: 2500
|
||||
NOTIFICATIONS_SMTP_SENDER: oCIS notifications <notifications@${OCIS_DOMAIN:-ocis.owncloud.test}>
|
||||
NOTIFICATIONS_SMTP_USERNAME: notifications@${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
NOTIFICATIONS_SMTP_INSECURE: "true" # the mail catcher uses self signed certificates
|
||||
# make the registry available to the app provider containers
|
||||
MICRO_REGISTRY_ADDRESS: 127.0.0.1:9233
|
||||
NATS_NATS_HOST: 0.0.0.0
|
||||
NATS_NATS_PORT: 9233
|
||||
volumes:
|
||||
- ./config/ocis/app-registry.yaml:/etc/ocis/app-registry.yaml
|
||||
- ./config/ocis/${COMPANION_WEB_CONFIG_FILE_NAME:-web.yaml}:/etc/ocis/web.yaml
|
||||
- ocis-config:/etc/ocis
|
||||
- ocis-data:/var/lib/ocis
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.ocis.entrypoints=https"
|
||||
- "traefik.http.routers.ocis.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`)"
|
||||
- "traefik.http.routers.ocis.tls.certresolver=http"
|
||||
- "traefik.http.routers.ocis.service=ocis"
|
||||
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
ocis-appprovider-collabora:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
command: app-provider server
|
||||
environment:
|
||||
# use the internal service name of the gateway
|
||||
REVA_GATEWAY: ${REVA_GATEWAY:-com.owncloud.api.gateway}
|
||||
APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164
|
||||
# configure the service name to avoid collision with onlyoffice
|
||||
APP_PROVIDER_SERVICE_NAME: app-provider-collabora
|
||||
# use the internal service name
|
||||
APP_PROVIDER_EXTERNAL_ADDR: com.owncloud.api.app-provider-collabora
|
||||
APP_PROVIDER_DRIVER: wopi
|
||||
APP_PROVIDER_WOPI_APP_NAME: Collabora
|
||||
APP_PROVIDER_WOPI_APP_ICON_URI: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}/favicon.ico
|
||||
APP_PROVIDER_WOPI_APP_URL: https://${COLLABORA_DOMAIN:-collabora.owncloud.test}
|
||||
APP_PROVIDER_WOPI_INSECURE: "${INSECURE:-false}"
|
||||
APP_PROVIDER_WOPI_WOPI_SERVER_EXTERNAL_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
APP_PROVIDER_WOPI_FOLDER_URL_BASE_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
# share the registry with the ocis container
|
||||
MICRO_REGISTRY_ADDRESS: ocis:9233
|
||||
volumes:
|
||||
- ocis-config:/etc/ocis
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
ocis-appprovider-onlyoffice:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
user: "0" # needed for apk add in entrypoint script
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
#command: app-provider server
|
||||
environment:
|
||||
# use the internal service name of the gateway
|
||||
REVA_GATEWAY: ${REVA_GATEWAY:-com.owncloud.api.gateway}
|
||||
APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164
|
||||
# configure the service name to avoid collision with collabora
|
||||
APP_PROVIDER_SERVICE_NAME: app-provider-onlyoffice
|
||||
# use the internal service name
|
||||
APP_PROVIDER_EXTERNAL_ADDR: com.owncloud.api.app-provider-onlyoffice
|
||||
APP_PROVIDER_DRIVER: wopi
|
||||
APP_PROVIDER_WOPI_APP_NAME: OnlyOffice
|
||||
APP_PROVIDER_WOPI_APP_ICON_URI: https://${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}/web-apps/apps/documenteditor/main/resources/img/favicon.ico
|
||||
APP_PROVIDER_WOPI_APP_URL: https://${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
|
||||
APP_PROVIDER_WOPI_INSECURE: "${INSECURE:-false}"
|
||||
APP_PROVIDER_WOPI_WOPI_SERVER_EXTERNAL_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
APP_PROVIDER_WOPI_FOLDER_URL_BASE_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
# share the registry with the ocis container
|
||||
MICRO_REGISTRY_ADDRESS: ocis:9233
|
||||
volumes:
|
||||
- ./config/ocis-appprovider-onlyoffice/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ocis-config:/etc/ocis
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
wopiserver:
|
||||
image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-v10.3.0}
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
environment:
|
||||
WOPISERVER_INSECURE: "${INSECURE:-false}"
|
||||
WOPISECRET: ${WOPI_JWT_SECRET:-LoremIpsum567}
|
||||
WOPISERVER_DOMAIN: ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
volumes:
|
||||
- ./config/wopiserver/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/wopiserver/wopiserver.conf.dist:/etc/wopi/wopiserver.conf.dist
|
||||
- wopi-recovery:/var/spool/wopirecovery
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.wopiserver.entrypoints=https"
|
||||
- "traefik.http.routers.wopiserver.rule=Host(`${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}`)"
|
||||
- "traefik.http.routers.wopiserver.tls.certresolver=http"
|
||||
- "traefik.http.routers.wopiserver.service=wopiserver"
|
||||
- "traefik.http.services.wopiserver.loadbalancer.server.port=8880"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
collabora:
|
||||
image: collabora/code:23.05.5.2.1
|
||||
networks:
|
||||
ocis-net:
|
||||
environment:
|
||||
aliasgroup1: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}:443
|
||||
DONT_GEN_SSL_CERT: "YES"
|
||||
extra_params: --o:ssl.enable=false --o:ssl.termination=true --o:welcome.enable=false --o:net.frame_ancestors=${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
username: ${COLLABORA_ADMIN_USER}
|
||||
password: ${COLLABORA_ADMIN_PASSWORD}
|
||||
cap_add:
|
||||
- MKNOD
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.collabora.entrypoints=https"
|
||||
- "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN:-collabora.owncloud.test}`)"
|
||||
- "traefik.http.routers.collabora.tls.certresolver=http"
|
||||
- "traefik.http.routers.collabora.service=collabora"
|
||||
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
onlyoffice:
|
||||
image: onlyoffice/documentserver:7.5.0
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
environment:
|
||||
WOPI_ENABLED: "true"
|
||||
USE_UNAUTHORIZED_STORAGE: "${INSECURE:-false}" # self signed certificates
|
||||
volumes:
|
||||
- ./config/onlyoffice/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/onlyoffice/local.json:/etc/onlyoffice/documentserver/local.dist.json
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.onlyoffice.entrypoints=https"
|
||||
- "traefik.http.routers.onlyoffice.rule=Host(`${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}`)"
|
||||
- "traefik.http.routers.onlyoffice.tls.certresolver=http"
|
||||
- "traefik.http.routers.onlyoffice.service=onlyoffice"
|
||||
- "traefik.http.services.onlyoffice.loadbalancer.server.port=80"
|
||||
# websockets can't be opened when this is ommitted
|
||||
- "traefik.http.middlewares.onlyoffice.headers.customrequestheaders.X-Forwarded-Proto=https"
|
||||
- "traefik.http.routers.onlyoffice.middlewares=onlyoffice"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
tika:
|
||||
image: ${TIKA_IMAGE:-apache/tika:latest-full}
|
||||
networks:
|
||||
ocis-net:
|
||||
restart: always
|
||||
|
||||
companion:
|
||||
image: ${COMPANION_IMAGE:-transloadit/companion:4.5.1}
|
||||
networks:
|
||||
ocis-net:
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: 0
|
||||
COMPANION_DATADIR: /tmp/companion/
|
||||
COMPANION_DOMAIN: ${COMPANION_DOMAIN:-companion.owncloud.test}
|
||||
COMPANION_PROTOCOL: https
|
||||
COMPANION_UPLOAD_URLS: "^https://${OCIS_DOMAIN:-ocis.owncloud.test}/"
|
||||
COMPANION_ONEDRIVE_KEY: "${COMPANION_ONEDRIVE_KEY}"
|
||||
COMPANION_ONEDRIVE_SECRET: "${COMPANION_ONEDRIVE_SECRET}"
|
||||
volumes:
|
||||
- companion-data:/tmp/companion/
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.companion.entrypoints=https"
|
||||
- "traefik.http.routers.companion.rule=Host(`${COMPANION_DOMAIN:-companion.owncloud.test}`)"
|
||||
- "traefik.http.routers.companion.tls.certresolver=http"
|
||||
- "traefik.http.routers.companion.service=companion"
|
||||
- "traefik.http.services.companion.loadbalancer.server.port=3020"
|
||||
logging:
|
||||
driver: "local"
|
||||
restart: always
|
||||
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
command: [ "-c", "apk add openssl; openssl req -subj '/CN=inbucket.test' -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/server.key -out /tmp/server.crt; /start-inbucket.sh" ]
|
||||
environment:
|
||||
INBUCKET_SMTP_TLSENABLED: "true"
|
||||
INBUCKET_SMTP_TLSPRIVKEY: /tmp/server.key
|
||||
INBUCKET_SMTP_TLSCERT: /tmp/server.crt
|
||||
INBUCKET_STORAGE_MAILBOXMSGCAP: 1000
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.inbucket.entrypoints=https"
|
||||
- "traefik.http.routers.inbucket.rule=Host(`${INBUCKET_DOMAIN:-mail.owncloud.test}`)"
|
||||
- "traefik.http.routers.inbucket.tls.certresolver=http"
|
||||
- "traefik.http.routers.inbucket.service=inbucket"
|
||||
- "traefik.http.services.inbucket.loadbalancer.server.port=9000"
|
||||
logging:
|
||||
driver: "local"
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
certs:
|
||||
ocis-config:
|
||||
ocis-data:
|
||||
wopi-recovery:
|
||||
companion-data:
|
||||
|
||||
networks:
|
||||
ocis-net:
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
services:
|
||||
ocis:
|
||||
environment:
|
||||
NOTIFICATIONS_SMTP_HOST: inbucket
|
||||
NOTIFICATIONS_SMTP_PORT: 2500
|
||||
NOTIFICATIONS_SMTP_SENDER: oCIS notifications <notifications@${OCIS_DOMAIN:-ocis.owncloud.test}>
|
||||
NOTIFICATIONS_SMTP_USERNAME: notifications@${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
NOTIFICATIONS_SMTP_INSECURE: "true" # the mail catcher uses self signed certificates
|
||||
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
networks:
|
||||
- ocis-net
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
command: [ "-c", "apk add openssl; openssl req -subj '/CN=inbucket.test' -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout /tmp/server.key -out /tmp/server.crt; /start-inbucket.sh" ]
|
||||
environment:
|
||||
INBUCKET_SMTP_TLSENABLED: "true"
|
||||
INBUCKET_SMTP_TLSPRIVKEY: /tmp/server.key
|
||||
INBUCKET_SMTP_TLSCERT: /tmp/server.crt
|
||||
INBUCKET_STORAGE_MAILBOXMSGCAP: 1000
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.inbucket.entrypoints=https"
|
||||
- "traefik.http.routers.inbucket.rule=Host(`${INBUCKET_DOMAIN:-mail.owncloud.test}`)"
|
||||
- "traefik.http.routers.inbucket.tls.certresolver=http"
|
||||
- "traefik.http.routers.inbucket.service=inbucket"
|
||||
- "traefik.http.services.inbucket.loadbalancer.server.port=9000"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
-11
@@ -1,6 +1,4 @@
|
||||
---
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
ocis:
|
||||
environment:
|
||||
@@ -22,15 +20,6 @@ services:
|
||||
# metrics
|
||||
APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165
|
||||
|
||||
ocis-appprovider-onlyoffice:
|
||||
environment:
|
||||
# tracing
|
||||
OCIS_TRACING_ENABLED: "true"
|
||||
OCIS_TRACING_TYPE: "jaeger"
|
||||
OCIS_TRACING_ENDPOINT: jaeger-agent:6831
|
||||
# metrics
|
||||
APP_PROVIDER_DEBUG_ADDR: 0.0.0.0:9165
|
||||
|
||||
networks:
|
||||
ocis-net:
|
||||
external: true
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
|
||||
ocis:
|
||||
image: ${OCIS_DOCKER_IMAGE:-owncloud/ocis}:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
- ocis-net
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
# run ocis init to initialize a configuration file with random secrets
|
||||
# it will fail on subsequent runs, because the config file already exists
|
||||
# therefore we ignore the error and then start the ocis server
|
||||
command: ["-c", "ocis init || true; ocis server"]
|
||||
environment:
|
||||
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
OCIS_LOG_LEVEL: ${LOG_LEVEL:-info}
|
||||
# do not use SSL between Traefik and oCIS
|
||||
PROXY_TLS: "false"
|
||||
# make the REVA gateway accessible to the app drivers
|
||||
GATEWAY_GRPC_ADDR: 0.0.0.0:9142
|
||||
# INSECURE: needed if oCIS / Traefik is using self generated certificates
|
||||
OCIS_INSECURE: "${INSECURE:-false}"
|
||||
# admin user password
|
||||
# use the admin password from the configuration file if defined
|
||||
IDM_ADMIN_PASSWORD: "${ADMIN_PASSWORD:-admin}"
|
||||
# demo users
|
||||
IDM_CREATE_DEMO_USERS: "${DEMO_USERS:-false}"
|
||||
# email server (if configured)
|
||||
NOTIFICATIONS_SMTP_HOST: "${SMTP_HOST}"
|
||||
NOTIFICATIONS_SMTP_PORT: "${SMTP_PORT}"
|
||||
NOTIFICATIONS_SMTP_SENDER: "${SMTP_SENDER}"
|
||||
NOTIFICATIONS_SMTP_USERNAME: "${SMTP_USERNAME}"
|
||||
NOTIFICATIONS_SMTP_INSECURE: "${SMTP_INSECURE}"
|
||||
# other required configurations
|
||||
MICRO_REGISTRY_ADDRESS: 127.0.0.1:9233
|
||||
NATS_NATS_HOST: 0.0.0.0
|
||||
NATS_NATS_PORT: 9233
|
||||
# enable to allow using the banned passwords list
|
||||
#OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST: banned-password-list.txt
|
||||
volumes:
|
||||
# configure the .env file to use own paths instead of docker internal volumes
|
||||
- ${OCIS_CONFIG_DIR:-ocis-config}:/etc/ocis
|
||||
- ${OCIS_DATA_DIR:-ocis-data}:/var/lib/ocis
|
||||
# paths are relative to the main compose file
|
||||
- ./config/ocis/app-registry.yaml:/etc/ocis/app-registry.yaml
|
||||
- ./config/ocis/web.yaml:/etc/ocis/web.yaml
|
||||
- ./config/ocis/banned-password-list.txt:/etc/ocis/banned-password-list.txt
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.ocis.entrypoints=https"
|
||||
- "traefik.http.routers.ocis.rule=Host(`${OCIS_DOMAIN:-ocis.owncloud.test}`)"
|
||||
- "traefik.http.routers.ocis.tls.certresolver=http"
|
||||
- "traefik.http.routers.ocis.service=ocis"
|
||||
- "traefik.http.services.ocis.loadbalancer.server.port=9200"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
ocis-config:
|
||||
ocis-data:
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
|
||||
|
||||
onlyoffice:
|
||||
# onlyoffice could be updated to: 8.0.1 <-- needs checking
|
||||
# the image used is the community edition, the EE has not been tested.
|
||||
image: onlyoffice/documentserver:7.5.0
|
||||
networks:
|
||||
ocis-net:
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
environment:
|
||||
WOPI_ENABLED: "true"
|
||||
# self-signed certificates
|
||||
USE_UNAUTHORIZED_STORAGE: "${INSECURE:-false}"
|
||||
volumes:
|
||||
# paths are relative to the main compose file
|
||||
- ./config/onlyoffice/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/onlyoffice/local.json:/etc/onlyoffice/documentserver/local.dist.json
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.onlyoffice.entrypoints=https"
|
||||
- "traefik.http.routers.onlyoffice.rule=Host(`${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}`)"
|
||||
- "traefik.http.routers.onlyoffice.tls.certresolver=http"
|
||||
- "traefik.http.routers.onlyoffice.service=onlyoffice"
|
||||
- "traefik.http.services.onlyoffice.loadbalancer.server.port=80"
|
||||
# websockets can't be opened when this is omitted
|
||||
- "traefik.http.middlewares.onlyoffice.headers.customrequestheaders.X-Forwarded-Proto=https"
|
||||
- "traefik.http.routers.onlyoffice.middlewares=onlyoffice"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/hosting/discovery"]
|
||||
|
||||
ocis-appprovider-onlyoffice:
|
||||
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
|
||||
networks:
|
||||
ocis-net:
|
||||
command: app-provider server
|
||||
environment:
|
||||
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-info}
|
||||
# use the internal service name of the gateway
|
||||
APP_PROVIDER_GRPC_ADDR: 0.0.0.0:9164
|
||||
# configure the service name to avoid collision with other apps like collabora
|
||||
APP_PROVIDER_SERVICE_NAME: app-provider-onlyoffice
|
||||
# use the internal service name
|
||||
APP_PROVIDER_EXTERNAL_ADDR: com.owncloud.api.app-provider-onlyoffice
|
||||
APP_PROVIDER_DRIVER: wopi
|
||||
APP_PROVIDER_WOPI_APP_NAME: OnlyOffice
|
||||
APP_PROVIDER_WOPI_APP_ICON_URI: https://${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}/web-apps/apps/documenteditor/main/resources/img/favicon.ico
|
||||
APP_PROVIDER_WOPI_APP_URL: https://${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
|
||||
APP_PROVIDER_WOPI_INSECURE: "${INSECURE:-false}"
|
||||
APP_PROVIDER_WOPI_WOPI_SERVER_EXTERNAL_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
APP_PROVIDER_WOPI_FOLDER_URL_BASE_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
|
||||
# share the registry with the ocis container
|
||||
MICRO_REGISTRY_ADDRESS: ocis:9233
|
||||
volumes:
|
||||
# configure the .env file to use own paths instead of docker internal volumes
|
||||
- ${OCIS_CONFIG_DIR:-ocis-config}:/etc/ocis
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
depends_on:
|
||||
ocis:
|
||||
condition: service_started
|
||||
onlyoffice:
|
||||
condition: service_healthy
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
services:
|
||||
tika:
|
||||
image: ${TIKA_IMAGE:-apache/tika:latest-full}
|
||||
networks:
|
||||
ocis-net:
|
||||
restart: always
|
||||
|
||||
ocis:
|
||||
environment:
|
||||
# fulltext search
|
||||
SEARCH_EXTRACTOR_TYPE: tika
|
||||
SEARCH_EXTRACTOR_TIKA_TIKA_URL: http://tika:9998
|
||||
FRONTEND_FULL_TEXT_SEARCH_ENABLED: "true"
|
||||
@@ -0,0 +1,38 @@
|
||||
---
|
||||
services:
|
||||
traefik:
|
||||
networks:
|
||||
ocis-net:
|
||||
aliases:
|
||||
- ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
|
||||
wopiserver:
|
||||
image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-v10.5.0}
|
||||
networks:
|
||||
- ocis-net
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- /entrypoint-override.sh
|
||||
environment:
|
||||
WOPISERVER_INSECURE: "${INSECURE:-false}"
|
||||
WOPISECRET: ${WOPI_JWT_SECRET:-LoremIpsum567}
|
||||
WOPISERVER_DOMAIN: ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
|
||||
volumes:
|
||||
# paths are relative to the main compose file
|
||||
- ./config/wopiserver/entrypoint-override.sh:/entrypoint-override.sh
|
||||
- ./config/wopiserver/wopiserver.conf.dist:/etc/wopi/wopiserver.conf.dist
|
||||
- wopi-recovery:/var/spool/wopirecovery
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.wopiserver.entrypoints=https"
|
||||
- "traefik.http.routers.wopiserver.rule=Host(`${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}`)"
|
||||
- "traefik.http.routers.wopiserver.tls.certresolver=http"
|
||||
#- "traefik.http.routers.wopiserver.service=wopiserver"
|
||||
- "traefik.http.services.wopiserver.loadbalancer.server.port=8880"
|
||||
logging:
|
||||
driver: ${LOG_DRIVER:-local}
|
||||
restart: always
|
||||
|
||||
volumes:
|
||||
wopi-recovery:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
variables:
|
||||
- rawname: CS3_GATEWAY
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:76
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77
|
||||
foundincode: true
|
||||
name: CS3_GATEWAY
|
||||
type: ""
|
||||
@@ -8,7 +8,7 @@ variables:
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: CS3_MACHINE_AUTH_API_KEY
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:77
|
||||
path: services/idp/pkg/backends/cs3/bootstrap/cs3.go:78
|
||||
foundincode: true
|
||||
name: CS3_MACHINE_AUTH_API_KEY
|
||||
type: ""
|
||||
@@ -44,7 +44,7 @@ variables:
|
||||
on supervision of ownCloud Support.'
|
||||
do_ignore: false
|
||||
- rawname: _registryAddressEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:145
|
||||
path: ocis-pkg/natsjsregistry/registry.go:165
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_ADDRESS
|
||||
type: string
|
||||
@@ -61,7 +61,7 @@ variables:
|
||||
description: ""
|
||||
do_ignore: true
|
||||
- rawname: _registryPasswordEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:163
|
||||
path: ocis-pkg/natsjsregistry/registry.go:193
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_AUTH_PASSWORD
|
||||
type: string
|
||||
@@ -69,7 +69,7 @@ variables:
|
||||
description: Optional when using nats to authenticate with the nats cluster.
|
||||
do_ignore: false
|
||||
- rawname: _registryUsernameEnv
|
||||
path: ocis-pkg/natsjsregistry/registry.go:163
|
||||
path: ocis-pkg/natsjsregistry/registry.go:193
|
||||
foundincode: true
|
||||
name: MICRO_REGISTRY_AUTH_USERNAME
|
||||
type: string
|
||||
|
||||
@@ -41,6 +41,7 @@ The last four containers are the WOPI server, Collabora and OnlyOffice.
|
||||
* onlyoffice.* for serving OnlyOffice
|
||||
* wopiserver.* for serving the WOPI server
|
||||
* traefik.* for serving the Traefik dashboard
|
||||
* companion.* for serving the uppy companion app
|
||||
|
||||
See also [example server setup]({{< ref "preparing_server" >}})
|
||||
|
||||
@@ -68,7 +69,7 @@ See also [example server setup]({{< ref "preparing_server" >}})
|
||||
TRAEFIK_DASHBOARD=
|
||||
# Domain of Traefik, where you can find the dashboard. Defaults to "traefik.owncloud.test"
|
||||
TRAEFIK_DOMAIN=
|
||||
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin"
|
||||
# Basic authentication for the dashboard. Defaults to user "admin" and password "admin" (written as: "admin:admin").
|
||||
TRAEFIK_BASIC_AUTH_USERS=
|
||||
# Email address for obtaining LetsEncrypt certificates, needs only be changed if this is a public facing server
|
||||
TRAEFIK_ACME_MAIL=
|
||||
@@ -83,6 +84,8 @@ See also [example server setup]({{< ref "preparing_server" >}})
|
||||
# The demo users should not be created on a production instance
|
||||
# because their passwords are public. Defaults to "false".
|
||||
DEMO_USERS=
|
||||
# Log level for oCIS. Defaults to "info".
|
||||
OCIS_LOG_LEVEL=
|
||||
|
||||
### Wopi server settings ###
|
||||
# cs3org wopi server version. Defaults to "v8.3.3"
|
||||
@@ -95,7 +98,7 @@ See also [example server setup]({{< ref "preparing_server" >}})
|
||||
### Collabora settings ###
|
||||
# Domain of Collabora, where you can find the frontend. Defaults to "collabora.owncloud.test"
|
||||
COLLABORA_DOMAIN=
|
||||
# Admin user for Collabora. Defaults to blank, provide one to enable access
|
||||
# Admin user for Collabora. Defaults to blank, provide one to enable access. Collabora Admin Panel URL: https://{COLLABORA_DOMAIN}/browser/dist/admin/admin.html
|
||||
COLLABORA_ADMIN_USER=
|
||||
# Admin password for Collabora. Defaults to blank, provide one to enable access
|
||||
COLLABORA_ADMIN_PASSWORD=
|
||||
@@ -103,6 +106,27 @@ See also [example server setup]({{< ref "preparing_server" >}})
|
||||
### OnlyOffice settings ###
|
||||
# Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test"
|
||||
ONLYOFFICE_DOMAIN=
|
||||
|
||||
### Email / Inbucket settings ###
|
||||
# Inbucket / Mail domain. Defaults to "mail.owncloud.test"
|
||||
INBUCKET_DOMAIN=
|
||||
|
||||
### Apache Tika Content analysis toolkit ###
|
||||
# Set the desired docker image tag or digest, defaults to "latest"
|
||||
TIKA_IMAGE=
|
||||
|
||||
# If you want to use debugging and tracing with this stack,
|
||||
# you need uncomment following line. Please see documentation at
|
||||
# https://owncloud.dev/ocis/deployment/monitoring-tracing/
|
||||
#COMPOSE_FILE=docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
|
||||
|
||||
### Uppy Companion settings ###
|
||||
# Domain of Uppy Companion. Defaults to "companion.owncloud.test"
|
||||
COMPANION_IMAGE=
|
||||
COMPANION_DOMAIN=
|
||||
# Provider settings, see https://uppy.io/docs/companion/#provideroptions for reference. Empty by default, which disables providers.
|
||||
COMPANION_ONEDRIVE_KEY=
|
||||
COMPANION_ONEDRIVE_SECRET=
|
||||
```
|
||||
|
||||
You are installing oCIS on a server and Traefik will obtain valid certificates for you so please remove `INSECURE=true` or set it to `false`.
|
||||
@@ -152,6 +176,8 @@ On Linux and macOS you can add them to your `/etc/hosts` file and on Windows to
|
||||
127.0.0.1 collabora.owncloud.test
|
||||
127.0.0.1 onlyoffice.owncloud.test
|
||||
127.0.0.1 wopiserver.owncloud.test
|
||||
127.0.0.1 mail.owncloud.test
|
||||
127.0.0.1 companion.owncloud.test
|
||||
```
|
||||
|
||||
After that you're ready to start the application stack:
|
||||
|
||||
@@ -362,6 +362,7 @@ PROXY_ENABLE_BASIC_AUTH=true \
|
||||
NOTIFICATIONS_SMTP_HOST=localhost \
|
||||
NOTIFICATIONS_SMTP_PORT=2500 \
|
||||
NOTIFICATIONS_SMTP_INSECURE=true \
|
||||
NOTIFICATIONS_SMTP_SENDER="owncloud <noreply@example.com>" \
|
||||
ocis/bin/ocis server
|
||||
```
|
||||
|
||||
|
||||
Vendored
+4
@@ -1,4 +1,6 @@
|
||||
// set the attribute to true or leave empty, true without any quotes.
|
||||
// if the generated adoc file is used outside tabs, it renders correctly depending on the attribute set.
|
||||
// if inside, you need to also use the xxx_deprecation.adoc file. attributes can't be defined inside tabs.
|
||||
|
||||
:show-deprecation: {{ .HasDeprecations }}
|
||||
|
||||
@@ -23,6 +25,8 @@ ifeval::[{show-deprecation} == true]
|
||||
{{- end }}
|
||||
|===
|
||||
|
||||
{empty} +
|
||||
|
||||
endif::[]
|
||||
|
||||
[caption=]
|
||||
|
||||
@@ -13,9 +13,8 @@ require (
|
||||
github.com/cenkalti/backoff v2.2.1+incompatible
|
||||
github.com/coreos/go-oidc/v3 v3.9.0
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781
|
||||
github.com/cs3org/reva/v2 v2.19.5
|
||||
github.com/cs3org/reva/v2 v2.19.7
|
||||
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e
|
||||
github.com/egirna/icap-client v0.1.1
|
||||
github.com/gabriel-vasile/mimetype v1.4.3
|
||||
@@ -54,6 +53,7 @@ require (
|
||||
github.com/jellydator/ttlcache/v3 v3.2.0
|
||||
github.com/jinzhu/now v1.1.5
|
||||
github.com/justinas/alice v1.2.0
|
||||
github.com/kovidgoyal/imaging v1.6.3
|
||||
github.com/leonelquinteros/gotext v1.5.3-0.20230317130943-71a59c05b2c1
|
||||
github.com/libregraph/idm v0.4.1-0.20231213140724-56a222fb4215
|
||||
github.com/libregraph/lico v0.61.3-0.20240322112242-72cf9221d3a7
|
||||
@@ -81,6 +81,7 @@ require (
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/spf13/cobra v1.8.0
|
||||
github.com/stretchr/testify v1.8.4
|
||||
github.com/test-go/testify v1.1.4
|
||||
github.com/thejerf/suture/v4 v4.0.2
|
||||
github.com/tidwall/gjson v1.17.1
|
||||
github.com/tus/tusd v1.13.0
|
||||
@@ -95,13 +96,13 @@ require (
|
||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.24.0
|
||||
go.opentelemetry.io/otel/sdk v1.24.0
|
||||
go.opentelemetry.io/otel/trace v1.24.0
|
||||
golang.org/x/crypto v0.21.0
|
||||
golang.org/x/image v0.15.0
|
||||
golang.org/x/net v0.23.0
|
||||
golang.org/x/crypto v0.23.0
|
||||
golang.org/x/image v0.18.0
|
||||
golang.org/x/net v0.25.0
|
||||
golang.org/x/oauth2 v0.17.0
|
||||
golang.org/x/sync v0.6.0
|
||||
golang.org/x/term v0.18.0
|
||||
golang.org/x/text v0.14.0
|
||||
golang.org/x/sync v0.7.0
|
||||
golang.org/x/term v0.20.0
|
||||
golang.org/x/text v0.16.0
|
||||
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe
|
||||
google.golang.org/grpc v1.62.0
|
||||
google.golang.org/protobuf v1.33.0
|
||||
@@ -334,10 +335,10 @@ require (
|
||||
go.uber.org/multierr v1.8.0 // indirect
|
||||
go.uber.org/zap v1.23.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3 // indirect
|
||||
golang.org/x/mod v0.14.0 // indirect
|
||||
golang.org/x/sys v0.18.0 // indirect
|
||||
golang.org/x/mod v0.17.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/time v0.5.0 // indirect
|
||||
golang.org/x/tools v0.17.0 // indirect
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
|
||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||
google.golang.org/appengine v1.6.8 // indirect
|
||||
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014 // indirect
|
||||
|
||||
@@ -1019,8 +1019,8 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
|
||||
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781 h1:BUdwkIlf8IS2FasrrPg8gGPHQPOrQ18MS1Oew2tmGtY=
|
||||
github.com/cs3org/go-cs3apis v0.0.0-20231023073225-7748710e0781/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
|
||||
github.com/cs3org/reva/v2 v2.19.5 h1:Qh38wpPovnb0jPpgGR6L6HfbQ8vwObcrB8yUCRJldSw=
|
||||
github.com/cs3org/reva/v2 v2.19.5/go.mod h1:GRUrOp5HbFVwZTgR9bVrMZ/MvVy+Jhxw1PdMmhhKP9E=
|
||||
github.com/cs3org/reva/v2 v2.19.7 h1:0hMIbCZq1VBSxAslEvDDkj1Si8RqxbxR0wx3JvIRXTE=
|
||||
github.com/cs3org/reva/v2 v2.19.7/go.mod h1:GRUrOp5HbFVwZTgR9bVrMZ/MvVy+Jhxw1PdMmhhKP9E=
|
||||
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||
@@ -1048,8 +1048,6 @@ github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8
|
||||
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25 h1:simG0vMYFvNriGhaaat7QVVkaVkXzvqcohaBoLZl9Hg=
|
||||
github.com/dhowden/tag v0.0.0-20230630033851-978a0926ee25/go.mod h1:Z3Lomva4pyMWYezjMAU5QWRh0p1VvO4199OHlFnyKkM=
|
||||
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
|
||||
github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c=
|
||||
github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4=
|
||||
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
|
||||
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
||||
github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E=
|
||||
@@ -1601,6 +1599,8 @@ github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXH
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kovidgoyal/imaging v1.6.3 h1:iNPpv7ygiaB/NOztc6APMT7yr9UwBS+rOZwIbAdtyY8=
|
||||
github.com/kovidgoyal/imaging v1.6.3/go.mod h1:sHvcLOOVhJuto2IoNdPLEqnAUoL5ZfHEF0PpNH+882g=
|
||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
@@ -2167,8 +2167,8 @@ golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIi
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
|
||||
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
@@ -2190,7 +2190,6 @@ golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86h
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20190910094157-69e4b8554b2a/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200430140353-33d19683fad8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20200618115811-c13761719519/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
@@ -2200,8 +2199,8 @@ golang.org/x/image v0.0.0-20210607152325-775e3b0c77b9/go.mod h1:023OzeP/+EPmXeap
|
||||
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20220302094943-723b81ca9867/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
|
||||
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
|
||||
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
|
||||
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
@@ -2232,8 +2231,8 @@ golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
|
||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -2313,8 +2312,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs=
|
||||
golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -2367,8 +2366,8 @@ golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
@@ -2495,8 +2494,8 @@ golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
@@ -2513,8 +2512,8 @@ golang.org/x/term v0.10.0/go.mod h1:lpqdcUyK/oCiQxvxVrppt5ggO2KCZ5QblwqPnfZ6d5o=
|
||||
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -2535,8 +2534,8 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -2623,8 +2622,8 @@ golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s=
|
||||
golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
|
||||
golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc=
|
||||
golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
)
|
||||
|
||||
// Throttle limits the number of concurrent requests.
|
||||
func Throttle(limit int) func(http.Handler) http.Handler {
|
||||
if limit > 0 {
|
||||
return middleware.Throttle(limit)
|
||||
}
|
||||
return func(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
next.ServeHTTP(w, r)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,10 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
natsjskv "github.com/go-micro/plugins/v4/store/nats-js-kv"
|
||||
@@ -36,12 +38,13 @@ func NewRegistry(opts ...registry.Option) registry.Registry {
|
||||
o(&options)
|
||||
}
|
||||
exp, _ := options.Context.Value(expiryKey{}).(time.Duration)
|
||||
return &storeregistry{
|
||||
n := &storeregistry{
|
||||
opts: options,
|
||||
store: natsjskv.NewStore(storeOptions(options)...),
|
||||
typ: _registryName,
|
||||
expiry: exp,
|
||||
}
|
||||
n.store = natsjskv.NewStore(n.storeOptions(options)...)
|
||||
return n
|
||||
}
|
||||
|
||||
type storeregistry struct {
|
||||
@@ -49,14 +52,19 @@ type storeregistry struct {
|
||||
store store.Store
|
||||
typ string
|
||||
expiry time.Duration
|
||||
lock sync.RWMutex
|
||||
}
|
||||
|
||||
// Init inits the registry
|
||||
func (n *storeregistry) Init(opts ...registry.Option) error {
|
||||
n.lock.Lock()
|
||||
defer n.lock.Unlock()
|
||||
|
||||
for _, o := range opts {
|
||||
o(&n.opts)
|
||||
}
|
||||
return n.store.Init(storeOptions(n.opts)...)
|
||||
n.store = natsjskv.NewStore(n.storeOptions(n.opts)...)
|
||||
return n.store.Init(n.storeOptions(n.opts)...)
|
||||
}
|
||||
|
||||
// Options returns the configured options
|
||||
@@ -66,6 +74,9 @@ func (n *storeregistry) Options() registry.Options {
|
||||
|
||||
// Register adds a service to the registry
|
||||
func (n *storeregistry) Register(s *registry.Service, _ ...registry.RegisterOption) error {
|
||||
n.lock.RLock()
|
||||
defer n.lock.RUnlock()
|
||||
|
||||
if s == nil {
|
||||
return errors.New("wont store nil service")
|
||||
}
|
||||
@@ -82,11 +93,17 @@ func (n *storeregistry) Register(s *registry.Service, _ ...registry.RegisterOpti
|
||||
|
||||
// Deregister removes a service from the registry
|
||||
func (n *storeregistry) Deregister(s *registry.Service, _ ...registry.DeregisterOption) error {
|
||||
n.lock.RLock()
|
||||
defer n.lock.RUnlock()
|
||||
|
||||
return n.store.Delete(s.Name)
|
||||
}
|
||||
|
||||
// GetService gets a specific service from the registry
|
||||
func (n *storeregistry) GetService(s string, _ ...registry.GetOption) ([]*registry.Service, error) {
|
||||
n.lock.RLock()
|
||||
defer n.lock.RUnlock()
|
||||
|
||||
recs, err := n.store.Read(s)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -104,6 +121,9 @@ func (n *storeregistry) GetService(s string, _ ...registry.GetOption) ([]*regist
|
||||
|
||||
// ListServices lists all registered services
|
||||
func (n *storeregistry) ListServices(...registry.ListOption) ([]*registry.Service, error) {
|
||||
n.lock.RLock()
|
||||
defer n.lock.RUnlock()
|
||||
|
||||
keys, err := n.store.List()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -132,7 +152,7 @@ func (n *storeregistry) String() string {
|
||||
return n.typ
|
||||
}
|
||||
|
||||
func storeOptions(opts registry.Options) []store.Option {
|
||||
func (n *storeregistry) storeOptions(opts registry.Options) []store.Option {
|
||||
storeoptions := []store.Option{
|
||||
store.Database("service-registry"),
|
||||
store.Table("service-registry"),
|
||||
@@ -150,6 +170,16 @@ func storeOptions(opts registry.Options) []store.Option {
|
||||
natsOptions := nats.GetDefaultOptions()
|
||||
natsOptions.Name = "nats-js-kv-registry"
|
||||
natsOptions.User, natsOptions.Password = getAuth()
|
||||
natsOptions.ReconnectedCB = func(_ *nats.Conn) {
|
||||
if err := n.Init(); err != nil {
|
||||
fmt.Println("cannot reconnect to nats")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
natsOptions.ClosedCB = func(_ *nats.Conn) {
|
||||
fmt.Println("nats connection closed")
|
||||
os.Exit(1)
|
||||
}
|
||||
storeoptions = append(storeoptions, natsjskv.NatsOptions(natsOptions))
|
||||
|
||||
if so, ok := opts.Context.Value(storeOptionsKey{}).([]store.Option); ok {
|
||||
|
||||
@@ -16,7 +16,7 @@ var (
|
||||
// LatestTag is the latest released version plus the dev meta version.
|
||||
// Will be overwritten by the release pipeline
|
||||
// Needs a manual change for every tagged release
|
||||
LatestTag = "5.0.2+dev"
|
||||
LatestTag = "5.0.6+dev"
|
||||
|
||||
// Date indicates the build date.
|
||||
// This has been removed, it looks like you can only replace static strings with recent go versions
|
||||
|
||||
+37
-1
@@ -23,4 +23,40 @@ To authenticate the connection to the etcd registry, you have to set `ETCD_USERN
|
||||
|
||||
## Memory limits
|
||||
|
||||
oCIS will automatically set the go native `GOMEMLIMIT` to `0.9`. To disable the limit set `AUTOMEMEMLIMIT=off`. For more information take a look at the official [Guide to the Go Garbage Collector](https://go.dev/doc/gc-guide).
|
||||
oCIS will automatically set the go native `GOMEMLIMIT` to `0.9`. To disable the limit set `AUTOMEMEMLIMIT=off`. For more information take a look at the official [Guide to the Go Garbage Collector](https://go.dev/doc/gc-guide).
|
||||
|
||||
## CLI Commands
|
||||
|
||||
The ocis package offers a variety of cli commands to monitor or repair ocis installations. All these commands have a common mandatory parameter: `--basePath` (or `-p`) which needs to point to a storage provider. Example paths are:
|
||||
|
||||
```bash
|
||||
.ocis/storage/users # bare metal installation
|
||||
/var/tmp/ocis/storage/users # docker installation
|
||||
...
|
||||
```
|
||||
|
||||
These paths can vary depending on your ocis installation.
|
||||
|
||||
### Revisions CLI
|
||||
|
||||
The revisions command allows removing the revisions of files in the storage.
|
||||
|
||||
```bash
|
||||
ocis revisions purge -p /base/path/storage/users
|
||||
```
|
||||
|
||||
It takes the `--resource-id` (or `--r`) parameter which specify the scope of the command:
|
||||
|
||||
* An empty string (default) removes all revisions from all spaces.
|
||||
* A spaceID (like `d419032c-65b9-4f4e-b1e4-0c69a946181d\$44b5a63b-540c-4002-a674-0e9c833bbe49`) removes all revisions in that space.
|
||||
* A resourceID (e.g. `d419032c-65b9-4f4e-b1e4-0c69a946181d\$44b5a63b-540c-4002-a674-0e9c833bbe49\!e8a73d49-2e00-4322-9f34-9d7f178577b2`) removes all revisions from that specific file.
|
||||
|
||||
This command provides additional options:
|
||||
|
||||
* `--dry-run` (default: `true`)\
|
||||
Do not remove any revisions but print the revisions that would be removed.
|
||||
* `-b` / `--blobstore`\
|
||||
Allows specifying the blobstore to use. Defaults to `ocis`. Can be switched to `s3ng` but needs addtional envvar configuration (see the `storage-users` service for more details).
|
||||
* `-v` / `--verbose`\
|
||||
Prints additional information about the revisions that are removed.
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
image: owncloud/ocis:latest
|
||||
manifests:
|
||||
- image: owncloud/ocis:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
- image: owncloud/ocis:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64
|
||||
platform:
|
||||
architecture: arm64
|
||||
variant: v8
|
||||
os: linux
|
||||
@@ -0,0 +1,152 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
|
||||
ocisbs "github.com/cs3org/reva/v2/pkg/storage/fs/ocis/blobstore"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup"
|
||||
s3bs "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng/blobstore"
|
||||
"github.com/cs3org/reva/v2/pkg/storagespace"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config/configlog"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
|
||||
"github.com/owncloud/ocis/v2/ocis/pkg/register"
|
||||
"github.com/owncloud/ocis/v2/ocis/pkg/revisions"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
// _nodesGlobPattern is the glob pattern to find all nodes
|
||||
_nodesGlobPattern = "spaces/*/*/*/*/*/*/*/*"
|
||||
)
|
||||
|
||||
// RevisionsCommand is the entrypoint for the revisions command.
|
||||
func RevisionsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "revisions",
|
||||
Usage: "ocis revisions functionality",
|
||||
Subcommands: []*cli.Command{
|
||||
PurgeRevisionsCommand(cfg),
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
return configlog.ReturnError(parser.ParseConfig(cfg, true))
|
||||
},
|
||||
Action: func(_ *cli.Context) error {
|
||||
fmt.Println("Read the docs")
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// PurgeRevisionsCommand allows removing all revisions from a storage provider.
|
||||
func PurgeRevisionsCommand(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
Name: "purge",
|
||||
Usage: "purge revisions",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "basepath",
|
||||
Aliases: []string{"p"},
|
||||
Usage: "the basepath of the decomposedfs (e.g. /var/tmp/ocis/storage/metadata)",
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "blobstore",
|
||||
Aliases: []string{"b"},
|
||||
Usage: "the blobstore type. Can be (none, ocis, s3ng). Default ocis. Note: When using s3ng this needs same configuration as the storage-users service",
|
||||
Value: "ocis",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "dry-run",
|
||||
Usage: "do not delete anything, just print what would be deleted",
|
||||
Value: true,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "verbose",
|
||||
Aliases: []string{"v"},
|
||||
Usage: "print verbose output",
|
||||
Value: false,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "resource-id",
|
||||
Aliases: []string{"r"},
|
||||
Usage: "purge all revisions of this file/space. If not set, all revisions will be purged",
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
basePath := c.String("basepath")
|
||||
if basePath == "" {
|
||||
fmt.Println("basepath is required")
|
||||
return cli.ShowCommandHelp(c, "revisions")
|
||||
}
|
||||
|
||||
var (
|
||||
bs revisions.DelBlobstore
|
||||
err error
|
||||
)
|
||||
switch c.String("blobstore") {
|
||||
case "s3ng":
|
||||
bs, err = s3bs.New(
|
||||
cfg.StorageUsers.Drivers.S3NG.Endpoint,
|
||||
cfg.StorageUsers.Drivers.S3NG.Region,
|
||||
cfg.StorageUsers.Drivers.S3NG.Bucket,
|
||||
cfg.StorageUsers.Drivers.S3NG.AccessKey,
|
||||
cfg.StorageUsers.Drivers.S3NG.SecretKey,
|
||||
s3bs.Options{},
|
||||
)
|
||||
case "ocis":
|
||||
bs, err = ocisbs.New(basePath)
|
||||
case "none":
|
||||
bs = nil
|
||||
default:
|
||||
err = errors.New("blobstore type not supported")
|
||||
}
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return err
|
||||
}
|
||||
|
||||
p, err := generatePath(basePath, c.String("resource-id"))
|
||||
if err != nil {
|
||||
fmt.Printf("❌ Error parsing resourceID: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
if err := revisions.PurgeRevisions(p, bs, c.Bool("dry-run"), c.Bool("verbose")); err != nil {
|
||||
fmt.Printf("❌ Error purging revisions: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func generatePath(basePath string, resourceID string) (string, error) {
|
||||
if resourceID == "" {
|
||||
return filepath.Join(basePath, _nodesGlobPattern), nil
|
||||
}
|
||||
|
||||
rid, err := storagespace.ParseID(resourceID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
sid := lookup.Pathify(rid.GetSpaceId(), 1, 2)
|
||||
if sid == "" {
|
||||
sid = "*/*"
|
||||
}
|
||||
|
||||
nid := lookup.Pathify(rid.GetOpaqueId(), 4, 2)
|
||||
if nid == "" {
|
||||
nid = "*/*/*/*/"
|
||||
}
|
||||
|
||||
return filepath.Join(basePath, "spaces", sid, "nodes", nid+"*"), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
register.AddCommand(RevisionsCommand)
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
// Package revisions allows manipulating revisions in a storage provider.
|
||||
package revisions
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
|
||||
"github.com/shamaton/msgpack/v2"
|
||||
)
|
||||
|
||||
var (
|
||||
// regex to determine if a node versioned. Examples:
|
||||
// 9113a718-8285-4b32-9042-f930f1a58ac2.REV.2024-05-22T07:32:53.89969726Z
|
||||
// 9113a718-8285-4b32-9042-f930f1a58ac2.REV.2024-05-22T07:32:53.89969726Z.mpk
|
||||
// 9113a718-8285-4b32-9042-f930f1a58ac2.REV.2024-05-22T07:32:53.89969726Z.mlock
|
||||
_versionRegex = regexp.MustCompile(`\.REV\.[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]+Z*`)
|
||||
)
|
||||
|
||||
// DelBlobstore is the interface for a blobstore that can delete blobs.
|
||||
type DelBlobstore interface {
|
||||
Delete(node *node.Node) error
|
||||
}
|
||||
|
||||
// PurgeRevisions removes all revisions from a storage provider.
|
||||
func PurgeRevisions(pattern string, bs DelBlobstore, dryRun bool, verbose bool) error {
|
||||
if verbose {
|
||||
fmt.Println("Looking for nodes in", pattern)
|
||||
}
|
||||
|
||||
nodes, err := filepath.Glob(pattern)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(nodes) == 0 {
|
||||
return errors.New("no nodes found, double check storage path")
|
||||
}
|
||||
|
||||
countFiles := 0
|
||||
countBlobs := 0
|
||||
countRevisions := 0
|
||||
for _, d := range nodes {
|
||||
if !_versionRegex.MatchString(d) {
|
||||
continue
|
||||
}
|
||||
|
||||
var blobID string
|
||||
e := filepath.Ext(d)
|
||||
switch e {
|
||||
case ".mpk":
|
||||
blobID, err = getBlobID(d)
|
||||
if err != nil {
|
||||
fmt.Printf("error getting blobID from %s: %v\n", d, err)
|
||||
continue
|
||||
}
|
||||
|
||||
countBlobs++
|
||||
case ".mlock":
|
||||
// no extra action on .mlock files
|
||||
default:
|
||||
countRevisions++
|
||||
}
|
||||
|
||||
if !dryRun {
|
||||
if blobID != "" {
|
||||
// TODO: needs spaceID for s3ng
|
||||
if err := bs.Delete(&node.Node{BlobID: blobID}); err != nil {
|
||||
fmt.Printf("error deleting blob %s: %v\n", blobID, err)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.Remove(d); err != nil {
|
||||
fmt.Printf("error removing %s: %v\n", d, err)
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
countFiles++
|
||||
|
||||
if verbose {
|
||||
spaceID, nodeID := getIDsFromPath(d)
|
||||
if dryRun {
|
||||
fmt.Println("Would delete")
|
||||
fmt.Println("\tResourceID:", spaceID+"!"+nodeID)
|
||||
fmt.Println("\tSpaceID:", spaceID)
|
||||
fmt.Println("\tPath:", d)
|
||||
if blobID != "" {
|
||||
fmt.Println("\tBlob:", blobID)
|
||||
}
|
||||
} else {
|
||||
fmt.Println("Deleted")
|
||||
fmt.Println("\tResourceID:", spaceID+"!"+nodeID)
|
||||
fmt.Println("\tSpaceID:", spaceID)
|
||||
fmt.Println("\tPath:", d)
|
||||
if blobID != "" {
|
||||
fmt.Println("\tBlob:", blobID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch {
|
||||
case countFiles == 0 && countRevisions == 0 && countBlobs == 0:
|
||||
fmt.Println("❎ No revisions found. Storage provider is clean.")
|
||||
case !dryRun:
|
||||
fmt.Printf("✅ Deleted %d revisions (%d files / %d blobs)\n", countRevisions, countFiles, countBlobs)
|
||||
default:
|
||||
fmt.Printf("👉 Would delete %d revisions (%d files / %d blobs)\n", countRevisions, countFiles, countBlobs)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func getBlobID(path string) (string, error) {
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
m := map[string][]byte{}
|
||||
if err := msgpack.Unmarshal(b, &m); err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if bid := m["user.ocis.blobid"]; string(bid) != "" {
|
||||
return string(bid), nil
|
||||
}
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func getIDsFromPath(path string) (string, string) {
|
||||
rawIDs := strings.Split(path, "/nodes/")
|
||||
if len(rawIDs) != 2 {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
s := strings.Split(rawIDs[0], "/spaces/")
|
||||
if len(s) != 2 {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
n := strings.Split(rawIDs[1], ".REV.")
|
||||
if len(n) != 2 {
|
||||
return "", ""
|
||||
}
|
||||
|
||||
spaceID := strings.Replace(s[1], "/", "", -1)
|
||||
nodeID := strings.Replace(n[0], "/", "", -1)
|
||||
return spaceID, filepath.Base(nodeID)
|
||||
}
|
||||
@@ -146,7 +146,7 @@ func (av Antivirus) processEvent(e events.Event, s events.Publisher) error {
|
||||
}
|
||||
|
||||
if av.c.DebugScanOutcome != "" {
|
||||
av.l.Warn().Str("antivir, clamav", ">>>>>>> ANTIVIRUS_DEBUG_SCAN_OUTCOME IS SET NO ACTUAL VIRUS SCAN IS PERFORMED!")
|
||||
av.l.Warn().Str("antivir, clamav", ">>>>>>> ANTIVIRUS_DEBUG_SCAN_OUTCOME IS SET NO ACTUAL VIRUS SCAN IS PERFORMED!").Send()
|
||||
if err := events.Publish(ctx, s, events.PostprocessingStepFinished{
|
||||
FinishedStep: events.PPStepAntivirus,
|
||||
Outcome: events.PostprocessingOutcome(av.c.DebugScanOutcome),
|
||||
@@ -158,7 +158,6 @@ func (av Antivirus) processEvent(e events.Event, s events.Publisher) error {
|
||||
Description: "DEBUG: forced outcome",
|
||||
Scandate: time.Now(),
|
||||
ResourceID: ev.ResourceID,
|
||||
ErrorMsg: "DEBUG: forced outcome",
|
||||
},
|
||||
}); err != nil {
|
||||
av.l.Fatal().Err(err).Str("uploadid", ev.UploadID).Interface("resourceID", ev.ResourceID).Msg("cannot publish events - exiting")
|
||||
|
||||
@@ -97,6 +97,11 @@ func (cl *ClientlogService) processEvent(event events.Event) {
|
||||
default:
|
||||
err = errors.New("unhandled event")
|
||||
case events.UploadReady:
|
||||
if e.Failed {
|
||||
// we don't inform about failed uploads yet
|
||||
return
|
||||
}
|
||||
|
||||
info, err := utils.GetResource(ctx, e.FileRef, gwc)
|
||||
if err != nil {
|
||||
cl.log.Error().Err(err).Interface("event", event).Msg("error getting resource")
|
||||
|
||||
@@ -191,5 +191,5 @@ type PasswordPolicy struct {
|
||||
MinUpperCaseCharacters int `yaml:"min_uppercase_characters" env:"OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS" desc:"Define the minimum number of lowercase letters. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
MinDigits int `yaml:"min_digits" env:"OCIS_PASSWORD_POLICY_MIN_DIGITS;FRONTEND_PASSWORD_POLICY_MIN_DIGITS" desc:"Define the minimum number of digits. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
MinSpecialCharacters int `yaml:"min_special_characters" env:"OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS;FRONTEND_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS" desc:"Define the minimum number of characters from the special characters list to be present. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
BannedPasswordsList string `yaml:"banned_passwords_list" env:"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" desc:"Path to the 'banned passwords list' file. See the documentation for more details." introductionVersion:"5.0"`
|
||||
BannedPasswordsList string `yaml:"banned_passwords_list" env:"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;FRONTEND_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" desc:"Path to the 'banned passwords list' file. This only impacts public link password validation. See the documentation for more details." introductionVersion:"5.0"`
|
||||
}
|
||||
@@ -89,7 +89,7 @@ type Cache struct {
|
||||
ProviderCacheNodes []string `yaml:"provider_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_PROVIDER_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
ProviderCacheDatabase string `yaml:"provider_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
ProviderCacheTTL time.Duration `yaml:"provider_cache_ttl" env:"OCIS_CACHE_TTL;GATEWAY_PROVIDER_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
ProviderCacheSize int `yaml:"provider_cache_size" env:"OCIS_CACHE_SIZE;GATEWAY_PROVIDER_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
ProviderCacheSize int `yaml:"provider_cache_size" env:"OCIS_CACHE_SIZE;GATEWAY_PROVIDER_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
ProviderCacheDisablePersistence bool `yaml:"provider_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GATEWAY_PROVIDER_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the provider cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
ProviderCacheAuthUsername string `yaml:"provider_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME;GATEWAY_PROVIDER_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
ProviderCacheAuthPassword string `yaml:"provider_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;GATEWAY_PROVIDER_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
@@ -97,7 +97,7 @@ type Cache struct {
|
||||
CreateHomeCacheNodes []string `yaml:"create_home_cache_nodes" env:"OCIS_CACHE_STORE_NODES;GATEWAY_CREATE_HOME_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
CreateHomeCacheDatabase string `yaml:"create_home_cache_database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
CreateHomeCacheTTL time.Duration `yaml:"create_home_cache_ttl" env:"OCIS_CACHE_TTL;GATEWAY_CREATE_HOME_CACHE_TTL" desc:"Default time to live for user info in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
CreateHomeCacheSize int `yaml:"create_home_cache_size" env:"OCIS_CACHE_SIZE;GATEWAY_CREATE_HOME_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
CreateHomeCacheSize int `yaml:"create_home_cache_size" env:"OCIS_CACHE_SIZE;GATEWAY_CREATE_HOME_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
CreateHomeCacheDisablePersistence bool `yaml:"create_home_cache_disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GATEWAY_CREATE_HOME_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the create home cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
CreateHomeCacheAuthUsername string `yaml:"create_home_cache_auth_username" env:"OCIS_CACHE_AUTH_USERNAME;GATEWAY_CREATE_HOME_CACHE_AUTH_USERNAME" desc:"The username to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
CreateHomeCacheAuthPassword string `yaml:"create_home_cache_auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;GATEWAY_CREATE_HOME_CACHE_AUTH_PASSWORD" desc:"The password to use for authentication. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -9,7 +9,7 @@ type Cache struct {
|
||||
Database string `yaml:"database" env:"GRAPH_CACHE_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
Table string `yaml:"table" env:"GRAPH_CACHE_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;GRAPH_CACHE_TTL" desc:"Time to live for cache records in the graph. Defaults to '336h' (2 weeks). See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;GRAPH_CACHE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;GRAPH_CACHE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;GRAPH_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;GRAPH_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;GRAPH_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -4,7 +4,7 @@ package channels
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
stdmail "net/mail"
|
||||
"strings"
|
||||
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
@@ -31,16 +31,24 @@ type Message struct {
|
||||
|
||||
// NewMailChannel instantiates a new mail communication channel.
|
||||
func NewMailChannel(cfg config.Config, logger log.Logger) (Channel, error) {
|
||||
var err error
|
||||
var a *stdmail.Address
|
||||
a, err = stdmail.ParseAddress(cfg.Notifications.SMTP.Sender)
|
||||
if err != nil {
|
||||
logger.Err(err).Msg("parsing error, the 'smtp_sender' must be a valid single RFC 5322 address.")
|
||||
}
|
||||
return Mail{
|
||||
conf: cfg,
|
||||
logger: logger,
|
||||
conf: cfg,
|
||||
smtpAddress: a,
|
||||
logger: logger,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Mail is the communication channel for email.
|
||||
type Mail struct {
|
||||
conf config.Config
|
||||
logger log.Logger
|
||||
conf config.Config
|
||||
smtpAddress *stdmail.Address
|
||||
logger log.Logger
|
||||
}
|
||||
|
||||
func (m Mail) getMailClient() (*mail.SMTPClient, error) {
|
||||
@@ -102,8 +110,12 @@ func (m Mail) getMailClient() (*mail.SMTPClient, error) {
|
||||
|
||||
// SendMessage sends a message to all given users.
|
||||
func (m Mail) SendMessage(ctx context.Context, message *Message) error {
|
||||
if m.smtpAddress == nil {
|
||||
m.logger.Error().Str("mail", "SendMessage").Msg("failed to send a message. SMTP address is not set")
|
||||
return nil
|
||||
}
|
||||
if m.conf.Notifications.SMTP.Host == "" {
|
||||
m.logger.Info().Str("mail", "SendMessage").Msg("failed to send a message. SMTP host is not set")
|
||||
m.logger.Info().Str("mail", "SendMessage").Msg("failed to send a message. SMTP host is not set")
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -113,11 +125,7 @@ func (m Mail) SendMessage(ctx context.Context, message *Message) error {
|
||||
}
|
||||
|
||||
email := mail.NewMSG()
|
||||
if message.Sender != "" {
|
||||
email.SetFrom(fmt.Sprintf("%s via %s", message.Sender, m.conf.Notifications.SMTP.Sender)).AddTo(message.Recipient...)
|
||||
} else {
|
||||
email.SetFrom(m.conf.Notifications.SMTP.Sender).AddTo(message.Recipient...)
|
||||
}
|
||||
email.SetFrom(appendSender(message.Sender, *m.smtpAddress)).AddTo(message.Recipient...)
|
||||
email.SetSubject(message.Subject)
|
||||
email.SetBody(mail.TextPlain, message.TextBody)
|
||||
if message.HTMLBody != "" {
|
||||
@@ -129,3 +137,10 @@ func (m Mail) SendMessage(ctx context.Context, message *Message) error {
|
||||
|
||||
return email.Send(smtpClient)
|
||||
}
|
||||
|
||||
func appendSender(sender string, a stdmail.Address) string {
|
||||
if strings.TrimSpace(sender) != "" {
|
||||
a.Name = strings.TrimSpace(sender + " via " + a.Name)
|
||||
}
|
||||
return a.String()
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package channels
|
||||
|
||||
import (
|
||||
"net/mail"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_appendSender(t *testing.T) {
|
||||
type args struct {
|
||||
sender string
|
||||
a mail.Address
|
||||
}
|
||||
|
||||
a1, err := mail.ParseAddress("ownCloud <noreply@example.com>")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
a2, err := mail.ParseAddress("noreply@example.com")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
sender string
|
||||
want1 string
|
||||
want2 string
|
||||
}{
|
||||
{
|
||||
name: "empty sender",
|
||||
sender: "",
|
||||
want1: `"ownCloud" <noreply@example.com>`,
|
||||
want2: `<noreply@example.com>`,
|
||||
},
|
||||
{
|
||||
name: "not empty sender",
|
||||
sender: `Joe Q. Public`,
|
||||
want1: `"Joe Q. Public via ownCloud" <noreply@example.com>`,
|
||||
want2: `"Joe Q. Public via" <noreply@example.com>`,
|
||||
},
|
||||
{
|
||||
name: "sender whit comma and semicolon",
|
||||
sender: `Joe, Q; Public:`,
|
||||
want1: `"Joe, Q; Public: via ownCloud" <noreply@example.com>`,
|
||||
want2: `"Joe, Q; Public: via" <noreply@example.com>`,
|
||||
},
|
||||
{
|
||||
name: "sender with quotes",
|
||||
sender: `Joe Q. "Public"`,
|
||||
want1: `"Joe Q. \"Public\" via ownCloud" <noreply@example.com>`,
|
||||
want2: `"Joe Q. \"Public\" via" <noreply@example.com>`,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := appendSender(tt.sender, *a1); got != tt.want1 {
|
||||
t.Errorf("appendSender() = %v, want %v", got, tt.want1)
|
||||
}
|
||||
if got := appendSender(tt.sender, *a2); got != tt.want2 {
|
||||
t.Errorf("appendSender() = %v, want %v", got, tt.want2)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package parser
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/mail"
|
||||
"strings"
|
||||
|
||||
ociscfg "github.com/owncloud/ocis/v2/ocis-pkg/config"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/shared"
|
||||
@@ -54,6 +56,14 @@ func Validate(cfg *config.Config) error {
|
||||
}
|
||||
}
|
||||
|
||||
if strings.TrimSpace(cfg.Notifications.SMTP.Sender) != "" {
|
||||
if s, err := mail.ParseAddress(cfg.Notifications.SMTP.Sender); err == nil {
|
||||
cfg.Notifications.SMTP.Sender = s.String()
|
||||
} else {
|
||||
return fmt.Errorf("the 'smtp_sender' must be a valid single RFC 5322 address. parsing error %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
if cfg.ServiceAccount.ServiceAccountID == "" {
|
||||
return shared.MissingServiceAccountID(cfg.Service.Name)
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ type Store struct {
|
||||
Database string `yaml:"database" env:"POSTPROCESSING_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
Table string `yaml:"table" env:"POSTPROCESSING_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;POSTPROCESSING_STORE_TTL" desc:"Time to live for events in the store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_PERSISTENT_STORE_SIZE;POSTPROCESSING_STORE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_PERSISTENT_STORE_SIZE;POSTPROCESSING_STORE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;POSTPROCESSING_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;POSTPROCESSING_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
}
|
||||
@@ -21,6 +21,7 @@ type Postprocessing struct {
|
||||
Steps []events.Postprocessingstep
|
||||
Status Status
|
||||
Failures int
|
||||
Finished bool
|
||||
|
||||
config config.Postprocessing
|
||||
}
|
||||
|
||||
@@ -148,8 +148,14 @@ func (pps *PostprocessingService) processEvent(e events.Event) error {
|
||||
next = pp.Delay()
|
||||
case events.UploadReady:
|
||||
if ev.Failed {
|
||||
// the upload failed - let's keep it around for a while
|
||||
return nil
|
||||
// the upload failed - let's keep it around for a while - but mark it as finished
|
||||
pp, err = pps.getPP(pps.store, ev.UploadID)
|
||||
if err != nil {
|
||||
pps.log.Error().Str("uploadID", ev.UploadID).Err(err).Msg("cannot get upload")
|
||||
return fmt.Errorf("%w: cannot get upload", ErrEvent)
|
||||
}
|
||||
pp.Finished = true
|
||||
return storePP(pps.store, pp)
|
||||
}
|
||||
|
||||
// the storage provider thinks the upload is done - so no need to keep it any more
|
||||
@@ -235,7 +241,6 @@ func (pps *PostprocessingService) handleResumePPEvent(ctx context.Context, ev ev
|
||||
for _, id := range ids {
|
||||
if err := pps.resumePP(ctx, id); err != nil {
|
||||
pps.log.Error().Str("uploadID", id).Err(err).Msg("cannot resume upload")
|
||||
return fmt.Errorf("cannot resume upload: %w", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -256,6 +261,11 @@ func (pps *PostprocessingService) resumePP(ctx context.Context, uploadID string)
|
||||
return fmt.Errorf("cannot get upload: %w", err)
|
||||
}
|
||||
|
||||
if pp.Finished {
|
||||
// dont retry finished uploads
|
||||
return nil
|
||||
}
|
||||
|
||||
return events.Publish(ctx, pps.pub, pp.CurrentStep())
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ type Cache struct {
|
||||
Database string `yaml:"database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
Table string `yaml:"table" env:"PROXY_OIDC_USERINFO_CACHE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;PROXY_OIDC_USERINFO_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;PROXY_OIDC_USERINFO_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;PROXY_OIDC_USERINFO_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;PROXY_OIDC_USERINFO_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"pre5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;PROXY_OIDC_USERINFO_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;PROXY_OIDC_USERINFO_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -63,7 +63,7 @@ type Cache struct {
|
||||
FileTable string `yaml:"files_table" env:"SETTINGS_FILE_CACHE_TABLE" desc:"The database table the store should use for the file cache." introductionVersion:"pre5.0"`
|
||||
DirectoryTable string `yaml:"directories_table" env:"SETTINGS_DIRECTORY_CACHE_TABLE" desc:"The database table the store should use for the directory cache." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;SETTINGS_CACHE_TTL" desc:"Default time to live for entries in the cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;SETTINGS_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;SETTINGS_CACHE_SIZE" desc:"The maximum quantity of items in the cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;SETTINGS_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;SETTINGS_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;SETTINGS_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"log"
|
||||
"sync"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/errtypes"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/metadata"
|
||||
"github.com/gofrs/uuid"
|
||||
olog "github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
@@ -139,10 +140,20 @@ func (s *Store) initMetadataClient(mdc MetadataClient) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(assIDs) > 0 {
|
||||
|
||||
adminUserID := accountUUID == s.cfg.AdminUserID
|
||||
if len(assIDs) > 0 && !adminUserID {
|
||||
// There is already a role assignment for this ID, skip to the next
|
||||
continue
|
||||
}
|
||||
// for the adminUserID we need to check if the user has the admin role every time
|
||||
if adminUserID {
|
||||
err = s.userMustHaveAdminRole(accountUUID, assIDs, mdc)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
ass := &settingsmsg.UserRoleAssignment{
|
||||
Id: uuid.Must(uuid.NewV4()).String(),
|
||||
@@ -164,6 +175,64 @@ func (s *Store) initMetadataClient(mdc MetadataClient) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *Store) userMustHaveAdminRole(accountUUID string, assIDs []string, mdc MetadataClient) error {
|
||||
ctx := context.TODO()
|
||||
var hasAdminRole bool
|
||||
|
||||
// load the assignments from the store and check if the admin role is already assigned
|
||||
for _, assID := range assIDs {
|
||||
b, err := mdc.SimpleDownload(ctx, assignmentPath(accountUUID, assID))
|
||||
switch err.(type) {
|
||||
case nil:
|
||||
// continue
|
||||
case errtypes.NotFound:
|
||||
continue
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
||||
a := &settingsmsg.UserRoleAssignment{}
|
||||
err = json.Unmarshal(b, a)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if a.RoleId == defaults.BundleUUIDRoleAdmin {
|
||||
hasAdminRole = true
|
||||
}
|
||||
}
|
||||
|
||||
// delete old role assignment and set admin role
|
||||
if !hasAdminRole {
|
||||
err := mdc.Delete(ctx, accountPath(accountUUID))
|
||||
switch err.(type) {
|
||||
case nil:
|
||||
// continue
|
||||
case errtypes.NotFound:
|
||||
// already gone, continue
|
||||
default:
|
||||
return err
|
||||
}
|
||||
|
||||
err = mdc.MakeDirIfNotExist(ctx, accountPath(accountUUID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ass := &settingsmsg.UserRoleAssignment{
|
||||
Id: uuid.Must(uuid.NewV4()).String(),
|
||||
AccountUuid: accountUUID,
|
||||
RoleId: defaults.BundleUUIDRoleAdmin,
|
||||
}
|
||||
b, err := json.Marshal(ass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return mdc.SimpleUpload(ctx, assignmentPath(accountUUID, ass.Id), b)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
settings.Registry[managerName] = New
|
||||
}
|
||||
@@ -2,10 +2,15 @@ package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/errtypes"
|
||||
. "github.com/onsi/gomega"
|
||||
settingsmsg "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/settings/v0"
|
||||
"github.com/owncloud/ocis/v2/services/settings/pkg/config/defaults"
|
||||
rdefaults "github.com/owncloud/ocis/v2/services/settings/pkg/store/defaults"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -112,3 +117,74 @@ func (m *MockedMetadataClient) IDExists(id string) bool {
|
||||
func (m *MockedMetadataClient) IDHasContent(id string, content []byte) bool {
|
||||
return string(m.data[id]) == string(content)
|
||||
}
|
||||
|
||||
// TestAdminUserIDInit test the happy path during initialization
|
||||
func TestAdminUserIDInit(t *testing.T) {
|
||||
RegisterTestingT(t)
|
||||
s := &Store{
|
||||
cfg: defaults.DefaultConfig(),
|
||||
}
|
||||
s.cfg.Bundles = rdefaults.GenerateBundlesDefaultRoles()
|
||||
s.cfg.AdminUserID = "admin"
|
||||
|
||||
// the first assignment is always happening during the initialisation of the metadata client
|
||||
err := NewMDC(s)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
assID, err := s.mdc.ReadDir(context.TODO(), accountPath(s.cfg.AdminUserID))
|
||||
Expect(len(assID)).To(Equal(1))
|
||||
ass, err := s.mdc.SimpleDownload(context.TODO(), assignmentPath(s.cfg.AdminUserID, assID[0]))
|
||||
Expect(ass).ToNot(BeNil())
|
||||
|
||||
assignment := &settingsmsg.UserRoleAssignment{}
|
||||
err = json.Unmarshal(ass, assignment)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(assignment.RoleId).To(Equal(rdefaults.BundleUUIDRoleAdmin))
|
||||
}
|
||||
|
||||
// TestAdminUserIDUpdate test the update on following initialisations
|
||||
func TestAdminUserIDUpdate(t *testing.T) {
|
||||
RegisterTestingT(t)
|
||||
s := &Store{
|
||||
cfg: defaults.DefaultConfig(),
|
||||
}
|
||||
s.cfg.Bundles = rdefaults.GenerateBundlesDefaultRoles()
|
||||
s.cfg.AdminUserID = "admin"
|
||||
|
||||
// the first assignment is always happening during the initialisation of the metadata client
|
||||
err := NewMDC(s)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
// read assignment
|
||||
assID, err := s.mdc.ReadDir(context.TODO(), accountPath(s.cfg.AdminUserID))
|
||||
Expect(len(assID)).To(Equal(1))
|
||||
|
||||
// set assignment to user role
|
||||
userRoleAssignment := &settingsmsg.UserRoleAssignment{
|
||||
AccountUuid: s.cfg.AdminUserID,
|
||||
RoleId: rdefaults.BundleUUIDRoleUser,
|
||||
}
|
||||
b, err := json.Marshal(userRoleAssignment)
|
||||
err = s.mdc.Delete(context.TODO(), assignmentPath(s.cfg.AdminUserID, assID[0]))
|
||||
Expect(err).To(BeNil())
|
||||
err = s.mdc.SimpleUpload(context.TODO(), assignmentPath(s.cfg.AdminUserID, assID[0]), b)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
// this happens on every Read / Write on the store
|
||||
// the actual init is only done if the metadata client has not been initialized before
|
||||
// this normally needs a restart of the service
|
||||
err = s.initMetadataClient(s.mdc)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
// read assignment id, changes every time the assignment is written
|
||||
assID, err = s.mdc.ReadDir(context.TODO(), accountPath(s.cfg.AdminUserID))
|
||||
Expect(len(assID)).To(Equal(1))
|
||||
|
||||
// check if the assignment is the admin role again
|
||||
ass, err := s.mdc.SimpleDownload(context.TODO(), assignmentPath(s.cfg.AdminUserID, assID[0]))
|
||||
Expect(ass).ToNot(BeNil())
|
||||
assignment := &settingsmsg.UserRoleAssignment{}
|
||||
err = json.Unmarshal(ass, assignment)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(assignment.RoleId).To(Equal(rdefaults.BundleUUIDRoleAdmin))
|
||||
}
|
||||
@@ -167,5 +167,5 @@ type PasswordPolicy struct {
|
||||
MinUpperCaseCharacters int `yaml:"min_uppercase_characters" env:"OCIS_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_UPPERCASE_CHARACTERS" desc:"Define the minimum number of lowercase letters. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
MinDigits int `yaml:"min_digits" env:"OCIS_PASSWORD_POLICY_MIN_DIGITS;SHARING_PASSWORD_POLICY_MIN_DIGITS" desc:"Define the minimum number of digits. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
MinSpecialCharacters int `yaml:"min_special_characters" env:"OCIS_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS;SHARING_PASSWORD_POLICY_MIN_SPECIAL_CHARACTERS" desc:"Define the minimum number of characters from the special characters list to be present. Defaults to 1 if not set." introductionVersion:"5.0"`
|
||||
BannedPasswordsList string `yaml:"banned_passwords_list" env:"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" desc:"Path to the 'banned passwords list' file. See the documentation for more details." introductionVersion:"5.0"`
|
||||
BannedPasswordsList string `yaml:"banned_passwords_list" env:"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST;SHARING_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" desc:"Path to the 'banned passwords list' file. This only impacts public link password validation. See the documentation for more details." introductionVersion:"5.0"`
|
||||
}
|
||||
@@ -91,7 +91,7 @@ type Cache struct {
|
||||
Nodes []string `yaml:"nodes" env:"OCIS_CACHE_STORE_NODES;STORAGE_SYSTEM_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Database string `yaml:"database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;STORAGE_SYSTEM_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_SYSTEM_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_SYSTEM_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_SYSTEM_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
AuthUsername string `yaml:"auth_username" env:"OCIS_CACHE_AUTH_USERNAME;STORAGE_SYSTEM_CACHE_AUTH_USERNAME" desc:"Username for the configured store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"auth_password" env:"OCIS_CACHE_AUTH_PASSWORD;STORAGE_SYSTEM_CACHE_AUTH_PASSWORD" desc:"Password for the configured store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -51,58 +51,90 @@ ocis storage-users uploads <command>
|
||||
```plaintext
|
||||
COMMANDS:
|
||||
sessions Print a list of upload sessions
|
||||
clean Clean up leftovers from expired uploads
|
||||
clean Clean up leftovers from expired uploads (deprecated)
|
||||
list Print a list of all incomplete uploads (deprecated)
|
||||
```
|
||||
|
||||
#### Sessions command
|
||||
|
||||
The `sessions` command is the entry point for listing, restarting and cleaning unfinished uploads.
|
||||
|
||||
```bash
|
||||
ocis storage-users uploads sessions <command>
|
||||
```
|
||||
|
||||
```
|
||||
NAME:
|
||||
ocis storage-users uploads sessions - Print a list of upload sessions
|
||||
|
||||
USAGE:
|
||||
ocis storage-users uploads sessions [command options]
|
||||
|
||||
OPTIONS:
|
||||
--id value filter sessions by upload session id (default: unset)
|
||||
--processing filter sessions by processing status (default: unset)
|
||||
--expired filter sessions by expired status (default: unset)
|
||||
--has-virus filter sessions by virus scan result (default: unset)
|
||||
--json output as json (default: false)
|
||||
--restart send restart event for all listed sessions (default: false)
|
||||
--clean remove uploads (default: false)
|
||||
--help, -h show help
|
||||
```
|
||||
|
||||
This will always output a list of uploads that match the criteria. See Command Examples section.
|
||||
|
||||
Some additional information on returned information:
|
||||
- `Offset` is the amount of bytes the server has already received. If `Offset` == `Size` the server has reveived all bytes of the upload.
|
||||
- `Processing` indicates if the uploaded file is currently going through postprocessing.
|
||||
- `Scan Date` and `Scan Result` indicate the scanning status. If `Scan Date` is set and `Scan Result` is empty the file is not virus infected.
|
||||
|
||||
#### Command Examples
|
||||
|
||||
Command to list ongoing upload sessions
|
||||
|
||||
```bash
|
||||
ocis storage-users sessions --expired=false
|
||||
ocis storage-users uploads sessions --expired=false --processing=false
|
||||
```
|
||||
|
||||
```plaintext
|
||||
Not expired sessions:
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+
|
||||
| Space | Upload Id | Name | Offset | Size | Executant | Owner | Expires | Processing |
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+
|
||||
| f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 5e387954-7313-4223-a904-bf996da6ec0b | foo.txt | 0 | 1234 | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 2024-01-26T13:04:31+01:00 | false |
|
||||
| f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f066244d-97b2-48e7-a30d-b40fcb60cec6 | bar.txt | 0 | 4321 | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 2024-01-26T13:18:47+01:00 | false |
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+---------------------------+-----------------------+
|
||||
| Space | Upload Id | Name | Offset | Size | Executant | Owner | Expires | Processing | Scan Date | Scan Result |
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+---------------------------+-----------------------+
|
||||
| f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 5e387954-7313-4223-a904-bf996da6ec0b | foo.txt | 0 | 1234 | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 2024-01-26T13:04:31+01:00 | false | 2024-04-24T11:24:14+02:00 | infected: virus A |
|
||||
| f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f066244d-97b2-48e7-a30d-b40fcb60cec6 | bar.txt | 0 | 4321 | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c | 2024-01-26T13:18:47+01:00 | false | 2024-04-24T14:38:29+02:00 | |
|
||||
+--------------------------------------+--------------------------------------+---------+--------+------+--------------------------------------+--------------------------------------+---------------------------+------------+---------------------------+-----------------------+
|
||||
```
|
||||
|
||||
The sessions command can also output json
|
||||
|
||||
```bash
|
||||
ocis storage-users sessions --expired=false --json
|
||||
ocis storage-users uploads sessions --expired=false --processing=false --json
|
||||
```
|
||||
|
||||
```json
|
||||
{"id":"5e387954-7313-4223-a904-bf996da6ec0b","space":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c","filename":"foo.txt","offset":0,"size":1234,"executant":{"idp":"https://cloud.ocis.test","opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"spaceowner":{"opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"expires":"2024-01-26T13:04:31+01:00","processing":false}
|
||||
{"id":"f066244d-97b2-48e7-a30d-b40fcb60cec6","space":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c","filename":"bar.txt","offset":0,"size":4321,"executant":{"idp":"https://cloud.ocis.test","opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"spaceowner":{"opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"expires":"2024-01-26T13:18:47+01:00","processing":false}
|
||||
{"id":"5e387954-7313-4223-a904-bf996da6ec0b","space":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c","filename":"foo.txt","offset":0,"size":1234,"executant":{"idp":"https://cloud.ocis.test","opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"spaceowner":{"opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"expires":"2024-01-26T13:04:31+01:00","processing":false, "scanDate": "2024-04-24T11:24:14+02:00", "scanResult": "infected: virus A"}
|
||||
{"id":"f066244d-97b2-48e7-a30d-b40fcb60cec6","space":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c","filename":"bar.txt","offset":0,"size":4321,"executant":{"idp":"https://cloud.ocis.test","opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"spaceowner":{"opaque_id":"f7fbf8c8-139b-4376-b307-cf0a8c2d0d9c"},"expires":"2024-01-26T13:18:47+01:00","processing":false, "scanDate": "2024-04-24T14:38:29+02:00", "scanResult": ""}
|
||||
```
|
||||
|
||||
Command to clear expired uploads
|
||||
The sessions command can also clear and restart uploads. The output is the same as if run without `--clean` or `--restart` flag.
|
||||
Note: It is recommended to run to command first without the `--clean` (`--processing`) flag to double check which uploads get cleaned (restarted).
|
||||
```bash
|
||||
ocis storage-users uploads clean
|
||||
# cleans all expired uploads regardless of processing and virus state.
|
||||
ocis storage-users uploads sessions --expired=true --clean
|
||||
|
||||
# restarts all uploads that are processing and are not virus infected
|
||||
ocis storage-users uploads sessions --processing=false --has-virus=false --restart
|
||||
```
|
||||
|
||||
```plaintext
|
||||
Cleaned uploads:
|
||||
- 455bd640-cd08-46e8-a5a0-9304908bd40a (Filename: file_example_PPT_1MB.ppt, Size: 1028608, Expires: 2022-08-17T12:35:34+02:00)
|
||||
```
|
||||
|
||||
Deprecated list command to identify unfinished uploads
|
||||
IMPOTANT: `list` and `clean` commands are deprecated. Do not use them.
|
||||
|
||||
```bash
|
||||
# deprecated
|
||||
ocis storage-users uploads list
|
||||
```
|
||||
|
||||
```plaintext
|
||||
Incomplete uploads:
|
||||
- 455bd640-cd08-46e8-a5a0-9304908bd40a (file_example_PPT_1MB.ppt, Size: 1028608, Expires: 2022-08-17T12:35:34+02:00)
|
||||
# deprecated
|
||||
ocis storage-users uploads clean
|
||||
```
|
||||
|
||||
### Purge Expired Space Trash-Bins Items
|
||||
|
||||
@@ -25,6 +25,22 @@ import (
|
||||
"github.com/owncloud/ocis/v2/services/storage-users/pkg/revaconfig"
|
||||
)
|
||||
|
||||
// Session contains the information of an upload session
|
||||
type Session struct {
|
||||
ID string `json:"id"`
|
||||
Space string `json:"space"`
|
||||
Filename string `json:"filename"`
|
||||
Offset int64 `json:"offset"`
|
||||
Size int64 `json:"size"`
|
||||
Executant userpb.UserId `json:"executant"`
|
||||
SpaceOwner *userpb.UserId `json:"spaceowner,omitempty"`
|
||||
Expires time.Time `json:"expires"`
|
||||
Processing bool `json:"processing"`
|
||||
ScanDate time.Time `json:"virus_scan_date"`
|
||||
ScanResult string `json:"virus_scan_result"`
|
||||
}
|
||||
|
||||
// Uploads is the entry point for the uploads command
|
||||
func Uploads(cfg *config.Config) *cli.Command {
|
||||
return &cli.Command{
|
||||
|
||||
@@ -47,6 +63,8 @@ func ListUploads(cfg *config.Config) *cli.Command {
|
||||
return configlog.ReturnFatal(parser.ParseConfig(cfg))
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Println("Warning: This command is deprecated, use 'uploads sessions' instead")
|
||||
|
||||
f, ok := registry.NewFuncs[cfg.Driver]
|
||||
if !ok {
|
||||
fmt.Fprintf(os.Stderr, "Unknown filesystem driver '%s'\n", cfg.Driver)
|
||||
@@ -101,6 +119,11 @@ func ListUploadSessions(cfg *config.Config) *cli.Command {
|
||||
DefaultText: "unset",
|
||||
Usage: "filter sessions by expired status",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "has-virus",
|
||||
DefaultText: "unset",
|
||||
Usage: "filter sessions by virus scan result",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "json",
|
||||
Usage: "output as json",
|
||||
@@ -109,6 +132,10 @@ func ListUploadSessions(cfg *config.Config) *cli.Command {
|
||||
Name: "restart",
|
||||
Usage: "send restart event for all listed sessions",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "clean",
|
||||
Usage: "remove uploads",
|
||||
},
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
return configlog.ReturnFatal(parser.ParseConfig(cfg))
|
||||
@@ -141,130 +168,91 @@ func ListUploadSessions(cfg *config.Config) *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
var b strings.Builder
|
||||
filter := storage.UploadSessionFilter{}
|
||||
if c.IsSet("processing") {
|
||||
processingValue := c.Bool("processing")
|
||||
filter.Processing = &processingValue
|
||||
if !processingValue {
|
||||
b.WriteString("Not ")
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Processing ")
|
||||
} else {
|
||||
b.WriteString("processing ")
|
||||
}
|
||||
}
|
||||
if c.IsSet("expired") {
|
||||
expiredValue := c.Bool("expired")
|
||||
filter.Expired = &expiredValue
|
||||
if !expiredValue {
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Not ")
|
||||
} else {
|
||||
b.WriteString(", not ")
|
||||
}
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Expired ")
|
||||
} else {
|
||||
b.WriteString("expired ")
|
||||
}
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Sessions")
|
||||
} else {
|
||||
b.WriteString("sessions")
|
||||
}
|
||||
if c.IsSet("id") {
|
||||
idValue := c.String("id")
|
||||
filter.ID = &idValue
|
||||
b.WriteString(" with id '" + idValue + "'")
|
||||
}
|
||||
b.WriteString(":")
|
||||
filter := buildFilter(c)
|
||||
uploads, err := managingFS.ListUploadSessions(c.Context, filter)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var table *tw.Table
|
||||
if c.Bool("json") {
|
||||
for _, u := range uploads {
|
||||
ref := u.Reference()
|
||||
s := struct {
|
||||
ID string `json:"id"`
|
||||
Space string `json:"space"`
|
||||
Filename string `json:"filename"`
|
||||
Offset int64 `json:"offset"`
|
||||
Size int64 `json:"size"`
|
||||
Executant userpb.UserId `json:"executant"`
|
||||
SpaceOwner *userpb.UserId `json:"spaceowner,omitempty"`
|
||||
Expires time.Time `json:"expires"`
|
||||
Processing bool `json:"processing"`
|
||||
}{
|
||||
Space: ref.GetResourceId().GetSpaceId(),
|
||||
ID: u.ID(),
|
||||
Filename: u.Filename(),
|
||||
Offset: u.Offset(),
|
||||
Size: u.Size(),
|
||||
Executant: u.Executant(),
|
||||
SpaceOwner: u.SpaceOwner(),
|
||||
Expires: u.Expires(),
|
||||
Processing: u.IsProcessing(),
|
||||
}
|
||||
j, err := json.Marshal(s)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
fmt.Println(string(j))
|
||||
var (
|
||||
table *tw.Table
|
||||
raw []Session
|
||||
)
|
||||
|
||||
if c.Bool("restart") {
|
||||
if err := events.Publish(context.Background(), stream, events.ResumePostprocessing{
|
||||
UploadID: u.ID(),
|
||||
Timestamp: utils.TSNow(),
|
||||
}); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to send restart event for upload session '%s'\n", u.ID())
|
||||
// if publishing fails there is no need to try publishing other events - they will fail too.
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if !c.Bool("json") {
|
||||
fmt.Println(buildInfo(filter))
|
||||
|
||||
// Print what the user requested
|
||||
fmt.Println(b.String())
|
||||
|
||||
// start a table
|
||||
table = tw.NewWriter(os.Stdout)
|
||||
table.SetHeader([]string{"Space", "Upload Id", "Name", "Offset", "Size", "Executant", "Owner", "Expires", "Processing"})
|
||||
table.SetHeader([]string{"Space", "Upload Id", "Name", "Offset", "Size", "Executant", "Owner", "Expires", "Processing", "Scan Date", "Scan Result"})
|
||||
table.SetAutoFormatHeaders(false)
|
||||
}
|
||||
|
||||
for _, u := range uploads {
|
||||
for _, u := range uploads {
|
||||
ref := u.Reference()
|
||||
sr, sd := u.ScanData()
|
||||
|
||||
session := Session{
|
||||
Space: ref.GetResourceId().GetSpaceId(),
|
||||
ID: u.ID(),
|
||||
Filename: u.Filename(),
|
||||
Offset: u.Offset(),
|
||||
Size: u.Size(),
|
||||
Executant: u.Executant(),
|
||||
SpaceOwner: u.SpaceOwner(),
|
||||
Expires: u.Expires(),
|
||||
Processing: u.IsProcessing(),
|
||||
ScanDate: sd,
|
||||
ScanResult: sr,
|
||||
}
|
||||
|
||||
if c.Bool("json") {
|
||||
raw = append(raw, session)
|
||||
} else {
|
||||
table.Append([]string{
|
||||
u.Reference().ResourceId.GetSpaceId(),
|
||||
u.ID(),
|
||||
u.Filename(),
|
||||
strconv.FormatInt(u.Offset(), 10),
|
||||
strconv.FormatInt(u.Size(), 10),
|
||||
u.Executant().OpaqueId,
|
||||
u.SpaceOwner().GetOpaqueId(),
|
||||
u.Expires().Format(time.RFC3339),
|
||||
strconv.FormatBool(u.IsProcessing()),
|
||||
session.Space,
|
||||
session.ID,
|
||||
session.Filename,
|
||||
strconv.FormatInt(session.Offset, 10),
|
||||
strconv.FormatInt(session.Size, 10),
|
||||
session.Executant.OpaqueId,
|
||||
session.SpaceOwner.GetOpaqueId(),
|
||||
session.Expires.Format(time.RFC3339),
|
||||
strconv.FormatBool(session.Processing),
|
||||
session.ScanDate.Format(time.RFC3339),
|
||||
session.ScanResult,
|
||||
})
|
||||
}
|
||||
|
||||
if c.Bool("restart") {
|
||||
if err := events.Publish(context.Background(), stream, events.ResumePostprocessing{
|
||||
UploadID: u.ID(),
|
||||
Timestamp: utils.TSNow(),
|
||||
}); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to send restart event for upload session '%s'\n", u.ID())
|
||||
// if publishing fails there is no need to try publishing other events - they will fail too.
|
||||
os.Exit(1)
|
||||
}
|
||||
if c.Bool("restart") {
|
||||
if err := events.Publish(context.Background(), stream, events.ResumePostprocessing{
|
||||
UploadID: u.ID(),
|
||||
Timestamp: utils.TSNow(),
|
||||
}); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to send restart event for upload session '%s'\n", u.ID())
|
||||
// if publishing fails there is no need to try publishing other events - they will fail too.
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
table.Render()
|
||||
|
||||
if c.Bool("clean") {
|
||||
if err := u.Purge(c.Context); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Failed to clean upload session '%s'\n", u.ID())
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if !c.Bool("json") {
|
||||
table.Render()
|
||||
return nil
|
||||
}
|
||||
|
||||
j, err := json.Marshal(raw)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return err
|
||||
}
|
||||
fmt.Println(string(j))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -279,6 +267,7 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command {
|
||||
return configlog.ReturnFatal(parser.ParseConfig(cfg))
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Println("Warning: This command is deprecated, use 'uploads sessions --clean' instead")
|
||||
f, ok := registry.NewFuncs[cfg.Driver]
|
||||
if !ok {
|
||||
fmt.Fprintf(os.Stderr, "Unknown filesystem driver '%s'\n", cfg.Driver)
|
||||
@@ -325,3 +314,90 @@ func PurgeExpiredUploads(cfg *config.Config) *cli.Command {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func buildFilter(c *cli.Context) storage.UploadSessionFilter {
|
||||
filter := storage.UploadSessionFilter{}
|
||||
if c.IsSet("processing") {
|
||||
processingValue := c.Bool("processing")
|
||||
filter.Processing = &processingValue
|
||||
}
|
||||
if c.IsSet("expired") {
|
||||
expiredValue := c.Bool("expired")
|
||||
filter.Expired = &expiredValue
|
||||
}
|
||||
if c.IsSet("has-virus") {
|
||||
infectedValue := c.Bool("has-virus")
|
||||
filter.HasVirus = &infectedValue
|
||||
}
|
||||
if c.IsSet("id") {
|
||||
idValue := c.String("id")
|
||||
filter.ID = &idValue
|
||||
}
|
||||
return filter
|
||||
}
|
||||
|
||||
func buildInfo(filter storage.UploadSessionFilter) string {
|
||||
var b strings.Builder
|
||||
if filter.Processing != nil {
|
||||
if !*filter.Processing {
|
||||
b.WriteString("Not ")
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Processing")
|
||||
} else {
|
||||
b.WriteString("processing")
|
||||
}
|
||||
}
|
||||
|
||||
if filter.Expired != nil {
|
||||
if b.Len() != 0 {
|
||||
b.WriteString(", ")
|
||||
}
|
||||
if !*filter.Expired {
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Not ")
|
||||
} else {
|
||||
b.WriteString("not ")
|
||||
}
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Expired")
|
||||
} else {
|
||||
b.WriteString("expired")
|
||||
}
|
||||
}
|
||||
|
||||
if filter.HasVirus != nil {
|
||||
if b.Len() != 0 {
|
||||
b.WriteString(", ")
|
||||
}
|
||||
if !*filter.HasVirus {
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Not ")
|
||||
} else {
|
||||
b.WriteString("not ")
|
||||
}
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Virusinfected")
|
||||
} else {
|
||||
b.WriteString("virusinfected")
|
||||
}
|
||||
}
|
||||
|
||||
if b.Len() == 0 {
|
||||
b.WriteString("Session")
|
||||
} else {
|
||||
b.WriteString(" session")
|
||||
}
|
||||
|
||||
if filter.ID != nil {
|
||||
b.WriteString(" with id '" + *filter.ID + "'")
|
||||
} else {
|
||||
// to make `session` plural
|
||||
b.WriteString("s")
|
||||
}
|
||||
|
||||
b.WriteString(":")
|
||||
return b.String()
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cs3org/reva/v2/pkg/storage"
|
||||
"github.com/test-go/testify/require"
|
||||
)
|
||||
|
||||
func TestBuildInfo(t *testing.T) {
|
||||
testCases := []struct {
|
||||
alias string
|
||||
filter storage.UploadSessionFilter
|
||||
expectedInfo string
|
||||
}{
|
||||
{
|
||||
alias: "empty filter",
|
||||
filter: storage.UploadSessionFilter{},
|
||||
expectedInfo: "Sessions:",
|
||||
},
|
||||
{
|
||||
alias: "processing",
|
||||
filter: storage.UploadSessionFilter{Processing: boolPtr(true)},
|
||||
expectedInfo: "Processing sessions:",
|
||||
},
|
||||
{
|
||||
alias: "processing and not expired",
|
||||
filter: storage.UploadSessionFilter{Processing: boolPtr(true), Expired: boolPtr(false)},
|
||||
expectedInfo: "Processing, not expired sessions:",
|
||||
},
|
||||
{
|
||||
alias: "processing and expired",
|
||||
filter: storage.UploadSessionFilter{Processing: boolPtr(true), Expired: boolPtr(true)},
|
||||
expectedInfo: "Processing, expired sessions:",
|
||||
},
|
||||
{
|
||||
alias: "with id",
|
||||
filter: storage.UploadSessionFilter{ID: strPtr("123")},
|
||||
expectedInfo: "Session with id '123':",
|
||||
},
|
||||
{
|
||||
alias: "processing, not expired and not virus infected",
|
||||
filter: storage.UploadSessionFilter{Processing: boolPtr(true), Expired: boolPtr(false), HasVirus: boolPtr(false)},
|
||||
expectedInfo: "Processing, not expired, not virusinfected sessions:",
|
||||
},
|
||||
{
|
||||
alias: "not virusinfected",
|
||||
filter: storage.UploadSessionFilter{HasVirus: boolPtr(false)},
|
||||
expectedInfo: "Not virusinfected sessions:",
|
||||
},
|
||||
{
|
||||
alias: "expired and virusinfected",
|
||||
filter: storage.UploadSessionFilter{Expired: boolPtr(true), HasVirus: boolPtr(true)},
|
||||
expectedInfo: "Expired, virusinfected sessions:",
|
||||
},
|
||||
{
|
||||
alias: "expired and not virus infected",
|
||||
filter: storage.UploadSessionFilter{Expired: boolPtr(true), HasVirus: boolPtr(false)},
|
||||
expectedInfo: "Expired, not virusinfected sessions:",
|
||||
},
|
||||
{
|
||||
alias: "processing, not expired, virus infected and with id (note: this makes no sense)",
|
||||
filter: storage.UploadSessionFilter{Processing: boolPtr(true), Expired: boolPtr(false), HasVirus: boolPtr(true), ID: strPtr("123")},
|
||||
expectedInfo: "Processing, not expired, virusinfected session with id '123':",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
alias := tc.alias
|
||||
filter := tc.filter
|
||||
expectedInfo := tc.expectedInfo
|
||||
|
||||
t.Run(alias, func(t *testing.T) {
|
||||
require.Equal(t, expectedInfo, buildInfo(filter))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func boolPtr(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
func strPtr(s string) *string {
|
||||
return &s
|
||||
}
|
||||
@@ -204,7 +204,7 @@ type FilemetadataCache struct {
|
||||
Nodes []string `yaml:"nodes" env:"OCIS_CACHE_STORE_NODES;STORAGE_USERS_FILEMETADATA_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Database string `yaml:"database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;STORAGE_USERS_FILEMETADATA_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens has no expiration. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_USERS_FILEMETADATA_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_USERS_FILEMETADATA_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_FILEMETADATA_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;STORAGE_USERS_FILEMETADATA_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;STORAGE_USERS_FILEMETADATA_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
@@ -216,7 +216,7 @@ type IDCache struct {
|
||||
Nodes []string `yaml:"nodes" env:"OCIS_CACHE_STORE_NODES;STORAGE_USERS_ID_CACHE_STORE_NODES" desc:"A list of nodes to access the configured store. This has no effect when 'memory' or 'ocmem' stores are configured. Note that the behaviour how nodes are used is dependent on the library of the configured store. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Database string `yaml:"database" env:"OCIS_CACHE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_CACHE_TTL;STORAGE_USERS_ID_CACHE_TTL" desc:"Default time to live for user info in the user info cache. Only applied when access tokens have no expiration. Defaults to 300s which is derived from the underlaying package though not explicitly set as default. See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_USERS_ID_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_CACHE_SIZE;STORAGE_USERS_ID_CACHE_SIZE" desc:"The maximum quantity of items in the user info cache. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
DisablePersistence bool `yaml:"disable_persistence" env:"OCIS_CACHE_DISABLE_PERSISTENCE;STORAGE_USERS_ID_CACHE_DISABLE_PERSISTENCE" desc:"Disables persistence of the cache. Only applies when store type 'nats-js-kv' is configured. Defaults to false." introductionVersion:"5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_CACHE_AUTH_USERNAME;STORAGE_USERS_ID_CACHE_AUTH_USERNAME" desc:"The username to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_CACHE_AUTH_PASSWORD;STORAGE_USERS_ID_CACHE_AUTH_PASSWORD" desc:"The password to authenticate with the cache store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
|
||||
@@ -41,19 +41,19 @@ Thumbnails can either be generated as `png`, `jpg` or `gif` files. These types a
|
||||
|
||||
## Thumbnail Query String Parameters
|
||||
|
||||
Clients can request thumbnail previews for files by adding `?preview=1` to the file URL. Requests for files with thumbnail availabe respond with HTTP status `404`.
|
||||
Clients can request thumbnail previews for files by adding `?preview=1` to the file URL. Requests for files with thumbnail available respond with HTTP status `404`.
|
||||
|
||||
The following query parameters are supported:
|
||||
|
||||
| Parameter | Required | Default Value | Description |
|
||||
| --------- | -------- | ---------------------------------------------------- | ------------------------------------------------------------------------------- |
|
||||
|-----------|----------|------------------------------------------------------|---------------------------------------------------------------------------------|
|
||||
| preview | YES | 1 | generates preview |
|
||||
| x | YES | first x-value configured in `THUMBNAILS_RESOLUTIONS` | horizontal target size |
|
||||
| y | YES | first y-value configured in `THUMBNAILS_RESOLUTIONS` | vertical target size |
|
||||
| scalingup | NO | 0 | prevents upscaling of small images |
|
||||
| scalingup | NO | 0 | prevents up-scaling of small images |
|
||||
| a | NO | 1 | aspect ratio |
|
||||
| c | NO | Caching string | Clients should send the etag, so they get a fresh thumbnail after a file change |
|
||||
| processor | NO | `resize` for gif's and `thumbnail` for all others | preferred thumbnail processor |
|
||||
| processor | NO | `resize` for gifs and `thumbnail` for all others | preferred thumbnail processor |
|
||||
|
||||
## Thumbnail Resolution
|
||||
|
||||
@@ -61,21 +61,21 @@ Various resolutions can be defined via `THUMBNAILS_RESOLUTIONS`. A requestor can
|
||||
|
||||
Example:
|
||||
|
||||
Requested: 18x12
|
||||
Available: 30x20, 15x10, 9x6
|
||||
Returned: 15x10
|
||||
Requested: 18x12
|
||||
Available: 30x20, 15x10, 9x6
|
||||
Returned: 15x10
|
||||
|
||||
## Thumbnail Processors
|
||||
|
||||
Normally, an image might get cropped when creating a preview, depending on the aspect ratio of the original image. This can have negative
|
||||
Normally, an image might get cropped when creating a preview, depending on the aspect ratio of the original image. This can have negative
|
||||
impacts on previews as only a part of the image will be shown. When using an _optional_ processor in the request, cropping can be avoided by defining on how the preview image generation will be done. The following processors are available:
|
||||
|
||||
* `resize` resizes the image to the specified width and height and returns the transformed image. If one of width or height is 0, the image aspect ratio is preserved.
|
||||
* `fit` scales down the image to fit the specified maximum width and height and returns the transformed image.
|
||||
* `fill`: creates an image with the specified dimensions and fills it with the scaled source image. To achieve the correct aspect ratio without stretching, the source image will be cropped.
|
||||
* `thumbnail` scales the image up or down, crops it to the specified width and hight and returns the transformed image.
|
||||
* `thumbnail` scales the image up or down, crops it to the specified width and height and returns the transformed image.
|
||||
|
||||
To apply one of those, a query parameter has to be added to the request, like `?processor=fit`. If no query parameter or processor is added, the default behaviour applies which is `resize` for gif's and `thumbnail` for all others.
|
||||
To apply one of those, a query parameter has to be added to the request, like `?processor=fit`. If no query parameter or processor is added, the default behaviour applies which is `resize` for gifs and `thumbnail` for all others.
|
||||
|
||||
## Deleting Thumbnails
|
||||
|
||||
@@ -84,3 +84,4 @@ As of now, there is no automated thumbnail deletion. This is especially true whe
|
||||
## Memory Considerations
|
||||
|
||||
Since source files need to be loaded into memory when generating thumbnails, large source files could potentially crash this service if there is insufficient memory available. For bigger instances when using container orchestration deployment methods, this service can be dedicated to its own server(s) with more memory.
|
||||
To have more control over memory (and CPU) consumption the maximum number of concurrent requests can be limited by setting the environment variable `THUMBNAILS_MAX_CONCURRENT_REQUESTS`. The default value is 0 which does not apply any restrictions to the number of concurrent requests. As soon as the number of concurrent requests is reached any further request will be responded with `429/Too Many Requests` and the client can retry at a later point in time.
|
||||
@@ -98,6 +98,7 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
http.Metrics(metrics),
|
||||
http.Namespace(cfg.HTTP.Namespace),
|
||||
http.TraceProvider(traceProvider),
|
||||
http.MaxConcurrentRequests(cfg.HTTP.MaxConcurrentRequests),
|
||||
)
|
||||
if err != nil {
|
||||
logger.Info().
|
||||
|
||||
@@ -32,9 +32,10 @@ func DefaultConfig() *config.Config {
|
||||
Namespace: "com.owncloud.api",
|
||||
},
|
||||
HTTP: config.HTTP{
|
||||
Addr: "127.0.0.1:9186",
|
||||
Root: "/thumbnails",
|
||||
Namespace: "com.owncloud.web",
|
||||
Addr: "127.0.0.1:9186",
|
||||
Root: "/thumbnails",
|
||||
Namespace: "com.owncloud.web",
|
||||
MaxConcurrentRequests: 0,
|
||||
},
|
||||
Service: config.Service{
|
||||
Name: "thumbnails",
|
||||
|
||||
@@ -4,8 +4,9 @@ import "github.com/owncloud/ocis/v2/ocis-pkg/shared"
|
||||
|
||||
// HTTP defines the available http configuration.
|
||||
type HTTP struct {
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_HTTP_ADDR" desc:"The bind address of the HTTP service." introductionVersion:"pre5.0"`
|
||||
TLS shared.HTTPServiceTLS `yaml:"tls"`
|
||||
Root string `yaml:"root" env:"THUMBNAILS_HTTP_ROOT" desc:"Subdirectory that serves as the root for this HTTP service." introductionVersion:"pre5.0"`
|
||||
Namespace string `yaml:"-"`
|
||||
Addr string `yaml:"addr" env:"THUMBNAILS_HTTP_ADDR" desc:"The bind address of the HTTP service." introductionVersion:"pre5.0"`
|
||||
TLS shared.HTTPServiceTLS `yaml:"tls"`
|
||||
Root string `yaml:"root" env:"THUMBNAILS_HTTP_ROOT" desc:"Subdirectory that serves as the root for this HTTP service." introductionVersion:"pre5.0"`
|
||||
Namespace string `yaml:"-"`
|
||||
MaxConcurrentRequests int `yaml:"max_concurrent_requests" env:"THUMBNAILS_MAX_CONCURRENT_REQUESTS" desc:"Number of maximum concurrent thumbnail requests. Default is 0 which is unlimited." introductionVersion:"6.0"`
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
"mime"
|
||||
"strings"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/kovidgoyal/imaging"
|
||||
"github.com/pkg/errors"
|
||||
"golang.org/x/image/font"
|
||||
"golang.org/x/image/font/opentype"
|
||||
|
||||
@@ -15,13 +15,14 @@ type Option func(o *Options)
|
||||
|
||||
// Options defines the available options for this package.
|
||||
type Options struct {
|
||||
Namespace string
|
||||
Logger log.Logger
|
||||
Context context.Context
|
||||
Config *config.Config
|
||||
Metrics *metrics.Metrics
|
||||
Flags []cli.Flag
|
||||
TraceProvider trace.TracerProvider
|
||||
Namespace string
|
||||
Logger log.Logger
|
||||
Context context.Context
|
||||
Config *config.Config
|
||||
Metrics *metrics.Metrics
|
||||
Flags []cli.Flag
|
||||
TraceProvider trace.TracerProvider
|
||||
MaxConcurrentRequests int
|
||||
}
|
||||
|
||||
// newOptions initializes the available default options.
|
||||
@@ -80,3 +81,10 @@ func TraceProvider(traceProvider trace.TracerProvider) Option {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MaxConcurrentRequests provides a function to set the MaxConcurrentRequests option.
|
||||
func MaxConcurrentRequests(val int) Option {
|
||||
return func(o *Options) {
|
||||
o.MaxConcurrentRequests = val
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ func Server(opts ...Option) (http.Service, error) {
|
||||
middleware.RealIP,
|
||||
middleware.RequestID,
|
||||
// ocismiddleware.Secure,
|
||||
ocismiddleware.Throttle(options.MaxConcurrentRequests),
|
||||
ocismiddleware.Version(
|
||||
options.Config.Service.Name,
|
||||
version.GetString(),
|
||||
|
||||
@@ -3,12 +3,11 @@ package svc
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
"github.com/riandyrn/otelchi"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/log"
|
||||
"github.com/owncloud/ocis/v2/ocis-pkg/tracing"
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"image/gif"
|
||||
"strings"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/kovidgoyal/imaging"
|
||||
)
|
||||
|
||||
// Generator generates a web friendly file version.
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"image"
|
||||
"strings"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/kovidgoyal/imaging"
|
||||
)
|
||||
|
||||
// Processor processes the thumbnail by applying different transformations to it.
|
||||
@@ -13,7 +13,7 @@ type Processor interface {
|
||||
Process(img image.Image, width, height int, filter imaging.ResampleFilter) *image.NRGBA
|
||||
}
|
||||
|
||||
// DefinableProcessor is the most simple processor, it holds a replaceable image converter function.
|
||||
// DefinableProcessor is the simplest processor, it holds a replaceable image converter function.
|
||||
type DefinableProcessor struct {
|
||||
Slug string
|
||||
Converter func(img image.Image, width, height int, filter imaging.ResampleFilter) *image.NRGBA
|
||||
|
||||
@@ -3,7 +3,7 @@ package thumbnail_test
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/kovidgoyal/imaging"
|
||||
tAssert "github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/owncloud/ocis/v2/services/thumbnails/pkg/thumbnail"
|
||||
|
||||
@@ -44,7 +44,7 @@ type Persistence struct {
|
||||
Database string `yaml:"database" env:"USERLOG_STORE_DATABASE" desc:"The database name the configured store should use." introductionVersion:"pre5.0"`
|
||||
Table string `yaml:"table" env:"USERLOG_STORE_TABLE" desc:"The database table the store should use." introductionVersion:"pre5.0"`
|
||||
TTL time.Duration `yaml:"ttl" env:"OCIS_PERSISTENT_STORE_TTL;USERLOG_STORE_TTL" desc:"Time to live for events in the store. Defaults to '336h' (2 weeks). See the Environment Variable Types description for more details." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_PERSISTENT_STORE_SIZE;USERLOG_STORE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not exclicitely set as default." introductionVersion:"pre5.0"`
|
||||
Size int `yaml:"size" env:"OCIS_PERSISTENT_STORE_SIZE;USERLOG_STORE_SIZE" desc:"The maximum quantity of items in the store. Only applies when store type 'ocmem' is configured. Defaults to 512 which is derived from the ocmem package though not explicitly set as default." introductionVersion:"pre5.0"`
|
||||
AuthUsername string `yaml:"username" env:"OCIS_PERSISTENT_STORE_AUTH_USERNAME;USERLOG_STORE_AUTH_USERNAME" desc:"The username to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
AuthPassword string `yaml:"password" env:"OCIS_PERSISTENT_STORE_AUTH_PASSWORD;USERLOG_STORE_AUTH_PASSWORD" desc:"The password to authenticate with the store. Only applies when store type 'nats-js-kv' is configured." introductionVersion:"5.0"`
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SHELL := bash
|
||||
NAME := web
|
||||
WEB_ASSETS_VERSION = v8.0.1
|
||||
WEB_ASSETS_VERSION = v8.0.5
|
||||
|
||||
include ../../.make/recursion.mk
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func (g Webdav) Search(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
t := r.Header.Get(TokenHeader)
|
||||
t := r.Header.Get(revactx.TokenHeader)
|
||||
ctx := revactx.ContextSetToken(r.Context(), t)
|
||||
ctx = metadata.Set(ctx, revactx.TokenHeader, t)
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
gatewayv1beta1 "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1"
|
||||
userv1beta1 "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1"
|
||||
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
|
||||
revactx "github.com/cs3org/reva/v2/pkg/ctx"
|
||||
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
|
||||
"github.com/cs3org/reva/v2/pkg/storage/utils/templates"
|
||||
"github.com/go-chi/chi/v5"
|
||||
@@ -37,10 +38,6 @@ func init() {
|
||||
chi.RegisterMethod("REPORT")
|
||||
}
|
||||
|
||||
const (
|
||||
TokenHeader = "X-Access-Token"
|
||||
)
|
||||
|
||||
var (
|
||||
codesEnum = map[int]string{
|
||||
http.StatusBadRequest: "Sabre\\DAV\\Exception\\BadRequest",
|
||||
@@ -52,8 +49,8 @@ var (
|
||||
|
||||
// Service defines the extension handlers.
|
||||
type Service interface {
|
||||
ServeHTTP(http.ResponseWriter, *http.Request)
|
||||
Thumbnail(http.ResponseWriter, *http.Request)
|
||||
ServeHTTP(w http.ResponseWriter, r *http.Request)
|
||||
Thumbnail(w http.ResponseWriter, r *http.Request)
|
||||
}
|
||||
|
||||
// NewService returns a service implementation for Service.
|
||||
@@ -235,7 +232,7 @@ func (g Webdav) SpacesThumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
renderError(w, r, errBadRequest(err.Error()))
|
||||
return
|
||||
}
|
||||
t := r.Header.Get(TokenHeader)
|
||||
t := r.Header.Get(revactx.TokenHeader)
|
||||
|
||||
fullPath := filepath.Join(tr.Identifier, tr.Filepath)
|
||||
rsp, err := g.thumbnailsClient.GetThumbnail(r.Context(), &thumbnailssvc.GetThumbnailRequest{
|
||||
@@ -284,7 +281,7 @@ func (g Webdav) Thumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
t := r.Header.Get(TokenHeader)
|
||||
t := r.Header.Get(revactx.TokenHeader)
|
||||
|
||||
gatewayClient, err := g.gatewaySelector.Next()
|
||||
if err != nil {
|
||||
@@ -312,7 +309,7 @@ func (g Webdav) Thumbnail(w http.ResponseWriter, r *http.Request) {
|
||||
user = userRes.GetUser()
|
||||
} else {
|
||||
// look up user from URL via GetUserByClaim
|
||||
ctx := grpcmetadata.AppendToOutgoingContext(r.Context(), TokenHeader, t)
|
||||
ctx := grpcmetadata.AppendToOutgoingContext(r.Context(), revactx.TokenHeader, t)
|
||||
userRes, err := gatewayClient.GetUserByClaim(ctx, &userv1beta1.GetUserByClaimRequest{
|
||||
Claim: "username",
|
||||
Value: tr.Identifier,
|
||||
@@ -475,11 +472,11 @@ func (g Webdav) sendThumbnailResponse(rsp *thumbnailssvc.GetThumbnailResponse, w
|
||||
|
||||
if dlRsp.StatusCode != http.StatusOK {
|
||||
logger.Debug().
|
||||
Str("transfer_token", rsp.TransferToken).
|
||||
Str("data_endpoint", rsp.DataEndpoint).
|
||||
Str("transfer_token", rsp.GetTransferToken()).
|
||||
Str("data_endpoint", rsp.GetDataEndpoint()).
|
||||
Str("response_status", dlRsp.Status).
|
||||
Msg("could not download thumbnail")
|
||||
renderError(w, r, errInternalError("could not download thumbnail"))
|
||||
renderError(w, r, newErrResponse(dlRsp.StatusCode, "could not download thumbnail"))
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
sonar.projectKey=owncloud_ocis
|
||||
sonar.organization=owncloud-1
|
||||
sonar.projectName=ocis
|
||||
sonar.projectVersion=5.0.1
|
||||
sonar.projectVersion=5.0.6
|
||||
sonar.host.url=https://sonarcloud.io
|
||||
|
||||
# =====================================================
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
services:
|
||||
acceptance-tests:
|
||||
image: owncloudci/php:7.4
|
||||
image: owncloudci/php:8.2
|
||||
working_dir: /drone/src
|
||||
command: /bin/bash /test/run-tests.sh
|
||||
environment:
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
## Scenarios from web tests that are expected to fail on OCIS with OCIS storage
|
||||
The expected failures in this file are from features in the owncloud/web repo.
|
||||
|
||||
Lines that contain a format like "[someSuite.someFeature.feature:n](https://github.com/owncloud/web/path/to/feature)"
|
||||
are lines that document a specific expected failure. Follow that with a URL to the line in the feature file in GitHub.
|
||||
Please follow this format for the actual expected failures.
|
||||
|
||||
Level-3 headings should be used for the references to the relevant issues. Include the issue title with a link to the issue in GitHub.
|
||||
|
||||
Other free text and Markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself.
|
||||
|
||||
Only the web scenarios tagged ocisSmokeTest are run by default in OCIS CI. This file lists the expected-failures of those ocisSmokeTest scenarios.
|
||||
@@ -1,16 +0,0 @@
|
||||
## Scenarios from web tests that are expected to fail on OCIS with OCIS storage
|
||||
|
||||
The expected failures in this file are from features in the owncloud/web repo.
|
||||
|
||||
Lines that contain a format like "[someSuite.someFeature.feature:n](https://github.com/owncloud/web/path/to/feature)"
|
||||
are lines that document a specific expected failure. Follow that with a URL to the line in the feature file in GitHub.
|
||||
Please follow this format for the actual expected failures.
|
||||
|
||||
Level-3 headings should be used for the references to the relevant issues. Include the issue title with a link to the issue in GitHub.
|
||||
|
||||
Other free text and Markdown formatting can be used elsewhere in the document if needed. But if you want to explain something about the issue, then please post that in the issue itself.
|
||||
|
||||
### [Exit page re-appears in loop when logged in user is deleted](https://github.com/owncloud/web/issues/4677)
|
||||
|
||||
- [webUILogin/openidLogin.feature:50](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L50)
|
||||
- [webUILogin/openidLogin.feature:60](https://github.com/owncloud/web/blob/master/tests/acceptance/features/webUILogin/openidLogin.feature#L60)
|
||||
@@ -2690,7 +2690,7 @@ trait Sharing {
|
||||
$expectedElementsArray['path'],
|
||||
(string) $elementResponded->path[0],
|
||||
__METHOD__
|
||||
. " Expected '${expectedElementsArray['path']}' but got '"
|
||||
. " Expected '{$expectedElementsArray['path']}' but got '"
|
||||
. $elementResponded->path[0]
|
||||
. "'"
|
||||
);
|
||||
@@ -2698,7 +2698,7 @@ trait Sharing {
|
||||
$expectedElementsArray['permissions'],
|
||||
(string) $elementResponded->permissions[0],
|
||||
__METHOD__
|
||||
. " Expected '${expectedElementsArray['permissions']}' but got '"
|
||||
. " Expected '{$expectedElementsArray['permissions']}' but got '"
|
||||
. $elementResponded->permissions[0]
|
||||
. "'"
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"config" : {
|
||||
"platform": {
|
||||
"php": "7.4"
|
||||
"php": "8.2"
|
||||
},
|
||||
"allow-plugins": {
|
||||
"composer/package-versions-deprecated": true
|
||||
|
||||
+11
-3
@@ -261,7 +261,7 @@ func checkIfNestedResource(ctx context.Context, ref *provider.Reference, parent
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if statResponse.Status.Code != rpc.Code_CODE_OK {
|
||||
if statResponse.GetStatus().GetCode() != rpc.Code_CODE_OK {
|
||||
return false, statuspkg.NewErrorFromCode(statResponse.Status.Code, "auth interceptor")
|
||||
}
|
||||
|
||||
@@ -313,14 +313,22 @@ func checkIfNestedResource(ctx context.Context, ref *provider.Reference, parent
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if childStat.Status.Code != rpc.Code_CODE_OK {
|
||||
if childStat.GetStatus().GetCode() == rpc.Code_CODE_NOT_FOUND && ref.GetPath() != "" && ref.GetPath() != "." {
|
||||
// The resource does not seem to exist (yet?). We might be part of an initiate upload request.
|
||||
// Stat the parent to get its path and check that against the root path.
|
||||
childStat, err = client.Stat(ctx, &provider.StatRequest{Ref: &provider.Reference{ResourceId: ref.GetResourceId()}})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
}
|
||||
if childStat.GetStatus().GetCode() != rpc.Code_CODE_OK {
|
||||
return false, statuspkg.NewErrorFromCode(childStat.Status.Code, "auth interceptor")
|
||||
}
|
||||
pathResp, err = client.GetPath(ctx, &provider.GetPathRequest{ResourceId: childStat.GetInfo().GetId()})
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if pathResp.Status.Code != rpc.Code_CODE_OK {
|
||||
if pathResp.GetStatus().GetCode() != rpc.Code_CODE_OK {
|
||||
return false, statuspkg.NewErrorFromCode(pathResp.Status.Code, "auth interceptor")
|
||||
}
|
||||
childPath = pathResp.Path
|
||||
|
||||
+9
-3
@@ -319,9 +319,15 @@ func (s *svc) handleTusPost(ctx context.Context, w http.ResponseWriter, r *http.
|
||||
w.Header().Set(net.HeaderOCMtime, httpRes.Header.Get(net.HeaderOCMtime))
|
||||
}
|
||||
|
||||
if resid, err := storagespace.ParseID(httpRes.Header.Get(net.HeaderOCFileID)); err == nil {
|
||||
sReq.Ref = &provider.Reference{
|
||||
ResourceId: &resid,
|
||||
if strings.HasPrefix(uReq.GetRef().GetPath(), "/public") && uReq.GetRef().GetResourceId() == nil {
|
||||
// Use the path based request for the public link
|
||||
sReq.Ref.Path = uReq.Ref.GetPath()
|
||||
sReq.Ref.ResourceId = nil
|
||||
} else {
|
||||
if resid, err := storagespace.ParseID(httpRes.Header.Get(net.HeaderOCFileID)); err == nil {
|
||||
sReq.Ref = &provider.Reference{
|
||||
ResourceId: &resid,
|
||||
}
|
||||
}
|
||||
}
|
||||
finishUpload = httpRes.Header.Get(net.HeaderUploadOffset) == r.Header.Get(net.HeaderUploadLength)
|
||||
|
||||
Generated
Vendored
-2
@@ -33,8 +33,6 @@ import (
|
||||
"github.com/jellydator/ttlcache/v2"
|
||||
)
|
||||
|
||||
//go:generate make --no-print-directory -C ../../../.. mockery NAME=UserConverter
|
||||
|
||||
// DBShare stores information about user and public shares.
|
||||
type DBShare struct {
|
||||
ID string
|
||||
|
||||
-2
@@ -37,8 +37,6 @@ import (
|
||||
"github.com/jellydator/ttlcache/v2"
|
||||
)
|
||||
|
||||
//go:generate make --no-print-directory -C ../../../.. mockery NAME=UserConverter
|
||||
|
||||
// DBShare stores information about user and public shares.
|
||||
type DBShare struct {
|
||||
ID string
|
||||
|
||||
-2
@@ -36,8 +36,6 @@ const (
|
||||
NoState collaboration.ShareState = -1
|
||||
)
|
||||
|
||||
//go:generate make --no-print-directory -C ../.. mockery NAME=Manager
|
||||
|
||||
// Metadata contains Metadata for a share
|
||||
type Metadata struct {
|
||||
ETag string
|
||||
|
||||
-2
@@ -54,8 +54,6 @@ func init() {
|
||||
tracer = otel.Tracer("github.com/cs3org/reva/pkg/storage/utils/decomposedfs/tree")
|
||||
}
|
||||
|
||||
//go:generate make --no-print-directory -C ../../../../.. mockery NAME=Blobstore
|
||||
|
||||
// Blobstore defines an interface for storing blobs in a blobstore
|
||||
type Blobstore interface {
|
||||
Upload(node *node.Node, source string) error
|
||||
|
||||
Loaded 100 of 263 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user