Add files for syncthing container
This commit is contained in:
9
build/boot/syncthing.sh
Normal file
9
build/boot/syncthing.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
if [ ! -f $SYNCTHING_CONFIG ]; then
|
||||||
|
/opt/syncthing/syncthing --generate="$SYNCTHING_CONFIG"
|
||||||
|
# don't take the whole volume with the default so that we can add additional folders
|
||||||
|
sed -e "s~id=\"default\" path=\"/root/Sync\"~id=\"default\" path=\"$SYNCTHING_DATA/default\"~" -i $SYNCTHING_CONFIG/config.xml
|
||||||
|
# ensure we can see the web ui outside of the docker container
|
||||||
|
sed -e "s/<address>127.0.0.1:8384/<address>0.0.0.0:8080/" -i $SYNCTHING_CONFIG/config.xml
|
||||||
|
fi
|
||||||
5
build/make/syncthing.mk
Normal file
5
build/make/syncthing.mk
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
syncthing:
|
||||||
|
$(call script,$@)
|
||||||
|
$(call runit,$@)
|
||||||
|
$(call boot,02,$@)
|
||||||
|
|
||||||
3
build/runit/syncthing
Normal file
3
build/runit/syncthing
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
/opt/syncthing/syncthing -home=$SYNCTHING_CONFIG
|
||||||
30
build/scripts/syncthing.sh
Normal file
30
build/scripts/syncthing.sh
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
source /build/config
|
||||||
|
set -x
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
export_env SYNCTHING_CONFIG /host/etc/syncthing
|
||||||
|
export_env SYNCTHING_VERSION 0.12.20
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
apt_install_temporary curl ca-certificates
|
||||||
|
|
||||||
|
## Gosu
|
||||||
|
# gpg --keyserver pgp.mit.edu --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
|
||||||
|
# curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)"
|
||||||
|
# curl -o /usr/local/bin/gosu.asc -L "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc"
|
||||||
|
# gpg --verify /usr/local/bin/gosu.asc
|
||||||
|
# rm /usr/local/bin/gosu.asc
|
||||||
|
# chmod +x /usr/local/bin/gosu
|
||||||
|
|
||||||
|
# Syncthing
|
||||||
|
cd /opt
|
||||||
|
curl -L -o syncthing.tar.gz https://github.com/syncthing/syncthing/releases/download/v$SYNCTHING_VERSION/syncthing-linux-amd64-v$SYNCTHING_VERSION.tar.gz
|
||||||
|
tar -xzvf syncthing.tar.gz
|
||||||
|
rm -f syncthing.tar.gz
|
||||||
|
mv syncthing-linux-amd64-v* syncthing
|
||||||
|
rm -rf syncthing/etc
|
||||||
|
rm -rf syncthing/*.pdf
|
||||||
|
mkdir -p $SYNCTHING_CONFIG
|
||||||
|
mkdir -p $SYNCTHING_DATA
|
||||||
Reference in New Issue
Block a user