apertodns 1.0.1 → 1.1.0

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 (4) hide show
  1. package/README.md +123 -9
  2. package/index.js +817 -206
  3. package/package.json +58 -49
  4. package/utils.js +151 -14
package/README.md CHANGED
@@ -1,26 +1,29 @@
1
- # ApertoDNS
1
+ # ApertoDNS CLI
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/apertodns.svg)](https://www.npmjs.com/package/apertodns)
4
- [![license](https://img.shields.io/npm/l/apertodns.svg)](https://github.com/apertonetwork/apertodns/blob/main/LICENSE)
4
+ [![license](https://img.shields.io/npm/l/apertodns.svg)](https://github.com/1r0n3d3v3l0per/apertodns/blob/main/LICENSE)
5
5
  [![node](https://img.shields.io/node/v/apertodns.svg)](https://nodejs.org)
6
6
 
7
- **Dynamic DNS management from your terminal.** Manage domains, tokens, and DNS updates with style.
7
+ **Dynamic DNS management from your terminal.** Manage domains, tokens, API keys, and DNS updates with style.
8
8
 
9
- ApertoDNS is a free Dynamic DNS service that lets you point a subdomain to your dynamic IP address. Perfect for home servers, IoT devices, game servers, and remote access.
9
+ ApertoDNS is a free Dynamic DNS service that lets you point a subdomain to your dynamic IP address. Perfect for home servers, IoT devices, game servers, NAS systems, and remote access.
10
10
 
11
11
  ## Features
12
12
 
13
13
  - **Easy Setup** - Login or register directly from CLI
14
14
  - **Multiple Domains** - Manage unlimited subdomains
15
- - **Auto Updates** - Set up cron for automatic IP updates
15
+ - **API Keys** - Create and manage API keys with granular scopes
16
+ - **Auto Updates** - Set up cron or daemon mode for automatic IP updates
16
17
  - **Interactive Mode** - Beautiful terminal UI with menus
18
+ - **JSON Output** - Machine-readable output for scripting
17
19
  - **IPv4 & IPv6** - Full dual-stack support
18
20
  - **Real-time Stats** - View usage statistics and logs
21
+ - **Router/NAS Compatible** - Works with Synology, QNAP, and DynDNS2-compatible routers
19
22
 
20
23
  ## Requirements
21
24
 
22
25
  - Node.js 18.0.0 or higher
23
- - An ApertoDNS account ([register free](https://apertodns.com))
26
+ - An ApertoDNS account ([register free](https://apertodns.com/register))
24
27
 
25
28
  ## Installation
26
29
 
@@ -28,6 +31,12 @@ ApertoDNS is a free Dynamic DNS service that lets you point a subdomain to your
28
31
  npm install -g apertodns
29
32
  ```
30
33
 
34
+ Or use without installing:
35
+
36
+ ```bash
37
+ npx apertodns --help
38
+ ```
39
+
31
40
  ## Quick Start
32
41
 
33
42
  ```bash
@@ -55,6 +64,7 @@ apertodns --force
55
64
  | `--tokens` | List all your tokens |
56
65
  | `--stats` | Statistics and metrics |
57
66
  | `--logs` | Recent activity logs |
67
+ | `--my-ip` | Show your current public IP |
58
68
 
59
69
  ### Domain Management
60
70
 
@@ -73,14 +83,42 @@ apertodns --force
73
83
  | `--toggle <id>` | Toggle token state |
74
84
  | `--verify` | Verify token validity |
75
85
 
86
+ ### API Keys
87
+
88
+ | Command | Description |
89
+ |---------|-------------|
90
+ | `--api-keys` | List all API keys |
91
+ | `--create-api-key <name>` | Create new API key |
92
+ | `--delete-api-key <id>` | Delete an API key |
93
+ | `--scopes` | Show available scopes |
94
+ | `--api-key <key>` | Use API key for authentication |
95
+
76
96
  ### Configuration
77
97
 
78
98
  | Command | Description |
79
99
  |---------|-------------|
80
100
  | `--setup` | Guided setup (login/register) |
81
101
  | `--status` | Show current status and IP |
102
+ | `--config` | Edit configuration |
103
+ | `--logout` | Remove local configuration |
82
104
  | `--force` | Force DNS update now |
105
+
106
+ ### Daemon Mode
107
+
108
+ | Command | Description |
109
+ |---------|-------------|
110
+ | `--daemon` | Start daemon mode (continuous updates) |
111
+ | `--interval <sec>` | Update interval (default: 300s) |
112
+
113
+ ### Options
114
+
115
+ | Option | Description |
116
+ |--------|-------------|
83
117
  | `--cron` | Silent mode for cron jobs |
118
+ | `--quiet` | Hide banner |
119
+ | `--json` | JSON output (machine-readable) |
120
+ | `-v, --version` | Show version |
121
+ | `-h, --help` | Show help |
84
122
 
85
123
  ## Interactive Mode
86
124
 
@@ -90,6 +128,41 @@ Run `apertodns` without arguments for an interactive menu with all options.
90
128
  apertodns
91
129
  ```
92
130
 
131
+ ## Authentication Methods
132
+
133
+ You can authenticate in 3 ways:
134
+
135
+ 1. **Interactive Login** - Run `apertodns --setup` (saves JWT to ~/.config/apertodns/)
136
+ 2. **API Key** - Use `--api-key <key>` for single operations
137
+ 3. **Environment Variable** - Set `APERTODNS_API_KEY`
138
+
139
+ ## JSON Output
140
+
141
+ All commands support `--json` flag for machine-readable output:
142
+
143
+ ```bash
144
+ # Get domains as JSON
145
+ apertodns --domains --json
146
+
147
+ # Get your IP as JSON
148
+ apertodns --my-ip --json
149
+
150
+ # Combine with API key for scripting
151
+ apertodns --api-key ak_xxx... --domains --json
152
+ ```
153
+
154
+ ## Daemon Mode
155
+
156
+ Run continuously to keep your DNS updated:
157
+
158
+ ```bash
159
+ # Default interval (5 minutes)
160
+ apertodns --daemon
161
+
162
+ # Custom interval (60 seconds)
163
+ apertodns --daemon --interval 60
164
+ ```
165
+
93
166
  ## Automatic Updates (Cron)
94
167
 
95
168
  Set up automatic IP updates with cron:
@@ -111,22 +184,63 @@ ApertoDNS is compatible with routers that support DynDNS2 protocol:
111
184
  ```
112
185
  Server: api.apertodns.com
113
186
  Protocol: DynDNS2
187
+ Path: /nic/update
114
188
  Username: your-token
115
189
  Password: your-token
116
190
  Hostname: yourdomain.apertodns.com
117
191
  ```
118
192
 
193
+ ### Compatible Devices
194
+
195
+ - **Routers**: ASUS, TP-Link, Netgear, Ubiquiti, pfSense, OPNsense, DD-WRT, OpenWRT
196
+ - **NAS**: Synology DSM, QNAP QTS, TrueNAS
197
+ - **Other**: Any device supporting DynDNS2/DynDNS protocol
198
+
199
+ ## Configuration Storage
200
+
201
+ Configuration is stored in platform-specific locations:
202
+
203
+ - **Linux**: `~/.config/apertodns/` or `~/.apertodns/`
204
+ - **macOS**: `~/.config/apertodns/`
205
+ - **Windows**: `%APPDATA%\apertodns\`
206
+
207
+ ## Security
208
+
209
+ - Credentials are stored locally, never transmitted except to ApertoDNS servers
210
+ - API keys support granular scopes for least-privilege access
211
+ - All API communication uses HTTPS
212
+ - No cross-account data access - strict user isolation
213
+
214
+ ## Examples
215
+
216
+ ```bash
217
+ # Quick status check
218
+ apertodns --status
219
+
220
+ # Test DNS propagation
221
+ apertodns --test myserver.apertodns.com
222
+
223
+ # Create domain and get token
224
+ apertodns --add-domain newserver.apertodns.com
225
+
226
+ # List domains as JSON
227
+ apertodns --domains --json
228
+
229
+ # Use API key for automation
230
+ APERTODNS_API_KEY=ak_xxx... apertodns --domains --json
231
+ ```
232
+
119
233
  ## Links
120
234
 
121
235
  - **Website**: [apertodns.com](https://apertodns.com)
122
236
  - **Dashboard**: [apertodns.com/dashboard](https://apertodns.com/dashboard)
123
- - **API Docs**: [apertodns.com/docs](https://apertodns.com/docs)
124
- - **Issues**: [GitHub Issues](https://github.com/apertonetwork/apertodns/issues)
237
+ - **Documentation**: [apertodns.com/docs](https://apertodns.com/docs)
238
+ - **Issues**: [GitHub Issues](https://github.com/1r0n3d3v3l0per/apertodns/issues)
125
239
 
126
240
  ## Support
127
241
 
128
242
  Need help?
129
- - Open an issue on [GitHub](https://github.com/apertonetwork/apertodns/issues)
243
+ - Open an issue on [GitHub](https://github.com/1r0n3d3v3l0per/apertodns/issues)
130
244
  - Email: support@apertodns.com
131
245
 
132
246
  ## License