apertodns 1.1.0 → 1.2.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 (3) hide show
  1. package/index.js +6 -5
  2. package/package.json +1 -1
  3. package/README.md +0 -248
package/index.js CHANGED
@@ -1300,18 +1300,19 @@ const setup = async () => {
1300
1300
  ]);
1301
1301
 
1302
1302
  const spin = spinner("Login in corso...").start();
1303
- const res = await fetch(`${API_BASE}/auth/login`, {
1303
+ const res = await fetch(`${API_BASE}/auth/cli-login`, {
1304
1304
  method: "POST",
1305
1305
  headers: { "Content-Type": "application/json" },
1306
1306
  body: JSON.stringify({ email, password })
1307
1307
  });
1308
1308
  const data = await res.json();
1309
1309
 
1310
- if (!res.ok || !data.cliToken) {
1311
- spin.fail("Login fallito: " + (data.message || "Errore"));
1310
+ if (!res.ok || !data.token) {
1311
+ spin.fail("Login fallito: " + (data.error || data.message || "Errore"));
1312
1312
  return;
1313
1313
  }
1314
- apiToken = data.cliToken;
1314
+ apiToken = data.token;
1315
+ config.jwtToken = data.token;
1315
1316
  spin.succeed("Login effettuato!");
1316
1317
  } else {
1317
1318
  // Registrazione solo via web per sicurezza (captcha)
@@ -1321,7 +1322,7 @@ const setup = async () => {
1321
1322
  }
1322
1323
 
1323
1324
  const remoteConfig = await fetchRemoteConfig(apiToken);
1324
- config = remoteConfig ? { ...remoteConfig, apiToken } : { apiToken };
1325
+ config = remoteConfig ? { ...remoteConfig, jwtToken: apiToken } : { jwtToken: apiToken };
1325
1326
 
1326
1327
  const { save } = await inquirer.prompt([{
1327
1328
  type: "confirm",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apertodns",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "description": "ApertoDNS CLI - Dynamic DNS management from your terminal. Manage domains, tokens, API keys and DNS updates with style.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/README.md DELETED
@@ -1,248 +0,0 @@
1
- # ApertoDNS CLI
2
-
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/1r0n3d3v3l0per/apertodns/blob/main/LICENSE)
5
- [![node](https://img.shields.io/node/v/apertodns.svg)](https://nodejs.org)
6
-
7
- **Dynamic DNS management from your terminal.** Manage domains, tokens, API keys, and DNS updates with style.
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, NAS systems, and remote access.
10
-
11
- ## Features
12
-
13
- - **Easy Setup** - Login or register directly from CLI
14
- - **Multiple Domains** - Manage unlimited subdomains
15
- - **API Keys** - Create and manage API keys with granular scopes
16
- - **Auto Updates** - Set up cron or daemon mode for automatic IP updates
17
- - **Interactive Mode** - Beautiful terminal UI with menus
18
- - **JSON Output** - Machine-readable output for scripting
19
- - **IPv4 & IPv6** - Full dual-stack support
20
- - **Real-time Stats** - View usage statistics and logs
21
- - **Router/NAS Compatible** - Works with Synology, QNAP, and DynDNS2-compatible routers
22
-
23
- ## Requirements
24
-
25
- - Node.js 18.0.0 or higher
26
- - An ApertoDNS account ([register free](https://apertodns.com/register))
27
-
28
- ## Installation
29
-
30
- ```bash
31
- npm install -g apertodns
32
- ```
33
-
34
- Or use without installing:
35
-
36
- ```bash
37
- npx apertodns --help
38
- ```
39
-
40
- ## Quick Start
41
-
42
- ```bash
43
- # 1. Setup (login or register)
44
- apertodns --setup
45
-
46
- # 2. View your dashboard
47
- apertodns --dashboard
48
-
49
- # 3. List your domains
50
- apertodns --domains
51
-
52
- # 4. Force DNS update
53
- apertodns --force
54
- ```
55
-
56
- ## Commands
57
-
58
- ### Main Commands
59
-
60
- | Command | Description |
61
- |---------|-------------|
62
- | `--dashboard` | Complete dashboard with all info |
63
- | `--domains` | List all your domains |
64
- | `--tokens` | List all your tokens |
65
- | `--stats` | Statistics and metrics |
66
- | `--logs` | Recent activity logs |
67
- | `--my-ip` | Show your current public IP |
68
-
69
- ### Domain Management
70
-
71
- | Command | Description |
72
- |---------|-------------|
73
- | `--add-domain <name>` | Create a new subdomain |
74
- | `--delete-domain` | Delete a domain (interactive) |
75
- | `--test <domain>` | Test DNS resolution |
76
-
77
- ### Token Management
78
-
79
- | Command | Description |
80
- |---------|-------------|
81
- | `--enable <id>` | Enable a token |
82
- | `--disable <id>` | Disable a token |
83
- | `--toggle <id>` | Toggle token state |
84
- | `--verify` | Verify token validity |
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
-
96
- ### Configuration
97
-
98
- | Command | Description |
99
- |---------|-------------|
100
- | `--setup` | Guided setup (login/register) |
101
- | `--status` | Show current status and IP |
102
- | `--config` | Edit configuration |
103
- | `--logout` | Remove local configuration |
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
- |--------|-------------|
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 |
122
-
123
- ## Interactive Mode
124
-
125
- Run `apertodns` without arguments for an interactive menu with all options.
126
-
127
- ```bash
128
- apertodns
129
- ```
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
-
166
- ## Automatic Updates (Cron)
167
-
168
- Set up automatic IP updates with cron:
169
-
170
- ```bash
171
- # Update every 5 minutes
172
- */5 * * * * /usr/local/bin/apertodns --cron >> /var/log/apertodns.log 2>&1
173
-
174
- # Or every minute for faster updates
175
- * * * * * /usr/local/bin/apertodns --cron
176
- ```
177
-
178
- Find your apertodns path with: `which apertodns`
179
-
180
- ## Router Integration (DynDNS2)
181
-
182
- ApertoDNS is compatible with routers that support DynDNS2 protocol:
183
-
184
- ```
185
- Server: api.apertodns.com
186
- Protocol: DynDNS2
187
- Path: /nic/update
188
- Username: your-token
189
- Password: your-token
190
- Hostname: yourdomain.apertodns.com
191
- ```
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
-
233
- ## Links
234
-
235
- - **Website**: [apertodns.com](https://apertodns.com)
236
- - **Dashboard**: [apertodns.com/dashboard](https://apertodns.com/dashboard)
237
- - **Documentation**: [apertodns.com/docs](https://apertodns.com/docs)
238
- - **Issues**: [GitHub Issues](https://github.com/1r0n3d3v3l0per/apertodns/issues)
239
-
240
- ## Support
241
-
242
- Need help?
243
- - Open an issue on [GitHub](https://github.com/1r0n3d3v3l0per/apertodns/issues)
244
- - Email: support@apertodns.com
245
-
246
- ## License
247
-
248
- MIT - [Aperto Network](https://apertodns.com)