Share build failures and test results automatically in your CI pipeline.
- name: Share Build Log on Failure
if: failure()
run: |
curl -X POST https://api.zerohost.net/v1/share \
-H "Content-Type: application/json" \
-H "X-API-Key: ${{ secrets.ZEROHOST_API_KEY }}" \
-d '{"text": "'"$(cat build.log)"'", "expires_in": "24h", "reference": "BUILD-${{ github.run_number }}"}'
GitHub Actions
Build Logs
CI/CD
Share container logs with burn-after-reading for secure troubleshooting.
if ! docker-compose up -d; then
LOGS=$(docker-compose logs)
curl -X POST https://api.zerohost.net/v1/share \
-H "Content-Type: application/json" \
-H "X-API-Key: $ZEROHOST_API_KEY" \
-d "{\"text\": \"$LOGS\", \"burn_after_reading\": true, \"expires_in\": \"1h\", \"reference\": \"DOCKER-$(date +%s)\"}"
fi
Docker
Container Logs
Burn After Reading
Share vulnerability scan results with password protection and time limits.
AUDIT_RESULTS=$(npm audit --json)
curl -X POST https://api.zerohost.net/v1/share \
-H "Content-Type: application/json" \
-H "X-API-Key: $ZEROHOST_API_KEY" \
-d "{\"text\": \"$AUDIT_RESULTS\", \"password\": \"security-$(date +%s)\", \"expires_in\": \"24h\", \"reference\": \"AUDIT-$(date +%Y%m%d)\"}"
Security Scanning
Password Protection
Compliance
Automatically retrieve and process shared incident data in your monitoring systems. Perfect for on-call automation and alert enrichment.
# Incident response script - retrieves shared debug data
INCIDENT_SHARE_ID="9b042e2b144afeb6421592fc7f5c0d94"
# Retrieve the shared incident data
INCIDENT_DATA=$(curl -s -H "X-API-Key: $ZEROHOST_API_KEY" \
"https://api.zerohost.net/v1/share/$INCIDENT_SHARE_ID")
# Check if share exists and extract content
if echo "$INCIDENT_DATA" | jq -e '.text' > /dev/null; then
echo "📥 Processing incident data..."
# Extract the shared content
LOGS=$(echo "$INCIDENT_DATA" | jq -r '.text')
# Process the logs for key metrics
ERROR_COUNT=$(echo "$LOGS" | grep -c "ERROR")
CRITICAL_COUNT=$(echo "$LOGS" | grep -c "CRITICAL")
# Create alert summary
ALERT_SUMMARY="🚨 Incident Summary
Errors: $ERROR_COUNT
Critical Issues: $CRITICAL_COUNT
Data Retrieved: $(date)
Share expires: $(echo "$INCIDENT_DATA" | jq -r '.expires_at')"
# Forward to incident management (Slack, PagerDuty, etc.)
curl -X POST "$SLACK_WEBHOOK_URL" \
-H "Content-Type: application/json" \
-d "{\"text\": \"$ALERT_SUMMARY\"}"
echo "✅ Incident data processed and team notified"
else
echo "❌ Share not found or expired"
fi
Incident Response
Share Retrieval
Automation
Access password-protected shares in automated workflows. Useful for accessing sensitive configuration data or credentials shared by team members.
# Retrieve password-protected deployment config
CONFIG_SHARE_ID="abc123def456789"
SHARE_PASSWORD="prod-deploy-$(date +%Y%m%d)"
# Attempt to retrieve protected share
RESPONSE=$(curl -s -X POST \
"https://api.zerohost.net/v1/share/$CONFIG_SHARE_ID" \
-H "Content-Type: application/json" \
-H "X-API-Key: $ZEROHOST_API_KEY" \
-d "{\"password\": \"$SHARE_PASSWORD\"}")
# Check if authentication was successful
if echo "$RESPONSE" | jq -e '.text' > /dev/null; then
echo "🔓 Successfully accessed protected share"
# Extract configuration
CONFIG_DATA=$(echo "$RESPONSE" | jq -r '.text')
# Save to secure temporary file
echo "$CONFIG_DATA" > /tmp/deploy-config.json
chmod 600 /tmp/deploy-config.json
# Use config in deployment
kubectl apply -f /tmp/deploy-config.json
# Clean up
rm -f /tmp/deploy-config.json
echo "✅ Deployment completed using shared config"
else
echo "❌ Failed to access protected share - check password"
exit 1
fi
Protected Access
Deployment
Configuration