Skip to content

Commit

Permalink
Merge pull request #13 from mhutter/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
mhutter authored Jan 9, 2024
2 parents 1b67641 + ebd2fb6 commit 667cb55
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
dotenv
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.env.sh
.env
4 changes: 1 addition & 3 deletions creds.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"cloudflare": {
"TYPE": "CLOUDFLAREAPI",
"apitoken": "$CLOUDFLARE_APITOKEN"
},
"gandi": {
"apikey": "$GANDI_APIKEY"
}
}
13 changes: 10 additions & 3 deletions dnsconfig.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// Providers
var REG_GANDI = NewRegistrar('gandi', 'GANDI_V5');
var CLOUDFLARE = NewDnsProvider('cloudflare', 'CLOUDFLAREAPI',
{ 'manage_redirects': true });
var REG_NONE = NewRegistrar('none');
var DNS_CF = NewDnsProvider('cloudflare', {'manage_redirects': true});
DEFAULTS(
DnsProvider(DNS_CF),
CF_PROXY_DEFAULT_OFF
);

// Templates
var GANDI_MX = [
Expand All @@ -10,5 +13,9 @@ var GANDI_MX = [
TXT('@', 'v=spf1 include:_mailcust.gandi.net ?all'),
];

// IPs
var RHEA_A = '116.202.233.38';
var RHEA_AAAA = '2a01:4f8:241:4c27::1';

// Zones
require_glob('./zones/');
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell."${system}" = pkgs.mkShell {
packages = with pkgs; [ dnscontrol ];
};
};
}
2 changes: 1 addition & 1 deletion zones/hutter.io.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
D('hutter.io', REG_GANDI, DnsProvider(CLOUDFLARE),
D('hutter.io', REG_NONE,
ALIAS('@', 'mhu-dev.pages.dev.', CF_PROXY_ON),
CNAME('www', '@', CF_PROXY_ON),

Expand Down
2 changes: 1 addition & 1 deletion zones/izibizi.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
D('izibizi.ch', REG_GANDI, DnsProvider(CLOUDFLARE),
D('izibizi.ch', REG_NONE,
ALIAS('@', 'web.jimdosite.com.', CF_PROXY_ON),
CNAME('www', 'web.jimdosite.com.'),

Expand Down
13 changes: 13 additions & 0 deletions zones/mhnet.app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
D('mhnet.app', REG_NONE,
A('*', RHEA_A),
AAAA('*', RHEA_AAAA),

// Sendgrid
CNAME('em6609', 'u22452480.wl231.sendgrid.net.'),
CNAME('s1._domainkey', 's1.domainkey.u22452480.wl231.sendgrid.net.'),
CNAME('s2._domainkey', 's2.domainkey.u22452480.wl231.sendgrid.net.'),
TXT('_dmarc', 'v=DMARC1; p=none;'),

// CAA
CAA('@', 'issue', 'letsencrypt.org')
);
10 changes: 7 additions & 3 deletions zones/mhnet.dev.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
D('mhnet.dev', REG_GANDI, DnsProvider(CLOUDFLARE),
D('mhnet.dev', REG_NONE,
// K3s cluster
A('*', '142.132.241.164', CF_PROXY_OFF),
AAAA('*', '2a01:4f8:c01e:373::1', CF_PROXY_OFF),
A('*', '142.132.241.164'),
AAAA('*', '2a01:4f8:c01e:373::1'),

// Rhea
A('rhea', RHEA_A),
AAAA('rhea', RHEA_AAAA),

// Vaultwarden
CNAME('vaultwarden', 'cname.cloudscale-lpg-2.appuio.cloud.'),
Expand Down
6 changes: 3 additions & 3 deletions zones/mhu.dev.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
D('mhu.dev', REG_GANDI, DnsProvider(CLOUDFLARE),
D('mhu.dev', REG_NONE,
ALIAS('@', 'mhu-dev.pages.dev.', CF_PROXY_ON),
CNAME('www', '@', CF_PROXY_ON),

// K3s cluster
A('*', '142.132.241.164', CF_PROXY_OFF),
AAAA('*', '2a01:4f8:c01e:373::1', CF_PROXY_OFF),
A('*', '142.132.241.164'),
AAAA('*', '2a01:4f8:c01e:373::1'),


// Verifications
Expand Down
2 changes: 1 addition & 1 deletion zones/mhutter.net.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
D('mhutter.net', REG_GANDI, DnsProvider(CLOUDFLARE),
D('mhutter.net', REG_NONE,
ALIAS('@', 'mhu-dev.pages.dev.', CF_PROXY_ON),
CNAME('www', '@', CF_PROXY_ON),

Expand Down
2 changes: 1 addition & 1 deletion zones/the-voice.cc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
D('the-voice.cc', REG_GANDI, DnsProvider(CLOUDFLARE),
D('the-voice.cc', REG_NONE,
ALIAS('@', 'the-voice.pages.dev.', CF_PROXY_ON),
CNAME('www', '@', CF_PROXY_ON),

Expand Down

0 comments on commit 667cb55

Please sign in to comment.