Download entrypoint.sh from bolikoto/zcode-api: direct link, hf CLI and curl.
- Browser
- Download file 918 Bytes
-
https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/bolikoto/zcode-api/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/entrypoint.sh
918 Bytes
| set -eu | |
| if [ -n "${ZCODE_CREDENTIALS_BASE64:-}" ]; then | |
| mkdir -p /home/bun/.zcode-proxy | |
| printf '%s' "$ZCODE_CREDENTIALS_BASE64" | base64 -d > /home/bun/.zcode-proxy/credentials.json | |
| chmod 600 /home/bun/.zcode-proxy/credentials.json | |
| fi | |
| CONFIG_PATH="${ZCODE_PROXY_CONFIG:-/data/config.yaml}" | |
| if [ ! -f "$CONFIG_PATH" ]; then | |
| mkdir -p "$(dirname "$CONFIG_PATH")" | |
| cp /app/config.example.yaml "$CONFIG_PATH" | |
| if grep -q '^ deviceMid: ""' "$CONFIG_PATH"; then | |
| if command -v uuidgen >/dev/null 2>&1; then | |
| DEVICE_MID=$(uuidgen | tr '[:upper:]' '[:lower:]') | |
| else | |
| DEVICE_MID=$(cat /proc/sys/kernel/random/uuid) | |
| fi | |
| sed -i "s/^ deviceMid: ""/ deviceMid: "$DEVICE_MID"/" "$CONFIG_PATH" | |
| fi | |
| fi | |
| # The local ZCode login state is start-plan; keep the persisted Space config aligned. | |
| sed -i 's/^plan: coding-plan$/plan: start-plan/' "$CONFIG_PATH" | |
| exec bun run src/index.ts serve | |