diff --git a/Dockerfile b/Dockerfile index 31465b371aa31e98426427df74234b5d34d19d0e..b383ec905b75a1e6090b43bbe24cbe9c6e7f9d0a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ RUN set -x && \ rm -rf /var/cache/apk/* && \ addgroup -S openwrt && \ adduser -S openwrt -G openwrt -h /home/openwrt && \ - chown -R openwrt:openwrt /tmp/openwrt + mkdir /srv/openwrt && \ + chown -R openwrt:openwrt /tmp/openwrt /srv/openwrt COPY entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 3e17f70b3a5c61a55f2373cbb8b0d5e0691c2208..2e65382b76cd28e683455b2e483e032443f5f0e4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -5,11 +5,11 @@ die() { exit 1 } -test -n "$OPENWRT_SSH_CONFIG" && echo "$OPENWRT_SSH_CONFIG" > /opt/config -test -n "$OPENWRT_SSH_KEY_ED25519" && echo "$OPENWRT_SSH_KEY_ED25519" > /opt/id_ed25519 -test -n "$OPENWRT_SSH_KNOWN_HOSTS" && echo "$OPENWRT_SSH_KNOWN_HOSTS" > /opt/known_hosts +test -n "$OPENWRT_SSH_CONFIG" && echo "$OPENWRT_SSH_CONFIG" > /srv/openwrt/config +test -n "$OPENWRT_SSH_KEY_ED25519" && echo "$OPENWRT_SSH_KEY_ED25519" > /srv/openwrt/id_ed25519 +test -n "$OPENWRT_SSH_KNOWN_HOSTS" && echo "$OPENWRT_SSH_KNOWN_HOSTS" > /srv/openwrt/known_hosts -rsync -a -og --chown=openwrt:openwrt /opt/ /home/openwrt/.ssh/ || die "Couldn't rsync user ssh settings" +rsync -a -og --chown=openwrt:openwrt /srv/openwrt/ /home/openwrt/.ssh/ || die "Couldn't rsync user ssh settings" chown -R openwrt:openwrt /home/openwrt/.ssh || die "Couldn't change ownership for user ssh settings" chmod -R a-rwx,u+rwX /home/openwrt/.ssh || die "Couldn't change access rights for user ssh settings"