diff --git a/.drone.yml b/.drone.yml index e3ec524..12c2f22 100644 --- a/.drone.yml +++ b/.drone.yml @@ -113,22 +113,23 @@ steps: from_secret: ZONE_ID commands: # Delete our machine called 'ci-sibling' and all the found DNS records on it. - - > - curl -s "https://api.hetzner.cloud/v1/servers" -H "Authorization: Bearer $PASSWORD" > .hetzner_servers.json - - > - export machineid=$( for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].id else null end' .hetzner_servers.json; done | grep -v null | sed 's/"//g') - - > - curl -s -X DELETE "https://api.hetzner.cloud/v1/servers/$machineid" -H "Authorization: Bearer $PASSWORD" - - > - json=$(curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Content-Type: application/json") - - > - echo "$json" > .dns-records.json - - > - result=$(jq -r ".result" <<< "$json") - - > - echo "$ZONE_ID" - - > - echo "$result" | jq '.[] | "\(.id)"' | while read id ; do echo "Deleting $id"; http -v --check-status --ignore-stdin DELETE https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$(echo $id | cut -f 2 -d '"') Authorization:"Bearer $CLOUDFLARE_TOKEN"; done + - return 0 + #- > + # curl -s "https://api.hetzner.cloud/v1/servers" -H "Authorization: Bearer $PASSWORD" > .hetzner_servers.json + #- > + # export machineid=$( for i in {0..24}; do jq 'if .servers['$i'].name == "ci-sibling" then .servers['$i'].id else null end' .hetzner_servers.json; done | grep -v null | sed 's/"//g') + #- > + # curl -s -X DELETE "https://api.hetzner.cloud/v1/servers/$machineid" -H "Authorization: Bearer $PASSWORD" + #- > + # json=$(curl -X GET "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Content-Type: application/json") + #- > + # echo "$json" > .dns-records.json + #- > + # result=$(jq -r ".result" <<< "$json") + #- > + # echo "$ZONE_ID" + #- > + # echo "$result" | jq '.[] | "\(.id)"' | while read id ; do echo "Deleting $id"; http -v --check-status --ignore-stdin DELETE https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$(echo $id | cut -f 2 -d '"') Authorization:"Bearer $CLOUDFLARE_TOKEN"; done when: status: - failure diff --git a/nixos-infect b/nixos-infect index 6270ad6..31a203f 100755 --- a/nixos-infect +++ b/nixos-infect @@ -67,7 +67,13 @@ makeConf() { }, "timezone": "Europe/Uzhgorod", "resticPassword": $ESCAPED_PASSWORD, - "username": "$LUSER" + "username": "$LUSER", + "ssh": { + "rootKeys": [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEZ/VXDu/hN4rWE3WssSOXQaRB7wfNj7IE52CePKpo3 naiji@naiji-pc", + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE7WW3x/Xuz6IBIG8uBMvcytCOMtYkGau7x2foyoK6rc inex@inex-hp-envy" + ] + } } EOF chmod 0600 /etc/nixos/userdata/userdata.json