Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ WORKDIR /app
COPY pyproject.toml README.md LICENSE ./
COPY src ./src
RUN pip install --no-cache-dir . \
&& useradd --system --uid 10001 --user-group --home-dir /nonexistent --shell /usr/sbin/nologin dbbackup
&& groupadd --gid 1004 dbbackup \
&& useradd --uid 1004 --gid 1004 --no-create-home --home-dir /nonexistent --shell /usr/sbin/nologin dbbackup

USER 10001
USER 1004:1004
ENTRYPOINT ["dbbackup"]
CMD ["backup"]

Expand All @@ -48,6 +49,6 @@ FROM runtime AS test
USER root
RUN pip install --no-cache-dir "pytest>=8"
COPY tests ./tests
USER 10001
USER 1004:1004
ENTRYPOINT []
CMD ["python", "-m", "pytest", "-p", "no:cacheprovider", "-m", "integration", "-v", "tests/integration"]
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,5 @@ services:
read_only: true
tmpfs:
- /tmp
- /backups:uid=10001,gid=10001
- /backups:uid=1004,gid=1004
depends_on: *db-deps
4 changes: 2 additions & 2 deletions deploy/k8s/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ spec:
runAsNonRoot: true
# Must be able to write to the NFS export: set these to its owner.
# (fsGroup doesn't help here, as NFS volumes aren't chowned.)
runAsUser: 10001
runAsGroup: 10001
runAsUser: 1004
runAsGroup: 1004
seccompProfile:
type: RuntimeDefault
containers:
Expand Down
2 changes: 1 addition & 1 deletion deploy/k8s/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ configMapGenerator:

images:
- name: ghcr.io/arkane-systems/db-backup
newTag: "0.1.0"
newTag: "0.1.1"

labels:
- pairs:
Expand Down
6 changes: 3 additions & 3 deletions docs/restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ spec:
template:
spec:
restartPolicy: Never
securityContext: {runAsNonRoot: true, runAsUser: 10001, runAsGroup: 10001}
securityContext: {runAsNonRoot: true, runAsUser: 1004, runAsGroup: 1004}
containers:
- name: restore
image: ghcr.io/arkane-systems/db-backup:0.1.0
image: ghcr.io/arkane-systems/db-backup:0.1.1
args: [restore, postgres-main, --host, new-postgres.example.lan, --username, postgres, --password-env, ADMIN_PASSWORD]
env:
- name: ADMIN_PASSWORD
Expand All @@ -85,7 +85,7 @@ spec:

```bash
docker run --rm -v /mnt/db-backups:/backups:ro -v $PWD/config.yaml:/etc/dbbackup/config.yaml:ro \
-e ADMIN_PASSWORD ghcr.io/arkane-systems/db-backup:0.1.0 \
-e ADMIN_PASSWORD ghcr.io/arkane-systems/db-backup:0.1.1 \
restore mariadb-main --host new-mariadb.example.lan --username root --password-env ADMIN_PASSWORD
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dbbackup"
version = "0.1.0"
version = "0.1.1"
description = "Containerized logical backups of MariaDB, PostgreSQL and MongoDB servers, with GFS retention"
readme = "README.md"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/dbbackup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Logical backups of MariaDB, PostgreSQL and MongoDB servers, with GFS retention."""

__version__ = "0.1.0"
__version__ = "0.1.1"
Loading