From 2100dbf786db5951314aa189a58504a115c3b721 Mon Sep 17 00:00:00 2001 From: Illia Chub Date: Tue, 11 Jan 2022 10:14:22 +0200 Subject: [PATCH] PoC: Special character escape attempt --- .drone.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index 875d7b4..816b842 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,17 +28,13 @@ steps: from_secret: DOMAIN ZONE_ID: from_secret: ZONE_ID + machineip: > + curl -s \ + -H "Authorization: Bearer $PASSWORD" \ + 'https://api.hetzner.cloud/v1/servers' > .machine.json \ + for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].public_net.ipv4.ip else null end' .machine.json; done | grep -v null | sed 's/"//' | sed 's/"//' + commands: - - > - curl -s - -H "Authorization: Bearer $PASSWORD" - 'https://api.hetzner.cloud/v1/servers' > .machine.json - - > - export machineip=$( for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].public_net.ipv4.ip else null end' .machine.json; done | grep -v null | sed 's/"//' | sed 's/"//' ) - - > - echo $DOMAIN - - > - echo $machineip - > curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$DOMAIN" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" @@ -47,7 +43,7 @@ steps: curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Content-Type: application/json" - --data '{"type":"A","name":"$DOMAIN","content":"'$machineip'","ttl":3600,"priority":10,"proxied":false}' + --data '{"type":"A","name":"$DOMAIN","content":"'"$machineip"'","ttl":3600,"priority":10,"proxied":false}' - > curl -s -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" -H "Authorization: Bearer $CLOUDFLARE_TOKEN"