fix up services

This commit is contained in:
Gerg-L 2023-10-23 18:18:13 -04:00
parent 6e5b5f3173
commit 4a13abb197
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
4 changed files with 16 additions and 25 deletions

View file

@ -17,7 +17,7 @@ _:
startAt = "*:0/30";
serviceConfig = {
LoadCredential = "token:${config.sops.secrets.cloudflare.path}";
EnvironmentFile = config.sops.secrets.cloudflare.path;
DynamicUser = true;
};
@ -33,8 +33,6 @@ _:
exit 0
fi
AUTH="$(cat "$CREDENTIALS_DIRECTORY/token")"
IP=$(grep -oP '^((?!fe80).).{22}ffee.{5}' /proc/net/if_inet6 | sed -E 's/(.{4})/\1:/g; s/.$//')
func () {
@ -69,15 +67,15 @@ _:
--url "https://api.cloudflare.com/client/v4/zones/$ZONE/dns_records/$ID" \
--header "Authorization: Bearer $AUTH" \
--header "Content-Type: application/json" \
--data "{
\"content\": \"$IP\",
\"name\": \"$RECORD\",
\"proxied\": $PROXY,
\"type\": \"AAAA\",
\"comment\": \"\",
\"tags\": [],
\"ttl\": 1
}"
--data '{
"content": "'"$IP"'",
"name": "'"$RECORD"'",
"proxied": '"$PROXY"',
"type": "AAAA",
"comment": "",
"tags": [],
"ttl": 1
}'
}
func "*.gerg-l.com" "8f76f071c5edbc0f947a5c5f9c5df9f8"