Add files for syncthing container

This commit is contained in:
2016-03-22 23:29:25 +01:00
parent d4381991e1
commit 1bfb086c90
4 changed files with 47 additions and 0 deletions

9
build/boot/syncthing.sh Normal file
View 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
View File

@@ -0,0 +1,5 @@
syncthing:
$(call script,$@)
$(call runit,$@)
$(call boot,02,$@)

3
build/runit/syncthing Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
set -e
/opt/syncthing/syncthing -home=$SYNCTHING_CONFIG

View 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