Commit de7dd11d authored by Dmitriy Safronov's avatar Dmitriy Safronov
Browse files

rsync-sync

parent 24b4b1c5
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
FROM registry.cyberbrain.pw/docker/git-sync:latest

ENV GIT_SYNC_HTTP_METRICS=false GIT_SYNC_ROOT='/tmp/git' GIT_SYNC_DEST='config' GIT_SYNC_EXECHOOK_COMMAND='/ha-rsync' GIT_SYNC_ADD_USER='true'
ENV GIT_SYNC_HTTP_METRICS=false \
    GIT_SYNC_ROOT='/tmp/git' \
    GIT_SYNC_DEST='sync' \
    GIT_SYNC_EXECHOOK_COMMAND='/rsync-sync' \
    GIT_SYNC_ADD_USER='true'

USER root:root

@@ -11,11 +15,11 @@ RUN set -ex \
    && rm -rf /var/lib/apt/lists/* \
    && chmod -Rv 0777 "${GIT_SYNC_ROOT:-/tmp/git}/"

COPY ha-rsync* /
COPY rsync-sync* /

RUN set -ex \
    && chmod a+x /ha-rsync
    && chmod a+x /rsync-sync

VOLUME ["/config"]
VOLUME ["/sync"]

USER 65533:65533
+1 −1
Original line number Diff line number Diff line
# Git Sync - Home Assistant
# Git Sync - Rsync Sync

Warning! Default excludes could change suddenly and with no reason)

ha-rsync

deleted100644 → 0
+0 −10
Original line number Diff line number Diff line
#!/usr/bin/env sh

rsync -a \
    --exclude-from='/ha-rsync.excludes' \
    --exclude='/.git' \
    --exclude='/.HA_VERSION' \
    --exclude='/secrets.yaml' \
    --delete-after \
    "${GIT_SYNC_ROOT:-/tmp/git}/${GIT_SYNC_DEST:-config}/" \
    /config

ha-rsync.excludes

deleted100644 → 0
+0 −15
Original line number Diff line number Diff line
# Don't overwrite files created from UI
/automations.yaml
/scenes.yaml
/scripts.yaml

# Don't overwrite cloud connection settings
/.cloud/*

# Don't overwrite local settings
/.storage/*

# Don't overwrite local dirs
/deps
/image
/tts

rsync-sync

0 → 100644
+8 −0
Original line number Diff line number Diff line
#!/usr/bin/env sh

rsync -a \
    --exclude-from='/rsync-sync.excludes' \
    --exclude='/.git' \
    --delete-after \
    "${GIT_SYNC_ROOT:-/tmp/git}/${GIT_SYNC_DEST:-sync}/" \
    /sync
Loading