#!/bin/bash set -eu mkdir -p /app/data/config export STNODEFAULTFOLDER=1 STNOUPGRADE=1 # if this if the first run, generate a useful config if [ ! -f /app/data/config/config.xml ]; then echo "=> Generating config" /app/code/syncthing --generate="/app/data/config" fi # Set the listenAddress and the gui enabled to make sure user doesnt lock themselves out by accident. sed -e "s,.*,tcp://:${SYNCER_PORT}," -i /app/data/config/config.xml sed -e 's,,,' -i /app/data/config/config.xml chown -R cloudron:cloudron /app/data/config /app/data echo "=> Starting syncthing" exec /usr/local/bin/gosu cloudron:cloudron /app/code/syncthing -gui-address=0.0.0.0:3000 -home=/app/data/config -no-browser