Compare commits

...

6 commits

Author SHA1 Message Date
nold e07f5e9957 Update README 2022-01-21 10:27:23 +01:00
nold c0cb6eb340 Update(drone): Build buster & bullseye images 2022-01-21 10:19:37 +01:00
nold 80e99c96d5 Change(Dockerfile): Allow different base images 2022-01-21 10:16:58 +01:00
nold 5c1724875c Change: Add restrict to client keys & output debian version 2022-01-21 10:16:42 +01:00
nold 04819a897c Fix: authorized_keys permissions 2022-01-21 10:03:52 +01:00
nold 9ff54e254f Upgrade to bullseye-slim image 2022-01-21 10:03:52 +01:00
4 changed files with 31 additions and 3 deletions

View file

@ -4,7 +4,7 @@ name: build
type: kubernetes type: kubernetes
steps: steps:
- name: build-image - name: build-bullseye
image: plugins/kaniko image: plugins/kaniko
settings: settings:
username: username:
@ -13,6 +13,24 @@ steps:
from_secret: docker_password from_secret: docker_password
repo: nold360/borgserver repo: nold360/borgserver
dockerfile: Dockerfile dockerfile: Dockerfile
build_args:
- BASE_IMAGE=debian:bullseye-slim
tags: tags:
- latest - 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 - buster
- 1.1.9

View file

@ -2,7 +2,8 @@
# Dockerfile to build borgbackup server images # Dockerfile to build borgbackup server images
# Based on Debian # Based on Debian
############################################################ ############################################################
FROM debian:buster-slim ARG BASE_IMAGE=debian:bullseye-slim
FROM $BASE_IMAGE
# Volume for SSH-Keys # Volume for SSH-Keys
VOLUME /sshkeys VOLUME /sshkeys

View file

@ -132,3 +132,9 @@ And create your first backup!
``` ```
$ borg create backup:my_first_borg_repo::documents-2017-11-01 /home/user/MyImportentDocs $ 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`

View file

@ -15,9 +15,11 @@ AUTHORIZED_KEYS_PATH=/home/borg/.ssh/authorized_keys
# Append only mode? # Append only mode?
BORG_APPEND_ONLY=${BORG_APPEND_ONLY:=no} BORG_APPEND_ONLY=${BORG_APPEND_ONLY:=no}
source /etc/os-release
echo "########################################################" echo "########################################################"
echo -n " * Docker BorgServer powered by " echo -n " * Docker BorgServer powered by "
borg -V borg -V
echo " * Based on ${PRETTY_NAME}"
echo "########################################################" echo "########################################################"
echo " * User id: $(id -u borg)" echo " * User id: $(id -u borg)"
echo " * Group id: $(id -g 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" borg_cmd="${BORG_CMD} --append-only"
fi 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} cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH}
done done
chmod 0600 "${AUTHORIZED_KEYS_PATH}"
echo " * Validating structure of generated ${AUTHORIZED_KEYS_PATH}..." echo " * Validating structure of generated ${AUTHORIZED_KEYS_PATH}..."
ERROR=$(ssh-keygen -lf ${AUTHORIZED_KEYS_PATH} 2>&1 >/dev/null) ERROR=$(ssh-keygen -lf ${AUTHORIZED_KEYS_PATH} 2>&1 >/dev/null)