mender-testkit 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mender_testkit/__init__.py +31 -0
- mender_testkit/_server_ref.py +27 -0
- mender_testkit/compose.py +114 -0
- mender_testkit/data/mender_server/.env +7 -0
- mender_testkit/data/mender_server/compose/certs/mender.crt +12 -0
- mender_testkit/data/mender_server/compose/certs/mender.key +5 -0
- mender_testkit/data/mender_server/compose/config/mender.pem +28 -0
- mender_testkit/data/mender_server/compose/config/traefik/middlewares.yaml +48 -0
- mender_testkit/data/mender_server/compose/config/traefik/tls.yaml +9 -0
- mender_testkit/data/mender_server/compose/docker-compose.enterprise.yml +181 -0
- mender_testkit/data/mender_server/compose/docker-compose.seaweedfs.yml +102 -0
- mender_testkit/data/mender_server/docker-compose.yml +436 -0
- mender_testkit/data/overlays/no-ports.yml +15 -0
- mender_testkit/devices.py +161 -0
- mender_testkit/docker.py +60 -0
- mender_testkit/plugin.py +183 -0
- mender_testkit/projects.py +35 -0
- mender_testkit/server.py +443 -0
- mender_testkit/testutils/__init__.py +13 -0
- mender_testkit/testutils/api/__init__.py +13 -0
- mender_testkit/testutils/api/auditlogs.py +16 -0
- mender_testkit/testutils/api/client.py +143 -0
- mender_testkit/testutils/api/deployments.py +33 -0
- mender_testkit/testutils/api/deployments_v2.py +23 -0
- mender_testkit/testutils/api/deviceauth.py +57 -0
- mender_testkit/testutils/api/deviceconfig.py +17 -0
- mender_testkit/testutils/api/deviceconnect.py +19 -0
- mender_testkit/testutils/api/devicemonitor.py +22 -0
- mender_testkit/testutils/api/inventory.py +30 -0
- mender_testkit/testutils/api/inventory_v2.py +27 -0
- mender_testkit/testutils/api/iot_manager.py +21 -0
- mender_testkit/testutils/api/proto_shell.py +82 -0
- mender_testkit/testutils/api/protomsg.py +91 -0
- mender_testkit/testutils/api/tenantadm.py +33 -0
- mender_testkit/testutils/api/tenantadm_v2.py +24 -0
- mender_testkit/testutils/api/useradm.py +36 -0
- mender_testkit/testutils/api/workflows.py +18 -0
- mender_testkit/testutils/common.py +641 -0
- mender_testkit/testutils/infra/__init__.py +13 -0
- mender_testkit/testutils/infra/cli.py +279 -0
- mender_testkit/testutils/infra/container_manager/__init__.py +14 -0
- mender_testkit/testutils/infra/container_manager/base.py +70 -0
- mender_testkit/testutils/infra/container_manager/docker_compose_base_manager.py +200 -0
- mender_testkit/testutils/infra/container_manager/docker_compose_manager.py +589 -0
- mender_testkit/testutils/infra/container_manager/docker_manager.py +77 -0
- mender_testkit/testutils/infra/container_manager/factory.py +250 -0
- mender_testkit/testutils/infra/container_manager/kubernetes_manager.py +210 -0
- mender_testkit/testutils/infra/device.py +459 -0
- mender_testkit/testutils/infra/mongo.py +44 -0
- mender_testkit/testutils/infra/smtpd_mock.py +176 -0
- mender_testkit/testutils/integration/stripe.py +61 -0
- mender_testkit/testutils/util/__init__.py +13 -0
- mender_testkit/testutils/util/artifact.py +306 -0
- mender_testkit/testutils/util/crypto.py +119 -0
- mender_testkit/testutils/util/websockets.py +111 -0
- mender_testkit-0.1.1.dist-info/METADATA +215 -0
- mender_testkit-0.1.1.dist-info/RECORD +61 -0
- mender_testkit-0.1.1.dist-info/WHEEL +5 -0
- mender_testkit-0.1.1.dist-info/entry_points.txt +2 -0
- mender_testkit-0.1.1.dist-info/licenses/LICENSE +181 -0
- mender_testkit-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Copyright 2026 Northern.tech AS
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Shared test infrastructure for the Mender integration test suites."""
|
|
15
|
+
|
|
16
|
+
import os
|
|
17
|
+
|
|
18
|
+
# Traefik's routers match on Host as well as path, and the tests address the
|
|
19
|
+
# ingress by container IP, so every request has to carry this. testutils defaults
|
|
20
|
+
# it to "traefik", the name mender-server's own deployments answer to.
|
|
21
|
+
#
|
|
22
|
+
# Set here rather than in plugin.py because it has to happen before
|
|
23
|
+
# testutils.api.client is imported -- that module reads it into a module-level
|
|
24
|
+
# constant. Importing any submodule of this package runs this file first, whereas
|
|
25
|
+
# plugin.py's own module-level imports already pull testutils in before its body
|
|
26
|
+
# executes.
|
|
27
|
+
os.environ.setdefault("GATEWAY_HOSTNAME", "docker.mender.io")
|
|
28
|
+
|
|
29
|
+
from ._server_ref import MENDER_SERVER_REF # noqa: E402
|
|
30
|
+
|
|
31
|
+
__all__ = ["MENDER_SERVER_REF"]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright 2026 Northern.tech AS
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""The mender-server commit this package's vendored trees were taken from.
|
|
15
|
+
|
|
16
|
+
Both src/testutils/ and src/mender_testkit/data/mender_server/ are copies
|
|
17
|
+
of that commit, refreshed by scripts/vendor.py. Do not edit either tree by
|
|
18
|
+
hand: a fix belongs upstream in mender-server, after which this ref moves and
|
|
19
|
+
the copies are regenerated. Renovate updates the constant below, see
|
|
20
|
+
renovate.json5.
|
|
21
|
+
|
|
22
|
+
A commit rather than a release tag because the Host-header routing the tests
|
|
23
|
+
depend on (MENDER_HOSTNAME in docker-compose.yml) is not in any tag yet -- as of
|
|
24
|
+
this writing v4.1.1 through v4.1.3 have none of it.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
MENDER_SERVER_REF = "30871b083f9b3154b560ac8f618cd58dcf8e35d8"
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Copyright 2026 Northern.tech AS
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
"""Access to the mender-server compose files shipped as package data.
|
|
15
|
+
|
|
16
|
+
importlib.resources exposes package data as a Traversable, not a filesystem
|
|
17
|
+
path -- in a zipped install there is no path at all. Docker compose needs real
|
|
18
|
+
files, and it needs them as a *tree*: docker-compose.yml binds ./compose/certs,
|
|
19
|
+
./compose/config/traefik and ./compose/config/mender.pem relative to the project
|
|
20
|
+
directory, and it `include:`s compose/docker-compose.seaweedfs.yml. So the whole
|
|
21
|
+
directory is materialised together rather than a file at a time.
|
|
22
|
+
|
|
23
|
+
importlib.resources.as_file() is the usual answer for a single resource, but its
|
|
24
|
+
temporary copy is removed when the context manager exits, which is no good for
|
|
25
|
+
paths that have to outlive a `compose up` ... `compose down` cycle.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
import atexit
|
|
29
|
+
import logging
|
|
30
|
+
import shutil
|
|
31
|
+
import tempfile
|
|
32
|
+
from importlib.resources import files
|
|
33
|
+
from pathlib import Path
|
|
34
|
+
|
|
35
|
+
logger = logging.getLogger(__name__)
|
|
36
|
+
|
|
37
|
+
_DATA_ROOT = ("data", "mender_server")
|
|
38
|
+
# Overrides written by this package rather than vendored from mender-server, so
|
|
39
|
+
# they live outside the tree scripts/vendor.py regenerates.
|
|
40
|
+
_OVERLAY_ROOT = ("data", "overlays")
|
|
41
|
+
|
|
42
|
+
# Materialised at most once per process, so `up` and `down` are handed identical
|
|
43
|
+
# paths. Under xdist each worker gets its own copy, which costs 31 KB.
|
|
44
|
+
_materialised = None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _copy_tree(src, dest: Path) -> None:
|
|
48
|
+
"""Recursively copy a Traversable into a real directory.
|
|
49
|
+
|
|
50
|
+
Written against the Traversable API rather than shutil.copytree so that it
|
|
51
|
+
works whether the package is installed as a directory or inside a zip.
|
|
52
|
+
"""
|
|
53
|
+
dest.mkdir(parents=True, exist_ok=True)
|
|
54
|
+
for entry in src.iterdir():
|
|
55
|
+
target = dest / entry.name
|
|
56
|
+
if entry.is_dir():
|
|
57
|
+
_copy_tree(entry, target)
|
|
58
|
+
else:
|
|
59
|
+
target.write_bytes(entry.read_bytes())
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def compose_dir(dest=None) -> Path:
|
|
63
|
+
"""Real on-disk directory holding mender-server's compose tree.
|
|
64
|
+
|
|
65
|
+
Pass this as compose's --project-directory so the relative bind mounts in
|
|
66
|
+
docker-compose.yml resolve. This package's own overrides are materialised
|
|
67
|
+
alongside, under overlays/.
|
|
68
|
+
|
|
69
|
+
With no `dest` the tree goes to a temporary directory removed at process
|
|
70
|
+
exit, which suits a pytest session. Pass `dest` to materialise somewhere
|
|
71
|
+
that outlives this process -- handing the path to a shell script, say.
|
|
72
|
+
"""
|
|
73
|
+
global _materialised
|
|
74
|
+
|
|
75
|
+
def _build(target: Path) -> None:
|
|
76
|
+
_copy_tree(_resource(_DATA_ROOT), target)
|
|
77
|
+
_copy_tree(_resource(_OVERLAY_ROOT), target / "overlays")
|
|
78
|
+
|
|
79
|
+
if dest is not None:
|
|
80
|
+
dest = Path(dest)
|
|
81
|
+
_build(dest)
|
|
82
|
+
return dest
|
|
83
|
+
if _materialised is None:
|
|
84
|
+
tmp = Path(tempfile.mkdtemp(prefix="mender-compose-"))
|
|
85
|
+
_build(tmp)
|
|
86
|
+
atexit.register(shutil.rmtree, tmp, ignore_errors=True)
|
|
87
|
+
logger.debug("materialised mender-server compose files to %s", tmp)
|
|
88
|
+
_materialised = tmp
|
|
89
|
+
return _materialised
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _resource(parts):
|
|
93
|
+
root = files(__package__)
|
|
94
|
+
for part in parts:
|
|
95
|
+
root = root / part
|
|
96
|
+
return root
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def compose_files(plan: str = "os", publish_ports: bool = False, dest=None) -> list:
|
|
100
|
+
"""Compose files for `plan`, in the order they must be passed to -f.
|
|
101
|
+
|
|
102
|
+
By default the backend publishes no host ports: the tests reach Traefik by
|
|
103
|
+
container IP, and not publishing lets several backends coexist. Pass
|
|
104
|
+
publish_ports=True to reach the stack from the host, which only works for one
|
|
105
|
+
backend at a time.
|
|
106
|
+
"""
|
|
107
|
+
d = compose_dir(dest)
|
|
108
|
+
paths = [d / "docker-compose.yml"]
|
|
109
|
+
if plan == "enterprise":
|
|
110
|
+
paths.append(d / "compose" / "docker-compose.enterprise.yml")
|
|
111
|
+
if not publish_ports:
|
|
112
|
+
# Last, so it overrides whatever the files above declared.
|
|
113
|
+
paths.append(d / "overlays" / "no-ports.yml")
|
|
114
|
+
return paths
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIB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ph2//WUi5XTDV0LWPow90ZPB1Gy//xARYGMMz2wha0VDT
|
|
20
|
+
aL7wTckWVjQs3LVLmuzC+48IhipbGDXgKhbtFaC7EEtiH7hthp14XijsTAvSOXrN
|
|
21
|
+
WXHerZtI61INcbJmUa3ZOKouTfj2J7yL7QHxQ4qeV7BFqgG6B5cLt+enAoGAYIQK
|
|
22
|
+
rGlgKMXl6k9aVhLCv3J+PUDcDE8B+vCzxRBHwS3JMQ2dsczTggcblPZJw8/hkOcK
|
|
23
|
+
tpfQH5GMvgSq3gZ52jJQMPARAHGiZmqVqZB6VduS+bDpR3d1lX7jNOFmA0Zlz9bI
|
|
24
|
+
Q5G69fzDfLKSggHOKX/IsXqWvY+V1pp0DqhIYn8CgYEAqCTUEX4nbKzKsh9+rxwh
|
|
25
|
+
m69Bpb/wPUTMsVmGKVPOqcXkCwx9Z/mFqlpm1wT3inZaNRcZ67Lrn1qfDhE0kUBF
|
|
26
|
+
QmrgFugqulEahrYpZcR4s7LM7RBQFadzgHGXWGonYDMNUMxTU+HIKuHEac++L1xP
|
|
27
|
+
HDs7g8VXdLEUfbVl1As20d4=
|
|
28
|
+
-----END PRIVATE KEY-----
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
http:
|
|
2
|
+
middlewares:
|
|
3
|
+
sec-headers:
|
|
4
|
+
headers:
|
|
5
|
+
stsSeconds: 31536000
|
|
6
|
+
forceSTSHeader: true
|
|
7
|
+
stsPreload: true
|
|
8
|
+
stsIncludeSubdomains: true
|
|
9
|
+
contentTypeNosniff: true
|
|
10
|
+
browserXssFilter: true
|
|
11
|
+
customRequestHeaders:
|
|
12
|
+
"X-Forwarded-Proto": "https"
|
|
13
|
+
|
|
14
|
+
compression:
|
|
15
|
+
compress: true
|
|
16
|
+
|
|
17
|
+
devauth:
|
|
18
|
+
forwardAuth:
|
|
19
|
+
address: "http://deviceauth:8080/api/internal/v1/devauth/tokens/verify"
|
|
20
|
+
authResponseHeaders: "X-MEN-RequestID"
|
|
21
|
+
|
|
22
|
+
userauth:
|
|
23
|
+
forwardAuth:
|
|
24
|
+
address: "http://useradm:8080/api/internal/v1/useradm/auth/verify"
|
|
25
|
+
authResponseHeaders: "X-MEN-RequestID,X-MEN-RBAC-Inventory-Groups,X-MEN-RBAC-Deployments-Groups,X-MEN-RBAC-Releases-Tags"
|
|
26
|
+
|
|
27
|
+
inventoryV1-replacepathregex:
|
|
28
|
+
replacepathregex:
|
|
29
|
+
regex: "^/api/devices/v1/inventory/(.*)"
|
|
30
|
+
replacement: "/api/0.1.0/attributes"
|
|
31
|
+
|
|
32
|
+
inventoryMgmtV1-replacepathregex:
|
|
33
|
+
replacepathregex:
|
|
34
|
+
regex: "^/api/management/v1/inventory/(.*)"
|
|
35
|
+
replacement: "/api/0.1.0/$1"
|
|
36
|
+
|
|
37
|
+
mgmtStack:
|
|
38
|
+
chain:
|
|
39
|
+
middlewares:
|
|
40
|
+
- userauth
|
|
41
|
+
- sec-headers
|
|
42
|
+
- compression
|
|
43
|
+
|
|
44
|
+
devStack:
|
|
45
|
+
chain:
|
|
46
|
+
middlewares:
|
|
47
|
+
- devauth
|
|
48
|
+
- compression
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Enterprise override for ../docker-compose.yml
|
|
2
|
+
services:
|
|
3
|
+
auditlogs:
|
|
4
|
+
build:
|
|
5
|
+
context: .
|
|
6
|
+
dockerfile: ./backend/services/auditlogs/Dockerfile
|
|
7
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/auditlogs:${MENDER_IMAGE_TAG:-latest}
|
|
8
|
+
restart: on-failure:3
|
|
9
|
+
command: [server, --automigrate]
|
|
10
|
+
depends_on:
|
|
11
|
+
- mongo
|
|
12
|
+
environment:
|
|
13
|
+
AUDITLOGS_MONGO_URL: "mongodb://mongo"
|
|
14
|
+
AUDITLOGS_DEVICEAUTH_ADDRESS: "deviceauth:8080"
|
|
15
|
+
AUDITLOGS_USERADM_ADDRESS: "useradm:8080"
|
|
16
|
+
labels:
|
|
17
|
+
traefik.enable: "true"
|
|
18
|
+
traefik.http.services.auditlogs.loadBalancer.server.port: "8080"
|
|
19
|
+
traefik.http.routers.auditlogs.middlewares: "mgmtStack@file"
|
|
20
|
+
traefik.http.routers.auditlogs.rule: >-
|
|
21
|
+
(Host(`${MENDER_HOSTNAME:-docker.mender.io}`) || Host(`localhost`) || Host(`traefik`)) &&
|
|
22
|
+
PathRegexp(`/api/management/v[0-9a-z]+/auditlogs`)
|
|
23
|
+
traefik.http.routers.auditlogs.service: auditlogs
|
|
24
|
+
networks:
|
|
25
|
+
default:
|
|
26
|
+
aliases: [mender-auditlogs]
|
|
27
|
+
|
|
28
|
+
create-artifact-worker:
|
|
29
|
+
build:
|
|
30
|
+
context: .
|
|
31
|
+
dockerfile: ./backend/services/create-artifact-worker/Dockerfile
|
|
32
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/create-artifact-worker:${MENDER_IMAGE_TAG:-latest}
|
|
33
|
+
|
|
34
|
+
deployments:
|
|
35
|
+
build:
|
|
36
|
+
context: .
|
|
37
|
+
dockerfile: ./backend/services/deployments/Dockerfile
|
|
38
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/deployments:${MENDER_IMAGE_TAG:-latest}
|
|
39
|
+
environment:
|
|
40
|
+
DEPLOYMENTS_ENABLE_AUDIT: "1"
|
|
41
|
+
|
|
42
|
+
deviceauth:
|
|
43
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/deviceauth:${MENDER_IMAGE_TAG:-latest}
|
|
44
|
+
environment:
|
|
45
|
+
DEVICEAUTH_REDIS_CONNECTION_STRING: "redis://redis:6379"
|
|
46
|
+
DEVICEAUTH_REDIS_LIMITS_EXPIRE_SEC: "3600"
|
|
47
|
+
DEVICEAUTH_TENANTADM_ADDR: "http://tenantadm:8080"
|
|
48
|
+
DEVICEAUTH_HAVE_ADDONS: "1"
|
|
49
|
+
DEVICEAUTH_ENABLE_AUDIT: "1"
|
|
50
|
+
|
|
51
|
+
deviceconfig:
|
|
52
|
+
build:
|
|
53
|
+
context: .
|
|
54
|
+
dockerfile: ./backend/services/deviceconfig/Dockerfile
|
|
55
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/deviceconfig:${MENDER_IMAGE_TAG:-latest}
|
|
56
|
+
|
|
57
|
+
deviceconnect:
|
|
58
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/deviceconnect:${MENDER_IMAGE_TAG:-latest}
|
|
59
|
+
environment:
|
|
60
|
+
DEVICECONNECT_ENABLE_AUDIT: "true"
|
|
61
|
+
|
|
62
|
+
devicemonitor:
|
|
63
|
+
build:
|
|
64
|
+
context: .
|
|
65
|
+
dockerfile: ./backend/services/devicemonitor/Dockerfile
|
|
66
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/devicemonitor:${MENDER_IMAGE_TAG:-latest}
|
|
67
|
+
restart: on-failure:3
|
|
68
|
+
command: [server, --automigrate]
|
|
69
|
+
depends_on:
|
|
70
|
+
- mongo
|
|
71
|
+
environment:
|
|
72
|
+
DEVICEMONITOR_MONGO_URL: "mongodb://mongo"
|
|
73
|
+
DEVICEMONITOR_WORKFLOWS_URL: http://workflows:8080
|
|
74
|
+
labels:
|
|
75
|
+
traefik.enable: "true"
|
|
76
|
+
traefik.http.services.devicemonitor.loadBalancer.server.port: "8080"
|
|
77
|
+
traefik.http.routers.devicemonitorDev.middlewares: "devStack@file"
|
|
78
|
+
traefik.http.routers.devicemonitorDev.rule: >-
|
|
79
|
+
(Host(`${MENDER_HOSTNAME:-docker.mender.io}`) || Host(`localhost`) || Host(`traefik`)) &&
|
|
80
|
+
PathRegexp(`/api/devices/v[0-9a-z]+/devicemonitor`)
|
|
81
|
+
traefik.http.routers.devicemonitorDev.service: devicemonitor
|
|
82
|
+
traefik.http.routers.devicemonitorMgmt.middlewares: "mgmtStack@file"
|
|
83
|
+
traefik.http.routers.devicemonitorMgmt.rule: >-
|
|
84
|
+
(Host(`${MENDER_HOSTNAME:-docker.mender.io}`) || Host(`localhost`) || Host(`traefik`)) &&
|
|
85
|
+
PathRegexp(`/api/management/v[0-9a-z]+/devicemonitor`)
|
|
86
|
+
traefik.http.routers.devicemonitorMgmt.service: devicemonitor
|
|
87
|
+
networks:
|
|
88
|
+
default:
|
|
89
|
+
aliases: [mender-devicemonitor]
|
|
90
|
+
|
|
91
|
+
generate-delta-worker:
|
|
92
|
+
build:
|
|
93
|
+
context: .
|
|
94
|
+
dockerfile: ./backend/services/generate-delta-worker/Dockerfile
|
|
95
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/generate-delta-worker:${MENDER_IMAGE_TAG:-latest}
|
|
96
|
+
restart: on-failure:3
|
|
97
|
+
depends_on:
|
|
98
|
+
- workflows
|
|
99
|
+
environment:
|
|
100
|
+
GENERATE_DELTA_DEPLOYMENTS_URL: http://deployments:8080
|
|
101
|
+
WORKFLOWS_MONGO_URL: "mongodb://mongo"
|
|
102
|
+
WORKFLOWS_NATS_URI: "nats://nats"
|
|
103
|
+
|
|
104
|
+
gui:
|
|
105
|
+
environment:
|
|
106
|
+
HAVE_AUDITLOGS: "1"
|
|
107
|
+
HAVE_DELTA_PROGRESS: "1"
|
|
108
|
+
HAVE_ENTERPRISE: "1"
|
|
109
|
+
HAVE_MONITOR: "1"
|
|
110
|
+
HAVE_MULTITENANT: "1"
|
|
111
|
+
|
|
112
|
+
inventory:
|
|
113
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/inventory:${MENDER_IMAGE_TAG:-latest}
|
|
114
|
+
environment:
|
|
115
|
+
INVENTORY_REDIS_CONNECTION_STRING: "redis://redis:6379"
|
|
116
|
+
INVENTORY_REDIS_LIMITS_EXPIRE_SEC: "1800"
|
|
117
|
+
|
|
118
|
+
iot-manager:
|
|
119
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/iot-manager:${MENDER_IMAGE_TAG:-latest}
|
|
120
|
+
|
|
121
|
+
useradm:
|
|
122
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/useradm:${MENDER_IMAGE_TAG:-latest}
|
|
123
|
+
environment:
|
|
124
|
+
USERADM_REDIS_CONNECTION_STRING: "redis://redis:6379"
|
|
125
|
+
USERADM_REDIS_LIMITS_EXPIRE_SEC: "3600"
|
|
126
|
+
USERADM_ORCHESTRATOR_ADDR: "http://workflows:8080"
|
|
127
|
+
USERADM_TENANTADM_ADDR: "http://tenantadm:8080"
|
|
128
|
+
USERADM_HAVE_ADDONS: "1"
|
|
129
|
+
USERADM_ENABLE_AUDIT: "1"
|
|
130
|
+
|
|
131
|
+
tenantadm:
|
|
132
|
+
build:
|
|
133
|
+
context: .
|
|
134
|
+
dockerfile: ./backend/services/tenantadm/Dockerfile
|
|
135
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/tenantadm:${MENDER_IMAGE_TAG:-latest}
|
|
136
|
+
restart: on-failure:3
|
|
137
|
+
command: [server, --automigrate]
|
|
138
|
+
depends_on:
|
|
139
|
+
- mongo
|
|
140
|
+
environment:
|
|
141
|
+
TENANTADM_MONGO: "mongodb://mongo"
|
|
142
|
+
TENANTADM_AUDITLOGS_ADDR: http://auditlogs:8080/
|
|
143
|
+
TENANTADM_ORCHESTRATOR_ADDR: http://workflows:8080/
|
|
144
|
+
TENANTADM_USERADM_ADDR: http://useradm:8080/
|
|
145
|
+
TENANTADM_DEVICEAUTH_ADDR: http://deviceauth:8080/
|
|
146
|
+
TENANTADM_DEPLOYMENTS_ADDR: http://deployments:8080/
|
|
147
|
+
labels:
|
|
148
|
+
traefik.enable: "true"
|
|
149
|
+
traefik.http.services.tenantadm.loadBalancer.server.port: "8080"
|
|
150
|
+
traefik.http.routers.tenantadm.middlewares: "mgmtStack@file"
|
|
151
|
+
traefik.http.routers.tenantadm.rule: >-
|
|
152
|
+
(Host(`${MENDER_HOSTNAME:-docker.mender.io}`) || Host(`localhost`) || Host(`traefik`)) &&
|
|
153
|
+
PathRegexp(`/api/management/v[0-9a-z]/tenantadm`)
|
|
154
|
+
traefik.http.routers.tenantadm.service: tenantadm
|
|
155
|
+
traefik.http.routers.signup.middlewares: >-
|
|
156
|
+
compression@file,sec-headers@file
|
|
157
|
+
traefik.http.routers.signup.rule: >-
|
|
158
|
+
(Host(`${MENDER_HOSTNAME:-docker.mender.io}`) || Host(`localhost`) || Host(`traefik`)) &&
|
|
159
|
+
((Method(`OPTIONS`) || Method(`POST`)) && PathRegexp(`/api/management/v[0-9a-z]+/tenantadm/tenants/signup`) ||
|
|
160
|
+
(Method(`OPTIONS`) || Method(`POST`)) && PathRegexp(`/api/management/v[0-9a-z]+/tenantadm/tenants/trial`))
|
|
161
|
+
traefik.http.routers.signup.service: tenantadm
|
|
162
|
+
networks:
|
|
163
|
+
default:
|
|
164
|
+
aliases: [mender-tenantadm]
|
|
165
|
+
|
|
166
|
+
workflows-worker:
|
|
167
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/workflows:${MENDER_IMAGE_TAG:-latest}
|
|
168
|
+
environment:
|
|
169
|
+
AUDITLOGS_ADDR: auditlogs:8080
|
|
170
|
+
DEVICEMONITOR_ADDR: devicemonitor:8080
|
|
171
|
+
TENANTADM_ADDR: tenantadm:8080
|
|
172
|
+
HAVE_AUDITLOGS: "1"
|
|
173
|
+
|
|
174
|
+
workflows:
|
|
175
|
+
image: ${MENDER_IMAGE_REGISTRY:-registry.mender.io}/${MENDER_IMAGE_REPOSITORY:-mender-server-enterprise}/workflows:${MENDER_IMAGE_TAG:-latest}
|
|
176
|
+
|
|
177
|
+
redis:
|
|
178
|
+
image: ${MIRROR_REGISTRY:-docker.io}/library/redis:8.8
|
|
179
|
+
networks:
|
|
180
|
+
default:
|
|
181
|
+
aliases: [mender-redis]
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
configs:
|
|
2
|
+
s3-conf:
|
|
3
|
+
content: |
|
|
4
|
+
{
|
|
5
|
+
"identities": [
|
|
6
|
+
{
|
|
7
|
+
"name": "mender",
|
|
8
|
+
"credentials": [
|
|
9
|
+
{
|
|
10
|
+
"accessKey": "${MENDER_ACCESS_KEY_ID:-mender}",
|
|
11
|
+
"secretKey": "${MENDER_SECRET_ACCESS_KEY:-thisisnotsecure}"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"actions": [
|
|
15
|
+
"Admin:mender",
|
|
16
|
+
"Read:mender",
|
|
17
|
+
"Write:mender",
|
|
18
|
+
"List:mender",
|
|
19
|
+
"Tagging:mender"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
services:
|
|
26
|
+
s3-master:
|
|
27
|
+
image: ${MIRROR_REGISTRY:-docker.io}/chrislusf/seaweedfs:4.22
|
|
28
|
+
command:
|
|
29
|
+
- master
|
|
30
|
+
- -mdir=/data
|
|
31
|
+
- -ip=s3-master
|
|
32
|
+
- -ip.bind=0.0.0.0
|
|
33
|
+
- -electionTimeout=1s
|
|
34
|
+
- -heartbeatInterval=200ms
|
|
35
|
+
- -raftHashicorp=true
|
|
36
|
+
volumes:
|
|
37
|
+
- s3:/data
|
|
38
|
+
|
|
39
|
+
s3-volume:
|
|
40
|
+
image: ${MIRROR_REGISTRY:-docker.io}/chrislusf/seaweedfs:4.22
|
|
41
|
+
command:
|
|
42
|
+
- volume
|
|
43
|
+
- -mserver=s3-master:9333
|
|
44
|
+
- -ip.bind=0.0.0.0
|
|
45
|
+
- -port=8080
|
|
46
|
+
- -dir=/data
|
|
47
|
+
- -preStopSeconds=0
|
|
48
|
+
depends_on:
|
|
49
|
+
- s3-master
|
|
50
|
+
volumes:
|
|
51
|
+
- s3:/data
|
|
52
|
+
|
|
53
|
+
s3-filer:
|
|
54
|
+
image: ${MIRROR_REGISTRY:-docker.io}/chrislusf/seaweedfs:4.22
|
|
55
|
+
command:
|
|
56
|
+
- filer
|
|
57
|
+
- -master=s3-master:9333
|
|
58
|
+
- -ip.bind=0.0.0.0
|
|
59
|
+
depends_on:
|
|
60
|
+
- s3-master
|
|
61
|
+
- s3-volume
|
|
62
|
+
volumes:
|
|
63
|
+
- s3:/data
|
|
64
|
+
|
|
65
|
+
s3:
|
|
66
|
+
image: ${MIRROR_REGISTRY:-docker.io}/chrislusf/seaweedfs:4.22
|
|
67
|
+
command:
|
|
68
|
+
- s3
|
|
69
|
+
- -port=8080
|
|
70
|
+
- -filer=s3-filer:8888
|
|
71
|
+
- -ip.bind=0.0.0.0
|
|
72
|
+
- -config=/etc/seaweedfs/s3.conf
|
|
73
|
+
depends_on:
|
|
74
|
+
- s3-master
|
|
75
|
+
- s3-volume
|
|
76
|
+
- s3-filer
|
|
77
|
+
configs:
|
|
78
|
+
- source: s3-conf
|
|
79
|
+
target: /etc/seaweedfs/s3.conf
|
|
80
|
+
labels:
|
|
81
|
+
traefik.enable: "true"
|
|
82
|
+
traefik.http.routers.s3.priority: "99999"
|
|
83
|
+
traefik.http.routers.s3.rule:
|
|
84
|
+
(Host(`s3.${MENDER_HOSTNAME:-docker.mender.io}`) ||
|
|
85
|
+
Host(`${MENDER_HOSTNAME:-docker.mender.io}`) ||
|
|
86
|
+
Host(`localhost`)) &&
|
|
87
|
+
PathPrefix(`/mender`)
|
|
88
|
+
traefik.http.services.s3.loadBalancer.server.port: "8080"
|
|
89
|
+
healthcheck:
|
|
90
|
+
test:
|
|
91
|
+
- CMD
|
|
92
|
+
- /usr/bin/nc
|
|
93
|
+
- -z
|
|
94
|
+
- 127.0.0.1
|
|
95
|
+
- "8080"
|
|
96
|
+
interval: 5s
|
|
97
|
+
retries: 10
|
|
98
|
+
volumes:
|
|
99
|
+
- s3:/data
|
|
100
|
+
|
|
101
|
+
volumes:
|
|
102
|
+
s3: {}
|