From 2faacaea37aadc9a7e51311a8fca145515ca5b65 Mon Sep 17 00:00:00 2001 From: Newnius Date: Fri, 27 Dec 2019 18:27:25 +0800 Subject: [PATCH] update rsync --- rsync/Dockerfile | 2 ++ rsync/bootstrap.sh | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rsync/Dockerfile b/rsync/Dockerfile index 8efbe08..e34780b 100644 --- a/rsync/Dockerfile +++ b/rsync/Dockerfile @@ -4,6 +4,8 @@ MAINTAINER Newnius RUN apk add --no-cache rsync +RUN ln -s /var/log/rsyncd.log /dev/stdout + ADD bootstrap.sh /etc/bootstrap.sh ENTRYPOINT ["/etc/bootstrap.sh"] diff --git a/rsync/bootstrap.sh b/rsync/bootstrap.sh index 10711a1..59e0634 100755 --- a/rsync/bootstrap.sh +++ b/rsync/bootstrap.sh @@ -2,9 +2,9 @@ if ! [[ -z "${AUTH_PASSWORD}" ]]; then echo "$AUTH_PASSWORD" > /etc/rsyncd.secret + chmod 600 /etc/rsyncd.secret if ! [[ -z "${AUTH_USER}" ]]; then echo "$AUTH_USER:$AUTH_PASSWORD" > /etc/rsyncd.secrets - chmod 600 /etc/rsyncd.secrets fi fi @@ -12,6 +12,8 @@ if [ -d /config/ ]; then cp /config/rsync* /etc/ fi +chmod 600 /etc/rsyncd.secrets + if ! [[ -z $@ ]]; then # use eval because commands likes `key=value command` would cause file not found error when using $@, but this eval will ruin current environment eval $@