first save up

This commit is contained in:
sparklyballs 2016-08-19 20:23:53 +01:00
commit 0441520cd1
4 changed files with 106 additions and 0 deletions

52
Dockerfile Normal file
View File

@ -0,0 +1,52 @@
FROM lsiobase/alpine
MAINTAINER sparklyballs
# package version
ARG RDIFF_VER="1.2.8"
# environment settings
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2"
# copy patches
COPY patches/ /tmp/patches/
# install build packages
RUN \
apk add --no-cache --virtual=build-dependencies \
curl \
g++ \
gcc \
librsync-dev \
python-dev \
tar && \
# install runtime packages
apk add --no-cache \
openssh && \
# build rdiff-backup
mkdir -p \
/tmp/rdiff-src && \
curl -o \
/tmp/rdiff.tar.gz -L \
"http://savannah.nongnu.org/download/rdiff-backup/rdiff-backup-${RDIFF_VER}.tar.gz" && \
tar xf /tmp/rdiff.tar.gz -C \
/tmp/rdiff-src --strip-components=1 && \
cd /tmp/rdiff-src && \
patch -p1 -i /tmp/patches/rdiff-backup-1.2.8-librsync-1.0.0.patch && \
python \
setup.py build && \
python \
setup.py install --prefix=/usr --root=/ && \
# cleanup
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/*
# copy local files
COPY root/ /
# ports and volumes
VOLUME /backup /config

View File

@ -0,0 +1,21 @@
Patch by Roman Tereshonkov and Kari Hautio for rdiff-backup <= 1.2.8 to avoid a build failure with
librsync >= 1.0.0 (which is a security bugfix release). The discussion and solution finding can be
found at https://bugs.launchpad.net/duplicity/+bug/1416344 (for duplicity).
--- a/_librsyncmodule.c 2009-03-16 15:36:21.000000000 +0100
+++ b/_librsyncmodule.c 2015-03-02 00:54:24.000000000 +0100
@@ -59,8 +59,13 @@
if (sm == NULL) return NULL;
sm->x_attr = NULL;
+#ifdef RS_DEFAULT_STRONG_LEN
sm->sig_job = rs_sig_begin((size_t)blocklen,
(size_t)RS_DEFAULT_STRONG_LEN);
+#else
+ sm->sig_job = rs_sig_begin((size_t)blocklen,
+ (size_t)8, RS_MD4_SIG_MAGIC);
+#endif
return (PyObject*)sm;
}

View File

@ -0,0 +1,29 @@
#!/usr/bin/with-contenv bash
# make folders
mkdir -p \
/config/ssh \
/config/cron \
/root/.ssh
# check for required config files, exit if not found
[[ ! -e /config/ssh/id_rsa.pub ]] || \
[[ ! -e /config/ssh/id_rsa ]] || \
[[ ! -e /config/ssh/config ]] || \
[[ ! -e /config/ssh/known_hosts ]] || \
[[ ! -e /config/cron/jobs ]] && \
( echo "required config not found" && exit 1)
# copy config
cp -pr /config/ssh/* /root/.ssh/
# set cron
crontab /config/cron/jobs
# permissions
chown -R abc:abc \
/config
chown -R root:root \
/root/.ssh
chmod -R 600 \
/root/.ssh/*

View File

@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash
/usr/sbin/crond -f -S -l 0 -c /etc/crontabs