This commit is contained in:
mrzta
2026-02-12 17:26:28 +00:00
parent 75f405501b
commit f39ec74206
65 changed files with 6002 additions and 0 deletions

18
cloudflare/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM alpine:latest
# Install tools
RUN apk add --no-cache curl bash jq
# Copy the script
COPY cloudflare-ddns.sh /usr/local/bin/cloudflare-ddns.sh
# --- FIX: This line removes Windows line endings if they exist ---
RUN sed -i 's/\r$//' /usr/local/bin/cloudflare-ddns.sh
# Make it executable
RUN chmod +x /usr/local/bin/cloudflare-ddns.sh
# Setup cron (Runs every 5 minutes and logs to Docker)
RUN echo "*/5 * * * * /usr/local/bin/cloudflare-ddns.sh > /proc/1/fd/1 2>&1" > /etc/crontabs/root
CMD ["crond", "-f", "-l", "2"]

75
cloudflare/checkip.sh Normal file
View File

@@ -0,0 +1,75 @@
#!/usr/bin/env bash
LOG_FILE="/var/log/public_ip_monitor.log"
LAST_IP_FILE="/var/log/last_ip.txt"
MAKE_DIR="/root/hurricane/cloudflare/zones" # CHANGE THIS to your Makefile directory
# Make sure log files exist
touch "$LOG_FILE"
touch "$LAST_IP_FILE"
while true; do
TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S")
echo "============================================" | tee -a "$LOG_FILE"
echo "[$TIMESTAMP] Checking public IP..." | tee -a "$LOG_FILE"
IP=""
METHOD=""
# Try api.ipify.org
echo "[$TIMESTAMP] Trying api.ipify.org..." | tee -a "$LOG_FILE"
IP=$(curl -s --max-time 10 https://api.ipify.org)
if [[ -n "$IP" ]]; then
METHOD="api.ipify.org"
echo "[$TIMESTAMP] SUCCESS: Retrieved IP: $IP" | tee -a "$LOG_FILE"
else
echo "[$TIMESTAMP] FAILED: api.ipify.org did not return an IP." | tee -a "$LOG_FILE"
echo "[$TIMESTAMP] Trying ifconfig.me..." | tee -a "$LOG_FILE"
IP=$(curl -s --max-time 10 http://ifconfig.io)
if [[ -n "$IP" ]]; then
METHOD="ifconfig.me"
echo "[$TIMESTAMP] SUCCESS: Retrieved IP: $IP" | tee -a "$LOG_FILE"
else
echo "[$TIMESTAMP] FAILED: ifconfig.me did not return an IP." | tee -a "$LOG_FILE"
echo "[$TIMESTAMP] Trying dig opendns..." | tee -a "$LOG_FILE"
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
if [[ -n "$IP" ]]; then
METHOD="dig opendns"
echo "[$TIMESTAMP] SUCCESS: Retrieved IP: $IP" | tee -a "$LOG_FILE"
else
IP="FAILED TO RESOLVE"
METHOD="All methods failed"
echo "[$TIMESTAMP] ERROR: All methods failed to retrieve IP." | tee -a "$LOG_FILE"
fi
fi
fi
if [[ "$IP" == "FAILED TO RESOLVE" ]]; then
echo "[$TIMESTAMP] ERROR: Could not determine public IP." | tee -a "$LOG_FILE"
else
# Read previous IP
LAST_IP=$(cat "$LAST_IP_FILE")
if [[ "$IP" != "$LAST_IP" ]]; then
echo "[$TIMESTAMP] Detected IP change: $LAST_IP --> $IP" | tee -a "$LOG_FILE"
echo "[$TIMESTAMP] Running 'make apply' in $MAKE_DIR..." | tee -a "$LOG_FILE"
cd "$MAKE_DIR"
make apply >> "$LOG_FILE" 2>&1
echo "$IP" > "$LAST_IP_FILE"
echo "[$TIMESTAMP] 'make apply' completed." | tee -a "$LOG_FILE"
else
echo "[$TIMESTAMP] No change detected. No action taken." | tee -a "$LOG_FILE"
fi
fi
echo "[$TIMESTAMP] Sleeping 5 minutes..." | tee -a "$LOG_FILE"
sleep 300
done

View File

@@ -0,0 +1,51 @@
#!/bin/bash
echo "[$(date)] --- DDNS Check Started ---"
# 1. Validate variables are not empty
if [ -z "$CF_API_TOKEN" ] || [ -z "$CF_ZONE_ID" ] || [ -z "$CF_RECORD_NAME" ]; then
echo "ERROR: One or more environment variables (TOKEN, ZONE_ID, RECORD_NAME) are missing!"
exit 1
fi
# 2. Get current public IP (Trying two services for reliability)
NEW_IP=$(curl -s https://api.ipify.org || curl -s https://ifconfig.me/ip)
if [[ ! $NEW_IP =~ ^[0-9]{1,3}(\.[0-9]{1,3}){3}$ ]]; then
echo "ERROR: Could not get a valid Public IP."
exit 1
fi
# 3. Get the current Record info from Cloudflare
RECORD_DATA=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/dns_records?name=$CF_RECORD_NAME&type=A" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json")
# Extract Record ID and Current IP from the JSON response
RECORD_ID=$(echo "$RECORD_DATA" | jq -r '.result[0].id // empty')
OLD_IP=$(echo "$RECORD_DATA" | jq -r '.result[0].content // empty')
if [ -z "$RECORD_ID" ]; then
echo "ERROR: Could not find DNS record for $CF_RECORD_NAME. Check your Zone ID and Name."
exit 1
fi
# 4. Compare and Update
if [ "$NEW_IP" = "$OLD_IP" ]; then
echo "IP is still $OLD_IP. No update needed."
else
echo "IP changed from $OLD_IP to $NEW_IP. Updating Cloudflare..."
UPDATE_RESPONSE=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$CF_ZONE_ID/dns_records/$RECORD_ID" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
--data "{\"type\":\"A\",\"name\":\"$CF_RECORD_NAME\",\"content\":\"$NEW_IP\",\"ttl\":120,\"proxied\":false}")
SUCCESS=$(echo "$UPDATE_RESPONSE" | jq -r '.success')
if [ "$SUCCESS" = "true" ]; then
echo "SUCCESS: Cloudflare updated to $NEW_IP"
else
echo "FAILURE: Update failed. Response: $UPDATE_RESPONSE"
fi
fi

View File

@@ -0,0 +1,9 @@
services:
cloudflare-updater:
build: .
container_name: cloudflare-ddns
restart: always
environment:
- CF_API_TOKEN=tDRW0bR8oiRI3xLYAOIGT_FVqIejif7hqk93W2Sc
- CF_ZONE_ID=0f670677e7c36e9fe8f8e6a1d1c72cbf
- CF_RECORD_NAME=home.ztariq.com

27
cloudflare/terraform.sh Normal file
View File

@@ -0,0 +1,27 @@
docker run --rm -it -v "$PWD":/app -w /app hashicorp/terraform:latest init
export AWS_ACCESS_KEY_ID="696EwxMMRUABP"
export AWS_SECRET_ACCESS_KEY="Ow5uqEka8Uzk0ea4Ag4wPacO4tiz5MsQV3JF4GuK"
export AWS_DEFAULT_REGION="eus3"
export AWS_EC2_METADATA_DISABLED=true
aws --endpoint-url https://YOUR-S3-ENDPOINT s3 ls s3://terraform
docker run --rm -it \
-v "$PWD":/app -w /app \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e AWS_DEFAULT_REGION=us-east-1 \
hashicorp/terraform:latest apply
docker run -d \
--name syncthing \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/London \
-p 8384:8384 \ # Web UI
-p 22000:22000/tcp \ # Sync (TCP)
-p 22000:22000/udp \ # QUIC (UDP)
-p 21027:21027/udp \ # Local discovery
-v ./sync/config:/config \
-v ./sync/data:/data \
lscr.io/linuxserver/syncthing:latest

View File

View File

@@ -0,0 +1,41 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5"
}
}
}
provider "cloudflare" {
api_token = var.cloudflare_apitoken
}
locals {
azure_records = {
root_a = { name = "@", type = "A", content = "185.139.7.37", ttl = 1, proxied = true }
root_uk_aaaa = { name = "@", type = "AAAA", content = "2a12:ab46:5344:fd::a", ttl = 1, proxied = true }
autodiscover = { name = "autodiscover", type = "CNAME", content = "eu1.workspace.org.", ttl = 360, proxied = false }
mail = { name = "mail", type = "CNAME", content = "eu1.workspace.org.", ttl = 360, proxied = false }
mail_mx = { name = "@", type = "MX", content = "eu1.workspace.org.", priority = 10, proxied = false }
spf_txt = { name = "@", content = "v=spf1 include:_spf.workspace.org -all", type = "TXT", ttl = 3600 }
verify_txt = { name = "workspace-verification", content = "44856072-5cde-458d-86c9-c8f86c0ab7bd", type = "TXT", ttl = 360 }
dkim_txt = { name = "cf8DDF69382578883._domainKey", content = "v=DKIM1;k=rsa;h=sha256;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr/Mu/P1bfiMIGkHNnvhLB1oVcAaSOg4QoKTCF9N6F/eVV7JCoERTSSHiMyS74V/xq0i3kUJYjspFgrXKicVaEl6jHmRJ4jSyb2b52frWzLakW1SB9LJwXZ/n0PDm90iSPToQOEvQTSl+pg9B9RWfhqr3Tv5hz9YvsjQP1tn7yNwJSbyhU944PWZimu0ryqwAQyLGNP+CsIeMTinwe0B8Rdtc52TusInwhcMddL9XgGYi/IsWsuri85R5yvzIOKk/sklfuDHOSQoCap7RW+Lm22B/DzC0spdjV42n0k4tGtv6Rz0bYT/2DpcqRVIQd9EAcTeUFq3qOYZCHsN0Q+iS2QIDAQAB", type = "TXT", ttl = 3600 }
dmarc_txt = { name = "_dmarc", content = "v=DMARC1; p=quarantine; rua=mailto:postmaster@azuredevops.co.uk; ruf=mailto:postmaster@azuredevops.co.uk; fo=1; adkim=s; aspf=s", type = "TXT", ttl = 3600 }
}
}
resource "cloudflare_dns_record" "this" {
for_each = local.azure_records
zone_id = var.zone_id
name = each.value.name
content = each.value.content
type = each.value.type
ttl = each.value.ttl
proxied = lookup(each.value, "proxied", false)
priority = lookup(each.value, "priority", null)
}

View File

@@ -0,0 +1,258 @@
{
"version": 4,
"terraform_version": "1.13.3",
"serial": 59,
"lineage": "87d4a795-db19-508c-0f53-1e6bdd9b5d93",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "cloudflare_dns_record",
"name": "this",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"index_key": "autodiscover",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "eu1.workspace.org.",
"created_on": "2025-10-03T10:35:51Z",
"data": null,
"id": "2c03ba416645db773ec3b0bdc7514d1e",
"meta": "{}",
"modified_on": "2025-10-04T13:37:12Z",
"name": "autodiscover.azuredevops.co.uk",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": false,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "CNAME",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "dkim_txt",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=DKIM1;k=rsa;h=sha256;p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr/Mu/P1bfiMIGkHNnvhLB1oVcAaSOg4QoKTCF9N6F/eVV7JCoERTSSHiMyS74V/xq0i3kUJYjspFgrXKicVaEl6jHmRJ4jSyb2b52frWzLakW1SB9LJwXZ/n0PDm90iSPToQOEvQTSl+pg9B9RWfhqr3Tv5hz9YvsjQP1tn7yNwJSbyhU944PWZimu0ryqwAQyLGNP+CsIeMTinwe0B8Rdtc52TusInwhcMddL9XgGYi/IsWsuri85R5yvzIOKk/sklfuDHOSQoCap7RW+Lm22B/DzC0spdjV42n0k4tGtv6Rz0bYT/2DpcqRVIQd9EAcTeUFq3qOYZCHsN0Q+iS2QIDAQAB",
"created_on": "2025-10-03T10:35:51Z",
"data": null,
"id": "d5bf0503497e76584ffbe03173f8d644",
"meta": "{}",
"modified_on": "2025-10-03T10:35:51Z",
"name": "cf8DDF69382578883._domainKey",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 3600,
"type": "TXT",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "dmarc_txt",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=DMARC1; p=quarantine; rua=mailto:postmaster@azuredevops.co.uk; ruf=mailto:postmaster@azuredevops.co.uk; fo=1; adkim=s; aspf=s",
"created_on": "2025-10-03T10:35:50Z",
"data": null,
"id": "50d45619b699b9482803d7f4a624127a",
"meta": "{}",
"modified_on": "2025-10-03T10:35:50Z",
"name": "_dmarc.azuredevops.co.uk",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 3600,
"type": "TXT",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "mail",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "eu1.workspace.org.",
"created_on": "2025-10-03T10:35:51Z",
"data": null,
"id": "9f0db2a3b0ad84d1037580611c84a348",
"meta": "{}",
"modified_on": "2025-10-04T13:37:12Z",
"name": "mail.azuredevops.co.uk",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": false,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "CNAME",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "root_a",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "185.139.7.37",
"created_on": "2025-10-03T10:35:51Z",
"data": null,
"id": "9868e7bf3f8cc58583eda37a9f45434f",
"meta": "{}",
"modified_on": "2025-10-04T13:37:12Z",
"name": "azuredevops.co.uk",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "root_uk_aaaa",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "2a12:ab46:5344:fd::a",
"created_on": "2025-10-04T13:33:21Z",
"data": null,
"id": "a9db6975674cf2e19cc3e99cf79a2904",
"meta": "{}",
"modified_on": "2025-10-04T13:37:12Z",
"name": "azuredevops.co.uk",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "AAAA",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "spf_txt",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=spf1 include:_spf.workspace.org -all",
"created_on": "2025-10-03T10:35:50Z",
"data": null,
"id": "7fef7251bb88c2b501343951705cdb3b",
"meta": "{}",
"modified_on": "2025-10-03T10:35:50Z",
"name": "azuredevops.co.uk",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 3600,
"type": "TXT",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "verify_txt",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "44856072-5cde-458d-86c9-c8f86c0ab7bd",
"created_on": "2025-10-03T10:35:50Z",
"data": null,
"id": "43850a81936261408d3cd135c064c199",
"meta": "{}",
"modified_on": "2025-10-03T10:35:50Z",
"name": "workspace-verification.azuredevops.co.uk",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "TXT",
"zone_id": "d2697ef5d69f322186bdbc812fdad150"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
}
],
"check_results": null
}

View File

@@ -0,0 +1,15 @@
variable "cloudflare_apitoken" {
description = "Cloudflare API token"
type = string
sensitive = true
}
variable "zone_id" {
description = "Cloudflare zone ID"
type = string
}
variable "current_ip" {
description = "Current public IP address"
type = string
}

View File

@@ -0,0 +1,6 @@
terraform {
backend "pg" {
conn_str = "postgres://zeshan:Shan33779488@100.115.152.20:5432/terraform?sslmode=disable"
schema_name = "dreamartdecor-state"
}
}

View File

@@ -0,0 +1,78 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "5.8.2"
}
}
}
provider "cloudflare" {
api_token = var.cloudflare_apitoken
}
locals {
dream_records = {
dream_mail = {
name = "mail"
content = "168.119.13.219"
type = "A"
ttl = 86400
}
dream_mx = {
name = "@"
content = "mail.dreamartdecor.com"
type = "MX"
ttl = 86400
priority = 10
}
dream_autoconfig = {
name = "autoconfig"
content = "mail.dreamartdecor.com"
type = "CNAME"
ttl = 86400
}
dream_mail_aaaa = {
name = "mail"
content = "2a01:4f8:242:4460::2"
type = "AAAA"
ttl = 86400
}
dream_txt_spf = {
name = "@"
content = "v=spf1 a mx ip4:168.119.13.219 ip6:2a01:4f8:242:4460::2 ~all"
type = "TXT"
ttl = 86400
}
dream_txt_dkim = {
name = "x._domainkey"
content = "v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1GW9inpeYtcxMWY3JjUnVFzsPgKCZOfOCETVvk5wWOYZr9LJGz0YnJu3xGIZeJiFWDOgGV/xorzlcAzDqumh58cYPkDIzYVgbOp8vw1qS+a3iKMtRM99kyadEmUDyKjHk11HiCADNaEAgCD1vaKlQzRGAmdP15XhFC7xprSPQPAi6z/l2Iy3wsLdMpYR9P+tiSpS0msI86PBj4Kj5JRuzyHMw4YCqLRKMOIXTKO/zBWOAJOc/eKbjMyTT/iUJe9YE5yuzUHSZNT57aTHIGGadhFhMrkCNVFMyuCGZFt7fCF+Xzvu0iljYK/Uw4Zru73fTaUtq8SMcnvLjj7lm0fpvwIDAQAB"
type = "TXT"
ttl = 86400
}
dream_dmarc = {
name = "_dmarc"
content = "v=DMARC1; p=none; rua=mailto:4a937e10a8e144c89cb11f1272c159c0@dmarc-reports.cloudflare.net"
type = "TXT"
ttl = 86400
}
dream_www = {
name = "www"
content = "dreamartdecor.com"
type = "CNAME"
ttl = 1
proxied = true
}
}
}
resource "cloudflare_dns_record" "this" {
for_each = local.dream_records
zone_id = var.zone_id
name = each.value.name
content = each.value.content
type = each.value.type
ttl = each.value.ttl
proxied = lookup(each.value, "proxied", false)
priority = lookup(each.value, "priority", null)
}

View File

@@ -0,0 +1,15 @@
variable "cloudflare_apitoken" {
description = "Cloudflare API token"
type = string
sensitive = true
}
variable "zone_id" {
description = "Cloudflare zone ID"
type = string
}
variable "current_ip" {
description = "Current public IP address"
type = string
}

View File

View File

@@ -0,0 +1,83 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 5"
}
}
}
provider "cloudflare" {
api_token = var.cloudflare_apitoken
}
locals {
ztariq_records = {
# --- A Records ---
beszel = { name = "beszel", type = "A", content = "198.23.169.195", ttl = 1, proxied = true }
ca = { name = "ca", type = "A", content = "154.12.117.17", ttl = 1, proxied = false }
nc = { name = "nc", type = "A", content = "154.12.117.17", ttl = 1, proxied = false }
nl = { name = "nl", type = "A", content = "62.84.172.70", ttl = 1, proxied = false }
reg = { name = "reg", type = "A", content = "154.12.117.17", ttl = 1, proxied = false }
tea = { name = "tea", type = "A", content = "198.23.169.195", ttl = 1, proxied = false }
uk = { name = "uk", type = "A", content = "185.139.7.37", ttl = 1, proxied = false }
uk2 = { name = "uk2", type = "A", content = "154.41.135.47", ttl = 1, proxied = false }
uptime = { name = "uptime", type = "A", content = "198.23.169.195", ttl = 1, proxied = true }
us = { name = "us", type = "A", content = "198.23.169.195", ttl = 1, proxied = false }
root_a = { name = "@", type = "A", content = "185.139.7.37", ttl = 1, proxied = true }
# --- AAAA Records ---
nl_aaaa = { name = "nl", type = "AAAA", content = "2a12:bec4:1821:f0::a", ttl = 1, proxied = false }
root_uk_aaaa = { name = "@", type = "AAAA", content = "2a12:ab46:5344:fd::a", ttl = 1, proxied = true }
root_uk_uk = { name = "uk", type = "AAAA", content = "2a12:ab46:5344:fd::a", ttl = 1, proxied = false }
# --- CNAME Records ---
autodiscover = { name = "autodiscover", type = "CNAME", content = "eu1.workspace.org.", ttl = 360, proxied = false }
mail = { name = "mail", type = "CNAME", content = "eu1.workspace.org.", ttl = 360, proxied = false }
# --- MX Records ---
mx_root = { name = "@", type = "MX", content = "eu1.workspace.org.", priority = 10, ttl = 360 }
# --- TXT Records ---
dmarc = {
name = "_dmarc"
type = "TXT"
content = "v=DMARC1; p=quarantine; rua=mailto:postmaster@ztariq.com; ruf=mailto:postmaster@ztariq.com; fo=1; adkim=s; aspf=s"
ttl = 3600
}
dkim = {
name = "nd8ddf6995beebee4._domainkey"
type = "TXT"
content = "v=DKIM1; k=rsa; h=sha256; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoi3yX1W5V6a9QbEXo00k9JCZ8Vew5rQEanHLIY0cOxCauAIZZIrhQsexZ0j45EFVtfMrBHeddUtolVSSDHvvJg49HzJqWsKOsN061uBgmdN69JEtzme04pRmz/7H+3Y0QDUSYDd+ffYzWaouplFqGuhYkQ5QG2J1JzofcetuAkQICIgWStcOO+av5WoyTdxfqsY64d/XFP4PZJJHX0XA1P2YaSuyNF5c7nv/+a9A6F5+OrgZhFNNWjUurkKKhFzhbR82BUPTXVuG3EI5wSQcIYjhXgINagsmvVyPL1XP584qtnq0ScGysSkh0T3Vhg/Kob9eHX1du7mZj7G0z3PHmwIDAQAB"
ttl = 360
}
workspace_verification = {
name = "workspace-verification"
type = "TXT"
content = "f23716dd-2ad6-4dd4-8867-112e3c4c318d"
ttl = 360
}
spf = {
name = "@"
type = "TXT"
content = "v=spf1 include:_spf.workspace.org -all"
ttl = 360
}
}
}
resource "cloudflare_dns_record" "ztariq" {
for_each = local.ztariq_records
zone_id = var.zone_id
name = each.value.name
type = each.value.type
content = each.value.content
ttl = each.value.ttl
proxied = lookup(each.value, "proxied", null)
priority = lookup(each.value, "priority", null)
lifecycle {
prevent_destroy = false
}
}

View File

@@ -0,0 +1,648 @@
{
"version": 4,
"terraform_version": "1.13.3",
"serial": 67,
"lineage": "86dbab99-bb75-e967-6f01-8134ccc693e6",
"outputs": {},
"resources": [
{
"mode": "managed",
"type": "cloudflare_dns_record",
"name": "ztariq",
"provider": "provider[\"registry.terraform.io/cloudflare/cloudflare\"]",
"instances": [
{
"index_key": "autodiscover",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "eu1.workspace.org.",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "1da92323f9f6e5a00e02df0edac16554",
"meta": "{}",
"modified_on": "2025-10-09T08:38:58Z",
"name": "autodiscover.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": false,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "CNAME",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "beszel",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "198.23.169.195",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "e1824f42449cb3fed3024633819bd345",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "beszel.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "ca",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "154.12.117.17",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "8eedfb649e973cacfcb117155ccbca61",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "ca.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "dkim",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=DKIM1; k=rsa; h=sha256; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoi3yX1W5V6a9QbEXo00k9JCZ8Vew5rQEanHLIY0cOxCauAIZZIrhQsexZ0j45EFVtfMrBHeddUtolVSSDHvvJg49HzJqWsKOsN061uBgmdN69JEtzme04pRmz/7H+3Y0QDUSYDd+ffYzWaouplFqGuhYkQ5QG2J1JzofcetuAkQICIgWStcOO+av5WoyTdxfqsY64d/XFP4PZJJHX0XA1P2YaSuyNF5c7nv/+a9A6F5+OrgZhFNNWjUurkKKhFzhbR82BUPTXVuG3EI5wSQcIYjhXgINagsmvVyPL1XP584qtnq0ScGysSkh0T3Vhg/Kob9eHX1du7mZj7G0z3PHmwIDAQAB",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "e7d739b620e7de9ddf4acc1d35d9104e",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "nd8ddf6995beebee4._domainkey.ztariq.com",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "TXT",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "dmarc",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=DMARC1; p=quarantine; rua=mailto:postmaster@ztariq.com; ruf=mailto:postmaster@ztariq.com; fo=1; adkim=s; aspf=s",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "d687c8ca6f4cd2057d1607c77797b8dd",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "_dmarc.ztariq.com",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 3600,
"type": "TXT",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "mail",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "eu1.workspace.org.",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "8adb370489931da4b8726c8142b468b2",
"meta": "{}",
"modified_on": "2025-10-09T08:38:58Z",
"name": "mail.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": false,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "CNAME",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "mx_root",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "eu1.workspace.org.",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "1853b26b8d52a41c5ef0f4212c41696f",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "ztariq.com",
"priority": 10,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "MX",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "nc",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "154.12.117.17",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "9188fe0d253b8094f19320d4afff3d9a",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "nc.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "nl",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "62.84.172.70",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "18b04c8ced7b1ae3bcf5fc873e1fbdf8",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "nl.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "nl_aaaa",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "2a12:bec4:1821:f0::a",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "f6bffdbdb7f94832d39186a147687fe8",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "nl.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "AAAA",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "reg",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "154.12.117.17",
"created_on": "2025-10-09T08:38:58Z",
"data": null,
"id": "2f92ab4eb7475d3c9b678f49abbc9ae3",
"meta": "{}",
"modified_on": "2025-10-09T08:38:58Z",
"name": "reg",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "root_a",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "185.139.7.37",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "1d1e80fd88cbed6b00ddf0ac4d856e0f",
"meta": "{}",
"modified_on": "2025-10-04T13:37:26Z",
"name": "ztariq.com",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "root_uk_aaaa",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "2a12:ab46:5344:fd::a",
"created_on": "2025-10-04T13:30:31Z",
"data": null,
"id": "69fa5646418278ab2d865b509349f85d",
"meta": "{}",
"modified_on": "2025-10-04T14:52:55Z",
"name": "ztariq.com",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "AAAA",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "root_uk_uk",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "2a12:ab46:5344:fd::a",
"created_on": "2025-10-04T13:32:56Z",
"data": null,
"id": "041c4d5e021eeb72b16ce82b3215d114",
"meta": "{}",
"modified_on": "2025-10-04T14:52:55Z",
"name": "uk.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "AAAA",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "spf",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "v=spf1 include:_spf.workspace.org -all",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "a7dc36bb0d2542c1d9534e70af352a70",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "ztariq.com",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "TXT",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "tea",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "198.23.169.195",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "12be831a0a9cfcaac555f82acbabec70",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "tea.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "uk",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "185.139.7.37",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "c932fd20294dd7e63dd49bcbb42dd46d",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "uk.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "uk2",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "154.41.135.47",
"created_on": "2025-10-05T13:44:38Z",
"data": null,
"id": "3e85a02d4d60fdd2746eded881daf70b",
"meta": "{}",
"modified_on": "2025-10-05T14:03:16Z",
"name": "uk2.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "uptime",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "198.23.169.195",
"created_on": "2025-10-03T10:41:38Z",
"data": null,
"id": "79f47fe2d5ec8575b215fddd6bbb1f6b",
"meta": "{}",
"modified_on": "2025-10-03T10:41:38Z",
"name": "uptime.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": true,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "us",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "198.23.169.195",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "3532e6cb018f85319c15430387aba340",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "us.ztariq.com",
"priority": null,
"proxiable": true,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 1,
"type": "A",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
},
{
"index_key": "workspace_verification",
"schema_version": 0,
"attributes": {
"comment": null,
"comment_modified_on": null,
"content": "f23716dd-2ad6-4dd4-8867-112e3c4c318d",
"created_on": "2025-10-03T10:41:37Z",
"data": null,
"id": "396e522c02d0fe0b716f174d2cdca4e3",
"meta": "{}",
"modified_on": "2025-10-03T10:41:37Z",
"name": "workspace-verification.ztariq.com",
"priority": null,
"proxiable": false,
"proxied": false,
"settings": {
"flatten_cname": null,
"ipv4_only": null,
"ipv6_only": null
},
"tags": [],
"tags_modified_on": null,
"ttl": 360,
"type": "TXT",
"zone_id": "0f670677e7c36e9fe8f8e6a1d1c72cbf"
},
"sensitive_attributes": [],
"identity_schema_version": 0
}
]
}
],
"check_results": null
}

View File

@@ -0,0 +1,15 @@
variable "cloudflare_apitoken" {
description = "Cloudflare API token"
type = string
sensitive = true
}
variable "zone_id" {
description = "Cloudflare zone ID"
type = string
}
variable "current_ip" {
description = "Current public IP address"
type = string
}