gitops/scripts/get_labring_registry.sh
2025-06-25 21:47:00 +08:00

13 lines
447 B
Bash
Executable File

#!/bin/bash
# Determine the appropriate LabRing container registry based on geolocation.
# Defaults to the Chinese mainland registry.
REGISTRY_CN="registry.cn-shanghai.aliyuncs.com/labring"
REGISTRY_INT="ghcr.io/labring"
# Query external service for country code; fall back to CN on failure.
COUNTRY=$(curl -fsSL https://ipapi.co/country/ 2>/dev/null || echo "")
if [ "$COUNTRY" = "CN" ]; then
echo "$REGISTRY_CN"
else
echo "$REGISTRY_INT"
fi