fix nextcloud
continuous-integration/drone/push Build is passing Details

development
NaiJi ✨ 2022-08-10 14:15:01 +03:00
parent e4ab961ab1
commit 5b3f5b1b07
2 changed files with 17 additions and 24 deletions

View File

@ -113,23 +113,22 @@ steps:
from_secret: ZONE_ID
commands:
# Delete our machine called 'ci-sibling' and all the found DNS records on it.
- 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
- >
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

View File

@ -67,13 +67,7 @@ makeConf() {
},
"timezone": "Europe/Uzhgorod",
"resticPassword": $ESCAPED_PASSWORD,
"username": "$LUSER",
"ssh": {
"rootKeys": [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMEZ/VXDu/hN4rWE3WssSOXQaRB7wfNj7IE52CePKpo3 naiji@naiji-pc",
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIE7WW3x/Xuz6IBIG8uBMvcytCOMtYkGau7x2foyoK6rc inex@inex-hp-envy"
]
}
"username": "$LUSER"
}
EOF
chmod 0600 /etc/nixos/userdata/userdata.json