dns

DNS Deployment for nordgedanken.dev infra.
git clone git://archive.git.mtrnord.blog/Nordgedanken/dns.git
Log | Files | Refs

commit 14447aa1e052eaa7d73a675147dffe4df0f7ac31
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue, 10 Oct 2023 16:32:59 +0200

Initial commit

Diffstat:
A.github/workflows/deploy.yml | 26++++++++++++++++++++++++++
A.github/workflows/pullrequest.yml | 65+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A.gitignore | 2++
Aconfig/midnightthoughts.space.yaml | 228+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconfig/production.yaml | 47+++++++++++++++++++++++++++++++++++++++++++++++
Arequirements.txt | 3+++
6 files changed, 371 insertions(+), 0 deletions(-)

diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml @@ -0,0 +1,26 @@ +name: octodns Deploy + +on: + # Deploy config whenever DNS changes are pushed to main. + push: + branches: + - main + +jobs: + publish: + name: Publish DNS config from main + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.12' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main + with: + config_path: config/production.yaml + doit: '--doit' + env: + POWERDNS_API_KEY_NS1: ${{ secrets.POWERDNS_API_KEY_NS1 }} + POWERDNS_API_KEY_NS2: ${{ secrets.POWERDNS_API_KEY_NS2 }} + POWERDNS_API_KEY_NS3: ${{ secrets.POWERDNS_API_KEY_NS3 }} diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml @@ -0,0 +1,65 @@ +name: Validate +on: + push: + branches: [main] + pull_request: +jobs: + linting: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2.3.4 + + - name: Run yamllint + run: yamllint . + validate: + needs: linting + + if: "${{ github.event_name == 'pull_request' }}" + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.12' + - run: pip install -r requirements.txt + - uses: solvaholic/octodns-sync@main + with: + config_path: config/production.yaml + - name: Get plan output + id: meta + run: | + # Parse plan output into $_plan + _plan="$(cat ${GITHUB_WORKSPACE}/octodns-sync.plan)" + _plan="${_plan//'%'/'%25'}" + _plan="${_plan//$'\n'/'%0A'}" + _plan="${_plan//$'\r'/'%0D'}" + # Set output 'plan' to $_plan + echo "::set-output name=plan::${_plan}" + # Set $_sha to the first 7 char of PR head SHA + _sha="$(echo "${{ github.event.pull_request.head.sha }}" | cut -c 1-7)" + # Set output 'sha' to $_sha + echo "::set-output name=sha::${_sha}" + + - name: Find comment + uses: peter-evans/find-comment@2.4.0 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: github-actions[bot] + body-includes: Automatically generated by octodns-sync + + - name: Add or update PR comment + uses: peter-evans/create-or-update-comment@3.0.2 + with: + issue-number: ${{ github.event.pull_request.number }} + comment-id: ${{ steps.fc.outputs.comment-id }} + body: | + ## OctoDNS Plan for `${{ steps.meta.outputs.sha }}` + + ${{ steps.meta.outputs.plan }} + + Automatically generated by octodns-sync + edit-mode: replace diff --git a/.gitignore b/.gitignore @@ -0,0 +1,2 @@ +tmp +env diff --git a/config/midnightthoughts.space.yaml b/config/midnightthoughts.space.yaml @@ -0,0 +1,228 @@ +--- +? '' +: - ttl: 1800 + type: A + value: 65.21.116.72 + - ttl: 1800 + type: CAA + values: + - flags: 0 + tag: iodef + value: mailto:mtrnord@nordgedanken.dev + - flags: 0 + tag: issue + value: letsencrypt.org; validationmethods=tls-alpn-01,dns-01,http-01 + - ttl: 1800 + type: MX + value: + exchange: mail.midnightthoughts.space. + preference: 10 + - ttl: 600 + type: NS + values: + - ns1.nordgedanken.dev. + - ns2.nordgedanken.dev. + - ns3.nordgedanken.dev. + - ttl: 1800 + type: TXT + value: google-site-verification=YeO0rqvYWOZoW6yj3MRf77luDe9CURDbmPYLFYiBXo8 +_acme-challenge: + ttl: 1800 + type: TXT + value: ht72nkSy0CBbNUyeoBdngJOMbViGNk-HhH04nnUSH0w +_dmarc.mail: + ttl: 1800 + type: TXT + value: v=DMARC1\; p=none\; sp=none\; fo=1\; ri=3600\; rua=mailto:mtrnord@nordgedanken.dev\; + ruf=mailto:mtrnord@nordgedanken.dev +art: + ttl: 1800 + type: A + value: 65.21.116.72 +castopod: +- ttl: 1800 + type: A + value: 65.21.116.74 +- ttl: 1800 + type: AAAA + value: 2a01:4f9:4a:451c:2::2 +coreharbor.kubernetes: + ttl: 1800 + type: A + value: 65.21.116.72 +dashboard.ceph: + ttl: 1800 + type: A + value: 65.21.116.72 +dashboard.kubernetes: + ttl: 1800 + type: A + value: 65.21.116.72 +default._domainkey.mail: + ttl: 1800 + type: TXT + value: v=DKIM1\; k=rsa\; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa+VrLSqHv7jEXdYtE8L+ZnwgMW9o8mV+kKGdl1emUNLe4TcOOUG8rU3zqU8VM8vnBjYAKLLrY6Exq7nqkLMXmTf9pmD3Y5LY4PVbZucDVfD4wFmtn0mSaUkZW2G8F9oJ3CvQqU94JbYCiXB+l9mkTiZloKOoKdFrjxBBOeSMD3QIDAQAB +docs.draupnir: + ttl: 1800 + type: CNAME + value: the-draupnir-project.github.io. +draupnir: + ttl: 1800 + type: A + value: 65.21.116.72 +fleet: + ttl: 1800 + type: A + value: 65.21.116.72 +grafana: + ttl: 1800 + type: A + value: 65.21.116.72 +headscale: +- ttl: 1800 + type: A + value: 49.13.24.105 +- ttl: 1800 + type: AAAA + value: 2a01:4f8:c012:492::1 +hookshot: + ttl: 1800 + type: A + value: 65.21.116.72 +keycloak: + ttl: 1800 + type: A + value: 65.21.116.72 +kubernetes: +- ttl: 1800 + type: A + value: 95.217.202.35 +- ttl: 1800 + type: AAAA + value: 2a01:4f9:4a:451c:2::5 +lg: +- ttl: 1800 + type: A + value: 49.13.24.105 +- ttl: 1800 + type: AAAA + value: 2a01:4f8:c012:492::1 +mail: +- ttl: 1800 + type: A + value: 95.217.202.35 +- ttl: 1800 + type: AAAA + value: 2a01:4f9:4a:451c:ffff:ffff:ffff:eeee +- ttl: 1800 + type: MX + value: + exchange: mail.midnightthoughts.space. + preference: 10 +- ttl: 1800 + type: TXT + values: + - google-site-verification=d5k_X67W_dLDw_KMEqTywt6s3ywb_3Nh-dWUuhoAhz0 + - v=spf1 mx include:_spf.mx.cloudflare.net a:mail.midnightthoughts.space ip4:65.21.116.72 + ~all +matrix: + ttl: 1800 + type: A + value: 65.21.116.72 +matrix.art: + ttl: 1800 + type: A + value: 65.21.116.72 +matrix.draupnir: + ttl: 1800 + type: A + value: 65.21.116.72 +nextcloud: + ttl: 1800 + type: A + value: 65.21.116.72 +nordgedanken.lg: + ttl: 1800 + type: A + value: 10.100.0.2 +notaryharbor.kubernetes: + ttl: 1800 + type: A + value: 65.21.116.72 +notes: + ttl: 1800 + type: CNAME + value: cname.vercel-dns.com. +pbx: +- ttl: 1800 + type: A + value: 49.13.24.105 +- ttl: 1800 + type: AAAA + value: 2a01:4f8:c012:492::1 +postgres-ui: + ttl: 1800 + type: A + value: 65.21.116.72 +postgres.internal: + ttl: 1800 + type: A + value: 10.100.12.1 +redmine: + ttl: 1800 + type: A + value: 65.21.116.72 +rook.ceph: + ttl: 1800 + type: A + value: 65.21.116.72 +rspamd: +- ttl: 1800 + type: A + value: 65.21.116.74 +- ttl: 1800 + type: AAAA + value: 2a01:4f9:4a:451c:2::2 +search.art: + ttl: 1800 + type: A + value: 65.21.116.72 +sliding.matrix: + ttl: 1800 + type: A + value: 65.21.116.72 +spec: + ttl: 1800 + type: A + value: 65.21.116.72 +status.draupnir: + ttl: 1800 + type: CNAME + value: the-draupnir-project.github.io. +weave: + ttl: 1800 + type: A + value: 65.21.116.72 +webhook.kubernetes: + ttl: 1800 + type: A + value: 65.21.116.72 +worker-1.lg: + ttl: 1800 + type: A + value: 10.100.0.1 +worker-2.lg: + ttl: 1800 + type: A + value: 10.100.0.3 +zammad: + ttl: 1800 + type: A + value: 65.21.116.72 +znc: +- ttl: 1800 + type: A + value: 49.13.24.105 +- ttl: 1800 + type: AAAA + value: 2a01:4f8:c012:492::1 diff --git a/config/production.yaml b/config/production.yaml @@ -0,0 +1,47 @@ +--- +providers: + config: + class: octodns.provider.yaml.YamlProvider + directory: ./config + default_ttl: 3600 + enforce_order: True + powerdns_ns1: + class: octodns_powerdns.PowerDnsProvider + # The host on which PowerDNS api is listening (required) + host: 65.21.116.72 + # The port on whih PowerDNS api is listening (optional, default 8081) + port: 8082 + # The api key that grans access (required, example is using an env var) + api_key: env/POWERDNS_API_KEY_NS1 + # Send DNS NOTIFY to secondary servers after change (optional, default false) + # notify: false + powerdns_ns2: + class: octodns_powerdns.PowerDnsProvider + # The host on which PowerDNS api is listening (required) + host: 37.27.5.79 + # The port on whih PowerDNS api is listening (optional, default 8081) + port: 8081 + # The api key that grans access (required, example is using an env var) + api_key: env/POWERDNS_API_KEY_NS2 + # Send DNS NOTIFY to secondary servers after change (optional, default false) + # notify: false + powerdns_ns3: + class: octodns_powerdns.PowerDnsProvider + # The host on which PowerDNS api is listening (required) + host: 37.27.7.20 + # The port on whih PowerDNS api is listening (optional, default 8081) + port: 8081 + # The api key that grans access (required, example is using an env var) + api_key: env/POWERDNS_API_KEY_NS3 + # Send DNS NOTIFY to secondary servers after change (optional, default false) + # notify: false +zones: + midnightthoughts.space.: &default + sources: + - config + targets: + - powerdns_ns1 + - powerdns_ns2 + - powerdns_ns3 + nordgedanken.dev.: *default + miki.community.: *default diff --git a/requirements.txt b/requirements.txt @@ -0,0 +1,3 @@ +octodns==1.2.1 +octodns-powerdns==0.0.5 +octodns-spf==0.0.2