From 7643f16ebd9e5ea1a76c1e33e8c879887feaee89 Mon Sep 17 00:00:00 2001 From: nold Date: Fri, 5 Jul 2019 13:20:24 +0200 Subject: [PATCH 01/17] Change: Ignore hidden files & files inside of hidden directories [pull/3] --- README.md | 4 +++- data/run.sh | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e0e788..ee0a028 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,10 @@ Here we will put all SSH public keys from our borg clients, we want to backup. E That means every client get's it's own repository. So you might want to use the hostname of the client as the name of the sshkey file. +Hidden files & files inside of hidden directories will be ignored! + ``` -F.e. /sshkeys/clients/webserver.mydomain.com +e.g. /sshkeys/clients/webserver.mydomain.com ``` Than your client would have to initiat the borg repository like this: diff --git a/data/run.sh b/data/run.sh index d8eca9f..17046e9 100755 --- a/data/run.sh +++ b/data/run.sh @@ -27,7 +27,7 @@ for dir in BORG_DATA_DIR SSH_KEY_DIR ; do exit 1 fi - if [ "$(find ${SSH_KEY_DIR}/clients -type f | wc -l)" == "0" ] ; then + if [ "$(find ${SSH_KEY_DIR}/clients ! -regex '.*/\..*' -a -type f | wc -l)" == "0" ] ; then echo "ERROR: No SSH-Pubkey file found in ${SSH_KEY_DIR}" exit 1 fi @@ -48,7 +48,7 @@ echo " * Starting SSH-Key import..." # Add every key to borg-users authorized_keys rm /home/borg/.ssh/authorized_keys &>/dev/null -for keyfile in $(find "${SSH_KEY_DIR}/clients" -type f); do +for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); do client_name=$(basename ${keyfile}) mkdir ${BORG_DATA_DIR}/${client_name} 2>/dev/null echo " ** Adding client ${client_name} with repo path ${BORG_DATA_DIR}/${client_name}" From a741486bb3f94a44e0437a0db921cafbdf182d64 Mon Sep 17 00:00:00 2001 From: nold Date: Fri, 5 Jul 2019 13:25:16 +0200 Subject: [PATCH 02/17] Add: docker-compose.yml --- docker-compose.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..aabaf84 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3' +services: + borgserver: + image: nold360/borgserver + #build: . + volumes: + - ./backup:/backup + - ./sshkeys:/sshkeys + ports: + - "2222:22" + environment: + BORG_SERVE_ARGS: "" + + # If set to "yes", only the BORG_ADMIN + # can delete/prune the all clients archives/repos + BORG_APPEND_ONLY: "no" + + # Hostname of Admin's SSH-Key + BORG_ADMIN: "" + restart: unless-stopped From 590d6712fb81f3d88a756163f182452bef24daca Mon Sep 17 00:00:00 2001 From: Matthijs Abma <4146168+abmaonline@users.noreply.github.com> Date: Sun, 1 Dec 2019 17:56:05 +0100 Subject: [PATCH 03/17] Create borg group and add option to set user id and group id explicitly for easier access to host resources --- Dockerfile | 4 ++-- README.md | 10 ++++++++++ data/run.sh | 23 +++++++++++++++++------ 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 30f7021..a682457 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,10 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get -y --no-install-recommends install \ borgbackup openssh-server && apt-get clean && \ - useradd -s /bin/bash -m borg && \ + useradd -s /bin/bash -m -U borg && \ mkdir /home/borg/.ssh && \ chmod 700 /home/borg/.ssh && \ - chown borg: /home/borg/.ssh && \ + chown borg:borg /home/borg/.ssh && \ mkdir /run/sshd && \ rm -f /etc/ssh/ssh_host*key* && \ rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/* diff --git a/README.md b/README.md index ee0a028..0560555 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,14 @@ borg prune --keep-last 100 --keep-weekly 1 (...) borgserver:/clientA/clientA ``` +#### PUID +Used to set the user id of the `borg` user inside the container. This can be useful when the container has to access resources on the host with a specific user id. + + +#### PGID +Used to set the group id of the `borg` group inside the container. This can be useful when the container has to access resources on the host with a specific group id. + + ### Persistent Storages & Client Configuration We will need two persistent storage directories for our borgserver to be usefull. @@ -118,6 +126,8 @@ services: BORG_SERVE_ARGS: "" BORG_APPEND_ONLY: "no" BORG_ADMIN: "" + PUID: 1000 + PGID: 1000 ``` ### ~/.ssh/config for clients diff --git a/data/run.sh b/data/run.sh index 17046e9..0e360bd 100755 --- a/data/run.sh +++ b/data/run.sh @@ -1,9 +1,20 @@ #!/bin/bash # Start Script for docker-borgserver +PUID=${PUID:-1000} +PGID=${PGID:-1000} + +usermod -o -u "$PUID" borg &>/dev/null +groupmod -o -g "$PGID" borg &>/dev/null + +echo "########################################################" +echo " * User id: $(id -u borg)" +echo " * Group id: $(id -g borg)" + BORG_DATA_DIR=/backup SSH_KEY_DIR=/sshkeys BORG_CMD='cd ${BORG_DATA_DIR}/${client_name}; borg serve --restrict-to-path ${BORG_DATA_DIR}/${client_name} ${BORG_SERVE_ARGS}' +AUTHORIZED_KEYS_PATH=/home/borg/.ssh/authorized_keys # Append only mode? BORG_APPEND_ONLY=${BORG_APPEND_ONLY:=no} @@ -47,7 +58,7 @@ echo "########################################################" echo " * Starting SSH-Key import..." # Add every key to borg-users authorized_keys -rm /home/borg/.ssh/authorized_keys &>/dev/null +rm ${AUTHORIZED_KEYS_PATH} &>/dev/null for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); do client_name=$(basename ${keyfile}) mkdir ${BORG_DATA_DIR}/${client_name} 2>/dev/null @@ -63,13 +74,13 @@ for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); d borg_cmd="${BORG_CMD} --append-only" fi - echo -n "command=\"$(eval echo -n \"${borg_cmd}\")\" " >> /home/borg/.ssh/authorized_keys - cat ${keyfile} >> /home/borg/.ssh/authorized_keys + echo -n "command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} + cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} done -chown -R borg: /backup -chown borg: /home/borg/.ssh/authorized_keys -chmod 600 /home/borg/.ssh/authorized_keys +chown -R borg:borg ${BORG_DATA_DIR} +chown borg:borg ${AUTHORIZED_KEYS_PATH} +chmod 600 ${AUTHORIZED_KEYS_PATH} echo "########################################################" echo " * Init done! Starting SSH-Daemon..." From 5d0d13c42acc36aaed4cb5b76d84bb7b86981489 Mon Sep 17 00:00:00 2001 From: Matthijs Abma <4146168+abmaonline@users.noreply.github.com> Date: Sun, 1 Dec 2019 17:58:29 +0100 Subject: [PATCH 04/17] Add simple integrity check for authorized_keys file, in case you put something interesting in your BORG_SERVE_ARGS --- data/run.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/data/run.sh b/data/run.sh index 0e360bd..3ffd137 100755 --- a/data/run.sh +++ b/data/run.sh @@ -78,6 +78,13 @@ for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); d cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} done +echo " * Validating structure of generated ${AUTHORIZED_KEYS_PATH}..." +ERROR=$(ssh-keygen -lf ${AUTHORIZED_KEYS_PATH} 2>&1 >/dev/null) +if [ $? -ne 0 ]; then + echo "ERROR: ${ERROR}" + exit 1 +fi + chown -R borg:borg ${BORG_DATA_DIR} chown borg:borg ${AUTHORIZED_KEYS_PATH} chmod 600 ${AUTHORIZED_KEYS_PATH} From ac797c90f66f19e9b130ddae482932e7e4e3d5b5 Mon Sep 17 00:00:00 2001 From: nold Date: Thu, 5 Dec 2019 16:45:31 +0100 Subject: [PATCH 05/17] Minor output change to PR#5 - thanks abmaonline --- data/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/run.sh b/data/run.sh index 3ffd137..e794704 100755 --- a/data/run.sh +++ b/data/run.sh @@ -7,10 +7,6 @@ PGID=${PGID:-1000} usermod -o -u "$PUID" borg &>/dev/null groupmod -o -g "$PGID" borg &>/dev/null -echo "########################################################" -echo " * User id: $(id -u borg)" -echo " * Group id: $(id -g borg)" - BORG_DATA_DIR=/backup SSH_KEY_DIR=/sshkeys BORG_CMD='cd ${BORG_DATA_DIR}/${client_name}; borg serve --restrict-to-path ${BORG_DATA_DIR}/${client_name} ${BORG_SERVE_ARGS}' @@ -23,6 +19,10 @@ echo "########################################################" echo -n " * Docker BorgServer powered by " borg -V echo "########################################################" +echo " * User id: $(id -u borg)" +echo " * Group id: $(id -g borg)" +echo "########################################################" + # Precheck if BORG_ADMIN is set if [ "${BORG_APPEND_ONLY}" == "yes" ] && [ -z "${BORG_ADMIN}" ] ; then From 674b4d8757365e9f64a9d163511c5b997647239d Mon Sep 17 00:00:00 2001 From: nold Date: Fri, 13 Aug 2021 12:50:23 +0200 Subject: [PATCH 06/17] Add: drone.yml --- .drone.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..efcda51 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,18 @@ +--- +kind: pipeline +name: build +type: kubernetes + +steps: +- name: build-image + image: plugins/buildah-docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: nold360/borgserver + dockerfile: Dockerfile + tags: + - latest + - buster From 7d29e33747a51bb24a43ae840241d72b15e061ca Mon Sep 17 00:00:00 2001 From: nold Date: Mon, 29 Nov 2021 17:39:31 +0100 Subject: [PATCH 07/17] Fix: drone - use kaniko for building --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index efcda51..e79c02f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,7 +5,7 @@ type: kubernetes steps: - name: build-image - image: plugins/buildah-docker + image: plugins/kaniko settings: username: from_secret: docker_username From 7b241c142bd30d5c0b2a76d2bd7239265879a005 Mon Sep 17 00:00:00 2001 From: nold Date: Fri, 21 Jan 2022 10:02:01 +0100 Subject: [PATCH 08/17] Update: README & docker-compose example --- README.md | 18 +----------------- docker-compose.yml | 5 +++-- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 0560555..a0d7eec 100644 --- a/README.md +++ b/README.md @@ -112,23 +112,7 @@ In this directory will borg write all the client data to. It's best to start wit ## Example Setup ### docker-compose.yml -Here is a quick example, how to run borgserver using docker-compose: -``` -services: - borgserver: - image: nold360/borgserver - volumes: - - /backup:/backup - - ./sshkeys:/sshkeys - ports: - - "2222:22" - environment: - BORG_SERVE_ARGS: "" - BORG_APPEND_ONLY: "no" - BORG_ADMIN: "" - PUID: 1000 - PGID: 1000 -``` +Here is a quick example, how to run borgserver using docker-compose: [docker-compose.yml](https://github.com/Nold360/docker-borgserver/blob/master/docker-compose.yml) ### ~/.ssh/config for clients With this configuration (on your borg client) you can easily connect to your borgserver. diff --git a/docker-compose.yml b/docker-compose.yml index aabaf84..e66b4cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,12 +9,13 @@ services: ports: - "2222:22" environment: + # Additional Arguments, see https://borgbackup.readthedocs.io/en/stable/usage/serve.html BORG_SERVE_ARGS: "" # If set to "yes", only the BORG_ADMIN - # can delete/prune the all clients archives/repos + # can delete/prune the other clients archives/repos BORG_APPEND_ONLY: "no" - # Hostname of Admin's SSH-Key + # Filename of Admins SSH-Key; has full access to all repos BORG_ADMIN: "" restart: unless-stopped From 0b641a82539a473ae861dbc21981f717425749cc Mon Sep 17 00:00:00 2001 From: Nold Date: Fri, 21 Jan 2022 10:33:54 +0100 Subject: [PATCH 09/17] Upgrade: bullseye & borgbackup 1.1.16 (#13) * Upgrade to bullseye-slim image * Fix(run.sh): authorized_keys permissions * Change(run.sh): Add restrict to client keys & output debian version * Change(Dockerfile): Allow different base images * Update(drone): Build buster & bullseye images * Update README --- .drone.yml | 20 +++++++++++++++++++- Dockerfile | 3 ++- README.md | 6 ++++++ data/run.sh | 5 ++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index e79c02f..f204aa3 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: build type: kubernetes steps: -- name: build-image +- name: build-bullseye image: plugins/kaniko settings: username: @@ -13,6 +13,24 @@ steps: from_secret: docker_password repo: nold360/borgserver dockerfile: Dockerfile + build_args: + - BASE_IMAGE=debian:bullseye-slim tags: - latest + - bullseye + - 1.1.16 + +- name: build-buster + image: plugins/kaniko + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: nold360/borgserver + dockerfile: Dockerfile + build_args: + - BASE_IMAGE=debian:buster-slim + tags: - buster + - 1.1.9 diff --git a/Dockerfile b/Dockerfile index a682457..a7cd5d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,8 @@ # Dockerfile to build borgbackup server images # Based on Debian ############################################################ -FROM debian:buster-slim +ARG BASE_IMAGE=debian:bullseye-slim +FROM $BASE_IMAGE # Volume for SSH-Keys VOLUME /sshkeys diff --git a/README.md b/README.md index a0d7eec..e381cdc 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,9 @@ And create your first backup! ``` $ borg create backup:my_first_borg_repo::documents-2017-11-01 /home/user/MyImportentDocs ``` + +## Tags + +All images are freshly built every week & published as `nold360/borgserver` with the following tags: + - Latest / Stable [borg 1.1.16]: `bullseye`, `1.1.16`, `latest` + - Legacy / Buster [borg 1.1.9 ]: `buster`, `1.1.9` diff --git a/data/run.sh b/data/run.sh index e794704..63ec0eb 100755 --- a/data/run.sh +++ b/data/run.sh @@ -15,9 +15,11 @@ AUTHORIZED_KEYS_PATH=/home/borg/.ssh/authorized_keys # Append only mode? BORG_APPEND_ONLY=${BORG_APPEND_ONLY:=no} +source /etc/os-release echo "########################################################" echo -n " * Docker BorgServer powered by " borg -V +echo " * Based on ${PRETTY_NAME}" echo "########################################################" echo " * User id: $(id -u borg)" echo " * Group id: $(id -g borg)" @@ -74,9 +76,10 @@ for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); d borg_cmd="${BORG_CMD} --append-only" fi - echo -n "command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} + echo -n "restrict,command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} done +chmod 0600 "${AUTHORIZED_KEYS_PATH}" echo " * Validating structure of generated ${AUTHORIZED_KEYS_PATH}..." ERROR=$(ssh-keygen -lf ${AUTHORIZED_KEYS_PATH} 2>&1 >/dev/null) From 95ec06eb800e5a8925e900873a56fb793d7f2429 Mon Sep 17 00:00:00 2001 From: Gerrit Pannek Date: Sat, 5 Feb 2022 18:12:37 +0100 Subject: [PATCH 10/17] Fix(run.sh): Add new line in authorized_keys [Fixes #12] --- data/run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/run.sh b/data/run.sh index 63ec0eb..215cbe6 100755 --- a/data/run.sh +++ b/data/run.sh @@ -76,8 +76,9 @@ for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); d borg_cmd="${BORG_CMD} --append-only" fi - echo -n "restrict,command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} - cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} + echo -n "restrict,command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} + cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} + echo >> ${AUTHORIZED_KEYS_PATH} done chmod 0600 "${AUTHORIZED_KEYS_PATH}" From ea677a7da9b6b037dd01ce35967511e74e4e0f62 Mon Sep 17 00:00:00 2001 From: nold Date: Wed, 11 May 2022 18:53:24 +0200 Subject: [PATCH 11/17] Add(drone): Build Bookworm --- .drone.yml | 15 +++++++++++++++ README.md | 1 + 2 files changed, 16 insertions(+) diff --git a/.drone.yml b/.drone.yml index f204aa3..56aceab 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,6 +4,21 @@ name: build type: kubernetes steps: +- name: build-bookworm + image: plugins/kaniko + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: nold360/borgserver + dockerfile: Dockerfile + build_args: + - BASE_IMAGE=debian:bookworm-slim + tags: + - bookworm + - 1.2.0 + - name: build-bullseye image: plugins/kaniko settings: diff --git a/README.md b/README.md index e381cdc..5b4defd 100644 --- a/README.md +++ b/README.md @@ -136,5 +136,6 @@ And create your first backup! ## Tags All images are freshly built every week & published as `nold360/borgserver` with the following tags: + - Next / Unstable [borg 1.2.0]: `bookworm`, `1.2.0` - Latest / Stable [borg 1.1.16]: `bullseye`, `1.1.16`, `latest` - Legacy / Buster [borg 1.1.9 ]: `buster`, `1.1.9` From 2c76a45aca8e864da665eccbf43e33a9f9243aad Mon Sep 17 00:00:00 2001 From: Nold Date: Wed, 20 Jul 2022 11:01:57 +0200 Subject: [PATCH 12/17] Update: bookworm image version 1.2.1 --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 56aceab..25c3848 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,7 @@ steps: - BASE_IMAGE=debian:bookworm-slim tags: - bookworm - - 1.2.0 + - 1.2.1 - name: build-bullseye image: plugins/kaniko From 57ed075e223aa6af4a6faba5bcc5cf1043661da3 Mon Sep 17 00:00:00 2001 From: nold Date: Tue, 20 Sep 2022 09:06:17 +0200 Subject: [PATCH 13/17] Update(drone): Image tag for bookwork v1.2 & v1.2.2 --- .drone.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 25c3848..e41176d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -17,7 +17,8 @@ steps: - BASE_IMAGE=debian:bookworm-slim tags: - bookworm - - 1.2.1 + - 1.2 + - 1.2.2 - name: build-bullseye image: plugins/kaniko From ef02f845dc12fa46a3ec1e3ab9daf493100f198a Mon Sep 17 00:00:00 2001 From: nold Date: Tue, 22 Nov 2022 22:15:49 +0100 Subject: [PATCH 14/17] add(ci): woodpecker.yml --- .drone.yml | 52 ------------------------------------------------- .woodpecker.yml | 30 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 52 deletions(-) delete mode 100644 .drone.yml create mode 100644 .woodpecker.yml diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index e41176d..0000000 --- a/.drone.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -kind: pipeline -name: build -type: kubernetes - -steps: -- name: build-bookworm - image: plugins/kaniko - settings: - username: - from_secret: docker_username - password: - from_secret: docker_password - repo: nold360/borgserver - dockerfile: Dockerfile - build_args: - - BASE_IMAGE=debian:bookworm-slim - tags: - - bookworm - - 1.2 - - 1.2.2 - -- name: build-bullseye - image: plugins/kaniko - settings: - username: - from_secret: docker_username - password: - from_secret: docker_password - repo: nold360/borgserver - dockerfile: Dockerfile - build_args: - - BASE_IMAGE=debian:bullseye-slim - tags: - - latest - - bullseye - - 1.1.16 - -- name: build-buster - image: plugins/kaniko - settings: - username: - from_secret: docker_username - password: - from_secret: docker_password - repo: nold360/borgserver - dockerfile: Dockerfile - build_args: - - BASE_IMAGE=debian:buster-slim - tags: - - buster - - 1.1.9 diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..5cd8b9e --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,30 @@ +--- +variables: + - &kaniko_plugin 'plugins/kaniko:1.6' + +matrix: + include: + - BASE: bookworm-slim + TAGS: '[ "bookwork", "1.2", "1.2.2" ]' + - BASE: bullseye-slim + TAGS: '[ "bullseye", "latest", "1.1.16" ]' + - BASE: buster-slim + TAGS: '[ "buster", "1.1.9" ]' + +pipeline: + build: + image: *kaniko_plugin + group: build + settings: + repo: nold360/borgserver + dockerfile: Dockerfile + build_args: + - BASE_IMAGE=debian:${BASE} + tags: ${TAGS} + username: + from_secret: docker_username + password: + from_secret: docker_password + when: + - branch: master + - event: cron From 45e8883cae9a844ba93baeed252bda6bdb3b5ac2 Mon Sep 17 00:00:00 2001 From: nold Date: Thu, 24 Nov 2022 16:22:39 +0100 Subject: [PATCH 15/17] fix(sshd_config): recommended keepalive values --- data/sshd_config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/data/sshd_config b/data/sshd_config index b1c2206..29e39c3 100644 --- a/data/sshd_config +++ b/data/sshd_config @@ -25,3 +25,6 @@ PermitTTY no PrintMotd no PermitTunnel no Subsystem sftp /bin/false + +ClientAliveInterval 10 +ClientAliveCountMax 30 From 49b78cf10f85a10dd006c5b80dce8c05c77446e4 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Sat, 13 Jan 2024 03:14:36 +0100 Subject: [PATCH 16/17] feat(platforms): Add ARM support --- .woodpecker.yml | 63 ++++++++++++++++++++++++++-------------------- Dockerfile | 3 +-- README.md | 13 +++------- docker-compose.yml | 2 +- 4 files changed, 41 insertions(+), 40 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 5cd8b9e..75acfa0 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,30 +1,39 @@ ---- -variables: - - &kaniko_plugin 'plugins/kaniko:1.6' - -matrix: - include: - - BASE: bookworm-slim - TAGS: '[ "bookwork", "1.2", "1.2.2" ]' - - BASE: bullseye-slim - TAGS: '[ "bullseye", "latest", "1.1.16" ]' - - BASE: buster-slim - TAGS: '[ "buster", "1.1.9" ]' - -pipeline: +steps: build: - image: *kaniko_plugin - group: build + image: woodpeckerci/plugin-docker-buildx settings: - repo: nold360/borgserver - dockerfile: Dockerfile - build_args: - - BASE_IMAGE=debian:${BASE} - tags: ${TAGS} - username: - from_secret: docker_username - password: - from_secret: docker_password + dry-run: true + repo: git.merp.digital/${CI_REPO_OWNER}/borgserver + platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + registry: git.merp.digital when: - - branch: master - - event: cron + - event: push + branch: + exclude: [develop, master] + + publish-nightly: + image: woodpeckerci/plugin-docker-buildx + settings: + repo: git.merp.digital/${CI_REPO_OWNER}/borgserver + platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + registry: git.merp.digital + tags: develop-${CI_COMMIT_SHA} + username: ${CI_REPO_OWNER} + password: + from_secret: cb_token + when: + - event: push + branch: develop + + publish-release: + image: woodpeckerci/plugin-docker-buildx + settings: + repo: git.merp.digital/${CI_REPO_OWNER}/borgserver + platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + registry: git.merp.digital + tags: ${CI_COMMIT_TAG} + username: ${CI_REPO_OWNER} + password: + from_secret: cb_token + when: + - event: tag \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a7cd5d1..893a84c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ # Dockerfile to build borgbackup server images # Based on Debian ############################################################ -ARG BASE_IMAGE=debian:bullseye-slim -FROM $BASE_IMAGE +FROM debian:12.4-slim # Volume for SSH-Keys VOLUME /sshkeys diff --git a/README.md b/README.md index 5b4defd..2ae399d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ docker run -td \ -p 2222:22 \ --volume ./borg/sshkeys:/sshkeys \ --volume ./borg/backup:/backup \ - nold360/borgserver:latest + git.merp.digital/eranmorkon/borgserver:1.0.0 ``` @@ -45,7 +45,7 @@ See the the documentation for all available arguments: [borgbackup.readthedocs.i ##### Example ``` -docker run --rm -e BORG_SERVE_ARGS="--progress --debug" (...) nold360/borgserver +docker run --rm -e BORG_SERVE_ARGS="--progress --debug" (...) git.merp.digital/eranmorkon/borgserver ``` #### BORG_APPEND_ONLY @@ -62,7 +62,7 @@ To declare a client as admin, set this variable to the name of the client/sshkey ##### Example ``` -docker run --rm -e BORG_APPEND_ONLY="yes" -e BORG_ADMIN="nolds_notebook" (...) nold360/borgserver +docker run --rm -e BORG_APPEND_ONLY="yes" -e BORG_ADMIN="nolds_notebook" (...) git.merp.digital/eranmorkon/borgserver ``` To prune repos from another client, you have to add the path to the repository in the clients directory: @@ -132,10 +132,3 @@ And create your first backup! ``` $ borg create backup:my_first_borg_repo::documents-2017-11-01 /home/user/MyImportentDocs ``` - -## Tags - -All images are freshly built every week & published as `nold360/borgserver` with the following tags: - - Next / Unstable [borg 1.2.0]: `bookworm`, `1.2.0` - - Latest / Stable [borg 1.1.16]: `bullseye`, `1.1.16`, `latest` - - Legacy / Buster [borg 1.1.9 ]: `buster`, `1.1.9` diff --git a/docker-compose.yml b/docker-compose.yml index e66b4cd..6557ab3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: borgserver: - image: nold360/borgserver + image: git.merp.digital/eranmorkon/borgserver #build: . volumes: - ./backup:/backup From 397f800372c87d8ea45b682f4762da78a5842943 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Sat, 13 Jan 2024 03:17:42 +0100 Subject: [PATCH 17/17] fix(platforms): Remove useless platforms --- .woodpecker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 75acfa0..b765cde 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -4,7 +4,7 @@ steps: settings: dry-run: true repo: git.merp.digital/${CI_REPO_OWNER}/borgserver - platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 registry: git.merp.digital when: - event: push @@ -15,7 +15,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/borgserver - platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 registry: git.merp.digital tags: develop-${CI_COMMIT_SHA} username: ${CI_REPO_OWNER} @@ -29,7 +29,7 @@ steps: image: woodpeckerci/plugin-docker-buildx settings: repo: git.merp.digital/${CI_REPO_OWNER}/borgserver - platforms: linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x + platforms: linux/386,linux/amd64,linux/arm/v7,linux/arm64/v8 registry: git.merp.digital tags: ${CI_COMMIT_TAG} username: ${CI_REPO_OWNER}