Skip to content

Commit

Permalink
Fix duplicity backup
Browse files Browse the repository at this point in the history
  • Loading branch information
k0gen committed Apr 14, 2024
1 parent a492b1e commit bbbda43
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM syncthing/syncthing:1.27.3 AS build
FROM syncthing/syncthing:1.27.6 AS build

RUN apk add --no-cache curl jq tini inotify-tools yq && \
rm -rf /var/cache/apk/*
Expand Down
18 changes: 9 additions & 9 deletions docker_files/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ fi

i=0

rm /root/health-web
rm /root/health-version
rm /root/data/health-web
rm /root/data/health-version
mkdir -p /mnt/filebrowser/syncthing
chown -R syncthing_user /mnt/filebrowser/syncthing
export HOME="/mnt/filebrowser/syncthing"
Expand All @@ -30,8 +30,8 @@ done
echo "Syncthing Settings"
sleep .1
syncthing cli config gui raw-address set -- 0.0.0.0:8384
syncthing cli config gui user set -- $(yq e '.username' /root/start9/config.yaml)
syncthing cli config gui password set -- $(yq e '.password' /root/start9/config.yaml)
syncthing cli config gui user set -- $(yq e '.username' /root/data/start9/config.yaml)
syncthing cli config gui password set -- $(yq e '.password' /root/data/start9/config.yaml)
syncthing cli config options uraccepted set -- -1
syncthing cli config defaults device auto-accept-folders set true
syncthing cli config defaults device introducer set true
Expand All @@ -47,13 +47,13 @@ while [[ "$(syncthing cli show system)" =~ 'no such file or directory' ]] || [[
fi
done

syncthing cli show system > /root/syncthing_stats.json
syncthing cli show system > /root/data/syncthing_stats.json

SU=$(yq '.username' /root/start9/config.yaml)
SP=$(yq '.password' /root/start9/config.yaml)
DID=$(yq -oy '.myID' /root/syncthing_stats.json)
SU=$(yq '.username' /root/data/start9/config.yaml)
SP=$(yq '.password' /root/data/start9/config.yaml)
DID=$(yq -oy '.myID' /root/data/syncthing_stats.json)

cat << BTC > /root/start9/stats.yaml
cat << BTC > /root/data/start9/stats.yaml
---
version: 2
data:
Expand Down
2 changes: 1 addition & 1 deletion docker_files/health-version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
while true ; do
echo "Health Check into file"
HOME=/mnt/filebrowser/syncthing syncthing cli config version get > /root/health-version
HOME=/mnt/filebrowser/syncthing syncthing cli config version get > /root/data/health-version
sleep 60
done

6 changes: 3 additions & 3 deletions docker_files/health-web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

check_web(){
echo 'Checking web'
curl -u $(yq e '.username' /root/start9/config.yaml):$(yq e '.password' /root/start9/config.yaml) --silent --fail localhost:8384/ &>/dev/null
curl -u $(yq e '.username' /root/data/start9/config.yaml):$(yq e '.password' /root/data/start9/config.yaml) --silent --fail localhost:8384/ &>/dev/null
RES=$?
echo RES
if test "$RES" != 0; then
echo "Error: Web interface is unreachable" > /root/health-web
echo "Error: Web interface is unreachable" > /root/data/health-web
else
echo "Ok: Web interface is reachable" > /root/health-web
echo "Ok: Web interface is reachable" > /root/data/health-web
fi
}
echo 'running check web'
Expand Down
16 changes: 7 additions & 9 deletions manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ main:
entrypoint: tini
args: ["entrypoint.sh"]
mounts:
main: /root
main: /root/data
filebrowser: /mnt/filebrowser
health-checks:
version:
Expand Down Expand Up @@ -103,11 +103,10 @@ backup:
- duplicity
- create
- /mnt/backup
- /root
- /root/data
mounts:
BACKUP: /mnt/backup
main: /root
io-format: yaml
BACKUP: "/mnt/backup"
main: "/root/data"
restore:
type: docker
image: compat
Expand All @@ -117,11 +116,10 @@ backup:
- duplicity
- restore
- /mnt/backup
- /root
- /root/data
mounts:
BACKUP: /mnt/backup
main: /root
io-format: yaml
BACKUP: "/mnt/backup"
main: "/root/data"
migrations:
from:
"*":
Expand Down
2 changes: 1 addition & 1 deletion scripts/embassy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export { setConfig } from "./procedures/setConfig.ts";
export { properties } from "./procedures/properties.ts";
export { health } from "./procedures/health.ts";
export { migration } from "./procedures/migration.ts";
export { createBackup, restoreBackup } from "./procedures/backups.ts";
// export { createBackup, restoreBackup } from "./procedures/backups.ts";

0 comments on commit bbbda43

Please sign in to comment.