Spaces:
Paused
Paused
| set -e | |
| APP_PASS="${APP_PASSWORD:-changeme}" | |
| export PASSWORD="$APP_PASS" | |
| HERMES_BIN="/opt/hermes/.venv/bin/hermes" | |
| HERMES_DIR="/data/.hermes" | |
| ln -sf /opt/hermes/.venv/bin/hermes /usr/local/bin/hermes | |
| ln -sf /opt/hermes/.venv/bin/python /usr/local/bin/hermes-python | |
| echo 'export PATH="/opt/hermes/.venv/bin:$PATH"' > /etc/profile.d/hermes.sh | |
| echo 'export PATH="/opt/hermes/.venv/bin:$PATH"' >> /root/.bashrc | |
| chmod +x /etc/profile.d/hermes.sh | |
| if [ -f /data/.env ]; then | |
| echo '[entrypoint] Loading /data/.env' | |
| set -a | |
| . /data/.env | |
| set +a | |
| else | |
| echo '[entrypoint] /data/.env not found. Creating template.' | |
| cat > /data/.env << 'ENVEOF' | |
| HERMES_PROVIDER=openai | |
| HERMES_MODEL=gpt-4o | |
| OPENAI_API_KEY=sk-your-key-here | |
| TELEGRAM_BOT_TOKEN= | |
| ENVEOF | |
| fi | |
| echo '[entrypoint] Generating hermes config...' | |
| python3 /app/src/start.py | |
| echo '[entrypoint] Starting hermes gateway in background...' | |
| $HERMES_BIN gateway run & | |
| echo '[entrypoint] Starting code-server on port 7860...' | |
| exec code-server --bind-addr 0.0.0.0:7860 --auth password \ | |
| --disable-telemetry --disable-update-check \ | |
| --user-data-dir /data/.code-server \ | |
| --extensions-dir /data/.code-server/extensions \ | |
| /data | |