raycast / entrypoint.sh
smgc's picture
Update entrypoint.sh
b88e56f verified
raw
history blame
No virus
939 Bytes
#!/bin/sh
# εˆ€ζ–­ε€„η†ε™¨ζžΆζž„
case "$(uname -m)" in
aarch64|arm64 )
ARCH=arm64
;;
x86_64|amd64 )
ARCH=amd64
;;
armv7* )
ARCH=arm
;;
* )
echo "Unsupported architecture"
exit 1
esac
# δΈ‹θ½½ιœ€θ¦ηš„εΊ”η”¨
wget -q -O /project/cloudflared https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-$ARCH
# θ΅‹ζ‰§θ‘Œζƒη»™ sh εŠζ‰€ζœ‰εΊ”η”¨
chmod +x /project/cloudflared
# 运葌 cloudflared
/project/cloudflared tunnel run --token ${ARGO_AUTH} &
# if has CERT_FILE env and CERT_KEY env, run uvicorn with ssl
if [ -n "$CERT_FILE" ] && [ -n "$CERT_KEY" ]; then
echo "run uvicorn with ssl"
python -m uvicorn app.main:app --host 0.0.0.0 --port 443 --ssl-keyfile $CERT_KEY --ssl-certfile $CERT_FILE $args $@
else
echo "run uvicorn without ssl"
python -m uvicorn app.main:app --host 0.0.0.0 --port 3000 $@
fi
wait