fix(bootstrap): register the host at the correct /proxmox/api/servers path
Some checks failed
Deploy to Production / Trigger production update (push) Has been cancelled
Some checks failed
Deploy to Production / Trigger production update (push) Has been cancelled
The proxmox router is mounted under the /proxmox prefix in main.py, so the real create-server endpoint is /proxmox/api/servers, not /api/servers as the registration step assumed. The bare /api root only has /api/auth/*. Verified end to end against a real Proxmox host: LXC provisioning, Docker install inside it, deploy.sh --standalone build+run, admin login, local root@pam token creation, and registration all completed successfully, with the panel reporting the new node online.
This commit is contained in:
@@ -175,7 +175,10 @@ register_this_host() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
log "Registering this host (${host_name} / ${host_ip}) in the panel..."
|
log "Registering this host (${host_name} / ${host_ip}) in the panel..."
|
||||||
resp=$(curl -fsS -X POST "${base}/api/servers" \
|
# The proxmox router is mounted under /proxmox (see main.py's
|
||||||
|
# include_router(..., prefix="/proxmox")) — only /api/auth/* lives at the
|
||||||
|
# bare /api root.
|
||||||
|
resp=$(curl -fsS -X POST "${base}/proxmox/api/servers" \
|
||||||
-H "Authorization: Bearer ${jwt}" \
|
-H "Authorization: Bearer ${jwt}" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "{\"name\":\"${host_name}\",\"hostname\":\"${host_name}\",\"ip_address\":\"${host_ip}\",\"port\":8006,\"api_user\":\"root@pam\",\"api_token_name\":\"${token_name}\",\"api_token_value\":\"${token_secret}\",\"use_password\":false,\"verify_ssl\":false}" \
|
-d "{\"name\":\"${host_name}\",\"hostname\":\"${host_name}\",\"ip_address\":\"${host_ip}\",\"port\":8006,\"api_user\":\"root@pam\",\"api_token_name\":\"${token_name}\",\"api_token_value\":\"${token_secret}\",\"use_password\":false,\"verify_ssl\":false}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user