@zerodot/tailscale 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.
Files changed (2) hide show
  1. package/README.md +50 -10
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,21 +1,61 @@
1
1
  # @zerodot/tailscale
2
2
 
3
- Tailscale node package for zerodot.
3
+ <img src="https://raw.githubusercontent.com/zerodot-io/nodes/main/packages/tailscale/tailscale.svg" alt="Tailscale logo" width="48" height="48">
4
4
 
5
- ## Credential
5
+ List, get, authorize, and delete devices in a Tailscale tailnet, and get the DNS nameservers of the tailnet. The node calls the Tailscale API v2 (`https://api.tailscale.com/api/v2`) with an API access token. It has no trigger.
6
6
 
7
- Create a **Tailscale API key** credential with an API access token and the tailnet to manage.
7
+ ## Install
8
8
 
9
- - **API key**: create an API access token in the [Tailscale admin console](https://login.tailscale.com/admin/settings/keys).
10
- - **Tailnet**: the tailnet name or ID. Use `-` for the default tailnet of the API key.
9
+ In zerodot, go to **System > Nodes** and install **Tailscale**.
11
10
 
12
- ## Operations
11
+ Manual: install `@zerodot/tailscale` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
12
+
13
+ ## Nodes
14
+
15
+ ### Tailscale (`tailscale.api`)
13
16
 
14
17
  - **Device**: List, Get, Authorize, Delete
15
18
  - **DNS**: Get Nameservers
16
19
 
17
- ## Notes
20
+ **Device ID.** Get, Authorize, and Delete need **Device ID** (`deviceId`), the ID of the device in Tailscale.
21
+
22
+ **List.** Lists the devices of the tailnet of the credential. The request is `/api/v2/tailnet/<tailnet>/devices`.
23
+
24
+ **Get.** Returns one device.
25
+
26
+ **Authorize.** Sends a POST request with the body `{ "authorized": true }` to the device. The node only sets the device to authorized. This is for tailnets that require device approval.
27
+
28
+ **Delete.** Sends a DELETE request for the device. The node does not ask for confirmation.
29
+
30
+ **Get Nameservers.** Gets the global DNS nameservers of the tailnet of the credential. The request is `/api/v2/tailnet/<tailnet>/dns/nameservers`.
31
+
32
+ **Output.** The node returns the JSON answer of Tailscale in `data`. The answer is not changed. For example, the List answer has the devices under `devices`. When Tailscale sends no body, the output is `{ "success": true }`.
33
+
34
+ **Errors.** When Tailscale returns an error, the run fails. The message has the status code and the message from Tailscale. For status 401, 403, 404, and 429, the message also has a short hint.
35
+
36
+ **Limits.** Each call stops after **Timeout** (`timeoutMs`, default 30000 ms, maximum 300000 ms). The node does not retry.
37
+
38
+ **Binary data.** The node does not read or write binary data.
39
+
40
+ **Destructive operations.** **Delete** removes a device with its ID. Authorize changes the approval of a device.
41
+
42
+ ## Credentials
43
+
44
+ ### Tailscale API key (`tailscale.apiKey`)
45
+
46
+ - **API Key** (`apiKey`): an API access token from the Tailscale admin console. This field is secret.
47
+ - **Tailnet** (`tailnet`): the tailnet name or ID. Use `-` for the default tailnet of the API key. The default is `-`.
48
+
49
+ The node sends the key as a Bearer token. The credential test lists the devices of the tailnet.
50
+
51
+ Setup:
52
+
53
+ 1. In the [Tailscale admin console](https://login.tailscale.com/admin/settings/keys), create an API access token.
54
+ 2. Copy the token.
55
+ 3. In zerodot, create a **Tailscale API key** credential.
56
+ 4. Paste the token into **API Key**. Enter the tailnet name, or `-` for the default tailnet.
57
+ 5. Save the credential. zerodot runs the test.
58
+
59
+ ## License
18
60
 
19
- - Tailscale API base URL: `https://api.tailscale.com/api/v2`
20
- - Device authorize marks a device as authorized for tailnets that require device approval.
21
- - DNS Get Nameservers returns the global DNS nameservers for the configured tailnet.
61
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@zerodot/tailscale",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "List and manage devices and DNS settings in a Tailscale tailnet. Use it to inspect devices, authorize or remove devices, and read DNS nameservers.",
5
5
  "license": "AGPL-3.0-only",
6
+ "homepage": "https://github.com/zerodot-io/nodes/tree/main/packages/tailscale",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/zerodot-io/nodes.git",