mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-24 14:50:39 -05:00
Compare commits
1 Commits
runTestInC
...
fixTransla
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
903346a712 |
3
.drone.env
Normal file
3
.drone.env
Normal file
@@ -0,0 +1,3 @@
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=8222156ec19d5a201ba3eb9293c1cd4516329400
|
||||
WEB_BRANCH=stable-11.0
|
||||
@@ -5,6 +5,7 @@ linters:
|
||||
disable:
|
||||
- contextcheck # FIXME: causes panic in graph service
|
||||
- lll # 760 issues in the codebase
|
||||
- exhaustivestruct
|
||||
- exhaustruct
|
||||
- exhaustive # 634 issues in the codebase
|
||||
- wrapcheck # 398 issues in the codebase
|
||||
@@ -15,12 +16,14 @@ linters:
|
||||
- forbidigo
|
||||
- gochecknoglobals
|
||||
- nlreturn
|
||||
- nosnakecase # each 100-200 issues in codebase
|
||||
- gci
|
||||
- godot
|
||||
- funlen
|
||||
- gomnd
|
||||
- gofumpt
|
||||
- ireturn
|
||||
- err113
|
||||
- goerr113
|
||||
- containedctx
|
||||
- paralleltest
|
||||
- gocritic # each 50-100 issues in codebase
|
||||
@@ -28,6 +31,8 @@ linters:
|
||||
- cyclop
|
||||
- noctx
|
||||
- testpackage
|
||||
- maligned
|
||||
- golint
|
||||
- forcetypeassert
|
||||
- nonamedreturns
|
||||
- dupl
|
||||
|
||||
12
.make/go.mk
12
.make/go.mk
@@ -67,6 +67,18 @@ fmt:
|
||||
@echo "- $(NAME): fmt"
|
||||
gofmt -s -w $(SOURCES)
|
||||
|
||||
.PHONY: golangci-lint-fix
|
||||
golangci-lint-fix: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run $(LINTERS) --fix
|
||||
|
||||
.PHONY: golangci-lint
|
||||
golangci-lint: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run --path-prefix services/$(NAME)
|
||||
|
||||
.PHONY: ci-golangci-lint
|
||||
ci-golangci-lint: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run --path-prefix services/$(NAME) --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@go test -v -tags '$(TAGS)' -coverprofile coverage.out ./...
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
# The test runner source for UI tests
|
||||
WEB_COMMITID=74c8df4f64d9bf957a0652fb92e01529efa3c0b3
|
||||
WEB_BRANCH=main
|
||||
419
.woodpecker.star
419
.woodpecker.star
@@ -5,7 +5,7 @@
|
||||
# NOTE: need to be updated if new production releases are determined
|
||||
# - follow semver
|
||||
# - omit 'v' prefix
|
||||
PRODUCTION_RELEASE_TAGS = ["2.0", "3.0"]
|
||||
PRODUCTION_RELEASE_TAGS = ["5.0", "7"]
|
||||
|
||||
# Repository
|
||||
|
||||
@@ -33,11 +33,10 @@ OC_LITMUS = "owncloudci/litmus:latest"
|
||||
OC_UBUNTU = "owncloud/ubuntu:20.04"
|
||||
ONLYOFFICE_DOCUMENT_SERVER = "onlyoffice/documentserver:7.5.1"
|
||||
PLUGINS_CODACY = "plugins/codacy:1"
|
||||
PLUGINS_DOCKER_BUILDX = "woodpeckerci/plugin-docker-buildx:latest"
|
||||
PLUGINS_DOCKER = "plugins/docker:latest"
|
||||
PLUGINS_GH_PAGES = "plugins/gh-pages:1"
|
||||
PLUGINS_GITHUB_RELEASE = "plugins/github-release:1"
|
||||
PLUGINS_GIT_ACTION = "plugins/git-action:1"
|
||||
PLUGINS_GIT_PUSH = "appleboy/drone-git-push"
|
||||
PLUGINS_MANIFEST = "plugins/manifest:1"
|
||||
PLUGINS_S3 = "plugins/s3:1"
|
||||
PLUGINS_S3_CACHE = "plugins/s3-cache:1"
|
||||
@@ -99,13 +98,13 @@ config = {
|
||||
"apiLocks",
|
||||
"apiActivities",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"settings": {
|
||||
"suites": [
|
||||
"apiSettings",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
"emailNeeded": True,
|
||||
"extraEnvironment": {
|
||||
@@ -113,7 +112,7 @@ config = {
|
||||
"EMAIL_PORT": "9000",
|
||||
},
|
||||
"extraServerEnvironment": {
|
||||
"OC_ADD_RUN_SERVICES": "notifications",
|
||||
"OCIS_ADD_RUN_SERVICES": "notifications",
|
||||
"NOTIFICATIONS_SMTP_HOST": "email",
|
||||
"NOTIFICATIONS_SMTP_PORT": "2500",
|
||||
"NOTIFICATIONS_SMTP_INSECURE": True,
|
||||
@@ -126,27 +125,27 @@ config = {
|
||||
"apiGraph",
|
||||
"apiServiceAvailability",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
},
|
||||
"graphUserGroup": {
|
||||
"suites": [
|
||||
"apiGraphUserGroup",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
},
|
||||
"spaces": {
|
||||
"suites": [
|
||||
"apiSpaces",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"spacesShares": {
|
||||
"suites": [
|
||||
"apiSpacesShares",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"spacesDavOperation": {
|
||||
"suites": [
|
||||
@@ -158,13 +157,13 @@ config = {
|
||||
"suites": [
|
||||
"apiSearch1",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"search2": {
|
||||
"suites": [
|
||||
"apiSearch2",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"sharingNg": {
|
||||
"suites": [
|
||||
@@ -172,23 +171,23 @@ config = {
|
||||
"apiSharingNg1",
|
||||
"apiSharingNg2",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"sharingNgShareInvitation": {
|
||||
"suites": [
|
||||
"apiSharingNgShareInvitation",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"sharingNgLinkShare": {
|
||||
"suites": [
|
||||
"apiSharingNgLinkSharePermission",
|
||||
"apiSharingNgLinkShareRoot",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
},
|
||||
"accountsHashDifficulty": {
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"suites": [
|
||||
"apiAccountsHashDifficulty",
|
||||
],
|
||||
@@ -198,7 +197,7 @@ config = {
|
||||
"suites": [
|
||||
"apiNotification",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
"emailNeeded": True,
|
||||
"extraEnvironment": {
|
||||
@@ -206,7 +205,7 @@ config = {
|
||||
"EMAIL_PORT": "9000",
|
||||
},
|
||||
"extraServerEnvironment": {
|
||||
"OC_ADD_RUN_SERVICES": "notifications",
|
||||
"OCIS_ADD_RUN_SERVICES": "notifications",
|
||||
"NOTIFICATIONS_SMTP_HOST": "email",
|
||||
"NOTIFICATIONS_SMTP_PORT": "2500",
|
||||
"NOTIFICATIONS_SMTP_INSECURE": True,
|
||||
@@ -218,14 +217,14 @@ config = {
|
||||
"suites": [
|
||||
"apiAntivirus",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"antivirusNeeded": True,
|
||||
"extraServerEnvironment": {
|
||||
"ANTIVIRUS_SCANNER_TYPE": "clamav",
|
||||
"ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310",
|
||||
"POSTPROCESSING_STEPS": "virusscan",
|
||||
"OC_ASYNC_UPLOADS": True,
|
||||
"OC_ADD_RUN_SERVICES": "antivirus",
|
||||
"OCIS_ASYNC_UPLOADS": True,
|
||||
"OCIS_ADD_RUN_SERVICES": "antivirus",
|
||||
"ANTIVIRUS_DEBUG_ADDR": "0.0.0.0:9297",
|
||||
},
|
||||
},
|
||||
@@ -233,14 +232,14 @@ config = {
|
||||
"suites": [
|
||||
"apiSearchContent",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"tikaNeeded": True,
|
||||
},
|
||||
"ocm": {
|
||||
"suites": [
|
||||
"apiOcm",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
"federationServer": True,
|
||||
"emailNeeded": True,
|
||||
@@ -249,8 +248,8 @@ config = {
|
||||
"EMAIL_PORT": "9000",
|
||||
},
|
||||
"extraServerEnvironment": {
|
||||
"OC_ADD_RUN_SERVICES": "ocm,notifications",
|
||||
"OC_ENABLE_OCM": True,
|
||||
"OCIS_ADD_RUN_SERVICES": "ocm,notifications",
|
||||
"OCIS_ENABLE_OCM": True,
|
||||
"OCM_OCM_INVITE_MANAGER_INSECURE": True,
|
||||
"OCM_OCM_SHARE_PROVIDER_INSECURE": True,
|
||||
"OCM_OCM_STORAGE_PROVIDER_INSECURE": True,
|
||||
@@ -276,10 +275,10 @@ config = {
|
||||
"suites": [
|
||||
"apiAuthApp",
|
||||
],
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"withRemotePhp": [True],
|
||||
"extraServerEnvironment": {
|
||||
"OC_ADD_RUN_SERVICES": "auth-app",
|
||||
"OCIS_ADD_RUN_SERVICES": "auth-app",
|
||||
"PROXY_ENABLE_APP_AUTH": True,
|
||||
},
|
||||
},
|
||||
@@ -293,8 +292,8 @@ config = {
|
||||
"extraServerEnvironment": {
|
||||
"ANTIVIRUS_SCANNER_TYPE": "clamav",
|
||||
"ANTIVIRUS_CLAMAV_SOCKET": "tcp://clamav:3310",
|
||||
"OC_ASYNC_UPLOADS": True,
|
||||
"OC_ADD_RUN_SERVICES": "antivirus",
|
||||
"OCIS_ASYNC_UPLOADS": True,
|
||||
"OCIS_ADD_RUN_SERVICES": "antivirus",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -305,9 +304,9 @@ config = {
|
||||
},
|
||||
"e2eTests": {
|
||||
"part": {
|
||||
"skip": False,
|
||||
"skip": True,
|
||||
"totalParts": 4, # divide and run all suites in parts (divide pipelines)
|
||||
"xsuites": ["search", "app-provider", "app-provider-onlyOffice", "app-store", "keycloak", "oidc", "ocm"], # suites to skip
|
||||
"xsuites": ["search", "app-provider", "oidc", "ocm"], # suites to skip
|
||||
},
|
||||
"search": {
|
||||
"skip": True,
|
||||
@@ -419,14 +418,8 @@ def main(ctx):
|
||||
|
||||
build_release_helpers = \
|
||||
changelog() + \
|
||||
docs()
|
||||
|
||||
build_release_helpers.append(
|
||||
pipelineDependsOn(
|
||||
licenseCheck(ctx),
|
||||
getGoBinForTesting(ctx),
|
||||
),
|
||||
)
|
||||
docs() + \
|
||||
licenseCheck(ctx)
|
||||
|
||||
test_pipelines = \
|
||||
codestyle(ctx) + \
|
||||
@@ -440,9 +433,10 @@ def main(ctx):
|
||||
testOpencloudAndUploadResults(ctx) + \
|
||||
testPipelines(ctx)
|
||||
|
||||
build_release_pipelines = \
|
||||
dockerReleases(ctx) + \
|
||||
binaryReleases(ctx)
|
||||
# build_release_pipelines = \
|
||||
# dockerReleases(ctx) + \
|
||||
# binaryReleases(ctx)
|
||||
build_release_pipelines = binaryReleases(ctx)
|
||||
|
||||
test_pipelines.append(
|
||||
pipelineDependsOn(
|
||||
@@ -886,16 +880,12 @@ def localApiTestPipeline(ctx):
|
||||
if ctx.build.event == "cron" or "full-ci" in ctx.build.title.lower():
|
||||
with_remote_php.append(False)
|
||||
|
||||
storages = ["decomposed"]
|
||||
if "posix" in ctx.build.title.lower():
|
||||
storages = ["posix"]
|
||||
|
||||
defaults = {
|
||||
"suites": {},
|
||||
"skip": False,
|
||||
"extraEnvironment": {},
|
||||
"extraServerEnvironment": {},
|
||||
"storages": storages,
|
||||
"storages": ["decomposed"],
|
||||
"accounts_hash_difficulty": 4,
|
||||
"emailNeeded": False,
|
||||
"antivirusNeeded": False,
|
||||
@@ -949,11 +939,12 @@ def localApiTestPipeline(ctx):
|
||||
|
||||
def localApiTests(ctx, name, suites, storage = "decomposed", extra_environment = {}, with_remote_php = False):
|
||||
test_dir = "%s/tests/acceptance" % dirs["base"]
|
||||
expected_failures_file = "%s/expected-failures-localAPI-on-decomposed-storage.md" % (test_dir)
|
||||
expected_failures_file = "%s/expected-failures-localAPI-on-%s-storage.md" % (test_dir, storage)
|
||||
|
||||
environment = {
|
||||
"TEST_SERVER_URL": OC_URL,
|
||||
"TEST_SERVER_FED_URL": OC_FED_URL,
|
||||
"OCIS_REVA_DATA_ROOT": "%s" % (dirs["ocisRevaDataRoot"] if storage == "owncloud" else ""),
|
||||
"SEND_SCENARIO_LINE_REFERENCES": True,
|
||||
"STORAGE_DRIVER": storage,
|
||||
"BEHAT_SUITES": ",".join(suites),
|
||||
@@ -1126,10 +1117,10 @@ def wopiValidatorTests(ctx, storage, wopiServerType, accounts_hash_difficulty =
|
||||
],
|
||||
}
|
||||
|
||||
def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = False, storage = "posix", accounts_hash_difficulty = 4):
|
||||
def coreApiTests(ctx, part_number = 1, number_of_parts = 1, with_remote_php = False, storage = "ocis", accounts_hash_difficulty = 4):
|
||||
filterTags = "~@skipOnGraph&&~@skipOnOcis-%s-Storage" % ("OC" if storage == "owncloud" else "OCIS")
|
||||
test_dir = "%s/tests/acceptance" % dirs["base"]
|
||||
expected_failures_file = "%s/expected-failures-API-on-decomposed-storage.md" % (test_dir)
|
||||
expected_failures_file = "%s/expected-failures-API-on-%s-storage.md" % (test_dir, storage.upper())
|
||||
|
||||
return {
|
||||
"name": "Core-API-Tests-%s%s" % (part_number, "-withoutRemotePhp" if not with_remote_php else ""),
|
||||
@@ -1190,13 +1181,10 @@ def apiTests(ctx):
|
||||
"withRemotePhp": with_remote_php,
|
||||
}
|
||||
|
||||
if "posix" in ctx.build.title.lower():
|
||||
storage = "posix"
|
||||
|
||||
for runPart in range(1, config["apiTests"]["numberOfParts"] + 1):
|
||||
for run_with_remote_php in defaults["withRemotePhp"]:
|
||||
if (not debugPartsEnabled or (debugPartsEnabled and runPart in debugParts)):
|
||||
pipelines.append(coreApiTests(ctx, runPart, config["apiTests"]["numberOfParts"], run_with_remote_php, storage))
|
||||
pipelines.append(coreApiTests(ctx, runPart, config["apiTests"]["numberOfParts"], run_with_remote_php))
|
||||
|
||||
return pipelines
|
||||
|
||||
@@ -1210,11 +1198,7 @@ def e2eTestPipeline(ctx):
|
||||
}
|
||||
|
||||
extra_server_environment = {
|
||||
"OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST": "%s" % dirs["bannedPasswordList"],
|
||||
"OC_SHOW_USER_EMAIL_IN_RESULTS": True,
|
||||
"FRONTEND_OCS_ENABLE_DENIALS": True,
|
||||
# Needed for enabling all roles
|
||||
"GRAPH_AVAILABLE_ROLES": "b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5,a8d5fe5e-96e3-418d-825b-534dbdf22b99,fb6c3e19-e378-47e5-b277-9732f9de6e21,58c63c02-1d89-4572-916a-870abc5a1b7d,2d00ce52-1fc2-4dbc-8b95-a73b73395f5a,1c996275-f1c9-4e71-abdf-a42f6495e960,312c0871-5ef7-4b3a-85b6-0e4074c64049,aa97fe03-7980-45ac-9e50-b325749fd7e6,63e64e19-8d43-42ec-a738-2b6af2610efa",
|
||||
"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST": "%s" % dirs["bannedPasswordList"],
|
||||
}
|
||||
|
||||
e2e_trigger = [
|
||||
@@ -1271,7 +1255,7 @@ def e2eTestPipeline(ctx):
|
||||
"name": "e2e-tests",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"environment": {
|
||||
"OC_BASE_URL": OC_DOMAIN,
|
||||
"BASE_URL_OCIS": OC_DOMAIN,
|
||||
"HEADLESS": True,
|
||||
"RETRY": "1",
|
||||
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["opencloudConfig"]),
|
||||
@@ -1283,8 +1267,7 @@ def e2eTestPipeline(ctx):
|
||||
}
|
||||
|
||||
# steps_after = uploadTracingResult(ctx) + \
|
||||
# steps_after = logTracingResults()
|
||||
steps_after = []
|
||||
steps_after = logTracingResults()
|
||||
|
||||
if params["totalParts"]:
|
||||
for index in range(params["totalParts"]):
|
||||
@@ -1344,10 +1327,6 @@ def multiServiceE2ePipeline(ctx):
|
||||
if (not "full-ci" in ctx.build.title.lower() and ctx.build.event != "cron"):
|
||||
return pipelines
|
||||
|
||||
storage = "decomposed"
|
||||
if "posix" in ctx.build.title.lower():
|
||||
storage = "posix"
|
||||
|
||||
extra_server_environment = {
|
||||
"OCIS_PASSWORD_POLICY_BANNED_PASSWORDS_LIST": "%s" % dirs["bannedPasswordList"],
|
||||
"OCIS_JWT_SECRET": "some-ocis-jwt-secret",
|
||||
@@ -1419,7 +1398,7 @@ def multiServiceE2ePipeline(ctx):
|
||||
restoreWebCache() + \
|
||||
restoreWebPnpmCache() + \
|
||||
tikaService() + \
|
||||
opencloudServer(storage, extra_server_environment = extra_server_environment, tika_enabled = params["tikaNeeded"]) + \
|
||||
opencloudServer(extra_server_environment = extra_server_environment, tika_enabled = params["tikaNeeded"]) + \
|
||||
storage_users_services + \
|
||||
[{
|
||||
"name": "e2e-tests",
|
||||
@@ -1522,13 +1501,14 @@ def dockerReleases(ctx):
|
||||
if ctx.build.event == "tag":
|
||||
build_type = "rolling" if "rolling" in repo else "production"
|
||||
|
||||
repo_pipelines.append(dockerRelease(ctx, repo, build_type))
|
||||
for arch in config["dockerReleases"]["architectures"]:
|
||||
repo_pipelines.append(dockerRelease(ctx, arch, repo, build_type))
|
||||
|
||||
# manifest = releaseDockerManifest(ctx, repo, build_type)
|
||||
# manifest["depends_on"] = getPipelineNames(repo_pipelines)
|
||||
# repo_pipelines.append(manifest)
|
||||
manifest = releaseDockerManifest(ctx, repo, build_type)
|
||||
manifest["depends_on"] = getPipelineNames(repo_pipelines)
|
||||
repo_pipelines.append(manifest)
|
||||
|
||||
readme = releaseDockerReadme(repo, build_type)
|
||||
readme = releaseDockerReadme(ctx, repo, build_type)
|
||||
readme["depends_on"] = getPipelineNames(repo_pipelines)
|
||||
repo_pipelines.append(readme)
|
||||
|
||||
@@ -1536,71 +1516,66 @@ def dockerReleases(ctx):
|
||||
|
||||
return pipelines
|
||||
|
||||
def dockerRelease(ctx, repo, build_type):
|
||||
def dockerRelease(ctx, arch, repo, build_type):
|
||||
build_args = [
|
||||
"REVISION=%s" % (ctx.build.commit),
|
||||
"VERSION=%s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "daily"),
|
||||
"VERSION=%s" % (ctx.build.ref.replace("refs/tags/", "") if ctx.build.event == "tag" else "master"),
|
||||
]
|
||||
|
||||
depends_on = getPipelineNames(getGoBinForTesting(ctx))
|
||||
depends_on = getPipelineNames(testOpencloudAndUploadResults(ctx) + testPipelines(ctx))
|
||||
|
||||
if ctx.build.event == "tag":
|
||||
depends_on = []
|
||||
|
||||
return {
|
||||
"name": "container-build-%s" % build_type,
|
||||
"name": "docker-%s-%s" % (arch, build_type),
|
||||
"labels": {
|
||||
"platform": "linux/%s" % arch,
|
||||
},
|
||||
"steps": makeNodeGenerate("") +
|
||||
makeGoGenerate("") + [
|
||||
{
|
||||
"name": "dryrun",
|
||||
"image": PLUGINS_DOCKER_BUILDX,
|
||||
"settings": {
|
||||
"dry_run": True,
|
||||
"platforms": "linux/amd64,linux/arm64",
|
||||
"repo": "%s,quay.io/%s" % (repo, repo),
|
||||
"auto_tag": False if build_type == "daily" else True,
|
||||
"tag": "daily" if build_type == "daily" else "",
|
||||
"default_tag": "daily",
|
||||
"dockerfile": "opencloud/docker/Dockerfile.multiarch",
|
||||
"build_args": build_args,
|
||||
},
|
||||
"when": [
|
||||
{
|
||||
"event": ["pull_request"],
|
||||
},
|
||||
"name": "build",
|
||||
"image": OC_CI_GOLANG,
|
||||
"environment": CI_HTTP_PROXY_ENV,
|
||||
"commands": [
|
||||
"make -C opencloud release-linux-docker-%s ENABLE_VIPS=true" % (arch),
|
||||
],
|
||||
},
|
||||
{
|
||||
"name": "build-and-push",
|
||||
"image": PLUGINS_DOCKER_BUILDX,
|
||||
"name": "dryrun",
|
||||
"image": PLUGINS_DOCKER,
|
||||
"settings": {
|
||||
"repo": "%s,quay.io/%s" % (repo, repo),
|
||||
"platforms": "linux/amd64,linux/arm64",
|
||||
"auto_tag": False if build_type == "daily" else True,
|
||||
"tag": "daily" if build_type == "daily" else "",
|
||||
"default_tag": "daily",
|
||||
"dockerfile": "opencloud/docker/Dockerfile.multiarch",
|
||||
"dry_run": True,
|
||||
"context": "ocis",
|
||||
"tags": "linux-%s" % (arch),
|
||||
"dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch),
|
||||
"repo": repo,
|
||||
"build_args": build_args,
|
||||
},
|
||||
"when": {
|
||||
"ref": {
|
||||
"include": [
|
||||
"refs/pull/**",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "docker",
|
||||
"image": PLUGINS_DOCKER,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"auto_tag": True,
|
||||
"context": "ocis",
|
||||
"auto_tag_suffix": "linux-%s" % (arch),
|
||||
"dockerfile": "ocis/docker/Dockerfile.linux.%s" % (arch),
|
||||
"repo": repo,
|
||||
"build_args": build_args,
|
||||
"logins": [
|
||||
{
|
||||
"registry": "https://index.docker.io/v1/",
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
},
|
||||
{
|
||||
"registry": "https://quay.io",
|
||||
"username": {
|
||||
"from_secret": "quay_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "quay_password",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
"when": [
|
||||
{
|
||||
@@ -1633,16 +1608,57 @@ def dockerRelease(ctx, repo, build_type):
|
||||
|
||||
def binaryReleases(ctx):
|
||||
pipelines = []
|
||||
targets = []
|
||||
build_type = "daily"
|
||||
|
||||
# uploads binary to https://download.owncloud.com/ocis/ocis/daily/
|
||||
target = "/ocis/%s/daily" % (ctx.repo.name.replace("ocis-", ""))
|
||||
depends_on = getPipelineNames(testOpencloudAndUploadResults(ctx) + testPipelines(ctx))
|
||||
|
||||
for os in config["binaryReleases"]["os"]:
|
||||
pipelines.append(binaryRelease(ctx, os, depends_on))
|
||||
if ctx.build.event == "tag":
|
||||
depends_on = []
|
||||
|
||||
buildref = ctx.build.ref.replace("refs/tags/v", "").lower()
|
||||
target_path = "/ocis/%s" % ctx.repo.name.replace("ocis-", "")
|
||||
|
||||
if buildref.find("-") != -1: # "x.x.x-alpha", "x.x.x-beta", "x.x.x-rc"
|
||||
folder = "testing"
|
||||
target = "%s/%s/%s" % (target_path, folder, buildref)
|
||||
targets.append(target)
|
||||
build_type = "testing"
|
||||
else:
|
||||
# uploads binary to eg. https://download.owncloud.com/ocis/ocis/rolling/1.0.0/
|
||||
folder = "rolling"
|
||||
target = "%s/%s/%s" % (target_path, folder, buildref)
|
||||
targets.append(target)
|
||||
|
||||
for prod_tag in PRODUCTION_RELEASE_TAGS:
|
||||
if buildref.startswith(prod_tag):
|
||||
# uploads binary to eg. https://download.owncloud.com/ocis/ocis/stable/2.0.0/
|
||||
folder = "stable"
|
||||
target = "%s/%s/%s" % (target_path, folder, buildref)
|
||||
targets.append(target)
|
||||
break
|
||||
|
||||
else:
|
||||
targets.append(target)
|
||||
|
||||
for target in targets:
|
||||
if "rolling" in target:
|
||||
build_type = "rolling"
|
||||
elif "stable" in target:
|
||||
build_type = "production"
|
||||
elif "testing" in target:
|
||||
build_type = "testing"
|
||||
|
||||
for os in config["binaryReleases"]["os"]:
|
||||
pipelines.append(binaryRelease(ctx, os, build_type, target, depends_on))
|
||||
|
||||
return pipelines
|
||||
|
||||
def binaryRelease(ctx, arch, depends_on = []):
|
||||
def binaryRelease(ctx, arch, build_type, target, depends_on = []):
|
||||
return {
|
||||
"name": "binaries-%s" % arch,
|
||||
"name": "binaries-%s-%s" % (arch, build_type),
|
||||
"steps": makeNodeGenerate("") +
|
||||
makeGoGenerate("") + [
|
||||
{
|
||||
@@ -1650,7 +1666,7 @@ def binaryRelease(ctx, arch, depends_on = []):
|
||||
"image": OC_CI_GOLANG,
|
||||
"environment": CI_HTTP_PROXY_ENV,
|
||||
"commands": [
|
||||
"make -C opencloud release-%s" % arch,
|
||||
"make -C opencloud release-%s" % (arch),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -1659,6 +1675,7 @@ def binaryRelease(ctx, arch, depends_on = []):
|
||||
"environment": CI_HTTP_PROXY_ENV,
|
||||
"commands": [
|
||||
"make -C opencloud release-finish",
|
||||
"cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/",
|
||||
],
|
||||
"when": [
|
||||
{
|
||||
@@ -1724,9 +1741,20 @@ def binaryRelease(ctx, arch, depends_on = []):
|
||||
}
|
||||
|
||||
def licenseCheck(ctx):
|
||||
return {
|
||||
# uploads third-party-licenses to https://download.owncloud.com/ocis/ocis/daily/
|
||||
target = "/ocis/%s/daily" % (ctx.repo.name.replace("ocis-", ""))
|
||||
if ctx.build.event == "tag":
|
||||
# uploads third-party-licenses to eg. https://download.owncloud.com/ocis/ocis/1.0.0-beta9/
|
||||
folder = "stable"
|
||||
buildref = ctx.build.ref.replace("refs/tags/v", "")
|
||||
buildref = buildref.lower()
|
||||
if buildref.find("-") != -1: # "x.x.x-alpha", "x.x.x-beta", "x.x.x-rc"
|
||||
folder = "testing"
|
||||
target = "/ocis/%s/%s/%s" % (ctx.repo.name.replace("ocis-", ""), folder, buildref)
|
||||
|
||||
return [{
|
||||
"name": "check-licenses",
|
||||
"steps": restoreGoBinCache() + [
|
||||
"steps": [
|
||||
{
|
||||
"name": "node-check-licenses",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
@@ -1812,6 +1840,68 @@ def licenseCheck(ctx):
|
||||
},
|
||||
],
|
||||
"workspace": workspace,
|
||||
}]
|
||||
|
||||
def releaseDockerManifest(ctx, repo, build_type):
|
||||
spec = "manifest.tmpl"
|
||||
spec_latest = "manifest-latest.tmpl"
|
||||
if "rolling" not in repo:
|
||||
spec = "manifest.production.tmpl"
|
||||
spec_latest = "manifest.production-latest.tmpl"
|
||||
|
||||
steps = [
|
||||
{
|
||||
"name": "execute",
|
||||
"image": PLUGINS_MANIFEST,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"spec": "ocis/docker/%s" % spec,
|
||||
"auto_tag": True if ctx.build.event == "tag" else False,
|
||||
"ignore_missing": True,
|
||||
},
|
||||
},
|
||||
]
|
||||
if len(ctx.build.ref.split("-")) == 1:
|
||||
steps.append(
|
||||
{
|
||||
"name": "execute-latest",
|
||||
"image": PLUGINS_MANIFEST,
|
||||
"settings": {
|
||||
"username": {
|
||||
"from_secret": "docker_username",
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"spec": "ocis/docker/%s" % spec_latest,
|
||||
"auto_tag": True,
|
||||
"ignore_missing": True,
|
||||
},
|
||||
"when": [
|
||||
{
|
||||
"event": "tag",
|
||||
},
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
return {
|
||||
"name": "manifest-%s" % build_type,
|
||||
"steps": steps,
|
||||
"when": [
|
||||
{
|
||||
"event": ["push", "manual"],
|
||||
"branch": "main",
|
||||
},
|
||||
{
|
||||
"event": "tag",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
def changelog():
|
||||
@@ -1842,18 +1932,23 @@ def changelog():
|
||||
},
|
||||
{
|
||||
"name": "publish",
|
||||
"image": PLUGINS_GIT_PUSH,
|
||||
"image": PLUGINS_GIT_ACTION,
|
||||
"settings": {
|
||||
"actions": [
|
||||
"commit",
|
||||
"push",
|
||||
],
|
||||
"message": "Automated changelog update [skip ci]",
|
||||
"branch": "main",
|
||||
"remote": "ssh://git@github.com/%s.git" % repo_slug,
|
||||
"commit": True,
|
||||
"ssh_key": {
|
||||
"from_secret": "ssh_key",
|
||||
},
|
||||
"commit_message": "Automated changelog update [skip ci]",
|
||||
"author_email": "devops@opencloud.eu",
|
||||
"author_name": "openclouders",
|
||||
"rebase": True,
|
||||
"netrc_machine": "github.com",
|
||||
"netrc_username": {
|
||||
"from_secret": "github_username",
|
||||
},
|
||||
"netrc_password": {
|
||||
"from_secret": "github_token",
|
||||
},
|
||||
},
|
||||
"when": [
|
||||
{
|
||||
@@ -1874,12 +1969,12 @@ def changelog():
|
||||
],
|
||||
}]
|
||||
|
||||
def releaseDockerReadme(repo, build_type):
|
||||
def releaseDockerReadme(ctx, repo, build_type):
|
||||
return {
|
||||
"name": "readme-%s" % build_type,
|
||||
"steps": [
|
||||
{
|
||||
"name": "push-docker",
|
||||
"name": "execute",
|
||||
"image": CHKO_DOCKER_PUSHRM,
|
||||
"environment": {
|
||||
"DOCKER_USER": {
|
||||
@@ -1889,22 +1984,10 @@ def releaseDockerReadme(repo, build_type):
|
||||
"from_secret": "docker_password",
|
||||
},
|
||||
"PUSHRM_TARGET": repo,
|
||||
"PUSHRM_SHORT": "Docker images for %s" % (repo),
|
||||
"PUSHRM_SHORT": "Docker images for %s" % (ctx.repo.name),
|
||||
"PUSHRM_FILE": "README.md",
|
||||
},
|
||||
},
|
||||
{
|
||||
"name": "push-quay",
|
||||
"image": CHKO_DOCKER_PUSHRM,
|
||||
"environment": {
|
||||
"APIKEY__QUAY_IO": {
|
||||
"from_secret": "quay_apikey",
|
||||
},
|
||||
"PUSHRM_TARGET": "quay.io/%s" % repo,
|
||||
"PUSHRM_FILE": "README.md",
|
||||
"PUSHRM_PROVIDER": "quay",
|
||||
},
|
||||
},
|
||||
],
|
||||
"when": [
|
||||
{
|
||||
@@ -2020,7 +2103,6 @@ def opencloudServer(storage = "decomposed", accounts_hash_difficulty = 4, volume
|
||||
"OC_URL": OC_URL,
|
||||
"OC_CONFIG_DIR": "/root/.opencloud/config", # needed for checking config later
|
||||
"STORAGE_USERS_DRIVER": "%s" % (storage),
|
||||
"STORAGE_USERS_ID_CACHE_STORE": "nats-js-kv",
|
||||
"PROXY_ENABLE_BASIC_AUTH": True,
|
||||
"WEB_UI_CONFIG_FILE": "%s/%s" % (dirs["base"], dirs["opencloudConfig"]),
|
||||
"OC_LOG_LEVEL": "error",
|
||||
@@ -2428,8 +2510,10 @@ def genericCachePurge(flush_path):
|
||||
{
|
||||
"event": "pull_request",
|
||||
},
|
||||
# {
|
||||
# "status": ["success", "failure"]
|
||||
# },
|
||||
],
|
||||
"runs_on": ["success", "failure"],
|
||||
}
|
||||
|
||||
def genericBuildArtifactCache(ctx, name, action, path):
|
||||
@@ -2636,15 +2720,15 @@ def setupForLitmus():
|
||||
],
|
||||
}]
|
||||
|
||||
def getWoodpeckerEnvAndCheckScript(ctx):
|
||||
opencloud_git_base_url = "https://raw.githubusercontent.com/opencloud-eu/opencloud"
|
||||
path_to_woodpecker_env = "%s/%s/.woodpecker.env" % (opencloud_git_base_url, ctx.build.commit)
|
||||
path_to_check_script = "%s/%s/tests/config/woodpecker/check_web_cache.sh" % (opencloud_git_base_url, ctx.build.commit)
|
||||
def getDroneEnvAndCheckScript(ctx):
|
||||
ocis_git_base_url = "https://raw.githubusercontent.com/opencloud-eu/opencloud"
|
||||
path_to_drone_env = "%s/%s/.drone.env" % (ocis_git_base_url, ctx.build.commit)
|
||||
path_to_check_script = "%s/%s/tests/config/woodpecker/check_web_cache.sh" % (ocis_git_base_url, ctx.build.commit)
|
||||
return {
|
||||
"name": "get-woodpecker-env-and-check-script",
|
||||
"name": "get-drone-env-and-check-script",
|
||||
"image": OC_UBUNTU,
|
||||
"commands": [
|
||||
"curl -s -o .woodpecker.env %s" % path_to_woodpecker_env,
|
||||
"curl -s -o .drone.env %s" % path_to_drone_env,
|
||||
"curl -s -o check_web_cache.sh %s" % path_to_check_script,
|
||||
],
|
||||
}
|
||||
@@ -2671,16 +2755,16 @@ def cloneWeb():
|
||||
"name": "clone-web",
|
||||
"image": OC_CI_NODEJS % DEFAULT_NODEJS_VERSION,
|
||||
"commands": [
|
||||
". ./.woodpecker.env",
|
||||
". ./.drone.env",
|
||||
"rm -rf %s" % dirs["web"],
|
||||
"git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/opencloud-eu/web.git %s" % dirs["web"],
|
||||
"git clone -b $WEB_BRANCH --single-branch --no-tags https://github.com/owncloud/web.git %s" % dirs["web"],
|
||||
"cd %s && git checkout $WEB_COMMITID" % dirs["web"],
|
||||
],
|
||||
}
|
||||
|
||||
def generateWebPnpmCache(ctx):
|
||||
return [
|
||||
getWoodpeckerEnvAndCheckScript(ctx),
|
||||
getDroneEnvAndCheckScript(ctx),
|
||||
checkForWebCache("web-pnpm"),
|
||||
cloneWeb(),
|
||||
{
|
||||
@@ -2708,7 +2792,7 @@ def generateWebPnpmCache(ctx):
|
||||
"image": MINIO_MC,
|
||||
"environment": MINIO_MC_ENV,
|
||||
"commands": [
|
||||
"source ./.woodpecker.env",
|
||||
"source ./.drone.env",
|
||||
# cache using the minio/mc client to the public bucket (long term bucket)
|
||||
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
|
||||
"mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webPnpmZip"],
|
||||
@@ -2718,7 +2802,7 @@ def generateWebPnpmCache(ctx):
|
||||
|
||||
def generateWebCache(ctx):
|
||||
return [
|
||||
getWoodpeckerEnvAndCheckScript(ctx),
|
||||
getDroneEnvAndCheckScript(ctx),
|
||||
checkForWebCache("web"),
|
||||
cloneWeb(),
|
||||
{
|
||||
@@ -2734,7 +2818,7 @@ def generateWebCache(ctx):
|
||||
"image": MINIO_MC,
|
||||
"environment": MINIO_MC_ENV,
|
||||
"commands": [
|
||||
"source ./.woodpecker.env",
|
||||
"source ./.drone.env",
|
||||
# cache using the minio/mc client to the 'owncloud' bucket (long term bucket)
|
||||
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
|
||||
"mc cp -r -a %s s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID" % dirs["webZip"],
|
||||
@@ -2748,7 +2832,7 @@ def restoreWebCache():
|
||||
"image": MINIO_MC,
|
||||
"environment": MINIO_MC_ENV,
|
||||
"commands": [
|
||||
"source ./.woodpecker.env",
|
||||
"source ./.drone.env",
|
||||
"rm -rf %s" % dirs["web"],
|
||||
"mkdir -p %s" % dirs["web"],
|
||||
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
|
||||
@@ -2768,7 +2852,7 @@ def restoreWebPnpmCache():
|
||||
"image": MINIO_MC,
|
||||
"environment": MINIO_MC_ENV,
|
||||
"commands": [
|
||||
"source ./.woodpecker.env",
|
||||
"source ./.drone.env",
|
||||
"mc alias set s3 $MC_HOST $AWS_ACCESS_KEY_ID $AWS_SECRET_ACCESS_KEY",
|
||||
"mc cp -r -a s3/$CACHE_BUCKET/opencloud/web-test-runner/$WEB_COMMITID/pnpm-store.tar.gz %s" % dirs["zip"],
|
||||
],
|
||||
@@ -2868,6 +2952,7 @@ def wopiCollaborationService(name):
|
||||
def tikaService():
|
||||
return [{
|
||||
"name": "tika",
|
||||
"type": "docker",
|
||||
"image": APACHE_TIKA,
|
||||
"detach": True,
|
||||
}, {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
# Table of Contents
|
||||
|
||||
|
||||
22
Makefile
22
Makefile
@@ -213,16 +213,20 @@ protobuf:
|
||||
done
|
||||
|
||||
.PHONY: golangci-lint
|
||||
golangci-lint: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
|
||||
golangci-lint:
|
||||
@for mod in $(OC_MODULES); do \
|
||||
$(MAKE) --no-print-directory -C $$mod golangci-lint; \
|
||||
done
|
||||
|
||||
.PHONY: ci-golangci-lint
|
||||
ci-golangci-lint:
|
||||
ci-golangci-lint: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
|
||||
|
||||
.PHONY: golangci-lint-fix
|
||||
golangci-lint-fix: $(GOLANGCI_LINT)
|
||||
$(GOLANGCI_LINT) run --fix --modules-download-mode vendor --timeout 15m0s --issues-exit-code 0 --out-format checkstyle > checkstyle.xml
|
||||
golangci-lint-fix:
|
||||
@for mod in $(OC_MODULES); do \
|
||||
$(MAKE) --no-print-directory -C $$mod golangci-lint-fix; \
|
||||
done
|
||||
|
||||
.PHONY: test-gherkin-lint
|
||||
test-gherkin-lint:
|
||||
@@ -237,13 +241,13 @@ bingo-update: $(BINGO)
|
||||
$(BINGO) get -l -v -t 20
|
||||
|
||||
.PHONY: check-licenses
|
||||
check-licenses: $(GO_LICENSES) ci-go-check-licenses ci-node-check-licenses
|
||||
check-licenses: ci-go-check-licenses ci-node-check-licenses
|
||||
|
||||
.PHONY: save-licenses
|
||||
save-licenses: $(GO_LICENSES) ci-go-save-licenses ci-node-save-licenses
|
||||
save-licenses: ci-go-save-licenses ci-node-save-licenses
|
||||
|
||||
.PHONY: ci-go-check-licenses
|
||||
ci-go-check-licenses:
|
||||
ci-go-check-licenses: $(GO_LICENSES)
|
||||
$(GO_LICENSES) check ./...
|
||||
|
||||
.PHONY: ci-node-check-licenses
|
||||
@@ -253,7 +257,7 @@ ci-node-check-licenses:
|
||||
done
|
||||
|
||||
.PHONY: ci-go-save-licenses
|
||||
ci-go-save-licenses:
|
||||
ci-go-save-licenses: $(GO_LICENSES)
|
||||
@mkdir -p ./third-party-licenses/go/opencloud/third-party-licenses
|
||||
$(GO_LICENSES) csv ./... > ./third-party-licenses/go/opencloud/third-party-licenses.csv
|
||||
$(GO_LICENSES) save ./... --force --save_path="./third-party-licenses/go/opencloud/third-party-licenses"
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||

|
||||
|
||||
[](https://ci.opencloud.eu/repos/3)
|
||||
[](https://app.element.io/#/room/#opencloud:matrix.org)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
-[](https://app.element.io/#/room/#opencloud:matrix.org)
|
||||
-[](https://opensource.org/licenses/Apache-2.0)
|
||||
|
||||
# Server Backend
|
||||
|
||||
|
||||
12
go.mod
12
go.mod
@@ -21,7 +21,7 @@ require (
|
||||
github.com/egirna/icap-client v0.1.1
|
||||
github.com/gabriel-vasile/mimetype v1.4.8
|
||||
github.com/ggwhite/go-masker v1.1.0
|
||||
github.com/go-chi/chi/v5 v5.2.1
|
||||
github.com/go-chi/chi/v5 v5.2.0
|
||||
github.com/go-chi/render v1.0.3
|
||||
github.com/go-ldap/ldap/v3 v3.4.10
|
||||
github.com/go-ldap/ldif v0.0.0-20200320164324-fd88d9b715b3
|
||||
@@ -48,7 +48,7 @@ require (
|
||||
github.com/jellydator/ttlcache/v3 v3.3.0
|
||||
github.com/jinzhu/now v1.1.5
|
||||
github.com/justinas/alice v1.2.0
|
||||
github.com/kovidgoyal/imaging v1.6.4
|
||||
github.com/kovidgoyal/imaging v1.6.3
|
||||
github.com/leonelquinteros/gotext v1.7.1
|
||||
github.com/libregraph/idm v0.5.0
|
||||
github.com/libregraph/lico v0.65.1
|
||||
@@ -63,7 +63,7 @@ require (
|
||||
github.com/onsi/ginkgo/v2 v2.23.0
|
||||
github.com/onsi/gomega v1.36.2
|
||||
github.com/open-policy-agent/opa v1.1.0
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250314084055-d2fcfe6b3445
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250312134906-766c69c5d1be
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/owncloud/libre-graph-api-go v1.0.5-0.20240829135935-80dc00d6f5ea
|
||||
github.com/pkg/errors v0.9.1
|
||||
@@ -274,7 +274,7 @@ require (
|
||||
github.com/pjbgf/sha1cd v0.3.2 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||
github.com/pquerna/cachecontrol v0.2.0 // indirect
|
||||
github.com/prometheus/alertmanager v0.28.1 // indirect
|
||||
github.com/prometheus/alertmanager v0.27.0 // indirect
|
||||
github.com/prometheus/client_model v0.6.1 // indirect
|
||||
github.com/prometheus/common v0.62.0 // indirect
|
||||
github.com/prometheus/procfs v0.15.1 // indirect
|
||||
@@ -289,8 +289,8 @@ require (
|
||||
github.com/sercand/kuberesolver/v5 v5.1.1 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/sethvargo/go-password v0.3.1 // indirect
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect
|
||||
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 // indirect
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
|
||||
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
|
||||
github.com/skeema/knownhosts v1.3.0 // indirect
|
||||
github.com/spacewander/go-suffix-tree v0.0.0-20191010040751-0865e368c784 // indirect
|
||||
github.com/spf13/pflag v1.0.6 // indirect
|
||||
|
||||
27
go.sum
27
go.sum
@@ -133,8 +133,9 @@ github.com/bbalet/stopwords v1.0.0/go.mod h1:sAWrQoDMfqARGIn4s6dp7OW7ISrshUD8IP2
|
||||
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
|
||||
github.com/beevik/etree v1.5.0 h1:iaQZFSDS+3kYZiGoc9uKeOkUY3nYMXOKLl6KIJxiJWs=
|
||||
github.com/beevik/etree v1.5.0/go.mod h1:gPNJNaBGVZ9AwsidazFZyygnd+0pAU38N4D+WemwKNs=
|
||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
|
||||
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
@@ -337,8 +338,8 @@ github.com/go-asn1-ber/asn1-ber v1.4.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkPro
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.7 h1:DTX+lbVTWaTw1hQ+PbZPlnDZPEIs0SS/GCZAl535dDk=
|
||||
github.com/go-asn1-ber/asn1-ber v1.5.7/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||
github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
|
||||
github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
|
||||
github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
||||
github.com/go-chi/chi/v5 v5.2.0 h1:Aj1EtB0qR2Rdo2dG4O94RIU35w2lvQSj6BRA4+qwFL0=
|
||||
github.com/go-chi/chi/v5 v5.2.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
||||
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
|
||||
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
|
||||
github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s=
|
||||
@@ -698,8 +699,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.4 h1:K0idhRPXnRrJBKnBYcTfI1HTWSNDeAn7hYDvf9I0dCk=
|
||||
github.com/kovidgoyal/imaging v1.6.4/go.mod h1:bEIgsaZmXlvFfkv/CUxr9rJook6AQkJnpB5EPosRfRY=
|
||||
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=
|
||||
@@ -864,8 +865,8 @@ github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
|
||||
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
|
||||
github.com/open-policy-agent/opa v1.1.0 h1:HMz2evdEMTyNqtdLjmu3Vyx06BmhNYAx67Yz3Ll9q2s=
|
||||
github.com/open-policy-agent/opa v1.1.0/go.mod h1:T1pASQ1/vwfTa+e2fYcfpLCvWgYtqtiUv+IuA/dLPQs=
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250314084055-d2fcfe6b3445 h1:At2GtwEeNls1P60RpBa9QQridCtFQNW/pnQ5tybT8X0=
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250314084055-d2fcfe6b3445/go.mod h1:yCscyJJ7FX/HA2fexM2i1OyKSZnJgdq1vnoXgXKmnn8=
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250312134906-766c69c5d1be h1:dxKsVUzdKIGf1hfGdr1GH6NFfo0xuIcPma/qjHNG8mU=
|
||||
github.com/opencloud-eu/reva/v2 v2.27.3-0.20250312134906-766c69c5d1be/go.mod h1:sqlExPoEnEd0KdfoSKogV8PrwEBY3l06icoa4gJnGnU=
|
||||
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
|
||||
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
|
||||
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
|
||||
@@ -910,8 +911,8 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
|
||||
github.com/pquerna/cachecontrol v0.2.0 h1:vBXSNuE5MYP9IJ5kjsdo8uq+w41jSPgvba2DEnkRx9k=
|
||||
github.com/pquerna/cachecontrol v0.2.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI=
|
||||
github.com/pquerna/otp v1.3.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg=
|
||||
github.com/prometheus/alertmanager v0.28.1 h1:BK5pCoAtaKg01BYRUJhEDV1tqJMEtYBGzPw8QdvnnvA=
|
||||
github.com/prometheus/alertmanager v0.28.1/go.mod h1:0StpPUDDHi1VXeM7p2yYfeZgLVi/PPlt39vo9LQUHxM=
|
||||
github.com/prometheus/alertmanager v0.27.0 h1:V6nTa2J5V4s8TG4C4HtrBP/WNSebCCTYGGv4qecA/+I=
|
||||
github.com/prometheus/alertmanager v0.27.0/go.mod h1:8Ia/R3urPmbzJ8OsdvmZvIprDwvwmYCmUbwBL+jlPOE=
|
||||
github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||
@@ -1009,11 +1010,11 @@ github.com/shamaton/msgpack/v2 v2.2.2 h1:GOIg0c9LV04VwzOOqZSrmsv/JzjNOOMxnS/HvOH
|
||||
github.com/shamaton/msgpack/v2 v2.2.2/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c h1:aqg5Vm5dwtvL+YgDpBcK1ITf3o96N/K7/wsRXQnUTEs=
|
||||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c/go.mod h1:owqhoLW1qZoYLZzLnBw+QkPP9WZnjlSWihhxAJC1+/M=
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 h1:bUGsEnyNbVPw06Bs80sCeARAlK8lhwqGyi6UT8ymuGk=
|
||||
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
|
||||
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 h1:OfRzdxCzDhp+rsKWXuOO2I/quKMJ/+TQwVbIP/gltZg=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92/go.mod h1:7/OT02F6S6I7v6WXb+IjhMuZEYfH/RJ5RwEWnEo5BMg=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU=
|
||||
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
|
||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
|
||||
|
||||
@@ -30,10 +30,16 @@ dev-docker-multiarch:
|
||||
docker buildx rm opencloudbuilder || true
|
||||
docker buildx create --platform linux/arm64,linux/amd64 --name opencloudbuilder
|
||||
docker buildx use opencloudbuilder
|
||||
cd .. && docker buildx build --platform linux/arm64,linux/amd64 --output type=docker --file opencloud/docker/Dockerfile.multiarch --tag opencloud-eu/opencloud:dev-multiarch .
|
||||
cd .. && docker buildx build --platform linux/arm64,linux/amd64 --output type=docker --file opencloud/docker/Dockerfile.linux.multiarch --tag opencloud-eu/opencloud:dev-multiarch .
|
||||
docker buildx rm opencloudbuilder
|
||||
|
||||
.PHONY: debug-docker
|
||||
debug-docker:
|
||||
$(MAKE) --no-print-directory debug-linux-docker-$(GOARCH)
|
||||
docker build -f docker/Dockerfile.linux.debug.$(GOARCH) -t opencloud-eu/opencloud:debug .
|
||||
|
||||
.PHONY: node-generate-prod
|
||||
node-generate-prod: # opencloud needs assets of all other modules
|
||||
@if [ $(MAKE_DEPTH) -le 1 ]; then \
|
||||
$(MAKE) --no-print-directory -C .. node-generate-prod \
|
||||
; fi;
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
FROM golang:alpine3.20 AS build
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
ARG VERSION
|
||||
ARG STRING
|
||||
|
||||
RUN apk add bash make git curl gcc musl-dev libc-dev binutils-gold inotify-tools vips-dev
|
||||
|
||||
COPY ../ /opencloud/
|
||||
COPY ./ /opencloud/
|
||||
|
||||
WORKDIR /opencloud
|
||||
RUN GOOS="${TARGETOS:-linux}" GOARCH="${TARGETARCH:-amd64}" ; \
|
||||
make go-generate ; \
|
||||
make -C opencloud release-linux-docker-${TARGETARCH} ENABLE_VIPS=true
|
||||
|
||||
FROM alpine:3.20
|
||||
@@ -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 = "1.1.0-alpha.1+dev"
|
||||
LatestTag = "1.0.0+dev"
|
||||
|
||||
// Date indicates the build date.
|
||||
// This has been removed, it looks like you can only replace static strings with recent go versions
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ include ../../.make/release.mk
|
||||
include ../../.make/docs.mk
|
||||
|
||||
.PHONY: go-generate
|
||||
go-generate:
|
||||
go-generate: $(MOCKERY)
|
||||
$(MOCKERY)
|
||||
|
||||
.PHONY: l10n-pull
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ type Settings struct {
|
||||
IdentifierRegistrationConf string `yaml:"-"`
|
||||
IdentifierScopesConf string `yaml:"-"` // unused
|
||||
IdentifierDefaultBannerLogo string
|
||||
IdentifierDefaultSignInPageText string `yaml:"default_sign_in_page_text" env:"IDP_DEFAULT_SIGNIN_PAGE_TEXT" desc:"" introductionVersion:"2.0.0"`
|
||||
IdentifierDefaultSignInPageText string
|
||||
IdentifierDefaultUsernameHintText string
|
||||
IdentifierUILocales []string
|
||||
|
||||
|
||||
@@ -1,234 +1,209 @@
|
||||
import React, { useEffect, useMemo } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import { connect } from "react-redux";
|
||||
import React, {useEffect, useMemo} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {connect} from 'react-redux';
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import {useTranslation} from 'react-i18next';
|
||||
|
||||
import { withStyles } from "@material-ui/core/styles";
|
||||
import Button from "@material-ui/core/Button";
|
||||
import CircularProgress from "@material-ui/core/CircularProgress";
|
||||
import green from "@material-ui/core/colors/green";
|
||||
import Typography from "@material-ui/core/Typography";
|
||||
import Link from "@material-ui/core/Link";
|
||||
import {withStyles} from '@material-ui/core/styles';
|
||||
import Button from '@material-ui/core/Button';
|
||||
import CircularProgress from '@material-ui/core/CircularProgress';
|
||||
import green from '@material-ui/core/colors/green';
|
||||
import Typography from '@material-ui/core/Typography';
|
||||
import Link from '@material-ui/core/Link';
|
||||
|
||||
import TextInput from "../../components/TextInput";
|
||||
import TextInput from '../../components/TextInput'
|
||||
|
||||
import {
|
||||
updateInput,
|
||||
executeLogonIfFormValid,
|
||||
advanceLogonFlow,
|
||||
} from "../../actions/login";
|
||||
import { ErrorMessage } from "../../errors";
|
||||
import {updateInput, executeLogonIfFormValid, advanceLogonFlow} from '../../actions/login';
|
||||
import {ErrorMessage} from '../../errors';
|
||||
|
||||
const styles = (theme) => ({
|
||||
buttonProgress: {
|
||||
color: green[500],
|
||||
position: "absolute",
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
marginTop: -12,
|
||||
marginLeft: -12,
|
||||
},
|
||||
main: {
|
||||
width: "100%",
|
||||
},
|
||||
header: {
|
||||
textAlign: "center",
|
||||
marginTop: 0,
|
||||
marginBottom: theme.spacing(6),
|
||||
},
|
||||
wrapper: {
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
textAlign: "center",
|
||||
},
|
||||
message: {
|
||||
marginTop: 5,
|
||||
marginBottom: 5,
|
||||
},
|
||||
const styles = theme => ({
|
||||
buttonProgress: {
|
||||
color: green[500],
|
||||
position: 'absolute',
|
||||
top: '50%',
|
||||
left: '50%',
|
||||
marginTop: -12,
|
||||
marginLeft: -12
|
||||
},
|
||||
main: {
|
||||
width: '100%'
|
||||
},
|
||||
header: {
|
||||
textAlign: 'center',
|
||||
marginTop: 0,
|
||||
marginBottom: theme.spacing(6)
|
||||
},
|
||||
wrapper: {
|
||||
position: 'relative',
|
||||
width: '100%',
|
||||
textAlign: 'center'
|
||||
},
|
||||
message: {
|
||||
marginTop: 5,
|
||||
marginBottom: 5
|
||||
}
|
||||
});
|
||||
|
||||
function Login(props) {
|
||||
const {
|
||||
hello,
|
||||
query,
|
||||
dispatch,
|
||||
history,
|
||||
loading,
|
||||
errors,
|
||||
classes,
|
||||
username,
|
||||
password,
|
||||
passwordResetLink,
|
||||
branding,
|
||||
} = props;
|
||||
const {
|
||||
hello,
|
||||
query,
|
||||
dispatch,
|
||||
history,
|
||||
loading,
|
||||
errors,
|
||||
classes,
|
||||
username,
|
||||
password,
|
||||
passwordResetLink,
|
||||
} = props;
|
||||
|
||||
const { t } = useTranslation();
|
||||
const loginFailed = errors.http;
|
||||
const hasError = errors.http || errors.username || errors.password;
|
||||
const errorMessage = errors.http ? (
|
||||
<ErrorMessage error={errors.http}></ErrorMessage>
|
||||
) : errors.username ? (
|
||||
<ErrorMessage error={errors.username}></ErrorMessage>
|
||||
) : (
|
||||
<ErrorMessage error={errors.password}></ErrorMessage>
|
||||
);
|
||||
const extraPropsUsername = {
|
||||
"aria-invalid": errors.username || errors.http ? "true" : "false",
|
||||
};
|
||||
const extraPropsPassword = {
|
||||
"aria-invalid": errors.password || errors.http ? "true" : "false",
|
||||
};
|
||||
const {t} = useTranslation();
|
||||
const loginFailed = errors.http;
|
||||
const hasError = errors.http || errors.username || errors.password;
|
||||
const errorMessage = errors.http
|
||||
? <ErrorMessage error={errors.http}></ErrorMessage>
|
||||
: (errors.username
|
||||
? <ErrorMessage error={errors.username}></ErrorMessage>
|
||||
: <ErrorMessage error={errors.password}></ErrorMessage>);
|
||||
const extraPropsUsername = {
|
||||
"aria-invalid": (errors.username || errors.http) ? 'true' : 'false'
|
||||
};
|
||||
const extraPropsPassword = {
|
||||
"aria-invalid": (errors.password || errors.http) ? 'true' : 'false',
|
||||
};
|
||||
|
||||
if (errors.username || errors.http) {
|
||||
extraPropsUsername["extraClassName"] = "error";
|
||||
extraPropsUsername["aria-describedby"] = "oc-login-error-message";
|
||||
}
|
||||
|
||||
if (errors.password || errors.http) {
|
||||
extraPropsPassword["extraClassName"] = "error";
|
||||
extraPropsPassword["aria-describedby"] = "oc-login-error-message";
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (hello && hello.state && history.action !== "PUSH") {
|
||||
if (!query.prompt || query.prompt.indexOf("select_account") === -1) {
|
||||
dispatch(advanceLogonFlow(true, history));
|
||||
return;
|
||||
}
|
||||
|
||||
history.replace(
|
||||
`/chooseaccount${history.location.search}${history.location.hash}`
|
||||
);
|
||||
return;
|
||||
if (errors.username || errors.http) {
|
||||
extraPropsUsername['extraClassName'] = 'error';
|
||||
extraPropsUsername['aria-describedby'] = 'oc-login-error-message';
|
||||
}
|
||||
});
|
||||
|
||||
const handleChange = (name) => (event) => {
|
||||
dispatch(updateInput(name, event.target.value));
|
||||
};
|
||||
if (errors.password || errors.http) {
|
||||
extraPropsPassword['extraClassName'] = 'error';
|
||||
extraPropsPassword['aria-describedby'] = 'oc-login-error-message';
|
||||
}
|
||||
|
||||
const handleNextClick = (event) => {
|
||||
event.preventDefault();
|
||||
useEffect(() => {
|
||||
if (hello && hello.state && history.action !== 'PUSH') {
|
||||
if (!query.prompt || query.prompt.indexOf('select_account') === -1) {
|
||||
dispatch(advanceLogonFlow(true, history));
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(executeLogonIfFormValid(username, password, false)).then(
|
||||
(response) => {
|
||||
if (response.success) {
|
||||
dispatch(advanceLogonFlow(response.success, history));
|
||||
history.replace(`/chooseaccount${history.location.search}${history.location.hash}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={classes.main}>
|
||||
<h1 className={classes.header}>
|
||||
{" "}
|
||||
{t("konnect.login.headline", "Sign in")}
|
||||
</h1>
|
||||
{branding?.signinPageText && (
|
||||
<Typography
|
||||
variant="body2"
|
||||
dangerouslySetInnerHTML={{ __html: branding.signinPageText }}
|
||||
/>
|
||||
)}
|
||||
<form
|
||||
action=""
|
||||
className="oc-login-form"
|
||||
onSubmit={(event) => handleNextClick(event)}
|
||||
>
|
||||
<TextInput
|
||||
autoFocus
|
||||
autoCapitalize="off"
|
||||
spellCheck="false"
|
||||
value={username}
|
||||
onChange={handleChange("username")}
|
||||
autoComplete="kopano-account username"
|
||||
placeholder={t("konnect.login.usernameField.label", "Username")}
|
||||
label={t("konnect.login.usernameField.label", "Username")}
|
||||
id="oc-login-username"
|
||||
{...extraPropsUsername}
|
||||
/>
|
||||
<TextInput
|
||||
type="password"
|
||||
margin="normal"
|
||||
onChange={handleChange("password")}
|
||||
autoComplete="kopano-account current-password"
|
||||
placeholder={t("konnect.login.passwordField.label", "Password")}
|
||||
label={t("konnect.login.passwordField.label", "Password")}
|
||||
id="oc-login-password"
|
||||
{...extraPropsPassword}
|
||||
/>
|
||||
{hasError && (
|
||||
<Typography
|
||||
id="oc-login-error-message"
|
||||
variant="subtitle2"
|
||||
component="span"
|
||||
color="error"
|
||||
className={classes.message}
|
||||
>
|
||||
{errorMessage}
|
||||
</Typography>
|
||||
)}
|
||||
<div className={classes.wrapper}>
|
||||
{loginFailed && passwordResetLink && (
|
||||
<Link
|
||||
id="oc-login-password-reset"
|
||||
href={passwordResetLink}
|
||||
variant="subtitle2"
|
||||
>
|
||||
{"Reset password?"}
|
||||
</Link>
|
||||
)}
|
||||
<Button
|
||||
type="submit"
|
||||
color="primary"
|
||||
variant="contained"
|
||||
className="oc-button-primary oc-mt-l"
|
||||
disabled={!!loading}
|
||||
onClick={handleNextClick}
|
||||
>
|
||||
{t("konnect.login.nextButton.label", "Log in")}
|
||||
</Button>
|
||||
{loading && (
|
||||
<CircularProgress size={24} className={classes.buttonProgress} />
|
||||
)}
|
||||
const handleChange = (name) => (event) => {
|
||||
dispatch(updateInput(name, event.target.value));
|
||||
};
|
||||
|
||||
const handleNextClick = (event) => {
|
||||
event.preventDefault();
|
||||
|
||||
dispatch(executeLogonIfFormValid(username, password, false)).then((response) => {
|
||||
if (response.success) {
|
||||
dispatch(advanceLogonFlow(response.success, history));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const usernamePlaceHolder = useMemo(() => {
|
||||
if (hello?.details?.branding?.usernameHintText) {
|
||||
switch (hello.details.branding.usernameHintText) {
|
||||
case "Username":
|
||||
break;
|
||||
case "Email":
|
||||
return t("konnect.login.usernameField.placeholder.email", "Email");
|
||||
case "Identity":
|
||||
return t("konnect.login.usernameField.placeholder.identity", "Identity");
|
||||
default:
|
||||
return hello.details.branding.usernameHintText;
|
||||
}
|
||||
}
|
||||
|
||||
return t("konnect.login.usernameField.placeholder.username", "Username");
|
||||
}, [hello, t]);
|
||||
|
||||
return (
|
||||
<div className={classes.main}>
|
||||
<h1 className={classes.header}> {t("konnect.login.headline", "Sign in")}</h1>
|
||||
<form action="" className="oc-login-form" onSubmit={(event) => handleNextClick(event)}>
|
||||
<TextInput
|
||||
autoFocus
|
||||
autoCapitalize="off"
|
||||
spellCheck="false"
|
||||
value={username}
|
||||
onChange={handleChange('username')}
|
||||
autoComplete="kopano-account username"
|
||||
placeholder={t("konnect.login.usernameField.label", "Username")}
|
||||
label={t("konnect.login.usernameField.label", "Username")}
|
||||
id="oc-login-username"
|
||||
{...extraPropsUsername}
|
||||
/>
|
||||
<TextInput
|
||||
type="password"
|
||||
margin="normal"
|
||||
onChange={handleChange('password')}
|
||||
autoComplete="kopano-account current-password"
|
||||
placeholder={t("konnect.login.passwordField.label", "Password")}
|
||||
label={t("konnect.login.passwordField.label", "Password")}
|
||||
id="oc-login-password"
|
||||
{...extraPropsPassword}
|
||||
/>
|
||||
{hasError && <Typography id="oc-login-error-message" variant="subtitle2" component="span" color="error"
|
||||
className={classes.message}>{errorMessage}</Typography>}
|
||||
<div className={classes.wrapper}>
|
||||
{loginFailed && passwordResetLink && <Link id="oc-login-password-reset" href={passwordResetLink}
|
||||
variant="subtitle2">{"Reset password?"}</Link>}
|
||||
<Button
|
||||
type="submit"
|
||||
color="primary"
|
||||
variant="contained"
|
||||
className="oc-button-primary oc-mt-l"
|
||||
disabled={!!loading}
|
||||
onClick={handleNextClick}
|
||||
>
|
||||
{t("konnect.login.nextButton.label", "Log in")}
|
||||
</Button>
|
||||
{loading && <CircularProgress size={24} className={classes.buttonProgress}/>}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
Login.propTypes = {
|
||||
classes: PropTypes.object.isRequired,
|
||||
classes: PropTypes.object.isRequired,
|
||||
|
||||
loading: PropTypes.string.isRequired,
|
||||
username: PropTypes.string.isRequired,
|
||||
password: PropTypes.string.isRequired,
|
||||
passwordResetLink: PropTypes.string.isRequired,
|
||||
errors: PropTypes.object.isRequired,
|
||||
branding: PropTypes.object,
|
||||
hello: PropTypes.object,
|
||||
query: PropTypes.object.isRequired,
|
||||
loading: PropTypes.string.isRequired,
|
||||
username: PropTypes.string.isRequired,
|
||||
password: PropTypes.string.isRequired,
|
||||
passwordResetLink: PropTypes.string.isRequired,
|
||||
errors: PropTypes.object.isRequired,
|
||||
branding: PropTypes.object,
|
||||
hello: PropTypes.object,
|
||||
query: PropTypes.object.isRequired,
|
||||
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
history: PropTypes.object.isRequired,
|
||||
dispatch: PropTypes.func.isRequired,
|
||||
history: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) => {
|
||||
const { loading, username, password, errors } = state.login;
|
||||
const { branding, hello, query, passwordResetLink } = state.common;
|
||||
const {loading, username, password, errors} = state.login;
|
||||
const {branding, hello, query, passwordResetLink} = state.common;
|
||||
|
||||
return {
|
||||
loading,
|
||||
username,
|
||||
password,
|
||||
errors,
|
||||
branding,
|
||||
hello,
|
||||
query,
|
||||
passwordResetLink,
|
||||
};
|
||||
return {
|
||||
loading,
|
||||
username,
|
||||
password,
|
||||
errors,
|
||||
branding,
|
||||
hello,
|
||||
query,
|
||||
passwordResetLink
|
||||
};
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(withStyles(styles)(Login));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Code generated by mockery v2.53.2. DO NOT EDIT.
|
||||
// Code generated by mockery v2.53.0. DO NOT EDIT.
|
||||
|
||||
package mocks
|
||||
|
||||
|
||||
@@ -194,14 +194,12 @@ type OwnCloudSQLDriver struct {
|
||||
// PosixDriver is the storage driver configuration when using 'posix' storage driver
|
||||
type PosixDriver struct {
|
||||
// Root is the absolute path to the location of the data
|
||||
Root string `yaml:"root" env:"STORAGE_USERS_POSIX_ROOT" desc:"The directory where the filesystem storage will store its data. If not defined, the root directory derives from $OC_BASE_DATA_PATH/storage/users." introductionVersion:"1.0.0"`
|
||||
PersonalSpaceAliasTemplate string `yaml:"personalspacealias_template" env:"STORAGE_USERS_POSIX_PERSONAL_SPACE_ALIAS_TEMPLATE" desc:"Template string to construct personal space aliases." introductionVersion:"1.0.0"`
|
||||
PersonalSpacePathTemplate string `yaml:"personalspacepath_template" env:"STORAGE_USERS_POSIX_PERSONAL_SPACE_PATH_TEMPLATE" desc:"Template string to construct the paths of the personal space roots." introductionVersion:"1.0.0"`
|
||||
GeneralSpaceAliasTemplate string `yaml:"generalspacealias_template" env:"STORAGE_USERS_POSIX_GENERAL_SPACE_ALIAS_TEMPLATE" desc:"Template string to construct general space aliases." introductionVersion:"1.0.0"`
|
||||
GeneralSpacePathTemplate string `yaml:"generalspacepath_template" env:"STORAGE_USERS_POSIX_GENERAL_SPACE_PATH_TEMPLATE" desc:"Template string to construct the paths of the projects space roots." introductionVersion:"1.0.0"`
|
||||
PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_POSIX_PERMISSIONS_ENDPOINT" desc:"Endpoint of the permissions service. The endpoints can differ for 'decomposed', 'posix' and 'decomposeds3'." introductionVersion:"1.0.0"`
|
||||
AsyncUploads bool `yaml:"async_uploads" env:"OC_ASYNC_UPLOADS" desc:"Enable asynchronous file uploads." introductionVersion:"1.0.0"`
|
||||
ScanDebounceDelay time.Duration `yaml:"scan_debounce_delay" env:"STORAGE_USERS_POSIX_SCAN_DEBOUNCE_DELAY" desc:"The time in milliseconds to wait before scanning the filesystem for changes after a change has been detected." introductionVersion:"1.0.0"`
|
||||
Root string `yaml:"root" env:"STORAGE_USERS_POSIX_ROOT" desc:"The directory where the filesystem storage will store its data. If not defined, the root directory derives from $OC_BASE_DATA_PATH/storage/users." introductionVersion:"1.0.0"`
|
||||
PersonalSpacePathTemplate string `yaml:"personalspacepath_template" env:"STORAGE_USERS_POSIX_PERSONAL_SPACE_PATH_TEMPLATE" desc:"Template string to construct the paths of the personal space roots." introductionVersion:"1.0.0"`
|
||||
GeneralSpacePathTemplate string `yaml:"generalspacepath_template" env:"STORAGE_USERS_POSIX_GENERAL_SPACE_PATH_TEMPLATE" desc:"Template string to construct the paths of the projects space roots." introductionVersion:"1.0.0"`
|
||||
PermissionsEndpoint string `yaml:"permissions_endpoint" env:"STORAGE_USERS_PERMISSION_ENDPOINT;STORAGE_USERS_POSIX_PERMISSIONS_ENDPOINT" desc:"Endpoint of the permissions service. The endpoints can differ for 'decomposed', 'posix' and 'decomposeds3'." introductionVersion:"1.0.0"`
|
||||
AsyncUploads bool `yaml:"async_uploads" env:"OC_ASYNC_UPLOADS" desc:"Enable asynchronous file uploads." introductionVersion:"1.0.0"`
|
||||
ScanDebounceDelay time.Duration `yaml:"scan_debounce_delay" env:"STORAGE_USERS_POSIX_SCAN_DEBOUNCE_DELAY" desc:"The time in milliseconds to wait before scanning the filesystem for changes after a change has been detected." introductionVersion:"1.0.0"`
|
||||
|
||||
UseSpaceGroups bool `yaml:"use_space_groups" env:"STORAGE_USERS_POSIX_USE_SPACE_GROUPS" desc:"Use space groups to manage permissions on spaces." introductionVersion:"1.0.0"`
|
||||
|
||||
|
||||
@@ -140,17 +140,15 @@ func DefaultConfig() *config.Config {
|
||||
AsyncUploads: true,
|
||||
},
|
||||
Posix: config.PosixDriver{
|
||||
UseSpaceGroups: false,
|
||||
Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"),
|
||||
PersonalSpaceAliasTemplate: "{{.SpaceType}}/{{.User.Username | lower}}",
|
||||
PersonalSpacePathTemplate: "users/{{.User.Username}}",
|
||||
GeneralSpaceAliasTemplate: "{{.SpaceType}}/{{.SpaceName | replace \" \" \"-\" | lower}}",
|
||||
GeneralSpacePathTemplate: "projects/{{.SpaceId}}",
|
||||
PermissionsEndpoint: "eu.opencloud.api.settings",
|
||||
AsyncUploads: true,
|
||||
ScanDebounceDelay: 1 * time.Second,
|
||||
WatchFS: false,
|
||||
EnableFSRevisions: false,
|
||||
UseSpaceGroups: false,
|
||||
Root: filepath.Join(defaults.BaseDataPath(), "storage", "users"),
|
||||
PersonalSpacePathTemplate: "users/{{.User.Username}}",
|
||||
GeneralSpacePathTemplate: "projects/{{.SpaceId}}",
|
||||
PermissionsEndpoint: "eu.opencloud.api.settings",
|
||||
AsyncUploads: true,
|
||||
ScanDebounceDelay: 1 * time.Second,
|
||||
WatchFS: false,
|
||||
EnableFSRevisions: false,
|
||||
},
|
||||
},
|
||||
Events: config.Events{
|
||||
|
||||
@@ -376,7 +376,7 @@ func composeMessage(nt NotificationTemplate, locale, defaultLocale, path string,
|
||||
|
||||
func loadTemplates(nt NotificationTemplate, locale, defaultLocale, path string) (string, string) {
|
||||
t := l10n.NewTranslatorFromCommonConfig(defaultLocale, _domain, path, _translationFS, "l10n/locale").Locale(locale)
|
||||
return t.Get("%s", nt.Subject), t.Get("%s", nt.Message)
|
||||
return t.Get("%s", nt.Subject), t.Get(nt.Message)
|
||||
}
|
||||
|
||||
func executeTemplate(raw string, vars map[string]interface{}) (string, error) {
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
@@ -1,14 +0,0 @@
|
||||
<svg width="170" height="35" viewBox="0 0 170 35" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M45.1928 23.7428C42.5766 22.2684 41.0547 19.5569 41.0547 16.1555C41.0547 14.4433 41.4115 12.921 42.1485 11.589C43.5753 8.92532 46.2869 7.35547 49.6879 7.35547C51.377 7.35547 52.8514 7.73604 54.1593 8.47339C56.7523 9.97188 58.2508 12.7307 58.2508 16.1555C58.2508 17.8443 57.894 19.3663 57.1801 20.6748C55.753 23.315 53.042 24.8605 49.6879 24.8605C47.9992 24.8605 46.501 24.504 45.1928 23.7428ZM49.6641 22.1254C52.9942 22.1254 55.1824 19.7947 55.1824 16.1555C55.1824 12.4215 52.8755 10.0667 49.6641 10.0667C46.4534 10.0667 44.1224 12.4215 44.1224 16.1555C44.1224 19.771 46.3345 22.1254 49.6641 22.1254Z" fill="#E2BAFF"/>
|
||||
<path d="M62.0912 11.9934L63.6608 14.7522C65.0879 12.4929 66.967 11.9934 68.4176 11.9934C69.5828 11.9934 70.5821 12.255 71.4618 12.8259C72.3657 13.4202 73.0558 14.1814 73.5077 15.1328C74.0069 16.1318 74.2448 17.2259 74.2448 18.4387C74.2448 19.6518 74.0069 20.7697 73.5077 21.7687C73.0558 22.7201 72.3419 23.4813 71.4381 24.0283C70.5821 24.5989 69.5828 24.8605 68.4176 24.8605C67.6327 24.8605 66.8477 24.6943 66.0869 24.3613C65.3971 24.0283 64.7787 23.5526 64.2792 22.958V28.9992H61.3774V16.5599L59.5938 13.4443L62.0912 11.9934ZM64.2792 18.4387C64.2792 19.1764 64.4219 19.8658 64.7073 20.4605C65.0641 21.1027 65.4685 21.5546 65.9442 21.84C66.4913 22.1493 67.0856 22.292 67.7754 22.292C68.489 22.292 69.0836 22.1493 69.6069 21.84C70.1302 21.5308 70.5583 21.0789 70.8196 20.4605C71.1289 19.8658 71.2478 19.1764 71.2478 18.4387C71.2478 17.2497 70.9386 16.2983 70.3204 15.6323C69.6782 14.9187 68.8457 14.562 67.7516 14.562C66.7291 14.562 65.8728 14.9187 65.2306 15.6323C64.6122 16.2983 64.2792 17.2497 64.2792 18.4387Z" fill="#E2BAFF"/>
|
||||
<path d="M76.5405 15.133C77.0162 14.1812 77.7297 13.3966 78.7049 12.7782C79.7039 12.2311 80.7981 11.9695 82.0587 11.9695C83.319 11.9695 84.3656 12.2311 85.1981 12.7306C86.1017 13.3015 86.768 14.0626 87.2437 15.0137C87.6715 15.9892 87.9094 17.1544 87.9094 18.4386L87.8621 19.1286H78.6098C78.7049 20.1987 79.0855 21.0077 79.7515 21.6261C80.4175 22.1491 81.2976 22.387 82.3438 22.387C83.1528 22.387 83.8661 22.2446 84.5318 21.9826C85.1981 21.721 85.7925 21.388 86.2685 20.9836C86.3398 21.0553 87.505 23.1005 87.505 23.1005C86.768 23.6476 85.9352 24.0758 85.0316 24.4084C84.1991 24.7177 83.2239 24.8604 82.1535 24.8604C80.8694 24.8604 79.7277 24.599 78.8001 24.052C77.8962 23.5287 77.1589 22.7675 76.5642 21.7689C76.0409 20.7696 75.7793 19.6516 75.7793 18.4386C75.7793 17.2496 76.0172 16.1317 76.5405 15.133ZM78.6811 17.1544H85.0316C84.9365 16.203 84.6273 15.5373 84.104 15.1089C83.5331 14.6097 82.8671 14.348 82.0587 14.348C81.2259 14.348 80.5126 14.6097 79.8704 15.0616C79.2996 15.5135 78.919 16.203 78.6811 17.1544Z" fill="#E2BAFF"/>
|
||||
<path d="M102.054 17.0594V24.4799H99.1283V17.3211C99.1283 16.3459 98.9142 15.6561 98.4623 15.2042C98.0342 14.6809 97.3919 14.443 96.5121 14.443C95.9411 14.443 95.4656 14.5857 94.9899 14.895C94.538 15.1328 94.1812 15.5372 93.9433 16.0367C93.7293 16.5124 93.5866 17.0832 93.5866 17.773V24.4799H90.6371V16.5599L88.8535 13.4202L91.3745 11.9934L92.8492 14.5144C94.3477 12.2785 95.9648 11.9934 97.059 11.9934C98.2958 11.9934 99.0569 12.2072 99.5564 12.445C100.056 12.6832 100.508 12.9921 100.841 13.3727C101.649 14.2527 102.054 15.4896 102.054 17.0594Z" fill="#E2BAFF"/>
|
||||
<path d="M117.538 23.838C117.015 24.0999 116.325 24.3613 115.469 24.5991C114.684 24.7656 113.851 24.8608 112.971 24.8608C111.259 24.8608 109.737 24.4802 108.429 23.7669C107.144 23.0531 106.145 22.0303 105.408 20.6748C104.694 19.3663 104.338 17.8443 104.338 16.1083C104.338 14.4195 104.694 12.8972 105.384 11.5414C106.074 10.2097 107.144 9.16318 108.405 8.47339C109.713 7.71225 111.283 7.35547 113.138 7.35547C114.066 7.35547 114.874 7.42683 115.564 7.61711C116.373 7.80739 117.038 8.04525 117.514 8.33068C118.014 8.56854 118.608 8.90153 119.298 9.35346L117.8 11.8982C117.062 11.3987 116.349 11.0185 115.659 10.733C114.85 10.4238 113.994 10.2573 113.066 10.2573C111.83 10.2573 110.807 10.4952 109.999 10.9944C109.118 11.5414 108.476 12.2312 108.048 13.0875C107.62 14.0151 107.382 15.0379 107.382 16.1555C107.382 17.2738 107.62 18.2725 108.048 19.1525C108.476 20.0088 109.118 20.6986 109.999 21.1981C110.831 21.6735 111.854 21.9117 113.043 21.9117C113.733 21.9117 114.351 21.84 114.922 21.6973C115.54 21.5308 116.064 21.3408 116.491 21.103C117.086 20.7937 117.538 20.5083 117.871 20.2467L119.346 22.8152C118.632 23.2434 118.037 23.6001 117.538 23.838Z" fill="#E2BAFF"/>
|
||||
<rect x="121.127" y="7.23633" width="2.90154" height="17.2437" fill="#E2BAFF"/>
|
||||
<path d="M126.195 18.4387C126.195 14.6809 128.859 11.9934 132.688 11.9934C136.494 11.9934 139.134 14.6571 139.134 18.4152C139.134 22.2206 136.494 24.8605 132.664 24.8605C129.002 24.8605 126.195 22.3633 126.195 18.4387ZM132.664 22.3633C134.71 22.3633 136.113 20.9124 136.113 18.4152C136.113 15.9891 134.71 14.4671 132.664 14.4671C130.548 14.4671 129.192 16.0604 129.192 18.4152C129.192 20.8411 130.572 22.3633 132.664 22.3633Z" fill="#E2BAFF"/>
|
||||
<path d="M145.86 24.8606C144.456 24.8606 143.339 24.4324 142.482 23.5048C141.674 22.5774 141.27 21.3168 141.27 19.747V12.374H144.171V19.5329C144.171 20.4605 144.385 21.1741 144.837 21.6736C145.265 22.1493 145.931 22.3634 146.811 22.3634C147.382 22.3634 147.881 22.2444 148.334 21.9828C148.785 21.7212 149.118 21.3168 149.356 20.8173C149.618 20.294 149.737 19.6994 149.737 19.081V12.374H152.662V20.3654L154.422 23.4337L151.925 24.8606L150.522 22.4585C150.522 22.4585 149.974 23.1721 149.237 23.7905C148.334 24.5517 147.382 24.8606 145.86 24.8606Z" fill="#E2BAFF"/>
|
||||
<path d="M156.104 15.1328C156.651 14.0624 157.293 13.2775 158.173 12.8259C159.053 12.2788 160.076 11.9696 161.17 11.9696C162.098 11.9696 162.859 12.1599 163.525 12.4929C164.191 12.8259 164.809 13.254 165.309 13.8959V7.23657H168.21V20.3415L169.947 23.4099L167.449 24.837L165.927 22.1968C165.927 22.1968 164.88 23.6712 163.525 24.3375C162.954 24.623 162.05 24.837 161.194 24.837C160.076 24.837 159.053 24.5751 158.173 24.0045C157.317 23.5526 156.651 22.7677 156.104 21.7687C155.604 20.7697 155.391 19.6993 155.391 18.4387C155.391 17.1546 155.604 16.0604 156.104 15.1328ZM158.363 18.4387C158.363 19.2474 158.506 19.8896 158.792 20.437C159.125 21.1027 159.553 21.5073 160.004 21.7925C160.528 22.1017 161.098 22.2682 161.812 22.2682C162.526 22.2682 163.144 22.1017 163.644 21.7925C164.143 21.5073 164.571 21.0789 164.88 20.437C165.166 19.8896 165.309 19.2474 165.309 18.4387C165.309 17.2497 164.999 16.2507 164.333 15.6323C163.763 14.9187 162.883 14.5385 161.836 14.5385C160.766 14.5385 159.933 14.9187 159.339 15.6323C158.673 16.2507 158.363 17.2497 158.363 18.4387Z" fill="#E2BAFF"/>
|
||||
<path d="M13.4814 25.5141L14.9505 24.6659V18.5276L20.234 15.4772V13.785L18.7649 12.9368L13.4462 16.0076L8.20127 12.9794L6.73242 13.8273V15.5198L12.0159 18.5703V24.668L13.4814 25.5141Z" fill="#E2BAFF"/>
|
||||
<path d="M26.9649 7.78377L13.4828 0L0 7.78408V11.1725L13.4824 3.38806L26.9649 11.1721V7.78377Z" fill="#E2BAFF"/>
|
||||
<path d="M26.9646 23.8279L13.4821 31.612L0 23.8279V27.2163L13.4821 35L26.9646 27.2163V23.8279Z" fill="#E2BAFF"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.0 KiB |
@@ -1,258 +0,0 @@
|
||||
{
|
||||
"clients": {
|
||||
"android": {},
|
||||
"desktop": {},
|
||||
"ios": {},
|
||||
"web": {
|
||||
"defaults": {
|
||||
"appBanner": {},
|
||||
"designTokens": {
|
||||
"breakpoints": {
|
||||
"large-default": "",
|
||||
"large-max": "",
|
||||
"medium-default": "",
|
||||
"medium-max": "",
|
||||
"small-default": "",
|
||||
"small-max": "",
|
||||
"xlarge": "",
|
||||
"xsmall-max": ""
|
||||
},
|
||||
"fontSizes": {
|
||||
"default": "",
|
||||
"large": "",
|
||||
"medium": ""
|
||||
},
|
||||
"sizes": {
|
||||
"form-check-default": "",
|
||||
"height-small": "",
|
||||
"height-table-row": "",
|
||||
"icon-default": "",
|
||||
"max-height-logo": "",
|
||||
"max-width-logo": "",
|
||||
"tiles-default": "",
|
||||
"tiles-resize-step": "",
|
||||
"width-medium": ""
|
||||
},
|
||||
"spacing": {
|
||||
"large": "",
|
||||
"medium": "",
|
||||
"small": "",
|
||||
"xlarge": "",
|
||||
"xsmall": "",
|
||||
"xxlarge": ""
|
||||
}
|
||||
},
|
||||
"logo": "themes/opencloud-dev/assets/logo.svg",
|
||||
"favicon": "themes/opencloud-dev/assets/favicon.jpg"
|
||||
},
|
||||
"themes": [
|
||||
{
|
||||
"isDark": false,
|
||||
"label": "Light Theme",
|
||||
"designTokens": {
|
||||
"roles": {
|
||||
"primary": "#07677F",
|
||||
"surfaceTint": "#07677F",
|
||||
"onPrimary": "#FFFFFF",
|
||||
"primaryContainer": "#B7EAFF",
|
||||
"onPrimaryContainer": "#001F28",
|
||||
"secondary": "#20434f",
|
||||
"onSecondary": "#FFFFFF",
|
||||
"secondaryContainer": "#f4e5ff",
|
||||
"onSecondaryContainer": "#071E26",
|
||||
"tertiary": "#5A5C7E",
|
||||
"onTertiary": "#FFFFFF",
|
||||
"tertiaryContainer": "#E0E0FF",
|
||||
"onTertiaryContainer": "#171937",
|
||||
"error": "#BA1A1A",
|
||||
"onError": "#FFFFFF",
|
||||
"errorContainer": "#FFDAD6",
|
||||
"onErrorContainer": "#410002",
|
||||
"background": "#F5FAFD",
|
||||
"onBackground": "#171C1F",
|
||||
"surface": "#FFFFFF",
|
||||
"onSurface": "#171C1F",
|
||||
"surfaceVariant": "#DBE4E8",
|
||||
"onSurfaceVariant": "#40484C",
|
||||
"outline": "#70787C",
|
||||
"outlineVariant": "#BFC8CC",
|
||||
"shadow": "#000000",
|
||||
"scrim": "#000000",
|
||||
"inverseSurface": "#2C3134",
|
||||
"inverseOnSurface": "#EDF1F4",
|
||||
"inversePrimary": "#88D1EC",
|
||||
"primaryFixed": "#B7EAFF",
|
||||
"onPrimaryFixed": "#001F28",
|
||||
"primaryFixedDim": "#88D1EC",
|
||||
"onPrimaryFixedVariant": "#004E60",
|
||||
"secondaryFixed": "#CFE6F1",
|
||||
"onSecondaryFixed": "#071E26",
|
||||
"secondaryFixedDim": "#B3CAD4",
|
||||
"onSecondaryFixedVariant": "#344A52",
|
||||
"tertiaryFixed": "#E0E0FF",
|
||||
"onTertiaryFixed": "#171937",
|
||||
"tertiaryFixedDim": "#C3C3EB",
|
||||
"onTertiaryFixedVariant": "#424465",
|
||||
"surfaceDim": "#D6DBDE",
|
||||
"surfaceBright": "#F5FAFD",
|
||||
"surfaceContainerLowest": "#FFFFFF",
|
||||
"surfaceContainerLow": "#EFF4F7",
|
||||
"surfaceContainer": "#F1F3F4",
|
||||
"surfaceContainerHigh": "#E4E9EC",
|
||||
"surfaceContainerHighest": "#DEE3E6",
|
||||
"chrome": "#20434f",
|
||||
"onChrome": "#ffffff"
|
||||
},
|
||||
"colorPalette": {
|
||||
"icon-archive": "#fbbe54",
|
||||
"icon-audio": "#700460",
|
||||
"icon-document": "#3b44a6",
|
||||
"icon-folder": "#4d7eaf",
|
||||
"icon-image": "#ee6b3b",
|
||||
"icon-medical": "#0984db",
|
||||
"icon-pdf": "#ec0d47",
|
||||
"icon-presentation": "#ee6b3b",
|
||||
"icon-spreadsheet": "#15c286",
|
||||
"icon-video": "#045459"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"isDark": true,
|
||||
"label": "Dark Theme",
|
||||
"designTokens": {
|
||||
"roles": {
|
||||
"primary": "#DDB9F7",
|
||||
"surfaceTint": "#DDB9F7",
|
||||
"onPrimary": "#402357",
|
||||
"primaryContainer": "#583A6F",
|
||||
"onPrimaryContainer": "#F2DAFF",
|
||||
"secondary": "#FFFFFF",
|
||||
"onSecondary": "#372C3F",
|
||||
"secondaryContainer": "#000000",
|
||||
"onSecondaryContainer": "#EEDDF6",
|
||||
"tertiary": "#F4B7BB",
|
||||
"onTertiary": "#4C2529",
|
||||
"tertiaryContainer": "#663A3F",
|
||||
"onTertiaryContainer": "#FFDADB",
|
||||
"error": "#FFB4AB",
|
||||
"onError": "#690005",
|
||||
"errorContainer": "#93000A",
|
||||
"onErrorContainer": "#FFDAD6",
|
||||
"background": "#151217",
|
||||
"onBackground": "#FFFFFF",
|
||||
"surface": "#19353f",
|
||||
"onSurface": "#FFFFFF",
|
||||
"surfaceVariant": "#4B454D",
|
||||
"onSurfaceVariant": "#CDC3CE",
|
||||
"outline": "#968E98",
|
||||
"outlineVariant": "#4B454D",
|
||||
"shadow": "#000000",
|
||||
"scrim": "#000000",
|
||||
"inverseSurface": "#FFFFFF",
|
||||
"inverseOnSurface": "#332F35",
|
||||
"inversePrimary": "#715289",
|
||||
"primaryFixed": "#F2DAFF",
|
||||
"onPrimaryFixed": "#2A0C41",
|
||||
"primaryFixedDim": "#DDB9F7",
|
||||
"onPrimaryFixedVariant": "#583A6F",
|
||||
"secondaryFixed": "#EEDDF6",
|
||||
"onSecondaryFixed": "#211829",
|
||||
"secondaryFixedDim": "#D1C1D9",
|
||||
"onSecondaryFixedVariant": "#4E4256",
|
||||
"tertiaryFixed": "#FFDADB",
|
||||
"onTertiaryFixed": "#321015",
|
||||
"tertiaryFixedDim": "#F4B7BB",
|
||||
"onTertiaryFixedVariant": "#663A3F",
|
||||
"surfaceDim": "#151217",
|
||||
"surfaceBright": "#3C383E",
|
||||
"surfaceContainerLowest": "#100D12",
|
||||
"surfaceContainerLow": "#1E1A20",
|
||||
"surfaceContainer": "#082029",
|
||||
"surfaceContainerHigh": "#2D292E",
|
||||
"surfaceContainerHighest": "#383339",
|
||||
"chrome": "#082029",
|
||||
"onChrome": "#ffffff"
|
||||
},
|
||||
"colorPalette": {
|
||||
"icon-archive": "rgb(255, 207, 1)",
|
||||
"icon-audio": "rgb(208, 67, 236)",
|
||||
"icon-document": "rgb(44, 101, 255)",
|
||||
"icon-folder": "rgb(44, 101, 255)",
|
||||
"icon-image": "rgb(255, 111, 0)",
|
||||
"icon-medical": "rgb(9,132,219)",
|
||||
"icon-pdf": "rgb(225, 5, 14)",
|
||||
"icon-presentation": "rgb(255, 64, 6)",
|
||||
"icon-spreadsheet": "rgb(0, 182, 87)",
|
||||
"icon-video": "rgb(0, 187, 219)"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"logo": "themes/opencloud-dev/assets/logo.svg",
|
||||
"name": "OpenCloud",
|
||||
"shareRoles": {
|
||||
"1c996275-f1c9-4e71-abdf-a42f6495e960": {
|
||||
"iconName": "upload",
|
||||
"label": "UnifiedRoleEditorLite"
|
||||
},
|
||||
"2d00ce52-1fc2-4dbc-8b95-a73b73395f5a": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleFileEditor"
|
||||
},
|
||||
"312c0871-5ef7-4b3a-85b6-0e4074c64049": {
|
||||
"iconName": "user-star",
|
||||
"label": "UnifiedRoleManager"
|
||||
},
|
||||
"3284f2d5-0070-4ad8-ac40-c247f7c1fb27": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleSpaceEditorWithoutVersions"
|
||||
},
|
||||
"58c63c02-1d89-4572-916a-870abc5a1b7d": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleSpaceEditor"
|
||||
},
|
||||
"63e64e19-8d43-42ec-a738-2b6af2610efa": {
|
||||
"iconName": "stop-circle",
|
||||
"label": "UnifiedRoleFullDenial"
|
||||
},
|
||||
"a8d5fe5e-96e3-418d-825b-534dbdf22b99": {
|
||||
"iconName": "eye",
|
||||
"label": "UnifiedRoleSpaceViewer"
|
||||
},
|
||||
"aa97fe03-7980-45ac-9e50-b325749fd7e6": {
|
||||
"iconName": "shield",
|
||||
"label": "UnifiedRoleSecureView"
|
||||
},
|
||||
"b1e2218d-eef8-4d4c-b82d-0f1a1b48f3b5": {
|
||||
"iconName": "eye",
|
||||
"name": "UnifiedRoleViewer"
|
||||
},
|
||||
"c1235aea-d106-42db-8458-7d5610fb0a67": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleFileEditorListGrants"
|
||||
},
|
||||
"d5041006-ebb3-4b4a-b6a4-7c180ecfb17d": {
|
||||
"iconName": "eye",
|
||||
"name": "UnifiedRoleViewerListGrants"
|
||||
},
|
||||
"e8ea8b21-abd4-45d2-b893-8d1546378e9e": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleEditorListGrants"
|
||||
},
|
||||
"fb6c3e19-e378-47e5-b277-9732f9de6e21": {
|
||||
"iconName": "pencil",
|
||||
"label": "UnifiedRoleEditor"
|
||||
}
|
||||
},
|
||||
"slogan": "OpenCloud – Your friendly neighbourhood cloud",
|
||||
"urls": {
|
||||
"accessDeniedHelp": "",
|
||||
"imprint": "",
|
||||
"privacy": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,59 +93,6 @@
|
||||
"isDark": false,
|
||||
"label": "Light Theme",
|
||||
"designTokens": {
|
||||
"roles": {
|
||||
"primary": "#07677F",
|
||||
"surfaceTint": "#07677F",
|
||||
"onPrimary": "#FFFFFF",
|
||||
"primaryContainer": "#B7EAFF",
|
||||
"onPrimaryContainer": "#001F28",
|
||||
"secondary": "#20434f",
|
||||
"onSecondary": "#FFFFFF",
|
||||
"secondaryContainer": "#f4e5ff",
|
||||
"onSecondaryContainer": "#071E26",
|
||||
"tertiary": "#5A5C7E",
|
||||
"onTertiary": "#FFFFFF",
|
||||
"tertiaryContainer": "#E0E0FF",
|
||||
"onTertiaryContainer": "#171937",
|
||||
"error": "#BA1A1A",
|
||||
"onError": "#FFFFFF",
|
||||
"errorContainer": "#FFDAD6",
|
||||
"onErrorContainer": "#410002",
|
||||
"background": "#F5FAFD",
|
||||
"onBackground": "#171C1F",
|
||||
"surface": "#FFFFFF",
|
||||
"onSurface": "#171C1F",
|
||||
"surfaceVariant": "#DBE4E8",
|
||||
"onSurfaceVariant": "#40484C",
|
||||
"outline": "#70787C",
|
||||
"outlineVariant": "#BFC8CC",
|
||||
"shadow": "#000000",
|
||||
"scrim": "#000000",
|
||||
"inverseSurface": "#2C3134",
|
||||
"inverseOnSurface": "#EDF1F4",
|
||||
"inversePrimary": "#88D1EC",
|
||||
"primaryFixed": "#B7EAFF",
|
||||
"onPrimaryFixed": "#001F28",
|
||||
"primaryFixedDim": "#88D1EC",
|
||||
"onPrimaryFixedVariant": "#004E60",
|
||||
"secondaryFixed": "#CFE6F1",
|
||||
"onSecondaryFixed": "#071E26",
|
||||
"secondaryFixedDim": "#B3CAD4",
|
||||
"onSecondaryFixedVariant": "#344A52",
|
||||
"tertiaryFixed": "#E0E0FF",
|
||||
"onTertiaryFixed": "#171937",
|
||||
"tertiaryFixedDim": "#C3C3EB",
|
||||
"onTertiaryFixedVariant": "#424465",
|
||||
"surfaceDim": "#D6DBDE",
|
||||
"surfaceBright": "#F5FAFD",
|
||||
"surfaceContainerLowest": "#FFFFFF",
|
||||
"surfaceContainerLow": "#EFF4F7",
|
||||
"surfaceContainer": "#F1F3F4",
|
||||
"surfaceContainerHigh": "#E4E9EC",
|
||||
"surfaceContainerHighest": "#DEE3E6",
|
||||
"chrome": "#20434f",
|
||||
"onChrome": "#ffffff"
|
||||
},
|
||||
"colorPalette": {
|
||||
"background-accentuate": "rgba(255, 255, 5, 0.1)",
|
||||
"background-default": "#ffffff",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
services:
|
||||
acceptance-tests:
|
||||
image: owncloudci/php:8.2
|
||||
working_dir: /woodpecker/src/github.com/opencloud-eu/opencloud
|
||||
working_dir: /drone/src
|
||||
command: /bin/bash /test/run-tests.sh
|
||||
environment:
|
||||
OC_ROOT: /woodpecker/src/github.com/opencloud-eu/opencloud
|
||||
OC_ROOT: /drone/src
|
||||
TEST_SERVER_URL: https://opencloud-server:9200
|
||||
OC_WRAPPER_URL: http://opencloud-server:5200
|
||||
STORAGE_DRIVER: $STORAGE_DRIVER
|
||||
@@ -17,8 +17,8 @@ services:
|
||||
EMAIL_HOST: email
|
||||
EMAIL_PORT: 9000
|
||||
env_file:
|
||||
- ../../../../.woodpecker.env
|
||||
- ../../../../.drone.env
|
||||
volumes:
|
||||
- ./run-tests.sh:/test/run-tests.sh
|
||||
- ../../../../:/woodpecker/src/github.com/opencloud-eu/opencloud
|
||||
- ../../../../:/drone/src
|
||||
- ../../../../vendor-bin/behat/composer.json:/tmp/vendor-bin/behat/composer.json
|
||||
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
STORAGE_SYSTEM_DRIVER_OC_ROOT: /srv/app/tmp/opencloud/storage/metadata
|
||||
SHARING_USER_JSON_FILE: /srv/app/tmp/opencloud/shares.json
|
||||
PROXY_ENABLE_BASIC_AUTH: "true"
|
||||
WEB_UI_CONFIG_FILE: /woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/drone/opencloud-config.json
|
||||
WEB_UI_CONFIG_FILE: /drone/src/tests/config/drone/opencloud-config.json
|
||||
ACCOUNTS_HASH_DIFFICULTY: 4
|
||||
OC_INSECURE: "true"
|
||||
IDM_CREATE_DEMO_USERS: "true"
|
||||
@@ -52,11 +52,11 @@ services:
|
||||
SEARCH_EXTRACTOR_CS3SOURCE_INSECURE: "true"
|
||||
|
||||
# fonts map for txt thumbnails (including unicode support)
|
||||
THUMBNAILS_TXT_FONTMAP_FILE: "/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/drone/fontsMap.json"
|
||||
THUMBNAILS_TXT_FONTMAP_FILE: "/drone/src/tests/config/drone/fontsMap.json"
|
||||
ports:
|
||||
- '9200:9200'
|
||||
- '5200:5200' ## ocwrapper
|
||||
- '9174:9174' ## notifications debug
|
||||
volumes:
|
||||
- ../../../config:/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config
|
||||
- ../../../config:/drone/src/tests/config
|
||||
- ../../../ocwrapper/bin/ocwrapper:/usr/bin/ocwrapper
|
||||
|
||||
@@ -196,23 +196,10 @@
|
||||
- [apiAntivirus/antivirus.feature:309](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L309)
|
||||
- [apiAntivirus/antivirus.feature:310](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L310)
|
||||
- [apiAntivirus/antivirus.feature:311](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L311)
|
||||
- [apiAntivirus/antivirus.feature:312](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L312)
|
||||
- [apiAntivirus/antivirus.feature:313](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L313)
|
||||
- [apiAntivirus/antivirus.feature:314](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L314)
|
||||
- [apiNotification/deprovisioningNotification.feature:126](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/deprovisioningNotification.feature#L126)
|
||||
- [apiNotification/deprovisioningNotification.feature:127](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/deprovisioningNotification.feature#L127)
|
||||
- [apiNotification/notification.feature:282](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L282)
|
||||
- [apiNotification/notification.feature:283](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L283)
|
||||
- [apiNotification/notification.feature:284](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L284)
|
||||
- [apiNotification/notification.feature:285](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L285)
|
||||
- [apiNotification/notification.feature:288](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/notification.feature#L288)
|
||||
- [apiNotification/spaceNotification.feature:434](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/spaceNotification.feature#L434)
|
||||
- [apiNotification/spaceNotification.feature:435](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/spaceNotification.feature#L435)
|
||||
- [apiNotification/emailNotification.feature:84](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/emailNotification.feature#L84)
|
||||
- [apiNotification/emailNotification.feature:117](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/emailNotification.feature#L117)
|
||||
- [apiNotification/emailNotification.feature:150](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/emailNotification.feature#L150)
|
||||
- [apiNotification/emailNotification.feature:205](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiNotification/emailNotification.feature#L205)
|
||||
- [apiActivities/activities.feature:2598](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiActivities/activities.feature#L2598)
|
||||
|
||||
|
||||
#### [Missing properties in REPORT response](https://github.com/owncloud/ocis/issues/9780), [d:getetag property has empty value in REPORT response](https://github.com/owncloud/ocis/issues/9783)
|
||||
@@ -224,27 +211,6 @@
|
||||
- [apiSearch1/search.feature:466](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L466)
|
||||
- [apiSearch1/search.feature:467](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiSearch1/search.feature#L467)
|
||||
|
||||
#### [No notification triggered for .zip virus file](https://github.com/opencloud-eu/opencloud/issues/382)
|
||||
- [apiAntivirus/antivirus.feature:41](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L41)
|
||||
- [apiAntivirus/antivirus.feature:43](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L43)
|
||||
- [apiAntivirus/antivirus.feature:45](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L45)
|
||||
- [apiAntivirus/antivirus.feature:69](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L69)
|
||||
- [apiAntivirus/antivirus.feature:71](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L71)
|
||||
- [apiAntivirus/antivirus.feature:73](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L73)
|
||||
- [apiAntivirus/antivirus.feature:115](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L115)
|
||||
- [apiAntivirus/antivirus.feature:117](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L117)
|
||||
- [apiAntivirus/antivirus.feature:119](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L119)
|
||||
- [apiAntivirus/antivirus.feature:141](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L141)
|
||||
- [apiAntivirus/antivirus.feature:143](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L143)
|
||||
- [apiAntivirus/antivirus.feature:145](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L145)
|
||||
- [apiAntivirus/antivirus.feature:169](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L169)
|
||||
- [apiAntivirus/antivirus.feature:171](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L171)
|
||||
- [apiAntivirus/antivirus.feature:173](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L173)
|
||||
- [apiAntivirus/antivirus.feature:199](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L199)
|
||||
- [apiAntivirus/antivirus.feature:201](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L201)
|
||||
- [apiAntivirus/antivirus.feature:203](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L203)
|
||||
- [apiAntivirus/antivirus.feature:228](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L228)
|
||||
- [apiAntivirus/antivirus.feature:253](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L253)
|
||||
|
||||
Note: always have an empty line at the end of this file.
|
||||
The bash script that processes this file requires that the last line has a newline on the end.
|
||||
|
||||
@@ -208,6 +208,8 @@
|
||||
- [apiLocks/unlockFiles.feature:321](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiLocks/unlockFiles.feature#L321)
|
||||
- [apiLocks/unlockFiles.feature:322](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiLocks/unlockFiles.feature#L322)
|
||||
- [apiLocks/unlockFiles.feature:323](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiLocks/unlockFiles.feature#L323)
|
||||
- [apiActivities/shareActivities.feature:1956](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiActivities/shareActivities.feature#L1956)
|
||||
- [apiActivities/shareActivities.feature:2095](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiActivities/shareActivities.feature#L2095)
|
||||
- [apiAntivirus/antivirus.feature:114](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L114)
|
||||
- [apiAntivirus/antivirus.feature:115](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L115)
|
||||
- [apiAntivirus/antivirus.feature:116](https://github.com/opencloud-eu/opencloud/blob/main/tests/acceptance/features/apiAntivirus/antivirus.feature#L116)
|
||||
|
||||
@@ -2594,7 +2594,7 @@ Feature: check activities
|
||||
}
|
||||
"""
|
||||
|
||||
@issue-9856 @issue-10127 @issue-369
|
||||
@issue-9856 @issue-10127
|
||||
Scenario: check activity message with different language
|
||||
Given user "Alice" has uploaded file with content "OpenCloud test text file" to "textfile.txt"
|
||||
And user "Alice" has switched the system language to "de" using the Graph API
|
||||
|
||||
@@ -737,7 +737,7 @@ Feature: check share activity
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -2357,7 +2357,7 @@ Feature: check share activity
|
||||
"required": ["id","name"],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "FOLDER"
|
||||
"const": "Alice Hansen"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Alice" file "<new-file-name>" should not exist
|
||||
Examples:
|
||||
| dav-path-version | file-name | new-file-name |
|
||||
@@ -54,7 +54,7 @@ Feature: antivirus
|
||||
And the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Alice" file "<new-file-name>" should not exist
|
||||
But as "Alice" file "/normalfile.txt" should exist
|
||||
And the content of file "/normalfile.txt" for user "Alice" should be:
|
||||
@@ -107,7 +107,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Alice" file "/uploadFolder/<new-file-name>" should not exist
|
||||
Examples:
|
||||
| dav-path-version | file-name | new-file-name |
|
||||
@@ -133,7 +133,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Alice" file "/uploadFolder/<new-file-name>" should not exist
|
||||
Examples:
|
||||
| dav-path-version | file-name | new-file-name |
|
||||
@@ -160,7 +160,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Brian" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Brian" file "/Shares/uploadFolder/<new-file-name>" should not exist
|
||||
And as "Alice" file "/uploadFolder/<new-file-name>" should not exist
|
||||
Examples:
|
||||
@@ -190,7 +190,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Brian" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Brian" file "/Shares/uploadFolder/<new-file-name>" should not exist
|
||||
And as "Alice" file "/uploadFolder/<new-file-name>" should not exist
|
||||
Examples:
|
||||
@@ -212,14 +212,14 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification for resource "<new-file-name>" with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And for user "Alice" folder "uploadFolder" of the space "new-space" should not contain these entries:
|
||||
| <new-file-name> |
|
||||
When user "Alice" uploads a file "filesForUpload/filesWithVirus/<file-name>" to "/<new-file-name>" in space "new-space" using the WebDAV API
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification for resource "<new-file-name>" with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And for user "Alice" the space "new-space" should not contain these entries:
|
||||
| /<new-file-name> |
|
||||
Examples:
|
||||
@@ -242,7 +242,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Brian" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in <new-file-name>. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And for user "Brian" the space "new-space" should not contain these entries:
|
||||
| /<new-file-name> |
|
||||
And for user "Alice" the space "new-space" should not contain these entries:
|
||||
@@ -273,7 +273,7 @@ Feature: antivirus
|
||||
Then the HTTP status code should be "201"
|
||||
And user "Alice" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in aFileWithVirus.txt. Upload not possible. Virus: Eicar-Signature |
|
||||
| Virus found in aFileWithVirus.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And as "Alice" file "/aFileWithVirus.txt" should not exist
|
||||
Examples:
|
||||
| dav-path-version |
|
||||
@@ -294,7 +294,7 @@ Feature: antivirus
|
||||
| new |
|
||||
| spaces |
|
||||
|
||||
@issue-enterprise-5706 @issue-183 @issue-369
|
||||
@issue-enterprise-5706 @issue-183
|
||||
Scenario Outline: upload a file with virus and get notification in different languages
|
||||
Given user "Alice" has switched the system language to "<language>" using the Graph API
|
||||
And using <dav-path-version> DAV path
|
||||
@@ -305,13 +305,13 @@ Feature: antivirus
|
||||
| <message> |
|
||||
And as "Alice" file "/aFileWithVirus.txt" should not exist
|
||||
Examples:
|
||||
| dav-path-version | language | subject | message |
|
||||
| old | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Eicar-Signature |
|
||||
| new | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Eicar-Signature |
|
||||
| spaces | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Eicar-Signature |
|
||||
| old | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Eicar-Signature |
|
||||
| new | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Eicar-Signature |
|
||||
| spaces | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Eicar-Signature |
|
||||
| dav-path-version | language | subject | message |
|
||||
| old | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
| new | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
| spaces | es | Virus encontrado | Virus encontrado en aFileWithVirus.txt. La subida no ha sido posible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
| old | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 |
|
||||
| new | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 |
|
||||
| spaces | de | Virus gefunden | In aFileWithVirus.txt wurde potenziell schädlicher Code gefunden. Das Hochladen wurde abgebrochen. Grund: Win.Test.EICAR_HDB-1 |
|
||||
|
||||
@issue-enterprise-5709
|
||||
Scenario Outline: try to create a version of file by uploading virus content
|
||||
@@ -477,7 +477,7 @@ Feature: antivirus
|
||||
When user "Brian" uploads a file "filesForUpload/filesWithVirus/eicar.com" to "text.txt" in space "new-space" using the WebDAV API
|
||||
Then the HTTP status code should be "204"
|
||||
And user "Brian" should get a notification with subject "Virus found" and message:
|
||||
| message |
|
||||
| Virus found in text.txt. Upload not possible. Virus: Eicar-Signature |
|
||||
| message |
|
||||
| Virus found in text.txt. Upload not possible. Virus: Win.Test.EICAR_HDB-1 |
|
||||
And for user "Brian" the content of the file "/text.txt" of the space "new-space" should be "hello world"
|
||||
And for user "Alice" the content of the file "/text.txt" of the space "new-space" should be "hello world"
|
||||
|
||||
@@ -256,7 +256,7 @@ Feature: enforce password on public link
|
||||
|
||||
|
||||
Scenario Outline: update a public link with a password that is listed in the Banned-Password-List
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using OCS API version "2"
|
||||
And user "Alice" has been created with default attributes
|
||||
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
|
||||
@@ -272,14 +272,14 @@ Feature: enforce password on public link
|
||||
And the OCS status code should be "<ocs-status-code>"
|
||||
And the OCS status message should be "<message>"
|
||||
Examples:
|
||||
| password | http-status-code | ocs-status-code | message |
|
||||
| 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | http-status-code | ocs-status-code | message |
|
||||
| 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| OpenCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
|
||||
|
||||
Scenario Outline: create a public link with a password that is listed in the Banned-Password-List
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using OCS API version "2"
|
||||
And user "Alice" has been created with default attributes
|
||||
And user "Alice" has uploaded file with content "test file" to "/testfile.txt"
|
||||
@@ -291,7 +291,7 @@ Feature: enforce password on public link
|
||||
And the OCS status code should be "<ocs-status-code>"
|
||||
And the OCS status message should be "<message>"
|
||||
Examples:
|
||||
| password | http-status-code | ocs-status-code | message |
|
||||
| 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | http-status-code | ocs-status-code | message |
|
||||
| 123 | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| password | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
| OpenCloud | 400 | 400 | Unfortunately, your password is commonly used. please pick a harder-to-guess password for your safety |
|
||||
|
||||
@@ -502,7 +502,7 @@ Feature: Create a link share for a resource
|
||||
|
||||
|
||||
Scenario Outline: create a file's link share with a password that is listed in the Banned-Password-List using permissions endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And user "Alice" has uploaded file with content "other data" to "text.txt"
|
||||
When user "Alice" creates the following resource link share using the Graph API:
|
||||
| resource | text.txt |
|
||||
@@ -757,7 +757,7 @@ Feature: Create a link share for a resource
|
||||
|
||||
|
||||
Scenario Outline: create a link share of a folder inside project-space with a password that is listed in the Banned-Password-List using permissions endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
|
||||
@@ -799,16 +799,16 @@ Feature: Create a link share for a resource
|
||||
| banned-password | permissions-role |
|
||||
| 123 | view |
|
||||
| password | view |
|
||||
| OpenCloud | view |
|
||||
| OpenCloud | view |
|
||||
| 123 | edit |
|
||||
| password | edit |
|
||||
| OpenCloud | edit |
|
||||
| OpenCloud | edit |
|
||||
| 123 | upload |
|
||||
| password | upload |
|
||||
| OpenCloud | upload |
|
||||
| OpenCloud | upload |
|
||||
| 123 | createOnly |
|
||||
| password | createOnly |
|
||||
| OpenCloud | createOnly |
|
||||
| OpenCloud | createOnly |
|
||||
|
||||
@env-config @issue-7879
|
||||
Scenario Outline: create a link share of a file inside project-space without password using permissions endpoint
|
||||
@@ -1157,7 +1157,7 @@ Feature: Create a link share for a resource
|
||||
|
||||
|
||||
Scenario Outline: create a link share of a file inside project-space with a password that is listed in the Banned-Password-List using permissions endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
|
||||
@@ -1199,10 +1199,10 @@ Feature: Create a link share for a resource
|
||||
| banned-password | permissions-role |
|
||||
| 123 | view |
|
||||
| password | view |
|
||||
| OpenCloud | view |
|
||||
| OpenCloud | view |
|
||||
| 123 | edit |
|
||||
| password | edit |
|
||||
| OpenCloud | edit |
|
||||
| OpenCloud | edit |
|
||||
|
||||
@env-config @issue-9724 @issue-10331
|
||||
Scenario: set password on a existing link share of a file inside project-space using permissions endpoint
|
||||
@@ -1612,7 +1612,7 @@ Feature: Create a link share for a resource
|
||||
|
||||
|
||||
Scenario Outline: try to create a link share of a project-space with a password that is listed in the Banned-Password-List using permissions endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
|
||||
|
||||
@@ -232,7 +232,7 @@ Feature: Update a link share for a resource
|
||||
|
||||
|
||||
Scenario Outline: update a file's link share with a password that is listed in the Banned-Password-List using permissions endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And user "Alice" has uploaded file with content "other data" to "text.txt"
|
||||
And user "Alice" has created the following resource link share:
|
||||
| resource | text.txt |
|
||||
@@ -276,7 +276,7 @@ Feature: Update a link share for a resource
|
||||
| banned-password |
|
||||
| 123 |
|
||||
| password |
|
||||
| OpenCloud |
|
||||
| OpenCloud |
|
||||
|
||||
@env-config @issue-9724 @issue-10331
|
||||
Scenario: set password on a existing link share of a folder inside project-space using permissions endpoint
|
||||
|
||||
@@ -349,7 +349,7 @@ Feature: Create a link share for a resource
|
||||
|
||||
@issue-7879 @skip-local-run
|
||||
Scenario Outline: try to create a link share of a project-space drive with a password that is listed in the Banned-Password-List using root endpoint
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/woodpecker/banned-password-list.txt"
|
||||
Given the config "OC_PASSWORD_POLICY_BANNED_PASSWORDS_LIST" has been set to path "config/drone/banned-password-list.txt"
|
||||
And using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
|
||||
@@ -389,21 +389,21 @@ Feature: Create a link share for a resource
|
||||
| banned-password | permissions-role |
|
||||
| 123 | view |
|
||||
| password | view |
|
||||
| OpenCloud | view |
|
||||
| OpenCloud | view |
|
||||
| 123 | edit |
|
||||
| password | edit |
|
||||
| OpenCloud | edit |
|
||||
| OpenCloud | edit |
|
||||
| 123 | upload |
|
||||
| password | upload |
|
||||
| OpenCloud | upload |
|
||||
| OpenCloud | upload |
|
||||
| 123 | createOnly |
|
||||
| password | createOnly |
|
||||
| OpenCloud | createOnly |
|
||||
| OpenCloud | createOnly |
|
||||
|
||||
@env-config @issue-7879
|
||||
Scenario Outline: create a link share of a project-space drive without password using root endpoint
|
||||
Given the following configs have been set:
|
||||
| config | value |
|
||||
| config | value |
|
||||
| OC_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD | false |
|
||||
And using spaces DAV path
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
source .woodpecker.env
|
||||
source .drone.env
|
||||
|
||||
# if no $1 is supplied end the script
|
||||
# Can be web, acceptance or e2e
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"defaultFont": "/woodpecker/src/github.com/opencloud-eu/opencloud/tests/config/woodpecker/NotoSans.ttf"
|
||||
"defaultFont": "/drone/src/tests/config/drone/NotoSans.ttf"
|
||||
}
|
||||
|
||||
8
vendor/github.com/kovidgoyal/imaging/.goreleaser.yaml
generated
vendored
8
vendor/github.com/kovidgoyal/imaging/.goreleaser.yaml
generated
vendored
@@ -6,7 +6,7 @@
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||
|
||||
version: 2
|
||||
version: 1
|
||||
|
||||
before:
|
||||
hooks:
|
||||
@@ -34,4 +34,8 @@ archives:
|
||||
format: zip
|
||||
|
||||
changelog:
|
||||
disable: true
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
|
||||
2
vendor/github.com/kovidgoyal/imaging/publish.py
generated
vendored
2
vendor/github.com/kovidgoyal/imaging/publish.py
generated
vendored
@@ -22,7 +22,7 @@ def main():
|
||||
os.environ['GITHUB_TOKEN'] = open(os.path.join(os.environ['PENV'], 'github-token')).read().strip()
|
||||
run('git', 'tag', '-a', 'v' + version, '-m', f'version {version}')
|
||||
run('git', 'push')
|
||||
run('goreleaser', 'release', '--clean')
|
||||
run('goreleaser', 'release')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
32
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/trashbin/trashbin.go
generated
vendored
32
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/trashbin/trashbin.go
generated
vendored
@@ -26,13 +26,13 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/rs/zerolog"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/trace"
|
||||
|
||||
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
|
||||
typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/errtypes"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/lookup"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/storage/fs/posix/options"
|
||||
@@ -145,7 +145,7 @@ func trashRootForNode(n *node.Node) string {
|
||||
}
|
||||
|
||||
func (tb *Trashbin) MoveToTrash(ctx context.Context, n *node.Node, path string) error {
|
||||
key := n.ID
|
||||
key := uuid.New().String()
|
||||
trashPath := trashRootForNode(n)
|
||||
|
||||
err := os.MkdirAll(filepath.Join(trashPath, "info"), 0755)
|
||||
@@ -197,30 +197,6 @@ func (tb *Trashbin) ListRecycle(ctx context.Context, spaceID string, key, relati
|
||||
return nil, err
|
||||
}
|
||||
originalPath = filepath.Join(originalPath, relativePath)
|
||||
|
||||
fi, err := os.Stat(base)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
item := &provider.RecycleItem{
|
||||
Key: filepath.Join(key, relativePath),
|
||||
Size: uint64(fi.Size()),
|
||||
Ref: &provider.Reference{
|
||||
ResourceId: &provider.ResourceId{
|
||||
SpaceId: spaceID,
|
||||
OpaqueId: spaceID,
|
||||
},
|
||||
Path: originalPath,
|
||||
},
|
||||
DeletionTime: ts,
|
||||
Type: provider.ResourceType_RESOURCE_TYPE_FILE,
|
||||
}
|
||||
if fi.IsDir() {
|
||||
item.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER
|
||||
} else {
|
||||
item.Type = provider.ResourceType_RESOURCE_TYPE_FILE
|
||||
}
|
||||
return []*provider.RecycleItem{item}, nil
|
||||
}
|
||||
|
||||
items := []*provider.RecycleItem{}
|
||||
@@ -311,10 +287,6 @@ func (tb *Trashbin) RestoreRecycleItem(ctx context.Context, spaceID string, key,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if id == "" {
|
||||
return nil, errtypes.NotFound("trashbin: item not found")
|
||||
|
||||
}
|
||||
|
||||
// update parent id in case it was restored to a different location
|
||||
_, parentID, _, err := tb.lu.MetadataBackend().IdentifyPath(ctx, filepath.Dir(restorePath))
|
||||
|
||||
9
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/decomposedfs.go
generated
vendored
9
vendor/github.com/opencloud-eu/reva/v2/pkg/storage/pkg/decomposedfs/decomposedfs.go
generated
vendored
@@ -102,10 +102,6 @@ type Session interface {
|
||||
LockID() string
|
||||
}
|
||||
|
||||
type IDCachingTree interface {
|
||||
WarmupIDCache(root string, assimilate, onlyDirty bool) error
|
||||
}
|
||||
|
||||
type SessionStore interface {
|
||||
New(ctx context.Context) *upload.DecomposedFsSession
|
||||
List(ctx context.Context) ([]*upload.DecomposedFsSession, error)
|
||||
@@ -1308,11 +1304,6 @@ func (fs *Decomposedfs) RestoreRecycleItem(ctx context.Context, space *provider.
|
||||
return err
|
||||
}
|
||||
sizeDiff = int64(treeSize)
|
||||
|
||||
// Warmup posix IDCache if restored path is a directory
|
||||
if cachingTree, ok := fs.tp.(IDCachingTree); ok {
|
||||
_ = cachingTree.WarmupIDCache(restoredNode.InternalPath(), false, false)
|
||||
}
|
||||
} else {
|
||||
sizeDiff = restoredNode.Blobsize
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ func New(m map[string]interface{}) (*Options, error) {
|
||||
o.Root = filepath.Clean(o.Root)
|
||||
|
||||
if o.PersonalSpaceAliasTemplate == "" {
|
||||
o.PersonalSpaceAliasTemplate = "{{.SpaceType}}/{{.User.Username | lower}}"
|
||||
o.PersonalSpaceAliasTemplate = "{{.SpaceType}}/{{.User.Username}}"
|
||||
}
|
||||
|
||||
if o.GeneralSpaceAliasTemplate == "" {
|
||||
|
||||
5
vendor/github.com/prometheus/alertmanager/NOTICE
generated
vendored
5
vendor/github.com/prometheus/alertmanager/NOTICE
generated
vendored
@@ -11,3 +11,8 @@ Bootstrap
|
||||
http://getbootstrap.com
|
||||
Copyright 2011-2014 Twitter, Inc.
|
||||
Licensed under the MIT License
|
||||
|
||||
bootstrap-datetimepicker.js
|
||||
http://www.eyecon.ro/bootstrap-datepicker
|
||||
Copyright 2012 Stefan Petre
|
||||
Licensed under the Apache License, Version 2.0
|
||||
|
||||
12
vendor/github.com/prometheus/alertmanager/asset/assets_vfsdata.go
generated
vendored
12
vendor/github.com/prometheus/alertmanager/asset/assets_vfsdata.go
generated
vendored
File diff suppressed because one or more lines are too long
52
vendor/github.com/prometheus/alertmanager/featurecontrol/featurecontrol.go
generated
vendored
52
vendor/github.com/prometheus/alertmanager/featurecontrol/featurecontrol.go
generated
vendored
@@ -16,41 +16,35 @@ package featurecontrol
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
|
||||
"github.com/go-kit/log"
|
||||
"github.com/go-kit/log/level"
|
||||
)
|
||||
|
||||
const (
|
||||
FeatureReceiverNameInMetrics = "receiver-name-in-metrics"
|
||||
FeatureClassicMode = "classic-mode"
|
||||
FeatureUTF8StrictMode = "utf8-strict-mode"
|
||||
FeatureAutoGOMEMLIMIT = "auto-gomemlimit"
|
||||
FeatureAutoGOMAXPROCS = "auto-gomaxprocs"
|
||||
)
|
||||
|
||||
var AllowedFlags = []string{
|
||||
FeatureReceiverNameInMetrics,
|
||||
FeatureClassicMode,
|
||||
FeatureUTF8StrictMode,
|
||||
FeatureAutoGOMEMLIMIT,
|
||||
FeatureAutoGOMAXPROCS,
|
||||
}
|
||||
|
||||
type Flagger interface {
|
||||
EnableReceiverNamesInMetrics() bool
|
||||
ClassicMode() bool
|
||||
UTF8StrictMode() bool
|
||||
EnableAutoGOMEMLIMIT() bool
|
||||
EnableAutoGOMAXPROCS() bool
|
||||
}
|
||||
|
||||
type Flags struct {
|
||||
logger *slog.Logger
|
||||
logger log.Logger
|
||||
enableReceiverNamesInMetrics bool
|
||||
classicMode bool
|
||||
utf8StrictMode bool
|
||||
enableAutoGOMEMLIMIT bool
|
||||
enableAutoGOMAXPROCS bool
|
||||
}
|
||||
|
||||
func (f *Flags) EnableReceiverNamesInMetrics() bool {
|
||||
@@ -65,14 +59,6 @@ func (f *Flags) UTF8StrictMode() bool {
|
||||
return f.utf8StrictMode
|
||||
}
|
||||
|
||||
func (f *Flags) EnableAutoGOMEMLIMIT() bool {
|
||||
return f.enableAutoGOMEMLIMIT
|
||||
}
|
||||
|
||||
func (f *Flags) EnableAutoGOMAXPROCS() bool {
|
||||
return f.enableAutoGOMAXPROCS
|
||||
}
|
||||
|
||||
type flagOption func(flags *Flags)
|
||||
|
||||
func enableReceiverNameInMetrics() flagOption {
|
||||
@@ -93,19 +79,7 @@ func enableUTF8StrictMode() flagOption {
|
||||
}
|
||||
}
|
||||
|
||||
func enableAutoGOMEMLIMIT() flagOption {
|
||||
return func(configs *Flags) {
|
||||
configs.enableAutoGOMEMLIMIT = true
|
||||
}
|
||||
}
|
||||
|
||||
func enableAutoGOMAXPROCS() flagOption {
|
||||
return func(configs *Flags) {
|
||||
configs.enableAutoGOMAXPROCS = true
|
||||
}
|
||||
}
|
||||
|
||||
func NewFlags(logger *slog.Logger, features string) (Flagger, error) {
|
||||
func NewFlags(logger log.Logger, features string) (Flagger, error) {
|
||||
fc := &Flags{logger: logger}
|
||||
opts := []flagOption{}
|
||||
|
||||
@@ -117,19 +91,13 @@ func NewFlags(logger *slog.Logger, features string) (Flagger, error) {
|
||||
switch feature {
|
||||
case FeatureReceiverNameInMetrics:
|
||||
opts = append(opts, enableReceiverNameInMetrics())
|
||||
logger.Warn("Experimental receiver name in metrics enabled")
|
||||
level.Warn(logger).Log("msg", "Experimental receiver name in metrics enabled")
|
||||
case FeatureClassicMode:
|
||||
opts = append(opts, enableClassicMode())
|
||||
logger.Warn("Classic mode enabled")
|
||||
level.Warn(logger).Log("msg", "Classic mode enabled")
|
||||
case FeatureUTF8StrictMode:
|
||||
opts = append(opts, enableUTF8StrictMode())
|
||||
logger.Warn("UTF-8 strict mode enabled")
|
||||
case FeatureAutoGOMEMLIMIT:
|
||||
opts = append(opts, enableAutoGOMEMLIMIT())
|
||||
logger.Warn("Automatically set GOMEMLIMIT to match the Linux container or system memory limit.")
|
||||
case FeatureAutoGOMAXPROCS:
|
||||
opts = append(opts, enableAutoGOMAXPROCS())
|
||||
logger.Warn("Automatically set GOMAXPROCS to match Linux container CPU quota")
|
||||
level.Warn(logger).Log("msg", "UTF-8 strict mode enabled")
|
||||
default:
|
||||
return nil, fmt.Errorf("Unknown option '%s' for --enable-feature", feature)
|
||||
}
|
||||
@@ -153,7 +121,3 @@ func (n NoopFlags) EnableReceiverNamesInMetrics() bool { return false }
|
||||
func (n NoopFlags) ClassicMode() bool { return false }
|
||||
|
||||
func (n NoopFlags) UTF8StrictMode() bool { return false }
|
||||
|
||||
func (n NoopFlags) EnableAutoGOMEMLIMIT() bool { return false }
|
||||
|
||||
func (n NoopFlags) EnableAutoGOMAXPROCS() bool { return false }
|
||||
|
||||
@@ -15,23 +15,23 @@ package compat
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"reflect"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/go-kit/log"
|
||||
"github.com/go-kit/log/level"
|
||||
"github.com/prometheus/common/model"
|
||||
"github.com/prometheus/common/promslog"
|
||||
|
||||
"github.com/prometheus/alertmanager/featurecontrol"
|
||||
"github.com/prometheus/alertmanager/matcher/parse"
|
||||
"github.com/prometheus/alertmanager/matchers/parse"
|
||||
"github.com/prometheus/alertmanager/pkg/labels"
|
||||
)
|
||||
|
||||
var (
|
||||
isValidLabelName = isValidClassicLabelName(promslog.NewNopLogger())
|
||||
parseMatcher = ClassicMatcherParser(promslog.NewNopLogger())
|
||||
parseMatchers = ClassicMatchersParser(promslog.NewNopLogger())
|
||||
isValidLabelName = isValidClassicLabelName(log.NewNopLogger())
|
||||
parseMatcher = ClassicMatcherParser(log.NewNopLogger())
|
||||
parseMatchers = ClassicMatchersParser(log.NewNopLogger())
|
||||
)
|
||||
|
||||
// IsValidLabelName returns true if the string is a valid label name.
|
||||
@@ -56,7 +56,7 @@ func Matchers(input, origin string) (labels.Matchers, error) {
|
||||
}
|
||||
|
||||
// InitFromFlags initializes the compat package from the flagger.
|
||||
func InitFromFlags(l *slog.Logger, f featurecontrol.Flagger) {
|
||||
func InitFromFlags(l log.Logger, f featurecontrol.Flagger) {
|
||||
if f.ClassicMode() {
|
||||
isValidLabelName = isValidClassicLabelName(l)
|
||||
parseMatcher = ClassicMatcherParser(l)
|
||||
@@ -74,27 +74,27 @@ func InitFromFlags(l *slog.Logger, f featurecontrol.Flagger) {
|
||||
|
||||
// ClassicMatcherParser uses the pkg/labels parser to parse the matcher in
|
||||
// the input string.
|
||||
func ClassicMatcherParser(l *slog.Logger) ParseMatcher {
|
||||
func ClassicMatcherParser(l log.Logger) ParseMatcher {
|
||||
return func(input, origin string) (matcher *labels.Matcher, err error) {
|
||||
l.Debug("Parsing with classic matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with classic matchers parser", "input", input, "origin", origin)
|
||||
return labels.ParseMatcher(input)
|
||||
}
|
||||
}
|
||||
|
||||
// ClassicMatchersParser uses the pkg/labels parser to parse zero or more
|
||||
// matchers in the input string. It returns an error if the input is invalid.
|
||||
func ClassicMatchersParser(l *slog.Logger) ParseMatchers {
|
||||
func ClassicMatchersParser(l log.Logger) ParseMatchers {
|
||||
return func(input, origin string) (matchers labels.Matchers, err error) {
|
||||
l.Debug("Parsing with classic matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with classic matchers parser", "input", input, "origin", origin)
|
||||
return labels.ParseMatchers(input)
|
||||
}
|
||||
}
|
||||
|
||||
// UTF8MatcherParser uses the new matcher/parse parser to parse the matcher
|
||||
// UTF8MatcherParser uses the new matchers/parse parser to parse the matcher
|
||||
// in the input string. If this fails it does not revert to the pkg/labels parser.
|
||||
func UTF8MatcherParser(l *slog.Logger) ParseMatcher {
|
||||
func UTF8MatcherParser(l log.Logger) ParseMatcher {
|
||||
return func(input, origin string) (matcher *labels.Matcher, err error) {
|
||||
l.Debug("Parsing with UTF-8 matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with UTF-8 matchers parser", "input", input, "origin", origin)
|
||||
if strings.HasPrefix(input, "{") || strings.HasSuffix(input, "}") {
|
||||
return nil, fmt.Errorf("unexpected open or close brace: %s", input)
|
||||
}
|
||||
@@ -102,22 +102,22 @@ func UTF8MatcherParser(l *slog.Logger) ParseMatcher {
|
||||
}
|
||||
}
|
||||
|
||||
// UTF8MatchersParser uses the new matcher/parse parser to parse zero or more
|
||||
// UTF8MatchersParser uses the new matchers/parse parser to parse zero or more
|
||||
// matchers in the input string. If this fails it does not revert to the
|
||||
// pkg/labels parser.
|
||||
func UTF8MatchersParser(l *slog.Logger) ParseMatchers {
|
||||
func UTF8MatchersParser(l log.Logger) ParseMatchers {
|
||||
return func(input, origin string) (matchers labels.Matchers, err error) {
|
||||
l.Debug("Parsing with UTF-8 matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with UTF-8 matchers parser", "input", input, "origin", origin)
|
||||
return parse.Matchers(input)
|
||||
}
|
||||
}
|
||||
|
||||
// FallbackMatcherParser uses the new matcher/parse parser to parse zero or more
|
||||
// FallbackMatcherParser uses the new matchers/parse parser to parse zero or more
|
||||
// matchers in the string. If this fails it reverts to the pkg/labels parser and
|
||||
// emits a warning log line.
|
||||
func FallbackMatcherParser(l *slog.Logger) ParseMatcher {
|
||||
func FallbackMatcherParser(l log.Logger) ParseMatcher {
|
||||
return func(input, origin string) (matcher *labels.Matcher, err error) {
|
||||
l.Debug("Parsing with UTF-8 matchers parser, with fallback to classic matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with UTF-8 matchers parser, with fallback to classic matchers parser", "input", input, "origin", origin)
|
||||
if strings.HasPrefix(input, "{") || strings.HasSuffix(input, "}") {
|
||||
return nil, fmt.Errorf("unexpected open or close brace: %s", input)
|
||||
}
|
||||
@@ -130,28 +130,28 @@ func FallbackMatcherParser(l *slog.Logger) ParseMatcher {
|
||||
if cErr != nil {
|
||||
return nil, cErr
|
||||
}
|
||||
// The input is valid in the pkg/labels parser, but not the matcher/parse
|
||||
// The input is valid in the pkg/labels parser, but not the matchers/parse
|
||||
// parser. This means the input is not forwards compatible.
|
||||
suggestion := cMatcher.String()
|
||||
l.Warn("Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted and backslashes are escaped. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
|
||||
level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
|
||||
return cMatcher, nil
|
||||
}
|
||||
// If the input is valid in both parsers, but produces different results,
|
||||
// then there is disagreement.
|
||||
if nErr == nil && cErr == nil && !reflect.DeepEqual(nMatcher, cMatcher) {
|
||||
l.Warn("Matchers input has disagreement", "input", input, "origin", origin)
|
||||
level.Warn(l).Log("msg", "Matchers input has disagreement", "input", input, "origin", origin)
|
||||
return cMatcher, nil
|
||||
}
|
||||
return nMatcher, nil
|
||||
}
|
||||
}
|
||||
|
||||
// FallbackMatchersParser uses the new matcher/parse parser to parse the
|
||||
// FallbackMatchersParser uses the new matchers/parse parser to parse the
|
||||
// matcher in the input string. If this fails it falls back to the pkg/labels
|
||||
// parser and emits a warning log line.
|
||||
func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
|
||||
func FallbackMatchersParser(l log.Logger) ParseMatchers {
|
||||
return func(input, origin string) (matchers labels.Matchers, err error) {
|
||||
l.Debug("Parsing with UTF-8 matchers parser, with fallback to classic matchers parser", "input", input, "origin", origin)
|
||||
level.Debug(l).Log("msg", "Parsing with UTF-8 matchers parser, with fallback to classic matchers parser", "input", input, "origin", origin)
|
||||
// Parse the input in both parsers to look for disagreement and incompatible
|
||||
// inputs.
|
||||
nMatchers, nErr := parse.Matchers(input)
|
||||
@@ -161,7 +161,7 @@ func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
|
||||
if cErr != nil {
|
||||
return nil, cErr
|
||||
}
|
||||
// The input is valid in the pkg/labels parser, but not the matcher/parse
|
||||
// The input is valid in the pkg/labels parser, but not the matchers/parse
|
||||
// parser. This means the input is not forwards compatible.
|
||||
var sb strings.Builder
|
||||
for i, n := range cMatchers {
|
||||
@@ -172,15 +172,15 @@ func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
|
||||
}
|
||||
suggestion := sb.String()
|
||||
// The input is valid in the pkg/labels parser, but not the
|
||||
// new matcher/parse parser.
|
||||
l.Warn("Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted and backslashes are escaped. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
|
||||
// new matchers/parse parser.
|
||||
level.Warn(l).Log("msg", "Alertmanager is moving to a new parser for labels and matchers, and this input is incompatible. Alertmanager has instead parsed the input using the classic matchers parser as a fallback. To make this input compatible with the UTF-8 matchers parser please make sure all regular expressions and values are double-quoted. If you are still seeing this message please open an issue.", "input", input, "origin", origin, "err", nErr, "suggestion", suggestion)
|
||||
return cMatchers, nil
|
||||
}
|
||||
// If the input is valid in both parsers, but produces different results,
|
||||
// then there is disagreement. We need to compare to labels.Matchers(cMatchers)
|
||||
// as cMatchers is a []*labels.Matcher not labels.Matchers.
|
||||
if nErr == nil && cErr == nil && !reflect.DeepEqual(nMatchers, labels.Matchers(cMatchers)) {
|
||||
l.Warn("Matchers input has disagreement", "input", input, "origin", origin)
|
||||
level.Warn(l).Log("msg", "Matchers input has disagreement", "input", input, "origin", origin)
|
||||
return cMatchers, nil
|
||||
}
|
||||
return nMatchers, nil
|
||||
@@ -188,14 +188,14 @@ func FallbackMatchersParser(l *slog.Logger) ParseMatchers {
|
||||
}
|
||||
|
||||
// isValidClassicLabelName returns true if the string is a valid classic label name.
|
||||
func isValidClassicLabelName(_ *slog.Logger) func(model.LabelName) bool {
|
||||
func isValidClassicLabelName(_ log.Logger) func(model.LabelName) bool {
|
||||
return func(name model.LabelName) bool {
|
||||
return name.IsValid()
|
||||
}
|
||||
}
|
||||
|
||||
// isValidUTF8LabelName returns true if the string is a valid UTF-8 label name.
|
||||
func isValidUTF8LabelName(_ *slog.Logger) func(model.LabelName) bool {
|
||||
func isValidUTF8LabelName(_ log.Logger) func(model.LabelName) bool {
|
||||
return func(name model.LabelName) bool {
|
||||
if len(name) == 0 {
|
||||
return false
|
||||
@@ -251,7 +251,7 @@ func (l *lexer) accept(valid string) bool {
|
||||
}
|
||||
|
||||
// expect consumes the next rune if its one of the valid runes.
|
||||
// It returns nil if the next rune is valid, otherwise an expectedError
|
||||
// it returns nil if the next rune is valid, otherwise an expectedError
|
||||
// error.
|
||||
func (l *lexer) expect(valid string) error {
|
||||
if strings.ContainsRune(valid, l.next()) {
|
||||
@@ -196,7 +196,7 @@ func (p *parser) parseEndOfMatcher(l *lexer) (parseFunc, error) {
|
||||
if err != nil {
|
||||
if errors.Is(err, errEOF) {
|
||||
// If this is the end of input we still need to check if the optional
|
||||
// open brace has a matching close brace.
|
||||
// open brace has a matching close brace
|
||||
return p.parseCloseBrace, nil
|
||||
}
|
||||
return nil, fmt.Errorf("%w: %w", err, errExpectedCommaOrCloseBrace)
|
||||
@@ -220,7 +220,7 @@ func (p *parser) parseComma(l *lexer) (parseFunc, error) {
|
||||
if err != nil {
|
||||
if errors.Is(err, errEOF) {
|
||||
// If this is the end of input we still need to check if the optional
|
||||
// open brace has a matching close brace.
|
||||
// open brace has a matching close brace
|
||||
return p.parseCloseBrace, nil
|
||||
}
|
||||
return nil, fmt.Errorf("%w: %w", err, errExpectedMatcherOrCloseBrace)
|
||||
@@ -242,7 +242,6 @@ func (p *parser) parseEOF(l *lexer) (parseFunc, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// nolint:godot
|
||||
// accept returns true if the next token is one of the specified kinds,
|
||||
// otherwise false. If the token is accepted it is consumed. tokenEOF is
|
||||
// not an accepted kind and instead accept returns ErrEOF if there is no
|
||||
@@ -257,7 +256,6 @@ func (p *parser) accept(l *lexer, kinds ...tokenKind) (ok bool, err error) {
|
||||
return ok, err
|
||||
}
|
||||
|
||||
// nolint:godot
|
||||
// acceptPeek returns true if the next token is one of the specified kinds,
|
||||
// otherwise false. However, unlike accept, acceptPeek does not consume accepted
|
||||
// tokens. tokenEOF is not an accepted kind and instead accept returns ErrEOF
|
||||
@@ -273,7 +271,6 @@ func (p *parser) acceptPeek(l *lexer, kinds ...tokenKind) (bool, error) {
|
||||
return t.isOneOf(kinds...), nil
|
||||
}
|
||||
|
||||
// nolint:godot
|
||||
// expect returns the next token if it is one of the specified kinds, otherwise
|
||||
// it returns an error. If the token is expected it is consumed. tokenEOF is not
|
||||
// an accepted kind and instead expect returns ErrEOF if there is no more input.
|
||||
@@ -288,7 +285,6 @@ func (p *parser) expect(l *lexer, kind ...tokenKind) (token, error) {
|
||||
return t, nil
|
||||
}
|
||||
|
||||
// nolint:godot
|
||||
// expect returns the next token if it is one of the specified kinds, otherwise
|
||||
// it returns an error. However, unlike expect, expectPeek does not consume tokens.
|
||||
// tokenEOF is not an accepted kind and instead expect returns ErrEOF if there is no
|
||||
2
vendor/github.com/prometheus/alertmanager/pkg/labels/matcher.go
generated
vendored
2
vendor/github.com/prometheus/alertmanager/pkg/labels/matcher.go
generated
vendored
@@ -205,7 +205,7 @@ func (ms Matchers) String() string {
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// This is copied from matcher/parse/lexer.go. It will be removed when
|
||||
// This is copied from matchers/parse/lexer.go. It will be removed when
|
||||
// the transition window from classic matchers to UTF-8 matchers is complete,
|
||||
// as then we can use double quotes when printing the label name for all
|
||||
// matchers. Until then, the classic parser does not understand double quotes
|
||||
|
||||
2
vendor/github.com/prometheus/alertmanager/pkg/labels/parse.go
generated
vendored
2
vendor/github.com/prometheus/alertmanager/pkg/labels/parse.go
generated
vendored
@@ -136,7 +136,7 @@ func ParseMatcher(s string) (_ *Matcher, err error) {
|
||||
return nil, fmt.Errorf("matcher value not valid UTF-8: %s", ms[3])
|
||||
}
|
||||
|
||||
// Unescape the rawValue.
|
||||
// Unescape the rawValue:
|
||||
for i, r := range rawValue {
|
||||
if escaped {
|
||||
escaped = false
|
||||
|
||||
4
vendor/github.com/prometheus/alertmanager/template/Dockerfile
generated
vendored
4
vendor/github.com/prometheus/alertmanager/template/Dockerfile
generated
vendored
@@ -1,7 +1,7 @@
|
||||
FROM node:20-alpine
|
||||
FROM node
|
||||
|
||||
ENV NODE_PATH="/usr/local/lib/node_modules"
|
||||
|
||||
RUN npm install juice@10.0.1 -g
|
||||
RUN npm install juice -g
|
||||
|
||||
ENTRYPOINT [""]
|
||||
|
||||
2
vendor/github.com/prometheus/alertmanager/template/Makefile
generated
vendored
2
vendor/github.com/prometheus/alertmanager/template/Makefile
generated
vendored
@@ -1,4 +1,4 @@
|
||||
DOCKER_IMG := alertmanager-template
|
||||
DOCKER_IMG := altermanager-template
|
||||
DOCKER_RUN_CURRENT_USER := docker run --user=$(shell id -u $(USER)):$(shell id -g $(USER))
|
||||
DOCKER_CMD := $(DOCKER_RUN_CURRENT_USER) --rm -t -v $(PWD):/app -w /app $(DOCKER_IMG)
|
||||
|
||||
|
||||
59
vendor/github.com/prometheus/alertmanager/template/default.tmpl
generated
vendored
59
vendor/github.com/prometheus/alertmanager/template/default.tmpl
generated
vendored
@@ -123,7 +123,6 @@ Alerts Resolved:
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "discord.default.content" }}{{ end }}
|
||||
{{ define "discord.default.title" }}{{ template "__subject" . }}{{ end }}
|
||||
{{ define "discord.default.message" }}
|
||||
{{ if gt (len .Alerts.Firing) 0 }}
|
||||
@@ -159,61 +158,3 @@ Alerts Resolved:
|
||||
{{ template "__text_alert_list_markdown" .Alerts.Resolved }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "msteamsv2.default.title" }}{{ template "__subject" . }}{{ end }}
|
||||
{{ define "msteamsv2.default.text" }}
|
||||
{{ if gt (len .Alerts.Firing) 0 }}
|
||||
# Alerts Firing:
|
||||
{{ template "__text_alert_list_markdown" .Alerts.Firing }}
|
||||
{{ end }}
|
||||
{{ if gt (len .Alerts.Resolved) 0 }}
|
||||
# Alerts Resolved:
|
||||
{{ template "__text_alert_list_markdown" .Alerts.Resolved }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "jira.default.summary" }}{{ template "__subject" . }}{{ end }}
|
||||
{{ define "jira.default.description" }}
|
||||
{{ if gt (len .Alerts.Firing) 0 }}
|
||||
# Alerts Firing:
|
||||
{{ template "__text_alert_list_markdown" .Alerts.Firing }}
|
||||
{{ end }}
|
||||
{{ if gt (len .Alerts.Resolved) 0 }}
|
||||
# Alerts Resolved:
|
||||
{{ template "__text_alert_list_markdown" .Alerts.Resolved }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{- define "jira.default.priority" -}}
|
||||
{{- $priority := "" }}
|
||||
{{- range .Alerts.Firing -}}
|
||||
{{- $severity := index .Labels "severity" -}}
|
||||
{{- if (eq $severity "critical") -}}
|
||||
{{- $priority = "High" -}}
|
||||
{{- else if (and (eq $severity "warning") (ne $priority "High")) -}}
|
||||
{{- $priority = "Medium" -}}
|
||||
{{- else if (and (eq $severity "info") (eq $priority "")) -}}
|
||||
{{- $priority = "Low" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if eq $priority "" -}}
|
||||
{{- range .Alerts.Resolved -}}
|
||||
{{- $severity := index .Labels "severity" -}}
|
||||
{{- if (eq $severity "critical") -}}
|
||||
{{- $priority = "High" -}}
|
||||
{{- else if (and (eq $severity "warning") (ne $priority "High")) -}}
|
||||
{{- $priority = "Medium" -}}
|
||||
{{- else if (and (eq $severity "info") (eq $priority "")) -}}
|
||||
{{- $priority = "Low" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $priority -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ define "rocketchat.default.title" }}{{ template "__subject" . }}{{ end }}
|
||||
{{ define "rocketchat.default.alias" }}{{ template "__alertmanager" . }}{{ end }}
|
||||
{{ define "rocketchat.default.titlelink" }}{{ template "__alertmanagerURL" . }}{{ end }}
|
||||
{{ define "rocketchat.default.emoji" }}{{ end }}
|
||||
{{ define "rocketchat.default.iconurl" }}{{ end }}
|
||||
{{ define "rocketchat.default.text" }}{{ end }}
|
||||
|
||||
15
vendor/github.com/prometheus/alertmanager/template/template.go
generated
vendored
15
vendor/github.com/prometheus/alertmanager/template/template.go
generated
vendored
@@ -26,7 +26,6 @@ import (
|
||||
tmpltext "text/template"
|
||||
"time"
|
||||
|
||||
commonTemplates "github.com/prometheus/common/helpers/templates"
|
||||
"github.com/prometheus/common/model"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
@@ -193,20 +192,6 @@ var DefaultFuncs = FuncMap{
|
||||
"stringSlice": func(s ...string) []string {
|
||||
return s
|
||||
},
|
||||
// date returns the text representation of the time in the specified format.
|
||||
"date": func(fmt string, t time.Time) string {
|
||||
return t.Format(fmt)
|
||||
},
|
||||
// tz returns the time in the timezone.
|
||||
"tz": func(name string, t time.Time) (time.Time, error) {
|
||||
loc, err := time.LoadLocation(name)
|
||||
if err != nil {
|
||||
return time.Time{}, err
|
||||
}
|
||||
return t.In(loc), nil
|
||||
},
|
||||
"since": time.Since,
|
||||
"humanizeDuration": commonTemplates.HumanizeDuration,
|
||||
}
|
||||
|
||||
// Pair is a key/value string pair.
|
||||
|
||||
142
vendor/github.com/prometheus/alertmanager/types/types.go
generated
vendored
142
vendor/github.com/prometheus/alertmanager/types/types.go
generated
vendored
@@ -22,7 +22,7 @@ import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/common/model"
|
||||
|
||||
"github.com/prometheus/alertmanager/matcher/compat"
|
||||
"github.com/prometheus/alertmanager/matchers/compat"
|
||||
"github.com/prometheus/alertmanager/pkg/labels"
|
||||
)
|
||||
|
||||
@@ -52,17 +52,9 @@ type AlertStatus struct {
|
||||
silencesVersion int
|
||||
}
|
||||
|
||||
// groupStatus stores the state of the group, and, as applicable, the names
|
||||
// of all active and mute time intervals that are muting it.
|
||||
type groupStatus struct {
|
||||
// mutedBy contains the names of all active and mute time intervals that
|
||||
// are muting it.
|
||||
mutedBy []string
|
||||
}
|
||||
|
||||
// AlertMarker helps to mark alerts as silenced and/or inhibited.
|
||||
// Marker helps to mark alerts as silenced and/or inhibited.
|
||||
// All methods are goroutine-safe.
|
||||
type AlertMarker interface {
|
||||
type Marker interface {
|
||||
// SetActiveOrSilenced replaces the previous SilencedBy by the provided IDs of
|
||||
// active and pending silences, including the version number of the
|
||||
// silences state. The set of provided IDs is supposed to represent the
|
||||
@@ -100,74 +92,24 @@ type AlertMarker interface {
|
||||
Inhibited(model.Fingerprint) ([]string, bool)
|
||||
}
|
||||
|
||||
// GroupMarker helps to mark groups as active or muted.
|
||||
// All methods are goroutine-safe.
|
||||
//
|
||||
// TODO(grobinson): routeID is used in Muted and SetMuted because groupKey
|
||||
// is not unique (see #3817). Once groupKey uniqueness is fixed routeID can
|
||||
// be removed from the GroupMarker interface.
|
||||
type GroupMarker interface {
|
||||
// Muted returns true if the group is muted, otherwise false. If the group
|
||||
// is muted then it also returns the names of the time intervals that muted
|
||||
// it.
|
||||
Muted(routeID, groupKey string) ([]string, bool)
|
||||
|
||||
// SetMuted marks the group as muted, and sets the names of the time
|
||||
// intervals that mute it. If the list of names is nil or the empty slice
|
||||
// then the muted marker is removed.
|
||||
SetMuted(routeID, groupKey string, timeIntervalNames []string)
|
||||
|
||||
// DeleteByGroupKey removes all markers for the GroupKey.
|
||||
DeleteByGroupKey(routeID, groupKey string)
|
||||
}
|
||||
|
||||
// NewMarker returns an instance of a AlertMarker implementation.
|
||||
func NewMarker(r prometheus.Registerer) *MemMarker {
|
||||
m := &MemMarker{
|
||||
alerts: map[model.Fingerprint]*AlertStatus{},
|
||||
groups: map[string]*groupStatus{},
|
||||
// NewMarker returns an instance of a Marker implementation.
|
||||
func NewMarker(r prometheus.Registerer) Marker {
|
||||
m := &memMarker{
|
||||
m: map[model.Fingerprint]*AlertStatus{},
|
||||
}
|
||||
|
||||
m.registerMetrics(r)
|
||||
|
||||
return m
|
||||
}
|
||||
|
||||
type MemMarker struct {
|
||||
alerts map[model.Fingerprint]*AlertStatus
|
||||
groups map[string]*groupStatus
|
||||
type memMarker struct {
|
||||
m map[model.Fingerprint]*AlertStatus
|
||||
|
||||
mtx sync.RWMutex
|
||||
}
|
||||
|
||||
// Muted implements GroupMarker.
|
||||
func (m *MemMarker) Muted(routeID, groupKey string) ([]string, bool) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
status, ok := m.groups[routeID+groupKey]
|
||||
if !ok {
|
||||
return nil, false
|
||||
}
|
||||
return status.mutedBy, len(status.mutedBy) > 0
|
||||
}
|
||||
|
||||
// SetMuted implements GroupMarker.
|
||||
func (m *MemMarker) SetMuted(routeID, groupKey string, timeIntervalNames []string) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
status, ok := m.groups[routeID+groupKey]
|
||||
if !ok {
|
||||
status = &groupStatus{}
|
||||
m.groups[routeID+groupKey] = status
|
||||
}
|
||||
status.mutedBy = timeIntervalNames
|
||||
}
|
||||
|
||||
func (m *MemMarker) DeleteByGroupKey(routeID, groupKey string) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
delete(m.groups, routeID+groupKey)
|
||||
}
|
||||
|
||||
func (m *MemMarker) registerMetrics(r prometheus.Registerer) {
|
||||
func (m *memMarker) registerMetrics(r prometheus.Registerer) {
|
||||
newMarkedAlertMetricByState := func(st AlertState) prometheus.GaugeFunc {
|
||||
return prometheus.NewGaugeFunc(
|
||||
prometheus.GaugeOpts{
|
||||
@@ -190,17 +132,17 @@ func (m *MemMarker) registerMetrics(r prometheus.Registerer) {
|
||||
r.MustRegister(alertStateUnprocessed)
|
||||
}
|
||||
|
||||
// Count implements AlertMarker.
|
||||
func (m *MemMarker) Count(states ...AlertState) int {
|
||||
// Count implements Marker.
|
||||
func (m *memMarker) Count(states ...AlertState) int {
|
||||
m.mtx.RLock()
|
||||
defer m.mtx.RUnlock()
|
||||
|
||||
if len(states) == 0 {
|
||||
return len(m.alerts)
|
||||
return len(m.m)
|
||||
}
|
||||
|
||||
var count int
|
||||
for _, status := range m.alerts {
|
||||
for _, status := range m.m {
|
||||
for _, state := range states {
|
||||
if status.State == state {
|
||||
count++
|
||||
@@ -210,15 +152,15 @@ func (m *MemMarker) Count(states ...AlertState) int {
|
||||
return count
|
||||
}
|
||||
|
||||
// SetActiveOrSilenced implements AlertMarker.
|
||||
func (m *MemMarker) SetActiveOrSilenced(alert model.Fingerprint, version int, activeIDs, pendingIDs []string) {
|
||||
// SetActiveOrSilenced implements Marker.
|
||||
func (m *memMarker) SetActiveOrSilenced(alert model.Fingerprint, version int, activeIDs, pendingIDs []string) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
|
||||
s, found := m.alerts[alert]
|
||||
s, found := m.m[alert]
|
||||
if !found {
|
||||
s = &AlertStatus{}
|
||||
m.alerts[alert] = s
|
||||
m.m[alert] = s
|
||||
}
|
||||
s.SilencedBy = activeIDs
|
||||
s.pendingSilences = pendingIDs
|
||||
@@ -235,15 +177,15 @@ func (m *MemMarker) SetActiveOrSilenced(alert model.Fingerprint, version int, ac
|
||||
s.State = AlertStateSuppressed
|
||||
}
|
||||
|
||||
// SetInhibited implements AlertMarker.
|
||||
func (m *MemMarker) SetInhibited(alert model.Fingerprint, ids ...string) {
|
||||
// SetInhibited implements Marker.
|
||||
func (m *memMarker) SetInhibited(alert model.Fingerprint, ids ...string) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
|
||||
s, found := m.alerts[alert]
|
||||
s, found := m.m[alert]
|
||||
if !found {
|
||||
s = &AlertStatus{}
|
||||
m.alerts[alert] = s
|
||||
m.m[alert] = s
|
||||
}
|
||||
s.InhibitedBy = ids
|
||||
|
||||
@@ -258,12 +200,12 @@ func (m *MemMarker) SetInhibited(alert model.Fingerprint, ids ...string) {
|
||||
s.State = AlertStateSuppressed
|
||||
}
|
||||
|
||||
// Status implements AlertMarker.
|
||||
func (m *MemMarker) Status(alert model.Fingerprint) AlertStatus {
|
||||
// Status implements Marker.
|
||||
func (m *memMarker) Status(alert model.Fingerprint) AlertStatus {
|
||||
m.mtx.RLock()
|
||||
defer m.mtx.RUnlock()
|
||||
|
||||
if s, found := m.alerts[alert]; found {
|
||||
if s, found := m.m[alert]; found {
|
||||
return *s
|
||||
}
|
||||
return AlertStatus{
|
||||
@@ -273,26 +215,26 @@ func (m *MemMarker) Status(alert model.Fingerprint) AlertStatus {
|
||||
}
|
||||
}
|
||||
|
||||
// Delete implements AlertMarker.
|
||||
func (m *MemMarker) Delete(alert model.Fingerprint) {
|
||||
// Delete implements Marker.
|
||||
func (m *memMarker) Delete(alert model.Fingerprint) {
|
||||
m.mtx.Lock()
|
||||
defer m.mtx.Unlock()
|
||||
|
||||
delete(m.alerts, alert)
|
||||
delete(m.m, alert)
|
||||
}
|
||||
|
||||
// Unprocessed implements AlertMarker.
|
||||
func (m *MemMarker) Unprocessed(alert model.Fingerprint) bool {
|
||||
// Unprocessed implements Marker.
|
||||
func (m *memMarker) Unprocessed(alert model.Fingerprint) bool {
|
||||
return m.Status(alert).State == AlertStateUnprocessed
|
||||
}
|
||||
|
||||
// Active implements AlertMarker.
|
||||
func (m *MemMarker) Active(alert model.Fingerprint) bool {
|
||||
// Active implements Marker.
|
||||
func (m *memMarker) Active(alert model.Fingerprint) bool {
|
||||
return m.Status(alert).State == AlertStateActive
|
||||
}
|
||||
|
||||
// Inhibited implements AlertMarker.
|
||||
func (m *MemMarker) Inhibited(alert model.Fingerprint) ([]string, bool) {
|
||||
// Inhibited implements Marker.
|
||||
func (m *memMarker) Inhibited(alert model.Fingerprint) ([]string, bool) {
|
||||
s := m.Status(alert)
|
||||
return s.InhibitedBy,
|
||||
s.State == AlertStateSuppressed && len(s.InhibitedBy) > 0
|
||||
@@ -301,7 +243,7 @@ func (m *MemMarker) Inhibited(alert model.Fingerprint) ([]string, bool) {
|
||||
// Silenced returns whether the alert for the given Fingerprint is in the
|
||||
// Silenced state, any associated silence IDs, and the silences state version
|
||||
// the result is based on.
|
||||
func (m *MemMarker) Silenced(alert model.Fingerprint) (activeIDs, pendingIDs []string, version int, silenced bool) {
|
||||
func (m *memMarker) Silenced(alert model.Fingerprint) (activeIDs, pendingIDs []string, version int, silenced bool) {
|
||||
s := m.Status(alert)
|
||||
return s.SilencedBy, s.pendingSilences, s.silencesVersion,
|
||||
s.State == AlertStateSuppressed && len(s.SilencedBy) > 0
|
||||
@@ -468,17 +410,15 @@ func (a *Alert) Merge(o *Alert) *Alert {
|
||||
}
|
||||
|
||||
// A Muter determines whether a given label set is muted. Implementers that
|
||||
// maintain an underlying AlertMarker are expected to update it during a call of
|
||||
// maintain an underlying Marker are expected to update it during a call of
|
||||
// Mutes.
|
||||
type Muter interface {
|
||||
Mutes(model.LabelSet) bool
|
||||
}
|
||||
|
||||
// A TimeMuter determines if the time is muted by one or more active or mute
|
||||
// time intervals. If the time is muted, it returns true and the names of the
|
||||
// time intervals that muted it. Otherwise, it returns false and a nil slice.
|
||||
// TimeMuter determines if alerts should be muted based on the specified current time and active time interval on the route.
|
||||
type TimeMuter interface {
|
||||
Mutes(timeIntervalNames []string, now time.Time) (bool, []string, error)
|
||||
Mutes(timeIntervalName []string, now time.Time) (bool, error)
|
||||
}
|
||||
|
||||
// A MuteFunc is a function that implements the Muter interface.
|
||||
@@ -518,7 +458,7 @@ type Silence struct {
|
||||
}
|
||||
|
||||
// Expired return if the silence is expired
|
||||
// meaning that both StartsAt and EndsAt are equal.
|
||||
// meaning that both StartsAt and EndsAt are equal
|
||||
func (s *Silence) Expired() bool {
|
||||
return s.StartsAt.Equal(s.EndsAt)
|
||||
}
|
||||
|
||||
123
vendor/github.com/prometheus/common/helpers/templates/time.go
generated
vendored
123
vendor/github.com/prometheus/common/helpers/templates/time.go
generated
vendored
@@ -1,123 +0,0 @@
|
||||
// Copyright 2024 The Prometheus Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package templates
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/common/model"
|
||||
)
|
||||
|
||||
var errNaNOrInf = errors.New("value is NaN or Inf")
|
||||
|
||||
func ConvertToFloat(i interface{}) (float64, error) {
|
||||
switch v := i.(type) {
|
||||
case float64:
|
||||
return v, nil
|
||||
case string:
|
||||
return strconv.ParseFloat(v, 64)
|
||||
case int:
|
||||
return float64(v), nil
|
||||
case uint:
|
||||
return float64(v), nil
|
||||
case int64:
|
||||
return float64(v), nil
|
||||
case uint64:
|
||||
return float64(v), nil
|
||||
case time.Duration:
|
||||
return v.Seconds(), nil
|
||||
default:
|
||||
return 0, fmt.Errorf("can't convert %T to float", v)
|
||||
}
|
||||
}
|
||||
|
||||
func FloatToTime(v float64) (*time.Time, error) {
|
||||
if math.IsNaN(v) || math.IsInf(v, 0) {
|
||||
return nil, errNaNOrInf
|
||||
}
|
||||
timestamp := v * 1e9
|
||||
if timestamp > math.MaxInt64 || timestamp < math.MinInt64 {
|
||||
return nil, fmt.Errorf("%v cannot be represented as a nanoseconds timestamp since it overflows int64", v)
|
||||
}
|
||||
t := model.TimeFromUnixNano(int64(timestamp)).Time().UTC()
|
||||
return &t, nil
|
||||
}
|
||||
|
||||
func HumanizeDuration(i interface{}) (string, error) {
|
||||
v, err := ConvertToFloat(i)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if math.IsNaN(v) || math.IsInf(v, 0) {
|
||||
return fmt.Sprintf("%.4g", v), nil
|
||||
}
|
||||
if v == 0 {
|
||||
return fmt.Sprintf("%.4gs", v), nil
|
||||
}
|
||||
if math.Abs(v) >= 1 {
|
||||
sign := ""
|
||||
if v < 0 {
|
||||
sign = "-"
|
||||
v = -v
|
||||
}
|
||||
duration := int64(v)
|
||||
seconds := duration % 60
|
||||
minutes := (duration / 60) % 60
|
||||
hours := (duration / 60 / 60) % 24
|
||||
days := duration / 60 / 60 / 24
|
||||
// For days to minutes, we display seconds as an integer.
|
||||
if days != 0 {
|
||||
return fmt.Sprintf("%s%dd %dh %dm %ds", sign, days, hours, minutes, seconds), nil
|
||||
}
|
||||
if hours != 0 {
|
||||
return fmt.Sprintf("%s%dh %dm %ds", sign, hours, minutes, seconds), nil
|
||||
}
|
||||
if minutes != 0 {
|
||||
return fmt.Sprintf("%s%dm %ds", sign, minutes, seconds), nil
|
||||
}
|
||||
// For seconds, we display 4 significant digits.
|
||||
return fmt.Sprintf("%s%.4gs", sign, v), nil
|
||||
}
|
||||
prefix := ""
|
||||
for _, p := range []string{"m", "u", "n", "p", "f", "a", "z", "y"} {
|
||||
if math.Abs(v) >= 1 {
|
||||
break
|
||||
}
|
||||
prefix = p
|
||||
v *= 1000
|
||||
}
|
||||
return fmt.Sprintf("%.4g%ss", v, prefix), nil
|
||||
}
|
||||
|
||||
func HumanizeTimestamp(i interface{}) (string, error) {
|
||||
v, err := ConvertToFloat(i)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
tm, err := FloatToTime(v)
|
||||
switch {
|
||||
case errors.Is(err, errNaNOrInf):
|
||||
return fmt.Sprintf("%.4g", v), nil
|
||||
case err != nil:
|
||||
return "", err
|
||||
}
|
||||
|
||||
return fmt.Sprint(tm), nil
|
||||
}
|
||||
201
vendor/github.com/prometheus/common/promslog/slog.go
generated
vendored
201
vendor/github.com/prometheus/common/promslog/slog.go
generated
vendored
@@ -1,201 +0,0 @@
|
||||
// Copyright 2024 The Prometheus Authors
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Package promslog defines standardised ways to initialize the Go standard
|
||||
// library's log/slog logger.
|
||||
// It should typically only ever be imported by main packages.
|
||||
|
||||
package promslog
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log/slog"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type LogStyle string
|
||||
|
||||
const (
|
||||
SlogStyle LogStyle = "slog"
|
||||
GoKitStyle LogStyle = "go-kit"
|
||||
)
|
||||
|
||||
var (
|
||||
LevelFlagOptions = []string{"debug", "info", "warn", "error"}
|
||||
FormatFlagOptions = []string{"logfmt", "json"}
|
||||
|
||||
callerAddFunc = false
|
||||
defaultWriter = os.Stderr
|
||||
goKitStyleReplaceAttrFunc = func(groups []string, a slog.Attr) slog.Attr {
|
||||
key := a.Key
|
||||
switch key {
|
||||
case slog.TimeKey:
|
||||
a.Key = "ts"
|
||||
|
||||
// This timestamp format differs from RFC3339Nano by using .000 instead
|
||||
// of .999999999 which changes the timestamp from 9 variable to 3 fixed
|
||||
// decimals (.130 instead of .130987456).
|
||||
t := a.Value.Time()
|
||||
a.Value = slog.StringValue(t.UTC().Format("2006-01-02T15:04:05.000Z07:00"))
|
||||
case slog.SourceKey:
|
||||
a.Key = "caller"
|
||||
src, _ := a.Value.Any().(*slog.Source)
|
||||
|
||||
switch callerAddFunc {
|
||||
case true:
|
||||
a.Value = slog.StringValue(filepath.Base(src.File) + "(" + filepath.Base(src.Function) + "):" + strconv.Itoa(src.Line))
|
||||
default:
|
||||
a.Value = slog.StringValue(filepath.Base(src.File) + ":" + strconv.Itoa(src.Line))
|
||||
}
|
||||
case slog.LevelKey:
|
||||
a.Value = slog.StringValue(strings.ToLower(a.Value.String()))
|
||||
default:
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
defaultReplaceAttrFunc = func(groups []string, a slog.Attr) slog.Attr {
|
||||
key := a.Key
|
||||
switch key {
|
||||
case slog.TimeKey:
|
||||
t := a.Value.Time()
|
||||
a.Value = slog.TimeValue(t.UTC())
|
||||
case slog.SourceKey:
|
||||
src, _ := a.Value.Any().(*slog.Source)
|
||||
a.Value = slog.StringValue(filepath.Base(src.File) + ":" + strconv.Itoa(src.Line))
|
||||
default:
|
||||
}
|
||||
|
||||
return a
|
||||
}
|
||||
)
|
||||
|
||||
// AllowedLevel is a settable identifier for the minimum level a log entry
|
||||
// must be have.
|
||||
type AllowedLevel struct {
|
||||
s string
|
||||
lvl *slog.LevelVar
|
||||
}
|
||||
|
||||
func (l *AllowedLevel) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||
var s string
|
||||
type plain string
|
||||
if err := unmarshal((*plain)(&s)); err != nil {
|
||||
return err
|
||||
}
|
||||
if s == "" {
|
||||
return nil
|
||||
}
|
||||
lo := &AllowedLevel{}
|
||||
if err := lo.Set(s); err != nil {
|
||||
return err
|
||||
}
|
||||
*l = *lo
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *AllowedLevel) String() string {
|
||||
return l.s
|
||||
}
|
||||
|
||||
// Set updates the value of the allowed level.
|
||||
func (l *AllowedLevel) Set(s string) error {
|
||||
if l.lvl == nil {
|
||||
l.lvl = &slog.LevelVar{}
|
||||
}
|
||||
|
||||
switch strings.ToLower(s) {
|
||||
case "debug":
|
||||
l.lvl.Set(slog.LevelDebug)
|
||||
callerAddFunc = true
|
||||
case "info":
|
||||
l.lvl.Set(slog.LevelInfo)
|
||||
callerAddFunc = false
|
||||
case "warn":
|
||||
l.lvl.Set(slog.LevelWarn)
|
||||
callerAddFunc = false
|
||||
case "error":
|
||||
l.lvl.Set(slog.LevelError)
|
||||
callerAddFunc = false
|
||||
default:
|
||||
return fmt.Errorf("unrecognized log level %s", s)
|
||||
}
|
||||
l.s = s
|
||||
return nil
|
||||
}
|
||||
|
||||
// AllowedFormat is a settable identifier for the output format that the logger can have.
|
||||
type AllowedFormat struct {
|
||||
s string
|
||||
}
|
||||
|
||||
func (f *AllowedFormat) String() string {
|
||||
return f.s
|
||||
}
|
||||
|
||||
// Set updates the value of the allowed format.
|
||||
func (f *AllowedFormat) Set(s string) error {
|
||||
switch s {
|
||||
case "logfmt", "json":
|
||||
f.s = s
|
||||
default:
|
||||
return fmt.Errorf("unrecognized log format %s", s)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Config is a struct containing configurable settings for the logger
|
||||
type Config struct {
|
||||
Level *AllowedLevel
|
||||
Format *AllowedFormat
|
||||
Style LogStyle
|
||||
Writer io.Writer
|
||||
}
|
||||
|
||||
// New returns a new slog.Logger. Each logged line will be annotated
|
||||
// with a timestamp. The output always goes to stderr.
|
||||
func New(config *Config) *slog.Logger {
|
||||
if config.Level == nil {
|
||||
config.Level = &AllowedLevel{}
|
||||
_ = config.Level.Set("info")
|
||||
}
|
||||
|
||||
if config.Writer == nil {
|
||||
config.Writer = defaultWriter
|
||||
}
|
||||
|
||||
logHandlerOpts := &slog.HandlerOptions{
|
||||
Level: config.Level.lvl,
|
||||
AddSource: true,
|
||||
ReplaceAttr: defaultReplaceAttrFunc,
|
||||
}
|
||||
|
||||
if config.Style == GoKitStyle {
|
||||
logHandlerOpts.ReplaceAttr = goKitStyleReplaceAttrFunc
|
||||
}
|
||||
|
||||
if config.Format != nil && config.Format.s == "json" {
|
||||
return slog.New(slog.NewJSONHandler(config.Writer, logHandlerOpts))
|
||||
}
|
||||
return slog.New(slog.NewTextHandler(config.Writer, logHandlerOpts))
|
||||
}
|
||||
|
||||
// NewNopLogger is a convenience function to return an slog.Logger that writes
|
||||
// to io.Discard.
|
||||
func NewNopLogger() *slog.Logger {
|
||||
return slog.New(slog.NewTextHandler(io.Discard, nil))
|
||||
}
|
||||
2
vendor/github.com/shurcooL/httpfs/filter/filters.go
generated
vendored
2
vendor/github.com/shurcooL/httpfs/filter/filters.go
generated
vendored
@@ -8,7 +8,7 @@ import (
|
||||
// FilesWithExtensions returns a filter func that selects files (but not directories)
|
||||
// that have any of the given extensions. For example:
|
||||
//
|
||||
// filter.FilesWithExtensions(".go", ".html")
|
||||
// filter.FilesWithExtensions(".go", ".html")
|
||||
//
|
||||
// Would select both .go and .html files. It would not select any directories.
|
||||
func FilesWithExtensions(exts ...string) Func {
|
||||
|
||||
4
vendor/github.com/shurcooL/httpfs/vfsutil/vfsutil.go
generated
vendored
4
vendor/github.com/shurcooL/httpfs/vfsutil/vfsutil.go
generated
vendored
@@ -2,7 +2,7 @@
|
||||
package vfsutil
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
@@ -35,5 +35,5 @@ func ReadFile(fs http.FileSystem, path string) ([]byte, error) {
|
||||
return nil, err
|
||||
}
|
||||
defer rc.Close()
|
||||
return io.ReadAll(rc)
|
||||
return ioutil.ReadAll(rc)
|
||||
}
|
||||
|
||||
16
vendor/github.com/shurcooL/vfsgen/.travis.yml
generated
vendored
Normal file
16
vendor/github.com/shurcooL/vfsgen/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
sudo: false
|
||||
language: go
|
||||
go:
|
||||
- 1.x
|
||||
- master
|
||||
matrix:
|
||||
allow_failures:
|
||||
- go: master
|
||||
fast_finish: true
|
||||
install:
|
||||
- # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
|
||||
script:
|
||||
- go get -t -v ./...
|
||||
- diff -n <(echo -n) <(gofmt -d -s .)
|
||||
- go vet ./...
|
||||
- go test -v -race ./...
|
||||
18
vendor/github.com/shurcooL/vfsgen/README.md
generated
vendored
18
vendor/github.com/shurcooL/vfsgen/README.md
generated
vendored
@@ -1,7 +1,7 @@
|
||||
vfsgen
|
||||
======
|
||||
|
||||
[](https://pkg.go.dev/github.com/shurcooL/vfsgen)
|
||||
[](https://travis-ci.org/shurcooL/vfsgen) [](https://godoc.org/github.com/shurcooL/vfsgen)
|
||||
|
||||
Package vfsgen takes an http.FileSystem (likely at `go generate` time) and
|
||||
generates Go code that statically implements the provided http.FileSystem.
|
||||
@@ -19,8 +19,8 @@ Features:
|
||||
Installation
|
||||
------------
|
||||
|
||||
```sh
|
||||
go get github.com/shurcooL/vfsgen
|
||||
```bash
|
||||
go get -u github.com/shurcooL/vfsgen
|
||||
```
|
||||
|
||||
Usage
|
||||
@@ -81,7 +81,7 @@ By using build tags, you can create a development mode where assets are loaded d
|
||||
For example, suppose your source filesystem is defined in a package with import path "example.com/project/data" as:
|
||||
|
||||
```Go
|
||||
//go:build dev
|
||||
// +build dev
|
||||
|
||||
package data
|
||||
|
||||
@@ -96,7 +96,7 @@ When built with the "dev" build tag, accessing `data.Assets` will read from disk
|
||||
A generate helper file assets_generate.go can be invoked via "//go:generate go run -tags=dev assets_generate.go" directive:
|
||||
|
||||
```Go
|
||||
//go:build ignore
|
||||
// +build ignore
|
||||
|
||||
package main
|
||||
|
||||
@@ -177,7 +177,6 @@ It strives to be the best in its class in terms of code quality and efficiency o
|
||||
|
||||
### Alternatives
|
||||
|
||||
- [`embed`](https://go.dev/pkg/embed) - Package embed provides access to files embedded in the running Go program.
|
||||
- [`go-bindata`](https://github.com/jteeuwen/go-bindata) - Reads from disk, generates Go code that provides access to data via a [custom API](https://github.com/jteeuwen/go-bindata#accessing-an-asset).
|
||||
- [`go-bindata-assetfs`](https://github.com/elazarl/go-bindata-assetfs) - Takes output of go-bindata and provides a wrapper that implements `http.FileSystem` interface (the same as what vfsgen outputs directly).
|
||||
- [`becky`](https://github.com/tv42/becky) - Embeds assets as string literals in Go source.
|
||||
@@ -196,13 +195,6 @@ Attribution
|
||||
|
||||
This package was originally based on the excellent work by [@jteeuwen](https://github.com/jteeuwen) on [`go-bindata`](https://github.com/jteeuwen/go-bindata) and [@elazarl](https://github.com/elazarl) on [`go-bindata-assetfs`](https://github.com/elazarl/go-bindata-assetfs).
|
||||
|
||||
Directories
|
||||
-----------
|
||||
|
||||
| Path | Synopsis |
|
||||
|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|
|
||||
| [cmd/vfsgendev](https://pkg.go.dev/github.com/shurcooL/vfsgen/cmd/vfsgendev) | vfsgendev is a convenience tool for using vfsgen in a common development configuration. |
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
|
||||
13
vendor/github.com/shurcooL/vfsgen/generator.go
generated
vendored
13
vendor/github.com/shurcooL/vfsgen/generator.go
generated
vendored
@@ -5,6 +5,7 @@ import (
|
||||
"compress/gzip"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
pathpkg "path"
|
||||
@@ -46,7 +47,7 @@ func Generate(input http.FileSystem, opt Options) error {
|
||||
}
|
||||
|
||||
// Write output file (all at once).
|
||||
err = os.WriteFile(opt.Filename, buf.Bytes(), 0644)
|
||||
err = ioutil.WriteFile(opt.Filename, buf.Bytes(), 0644)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -216,7 +217,7 @@ var t = template.Must(template.New("").Funcs(template.FuncMap{
|
||||
},
|
||||
}).Parse(`{{define "Header"}}// Code generated by vfsgen; DO NOT EDIT.
|
||||
|
||||
{{with .BuildTags}}//go:build {{.}}
|
||||
{{with .BuildTags}}// +build {{.}}
|
||||
|
||||
{{end}}package {{.PackageName}}
|
||||
|
||||
@@ -225,6 +226,7 @@ import (
|
||||
"compress/gzip"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
pathpkg "path"
|
||||
@@ -356,7 +358,7 @@ func (f *vfsgen۰CompressedFile) Read(p []byte) (n int, err error) {
|
||||
}
|
||||
if f.grPos < f.seekPos {
|
||||
// Fast-forward.
|
||||
_, err = io.CopyN(io.Discard, f.gr, f.seekPos-f.grPos)
|
||||
_, err = io.CopyN(ioutil.Discard, f.gr, f.seekPos-f.grPos)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -384,8 +386,9 @@ func (f *vfsgen۰CompressedFile) Close() error {
|
||||
return f.gr.Close()
|
||||
}
|
||||
{{else}}
|
||||
// We already imported "compress/gzip" but ended up not using it. Avoid unused import error.
|
||||
var _ *gzip.Reader
|
||||
// We already imported "compress/gzip" and "io/ioutil", but ended up not using them. Avoid unused import error.
|
||||
var _ = gzip.Reader{}
|
||||
var _ = ioutil.Discard
|
||||
{{end}}{{if .HasFile}}
|
||||
// vfsgen۰FileInfo is a static definition of an uncompressed file (because it's not worth gzip compressing).
|
||||
type vfsgen۰FileInfo struct {
|
||||
|
||||
26
vendor/modules.txt
vendored
26
vendor/modules.txt
vendored
@@ -439,8 +439,8 @@ github.com/go-acme/lego/v4/challenge
|
||||
# github.com/go-asn1-ber/asn1-ber v1.5.7
|
||||
## explicit; go 1.13
|
||||
github.com/go-asn1-ber/asn1-ber
|
||||
# github.com/go-chi/chi/v5 v5.2.1
|
||||
## explicit; go 1.20
|
||||
# github.com/go-chi/chi/v5 v5.2.0
|
||||
## explicit; go 1.14
|
||||
github.com/go-chi/chi/v5
|
||||
github.com/go-chi/chi/v5/middleware
|
||||
# github.com/go-chi/render v1.0.3
|
||||
@@ -845,7 +845,7 @@ github.com/klauspost/compress/zstd/internal/xxhash
|
||||
# github.com/klauspost/cpuid/v2 v2.2.9
|
||||
## explicit; go 1.20
|
||||
github.com/klauspost/cpuid/v2
|
||||
# github.com/kovidgoyal/imaging v1.6.4
|
||||
# github.com/kovidgoyal/imaging v1.6.3
|
||||
## explicit; go 1.21
|
||||
github.com/kovidgoyal/imaging
|
||||
# github.com/leodido/go-urn v1.4.0
|
||||
@@ -1194,7 +1194,7 @@ github.com/open-policy-agent/opa/v1/types
|
||||
github.com/open-policy-agent/opa/v1/util
|
||||
github.com/open-policy-agent/opa/v1/util/decoding
|
||||
github.com/open-policy-agent/opa/v1/version
|
||||
# github.com/opencloud-eu/reva/v2 v2.27.3-0.20250314084055-d2fcfe6b3445
|
||||
# github.com/opencloud-eu/reva/v2 v2.27.3-0.20250312134906-766c69c5d1be
|
||||
## explicit; go 1.24.1
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/runtime
|
||||
@@ -1629,12 +1629,12 @@ github.com/pmezard/go-difflib/difflib
|
||||
## explicit; go 1.16
|
||||
github.com/pquerna/cachecontrol
|
||||
github.com/pquerna/cachecontrol/cacheobject
|
||||
# github.com/prometheus/alertmanager v0.28.1
|
||||
## explicit; go 1.22.0
|
||||
# github.com/prometheus/alertmanager v0.27.0
|
||||
## explicit; go 1.21
|
||||
github.com/prometheus/alertmanager/asset
|
||||
github.com/prometheus/alertmanager/featurecontrol
|
||||
github.com/prometheus/alertmanager/matcher/compat
|
||||
github.com/prometheus/alertmanager/matcher/parse
|
||||
github.com/prometheus/alertmanager/matchers/compat
|
||||
github.com/prometheus/alertmanager/matchers/parse
|
||||
github.com/prometheus/alertmanager/pkg/labels
|
||||
github.com/prometheus/alertmanager/template
|
||||
github.com/prometheus/alertmanager/types
|
||||
@@ -1652,9 +1652,7 @@ github.com/prometheus/client_model/go
|
||||
# github.com/prometheus/common v0.62.0
|
||||
## explicit; go 1.21
|
||||
github.com/prometheus/common/expfmt
|
||||
github.com/prometheus/common/helpers/templates
|
||||
github.com/prometheus/common/model
|
||||
github.com/prometheus/common/promslog
|
||||
# github.com/prometheus/procfs v0.15.1
|
||||
## explicit; go 1.20
|
||||
github.com/prometheus/procfs
|
||||
@@ -1780,13 +1778,13 @@ github.com/shamaton/msgpack/v2/internal/encoding
|
||||
github.com/shamaton/msgpack/v2/internal/stream/decoding
|
||||
github.com/shamaton/msgpack/v2/internal/stream/encoding
|
||||
github.com/shamaton/msgpack/v2/time
|
||||
# github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c
|
||||
## explicit; go 1.19
|
||||
# github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
|
||||
## explicit
|
||||
github.com/shurcooL/httpfs/filter
|
||||
github.com/shurcooL/httpfs/union
|
||||
github.com/shurcooL/httpfs/vfsutil
|
||||
# github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92
|
||||
## explicit; go 1.19
|
||||
# github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
|
||||
## explicit
|
||||
github.com/shurcooL/vfsgen
|
||||
# github.com/sirupsen/logrus v1.9.3
|
||||
## explicit; go 1.13
|
||||
|
||||
Reference in New Issue
Block a user