Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor host address management #29

Merged
merged 3 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 30 additions & 16 deletions dnsconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ function loadTemplate(template) {
return function (domain, registrar) {
DOMAIN = domain;
REGISTRAR = registrar;
DYNAMIC_RECORDS = [];

for (var i = 2; i < arguments.length; i++) {
DYNAMIC_RECORDS = DYNAMIC_RECORDS.concat(arguments[i]);
}

require("src/" + template + ".js");
};
Expand All @@ -27,7 +22,18 @@ function loadTemplate(template) {
// Ensure that the reverse DNS records are in RFC 4183 notation
REVCOMPAT("rfc4183");

require("src/hosts.js");
var IPV4 = require("src/ipv4.json");
var IPV6 = require("src/ipv6.json");

var HOST_RECORDS = [];

for (var name in IPV4) {
HOST_RECORDS.push(A(name, IPV4[name]));
}

for (var name in IPV6) {
HOST_RECORDS.push(AAAA(name, IPV6[name]));
}

var OPENSTREETMAP = loadTemplate("openstreetmap");

Expand All @@ -40,23 +46,15 @@ try {
var GEO_NS_RECORDS = [];
}

OPENSTREETMAP_ORG_RECORDS = [
CNAME("_acme-challenge.tile", "bxve5ryiwwv7woiraq.fastly-validations.com.", TTL("10m"))
]

OSM_ORG_RECORDS = [
CNAME("_acme-challenge.tile", "21gvdfyyxjoc4lmsem.fastly-validations.com.", TTL("10m"))
]

OPENSTREETMAP("openstreetmap.org", REG_GANDI, OPENSTREETMAP_ORG_RECORDS, SSHFP_RECORDS, GEO_NS_RECORDS, NOMINATIM_RECORDS);
OPENSTREETMAP("openstreetmap.org", REG_GANDI);
OPENSTREETMAP("openstreetmap.com", REG_GANDI);
OPENSTREETMAP("openstreetmap.net", REG_GANDI);
OPENSTREETMAP("openstreetmap.ca", REG_GANDI);
OPENSTREETMAP("openstreetmap.eu", REG_NONE);
OPENSTREETMAP("openstreetmap.pro", REG_GANDI);
OPENSTREETMAP("openstreetmap.gay", REG_GANDI);
OPENSTREETMAP("openstreetmaps.org", REG_GANDI);
OPENSTREETMAP("osm.org", REG_GANDI, OSM_ORG_RECORDS, SSHFP_RECORDS);
OPENSTREETMAP("osm.org", REG_GANDI);
OPENSTREETMAP("openmaps.org", REG_GANDI);
OPENSTREETMAP("openstreetmap.io", REG_GANDI);
OPENSTREETMAP("osm.io", REG_GANDI);
Expand Down Expand Up @@ -84,6 +82,22 @@ OPENSTREETMAP("openstreetmap.org.nz", REG_GANDI);
// Disable due to registration issue
// OPENSTREETMAP("openstreetmap.al", REG_NONE);

D_EXTEND("openstreetmap.org",
CNAME("_acme-challenge.tile", "bxve5ryiwwv7woiraq.fastly-validations.com.", TTL("10m")),

HOST_RECORDS,
SSHFP_RECORDS,
GEO_NS_RECORDS,
NOMINATIM_RECORDS
);

D_EXTEND("osm.org",
CNAME("_acme-challenge.tile", "21gvdfyyxjoc4lmsem.fastly-validations.com.", TTL("10m")),

HOST_RECORDS,
SSHFP_RECORDS
);

// Mastodon redirects to en.osm.town
var OPENSTREETMAP_TOWN = loadTemplate("openstreetmap-town");
OPENSTREETMAP_TOWN("openstreetmap.town", REG_GANDI);
Expand Down
266 changes: 0 additions & 266 deletions src/hosts.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/ideditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ D(DOMAIN, REGISTRAR, DnsProvider(PROVIDER),

ALIAS("@", "openstreetmap.github.io."),
CNAME("www", "openstreetmap.github.io."),
A("preview", NAGA_IPV4_HE),
AAAA("preview", NAGA_IPV6_HE)
A("preview", IPV4["naga.he"]),
AAAA("preview", IPV6["naga.he"])

);
Loading
Loading