syncthing-app/start.sh

29 lines
833 B
Bash
Executable File

#!/bin/bash
set -eu
mkdir -p /app/data/config
if ! [ -f /app/data/config/config.xml ]; then
cp /app/code/config.xml.default /app/data/config/config.xml
fi
cat >/run/ldap.conf <<EOF
ldap_server cloudron {
url ${LDAP_URL}/${LDAP_USERS_BASE_DN}?username;
binddn ${LDAP_BIND_DN};
binddn_passwd ${LDAP_BIND_PASSWORD};
group_attribute ${LDAP_GROUPS_BASE_DN};
group_attribute_is_dn on;
require valid_user;
}
EOF
sed -e 's,<listenAddress>.*</listenAddress>,<listenAddress>tcp://:22000</listenAddress>,' -i /app/data/config/config.xml
sed -e 's,<user>.*</user>,<user>admin</user>,' -i /app/data/config/config.xml
sed -e 's,<password>.*</password>,<password>$2a$10$onEZNvFhasmJMq7ugGDIJekK0mZ9YByNK0b1p8kJPtXL.ELVrsolm</password>,' -i /app/data/config/config.xml
export STNODEFAULTFOLDER=1 STNOUPGRADE=1
exec busybox init