Compare commits

..

No commits in common. "e9757350f340e677127aeff1093fc2dd55c63c61" and "6b6818efa41a78f8803ee2ccd1a1af14cea79b05" have entirely different histories.

3 changed files with 6 additions and 35 deletions

View file

@ -2,22 +2,11 @@
FINISH_FILE="$GEODATA_DIR/cron-job-finished.txt"
MAX_WAIT=300 # 5 minutes
ELAPSED=0
INTERVAL=10
while [ ! -f "$FINISH_FILE" ] && [ $ELAPSED -lt $MAX_WAIT ]; do
echo "Still waiting for geodata initialization... ($ELAPSED/$MAX_WAIT seconds)"
sleep $INTERVAL
ELAPSED=$((ELAPSED + INTERVAL))
while [ ! -f "$FINISH_FILE" ]; do
echo "Still waiting... (looking for $FINISH_FILE)"
sleep 10
done
if [ ! -f "$FINISH_FILE" ]; then
echo "ERROR: Geodata initialization timed out after $MAX_WAIT seconds"
echo "Container startup aborted."
exit 1
fi
# Start fail2ban
[ "$XUI_ENABLE_FAIL2BAN" = "true" ] && fail2ban-client -x start

View file

@ -35,7 +35,7 @@ services:
build:
context: docker-cron-runner
args:
XRAY_VERSION: "${XRAY_VERSION:-v25.10.15}"
XRAY_VERSION: "v25.10.15"
XRAY_BUILD_DIR: "/app/xray"
container_name: geodata_cron
restart: unless-stopped

View file

@ -122,29 +122,11 @@ install_xray_core() {
cd "$XRAYDIR"
wget -q "https://github.com/XTLS/Xray-core/releases/download/${XRAY_VERSION}/Xray-linux-${ARCH}.zip"
# Validate the downloaded zip file
if [ ! -f "Xray-linux-${ARCH}.zip" ] || [ ! -s "Xray-linux-${ARCH}.zip" ]; then
echo "[ERR] Failed to download Xray-core zip or file is empty"
cd "$OLD_DIR"
return 1
fi
unzip -q "Xray-linux-${ARCH}.zip" -d ./xray-unzip
# Validate the extracted xray binary
if [ ! -f "./xray-unzip/xray" ] || [ ! -s "./xray-unzip/xray" ]; then
echo "[ERR] Failed to extract xray binary"
rm -rf ./xray-unzip
rm -f "Xray-linux-${ARCH}.zip"
cd "$OLD_DIR"
return 1
fi
unzip "Xray-linux-${ARCH}.zip" -d ./xray-unzip
cp ./xray-unzip/xray ./"xray-linux-${FNAME}"
rm -r xray-unzip
rm "Xray-linux-${ARCH}.zip"
}
}
if [ "${0##*/}" = "xray-tools.sh" ]; then
cmd="$1"