feat: init

This commit is contained in:
2025-05-12 13:09:43 +02:00
commit 516eb78832
12 changed files with 403 additions and 0 deletions

25
config/dns/entrypoint.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
if [ ! -d "/app/conf" ]; then
mkdir /app/conf
fi
if [ ! -f "/app/conf/config.json" ]; then
cp /conf/config.sample.json /app/conf/config.json
elif [ "/conf/config.sample.json" -nt "/app/conf/config.json" ]; then
echo "example config file is newer than existing config."
echo "replacing existing file by new config"
CONFIG_BACKUP="/app/conf/config_$(date +"%Y%m%d_%H%M%s").json"
echo "saving existing config as ${CONFIG_BACKUP}"
cp /app/conf/config.json ${CONFIG_BACKUP}
cp /conf/config.sample.json /app/conf/config.json
fi
if [ -z "$@" ] ; then
exec "/app/dns-proxy-server" -XX:MaxHeapSize=50m -XX:MaxNewSize=10m
else
exec "$@"
fi