Fix deploy.sh step counter and document auth token retrieval
- Renumber deploy.sh steps from [1/5]-[4/5] to [1/4]-[4/4] (step 5 was removed) - Add 'Finding Your Auth Token' section to README.md explaining how to retrieve the authToken from config.json on mini-server
This commit is contained in:
@@ -127,6 +127,23 @@ ai.example.com {
|
||||
|
||||
## Client Configuration
|
||||
|
||||
### Finding Your Auth Token
|
||||
|
||||
The proxy auth token is the `authToken` value in `config.json` on the server where the proxy runs. To retrieve it:
|
||||
|
||||
```bash
|
||||
ssh mini-server "node -e \"console.log(JSON.parse(require('fs').readFileSync('/home/harrison/ai-proxy/config.json','utf-8')).authToken)\""
|
||||
```
|
||||
|
||||
Or just SSH in and read the file directly:
|
||||
|
||||
```bash
|
||||
ssh mini-server
|
||||
cat ~/ai-proxy/config.json | grep authToken
|
||||
```
|
||||
|
||||
This is the token you'll use in all client configurations below.
|
||||
|
||||
### Claude Code CLI
|
||||
|
||||
Add to `~/.claude/settings.json`:
|
||||
|
||||
@@ -25,7 +25,7 @@ if [ ! -f "$PROXY_DIR/config.json" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[1/5] Config found."
|
||||
echo "[1/4] Config found."
|
||||
|
||||
# --- Step 2: Generate auth token if still default ---
|
||||
AUTH_TOKEN=$(node -e "console.log(JSON.parse(require('fs').readFileSync('$PROXY_DIR/config.json','utf-8')).authToken)")
|
||||
@@ -40,10 +40,10 @@ if [ "$AUTH_TOKEN" = "CHANGE_ME_TO_A_LONG_RANDOM_STRING" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[2/5] Auth token is set."
|
||||
echo "[2/4] Auth token is set."
|
||||
|
||||
# --- Step 3: Test the proxy locally ---
|
||||
echo "[3/5] Testing proxy startup..."
|
||||
echo "[3/4] Testing proxy startup..."
|
||||
source "$HOME/.nvm/nvm.sh"
|
||||
timeout 5 node "$PROXY_DIR/proxy.mjs" &
|
||||
PROXY_PID=$!
|
||||
@@ -66,7 +66,7 @@ else
|
||||
fi
|
||||
|
||||
# --- Step 4: Install systemd service ---
|
||||
echo "[4/5] Installing systemd service..."
|
||||
echo "[4/4] Installing systemd service..."
|
||||
sudo cp "$PROXY_DIR/$SERVICE_NAME.service" "/etc/systemd/system/$SERVICE_NAME.service"
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable "$SERVICE_NAME"
|
||||
|
||||
Reference in New Issue
Block a user