aptunnel 1.1.0 → 1.1.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 +1 -1
- package/package.json +1 -1
- package/src/commands/config.js +2 -2
- package/src/commands/tunnel.js +1 -1
- package/src/lib/config-manager.js +7 -6
package/README.md
CHANGED
|
@@ -155,7 +155,7 @@ dev ekaredb-redis dev-redis 55555 DOWN - - -
|
|
|
155
155
|
```bash
|
|
156
156
|
aptunnel login # uses saved credentials, supports 2FA
|
|
157
157
|
aptunnel login --email=x@y.com --password=secret
|
|
158
|
-
aptunnel login --lifetime=
|
|
158
|
+
aptunnel login --lifetime=7d # custom token lifetime (max: 7d)
|
|
159
159
|
aptunnel login --status # show token info only
|
|
160
160
|
```
|
|
161
161
|
|
package/package.json
CHANGED
package/src/commands/config.js
CHANGED
|
@@ -26,8 +26,8 @@ export async function runConfig(args) {
|
|
|
26
26
|
if (setPortArg !== -1) {
|
|
27
27
|
const alias = args[setPortArg + 1];
|
|
28
28
|
const port = parseInt(args[setPortArg + 2], 10);
|
|
29
|
-
if (!alias || isNaN(port)) {
|
|
30
|
-
logger.error('Usage: aptunnel config --set-port <alias> <port>');
|
|
29
|
+
if (!alias || isNaN(port) || port < 1 || port > 65535) {
|
|
30
|
+
logger.error('Usage: aptunnel config --set-port <alias> <port> (port must be 1–65535)');
|
|
31
31
|
process.exit(1);
|
|
32
32
|
}
|
|
33
33
|
setPort(alias, port);
|
package/src/commands/tunnel.js
CHANGED
|
@@ -226,7 +226,7 @@ function printConnectionInfo(alias, port, conn) {
|
|
|
226
226
|
logger.detail('Port:', String(conn.port ?? port));
|
|
227
227
|
logger.detail('Host:', conn.host ?? 'localhost.aptible.in');
|
|
228
228
|
logger.detail('User:', conn.user ?? 'aptible');
|
|
229
|
-
logger.detail('Password:', conn.password ? chalk.dim(conn.password) : chalk.dim('(not parsed)'));
|
|
229
|
+
logger.detail('Password:', conn.password ? chalk.dim('*'.repeat(Math.min(conn.password.length, 12))) : chalk.dim('(not parsed)'));
|
|
230
230
|
logger.detail('URL:', conn.url ? chalk.cyan(conn.url) : chalk.dim('(not parsed)'));
|
|
231
231
|
logger.detail('PID:', String(readPid(toIdentifier(alias)) ?? '?'));
|
|
232
232
|
console.log('');
|
|
@@ -81,13 +81,14 @@ export function savePassword(password) {
|
|
|
81
81
|
|
|
82
82
|
if (platform() === 'win32') {
|
|
83
83
|
// On Windows chmod doesn't restrict access — use icacls
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const username = process.env.USERNAME ?? process.env.USER ?? '';
|
|
85
|
+
if (username) {
|
|
86
|
+
const r = spawnSync('icacls', [credsPath, '/inheritance:r', '/grant:r', `${username}:(R,W)`], { encoding: 'utf8' });
|
|
87
|
+
if (r.status !== 0) {
|
|
88
|
+
process.stderr.write(`[aptunnel] Warning: could not restrict permissions on credentials file: ${credsPath}\n`);
|
|
88
89
|
}
|
|
89
|
-
}
|
|
90
|
-
|
|
90
|
+
} else {
|
|
91
|
+
process.stderr.write(`[aptunnel] Warning: could not determine current user — credentials file may not be permission-restricted.\n`);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}
|