diff --git a/piframefleet/Dockerfile b/piframefleet/Dockerfile index 2475a17..1bb44a4 100644 --- a/piframefleet/Dockerfile +++ b/piframefleet/Dockerfile @@ -5,9 +5,6 @@ WORKDIR /opt/ # need to figure out if arm64/arm64 32bit multilib/arm COPY piframefleet/arch_detect.sh /opt/ -# Copy ansible samples -> /opt -COPY ansible /opt/ - # Install and base setup all the things RUN apk upgrade --update --no-cache && \ apk add python3 curl jq bash unzip && \ @@ -46,6 +43,7 @@ VOLUME /lib/modules ENV ENABLE_SYNCTHING=false EXPOSE 8384/tcp EXPOSE 22000/tcp +VOLUME /opt/syncthing # FileBrowser related 'stuff' ENV ENABLE_FILEBROWSER=false diff --git a/piframefleet/root/etc/cont-init.d/99-welcome b/piframefleet/root/etc/cont-init.d/00-welcome old mode 100644 new mode 100755 similarity index 100% rename from piframefleet/root/etc/cont-init.d/99-welcome rename to piframefleet/root/etc/cont-init.d/00-welcome diff --git a/piframefleet/root/etc/cont-init.d/30-config b/piframefleet/root/etc/cont-init.d/30-config old mode 100644 new mode 100755 index f97dfd4..b5d3b5f --- a/piframefleet/root/etc/cont-init.d/30-config +++ b/piframefleet/root/etc/cont-init.d/30-config @@ -1,9 +1,15 @@ #!/usr/bin/with-contenv bash +#################### +# Pictures storage +#################### +if [ ! -d "/opt/pictures" ] ; then + mkdir /opt/pictures +fi + #################### # WireGuard #################### - if [ "$ENABLE_WIREGUARD" = true ] ; then ip link del dev test 2>/dev/null if ip link add dev test type wireguard; then @@ -15,10 +21,22 @@ if [ "$ENABLE_WIREGUARD" = true ] ; then fi #################### -# Pictures storage +# syncthing #################### -if [ ! -d "/opt/pictures" ]; then - mkdir /opt/pictures +if [ "$ENABLE_SYNCTHING" = true ] ; then + if [ ! -d "/opt/syncthing" ]; then + mkdir /opt/syncthing + fi + ST_CONF="/opt/syncthing/config.xml" + if [ ! -f "$ST_CONF" ]; then + echo "**** Initial Syncthing Config ****" + /usr/bin/syncthing -generate /opt/syncthing + sed -i 's/
127.0.0.1:8384<\/address>/0.0.0.0:8384<\/address>/g' /opt/syncthing/config.xml + sed -i 's/