cf-dns-updater
Advanced tools
Comparing version 3.0.2 to 3.0.3
{ | ||
"name": "cf-dns-updater", | ||
"version": "3.0.2", | ||
"version": "3.0.3", | ||
"description": "Update a DNS record on CloudFlare with a new IP", | ||
@@ -14,3 +14,3 @@ "type": "module", | ||
"scripts": { | ||
"test": "echo 'No tests defined'" | ||
"test": "eslint ." | ||
}, | ||
@@ -17,0 +17,0 @@ "engines": { |
@@ -56,3 +56,3 @@ # cf-dns-updater | ||
Requires Node 14 or above. | ||
Requires Node 18 or above. | ||
@@ -74,4 +74,16 @@ ```js | ||
## Docker usage | ||
The `ghcr.io/rexxars/cf-dns-updater:latest` [Docker image](https://github.com/rexxars/cf-dns-updater/pkgs/container/cf-dns-updater) can be used to update a DNS record. In this case, you'll want to use environment variables to configure the tool: | ||
```bash | ||
docker run \ | ||
-e CF_ZONE_ID=yourZoneId \ | ||
-e CF_DNS_RECORD_ID=yourRecordId \ | ||
-e CF_API_TOKEN=yourApiToken \ | ||
ghcr.io/rexxars/cf-dns-updater:latest | ||
``` | ||
## License | ||
MIT © [Espen Hovlandsdal](https://espen.codes/) |
@@ -16,2 +16,3 @@ #!/usr/bin/env node | ||
const trim = (item) => `${item || ''}`.trim() | ||
const trimEnv = (item) => (typeof item === 'undefined' || item === '' ? undefined : item.trim()) | ||
@@ -82,7 +83,7 @@ updateNotifier({pkg}).notify() | ||
const options = { | ||
zone: process.env.CF_ZONE_ID, | ||
record: process.env.CF_DNS_RECORD_ID, | ||
email: process.env.CF_AUTH_EMAIL, | ||
apiKey: process.env.CF_API_KEY, | ||
apiToken: process.env.CF_API_TOKEN, | ||
zone: trimEnv(process.env.CF_ZONE_ID), | ||
record: trimEnv(process.env.CF_DNS_RECORD_ID), | ||
email: trimEnv(process.env.CF_AUTH_EMAIL), | ||
apiKey: trimEnv(process.env.CF_API_KEY), | ||
apiToken: trimEnv(process.env.CF_API_TOKEN), | ||
...cli.flags, | ||
@@ -89,0 +90,0 @@ } |
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
11997
257
1
88