@zerodot/technitium-dns 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,22 +1,74 @@
1
1
  # @zerodot/technitium-dns
2
2
 
3
- Technitium DNS node package for zerodot.
3
+ <img src="https://raw.githubusercontent.com/zerodot-io/nodes/main/packages/technitium-dns/technitium-dns.svg" alt="Technitium DNS logo" width="48" height="48">
4
4
 
5
- ## Credential
5
+ Manage zones and DNS records in Technitium DNS Server. List, create, inspect, and delete zones. Add DNS records, and get the records of a domain or a zone. The node calls the HTTP API of your own Technitium DNS Server with an API token.
6
6
 
7
- Create a **Technitium DNS API token** credential with:
7
+ ## Install
8
8
 
9
- - **Server URL**: Base URL of your Technitium DNS Server, for example `http://localhost:5380`
10
- - **API Token**: API token created in Technitium DNS Server
9
+ In zerodot, go to **System > Nodes** and install **Technitium DNS**.
11
10
 
12
- ## Operations
11
+ Manual: install `@zerodot/technitium-dns` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
12
+
13
+ ## Nodes
14
+
15
+ ### Technitium DNS (`technitium_dns.api`)
13
16
 
14
17
  - **Zone**: Get All, Create, Get Options, Delete
15
18
  - **Record**: Add, Get Many
16
19
 
17
- ## Notes
20
+ **Zone.**
21
+
22
+ - **Get All** lists the zones of the server.
23
+ - **Create** makes a zone. **Zone** is required, for example `example.com`. **Zone Type** is `Primary` by default. The other types are Secondary, Stub, Forwarder, SecondaryForwarder, Catalog, and SecondaryCatalog. **Primary Name Server Addresses** takes comma-separated addresses or names. It is used for Secondary, Stub, SecondaryForwarder, and SecondaryCatalog zones.
24
+ - **Get Options** reads the options of a zone. The node also asks for the available TSIG key names and catalog zone names.
25
+ - **Delete** removes the zone that is named in **Zone**.
26
+
27
+ **Record.**
28
+
29
+ - **Add** adds a record. **Domain** is required. **Zone** is optional. When it is empty, Technitium DNS uses the closest authoritative zone. **Record Type** is `A` by default.
30
+ - The node checks these fields for each record type:
31
+ - A and AAAA: **IP Address**
32
+ - CNAME: **CNAME**
33
+ - NS: **Name Server**
34
+ - PTR: **PTR Name**
35
+ - MX: **Exchange** and **Preference**
36
+ - TXT: **Text**
37
+ - SRV, DNAME, CAA, ANAME, FWD, and APP: the node has no field for their type-specific data.
38
+ - The common fields are **TTL** (in seconds; the server default is used when it is empty) and **Comments**.
39
+ - **Overwrite** is off by default. When it is on, the record set of the selected type is replaced.
40
+ - **Get Many** gets the records of **Domain**. **List Zone** is off by default. When it is on, the node gets all records of the zone, not only the records of the domain.
41
+
42
+ ### Behavior notes
43
+
44
+ - **Zone names and domains.** The node removes spaces at the start and end of a name. It sends the name as you enter it.
45
+ - **Requests.** Every operation uses an HTTP GET request. This includes Create, Add, and Delete.
46
+ - **Output.** The node returns the JSON answer of Technitium DNS. For example, the answer has `status` and `response`. A JSON answer that is not an object is returned as `{ "value": ... }`. An empty answer is returned as `{ "success": true }`.
47
+ - **Errors.** The node fails when the HTTP status is an error. It also fails when the answer has `status` set to `error` or `invalid-token`, even with an HTTP 200. The message has the text from Technitium DNS and a hint. The API token is never in the message.
48
+ - **Destructive operations.** **Delete** removes a zone. **Add** with **Overwrite** on replaces the record set of that type.
49
+ - **Pagination.** None. Each run makes one call.
50
+ - **Binary data.** None.
51
+ - **Timeout.** The **Timeout** setting is in milliseconds. It is 30000 by default and up to 300000.
52
+ - **Retries.** None. A redirect makes the call fail.
53
+
54
+ ## Credentials
55
+
56
+ ### Technitium DNS API token (`technitium_dns.apiToken`)
57
+
58
+ - **Server URL** (`serverUrl`): the base URL of your server, for example `http://localhost:5380`. This value is not secret. Trailing slashes are removed.
59
+ - **API Token** (`apiToken`): the API token from Technitium DNS Server. This value is secret.
60
+
61
+ The token is sent as a Bearer token in the `Authorization` header of each request. The package does not set token scopes. A 403 error can mean that the token has no access to the zone or the action.
62
+
63
+ The credential is tested with `GET /api/user/session/get`.
64
+
65
+ Setup:
66
+
67
+ 1. Open your Technitium DNS Server.
68
+ 2. Create an API token in Technitium DNS Server.
69
+ 3. In zerodot, create a **Technitium DNS API token** credential. Enter the server URL and the token.
70
+ 4. Save the credential. zerodot runs the test.
71
+
72
+ ## License
18
73
 
19
- - Technitium DNS API base path: `/api/...` on your server URL
20
- - The credential is tested with `GET /api/user/session/get`
21
- - Zone operations use the zone domain name (for example `example.com`)
22
- - Record operations take a domain and optional zone name; record add supports common record fields such as A/AAAA, CNAME, NS, PTR, MX, and TXT
74
+ AGPL-3.0-only
package/dist/index.cjs CHANGED
@@ -40,7 +40,7 @@ function detailOf(answer) {
40
40
  ]) {
41
41
  const value = body[key];
42
42
  if (key === "status") {
43
- if (value === "error" || value === "invalid-token") continue;
43
+ if (value === "ok" || value === "error" || value === "invalid-token") continue;
44
44
  }
45
45
  if (typeof value === "string" && value.trim() !== "") return value.trim();
46
46
  }
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@zerodot/technitium-dns",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Manage zones and DNS records in Technitium DNS Server. Use it to list, create, and delete zones, inspect zone options, and work with DNS records.",
5
5
  "license": "AGPL-3.0-only",
6
+ "homepage": "https://github.com/zerodot-io/nodes/tree/main/packages/technitium-dns",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/zerodot-io/nodes.git",
@@ -1,38 +1 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <!-- Created with Inkscape (http://www.inkscape.org/) -->
3
-
4
- <svg
5
- version="1.1"
6
- id="svg1"
7
- width="200"
8
- height="200"
9
- viewBox="0 0 200 200"
10
- sodipodi:docname="technitium.png"
11
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
13
- xmlns:xlink="http://www.w3.org/1999/xlink"
14
- xmlns="http://www.w3.org/2000/svg"
15
- xmlns:svg="http://www.w3.org/2000/svg">
16
- <defs
17
- id="defs1" />
18
- <sodipodi:namedview
19
- id="namedview1"
20
- pagecolor="#ffffff"
21
- bordercolor="#000000"
22
- borderopacity="0.25"
23
- inkscape:showpageshadow="2"
24
- inkscape:pageopacity="0.0"
25
- inkscape:pagecheckerboard="0"
26
- inkscape:deskcolor="#d1d1d1" />
27
- <g
28
- inkscape:groupmode="layer"
29
- inkscape:label="Image"
30
- id="g1">
31
- <image
32
- width="200"
33
- height="200"
34
- preserveAspectRatio="none"
35
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIAgMAAADQNkYNAAAADFBMVEVmmf+Msv+yzP////+SQxlN&#10;AAAAsklEQVR4Ae3WgQXDUBCH8VMUCbpHl+g+maIjdIQCmoOOkFU6QgBU5eqknpbjNIQnvg/wnh/A&#10;3wnVWqd5V5G9er14g+WNIq15U30EAoFAyvTd58d4+gr56WDeS+IgkMVkMO/xRXYWB4FAINslcS0E&#10;sg45BldfQk7mjRAIBAKBLCWNerc/SGkVAoGEnTdNIBAIJF3LEgSymDQaNP8+9VMf3JZJEwQCgdRH&#10;OvUuPn15vVQavQGIzVnNMxO64QAAAABJRU5ErkJggg==&#10;"
36
- id="image1" />
37
- </g>
38
- </svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 512 512"><path d="M512 512H0V0h512zM118.1 85.8v211.7H182V85.7h211.6V22.3H22.3v63.5zm96 96.3h212.1v211.6h63.4V22.2h-63.8v96H214.2c-.1 21.3-.1 42.1-.1 63.9m-191.8-64v371.6H86v-95.8h211.6v-64.1H85.7V118.1zm95.8 371.5h371.5v-63.7h-95.8V214.2h-64.1v212H118.1z" style="fill:#6698fe"/><path d="M118.1 85.8H22.3V22.3h371.3v63.4H182v211.8h-63.9zm96 96.3v-63.9h211.6v-96h63.8v371.5h-63.4V182.1zm-191.8-64h63.3v211.7h211.9v64.1H85.9v95.8H22.2c.1-123.7.1-247.4.1-371.6m95.8 371.5v-63.4h211.6v-212h64.1v211.7h95.8v63.7z" style="fill:#fefefe"/></svg>