Improvements and bug fixes
This commit is contained in:
parent
cf5e2fb26d
commit
79fe5aac39
|
@ -1,7 +1,7 @@
|
||||||
version: "3.7"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:mainline-alpine
|
image: nginx
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
hostname: ${DOMAIN_NAME:?err}
|
hostname: ${DOMAIN_NAME:?err}
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -37,11 +37,11 @@ services:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
trap exit TERM;
|
trap exit TERM INT;
|
||||||
sleep 10;
|
sleep 10;
|
||||||
while :; do
|
while :; do
|
||||||
apikey="$(grep -oPm 1 '(?<=\<apikey\>).*(?=\</apikey\>)' /data/syncthing/config.xml)"
|
apikey="$$(grep -oPm 1 '(?<=\<apikey\>).*(?=\</apikey\>)' /data/syncthing/config.xml)"
|
||||||
curl -s -X POST -H "X-API-Key: $$apikey" http://syncthing:8384/rest/db/revert?folder=jhcrt-m2dra;
|
curl -s --fail -X POST -H "X-API-Key: $$apikey" http://syncthing:8384/rest/db/revert?folder=jhcrt-m2dra || echo Failed to revert folder;
|
||||||
sed -i -r '/<device id="ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY"/! s|(^ *<device .*id="[^"]+".*skipIntroductionRemovals="false".*introducedBy=")(">)|\1ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY\2|' /data/syncthing/config.xml
|
sed -i -r '/<device id="ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY"/! s|(^ *<device .*id="[^"]+".*skipIntroductionRemovals="false".*introducedBy=")(">)|\1ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY\2|' /data/syncthing/config.xml
|
||||||
sleep 1h &
|
sleep 1h &
|
||||||
wait $${!};
|
wait $${!};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: "3.7"
|
version: "3.7"
|
||||||
services:
|
services:
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:mainline-alpine
|
image: nginx
|
||||||
container_name: nginx
|
container_name: nginx
|
||||||
hostname: ${DOMAIN_NAME:?err}
|
hostname: ${DOMAIN_NAME:?err}
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -46,11 +46,11 @@ services:
|
||||||
- /bin/sh
|
- /bin/sh
|
||||||
- -c
|
- -c
|
||||||
- |
|
- |
|
||||||
trap exit TERM;
|
trap exit TERM INT;
|
||||||
sleep 10;
|
sleep 10;
|
||||||
while :; do
|
while :; do
|
||||||
apikey="$(grep -oPm 1 '(?<=\<apikey\>).*(?=\</apikey\>)' /data/syncthing/config.xml)"
|
apikey="$$(grep -oPm 1 '(?<=\<apikey\>).*(?=\</apikey\>)' /data/syncthing/config.xml)"
|
||||||
curl -s -X POST -H "X-API-Key: $$apikey" http://syncthing:8384/rest/db/revert?folder=jhcrt-m2dra;
|
curl -s --fail -X POST -H "X-API-Key: $$apikey" http://syncthing:8384/rest/db/revert?folder=jhcrt-m2dra || echo Failed to revert folder;
|
||||||
sed -i -r '/<device id="ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY"/! s|(^ *<device .*id="[^"]+".*skipIntroductionRemovals="false".*introducedBy=")(">)|\1ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY\2|' /data/syncthing/config.xml
|
sed -i -r '/<device id="ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY"/! s|(^ *<device .*id="[^"]+".*skipIntroductionRemovals="false".*introducedBy=")(">)|\1ZDHVMSP-EW4TMWX-DBH2W4P-HV5A6OY-BBEFABO-QTENANJ-RJ6GKNX-6KCG7QY\2|' /data/syncthing/config.xml
|
||||||
sleep 1h &
|
sleep 1h &
|
||||||
wait $${!};
|
wait $${!};
|
||||||
|
|
6
update
6
update
|
@ -18,8 +18,12 @@ if [ ! -d "./.git" ]; then
|
||||||
git remote add origin https://github.com/chaotic-aur/docker-mirror
|
git remote add origin https://github.com/chaotic-aur/docker-mirror
|
||||||
git fetch
|
git fetch
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
|
else if [ ! -f ./custom.diff ]; then
|
||||||
|
git pull || { echo "Git pull failed, please fix the issue at hand."; exit 1; }
|
||||||
else
|
else
|
||||||
git pull || echo "Git pull failed, please fix the issue at hand."
|
git fetch
|
||||||
|
git reset --hard origin/main
|
||||||
|
git apply ./custom.diff
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$SELFUPDATE" != 1 ]; then
|
if [ "$SELFUPDATE" != 1 ]; then
|
||||||
|
|
Loading…
Reference in New Issue