@dns-data/remote 0.2.6 → 0.2.7
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 +10 -1
- package/bin/desktop-shortcut.js +90 -0
- package/bin/dns-data.js +12 -1
- package/package.json +33 -32
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Version 0.2.4: Local launcher reports confirmed monthly Free quota exhaustion an
|
|
|
15
15
|
|
|
16
16
|
Version 0.2.5: bounded retries for transient control network failures, longer policy and WebSocket handshake timeouts, and corrected response-body cancellation. Authoritative device/account denials are not overridden. Hardware and entitlement verification remain mandatory on every start and reconnect.
|
|
17
17
|
|
|
18
|
-
Version 0.2.6
|
|
18
|
+
Version 0.2.6 official release: macOS users continue starting with
|
|
19
19
|
npx -y @dns-data/remote@latest; the same native Agent now includes LAN Direct
|
|
20
20
|
v3 from the Windows implementation. The launcher installs this verified Agent
|
|
21
21
|
under ~/Library/Application Support/DNS-DATA/Remote-Agent/ so ordinary npm
|
|
@@ -25,3 +25,12 @@ remain in force; this package does not disable or bypass them. The Agent
|
|
|
25
25
|
performs authorized full-file direct LAN copies over TLS 1.3 and TCP 443
|
|
26
26
|
without an intermediate server handling file bytes. Desktop and Documents
|
|
27
27
|
folder access is still subject to macOS file privacy authorization.
|
|
28
|
+
|
|
29
|
+
Version 0.2.7 candidate (not published): Running npx -y @dns-data/remote@latest
|
|
30
|
+
now creates or repairs a single DNS-DATA desktop launcher automatically for
|
|
31
|
+
Windows x64 (DNS-DATA.cmd) and macOS Apple Silicon (DNS-DATA.command).
|
|
32
|
+
Normal startup works for both newly enrolled and already-bound devices.
|
|
33
|
+
The desktop shortcut always executes npm @latest, not a fixed local binary.
|
|
34
|
+
Repeated runs do not duplicate it; unrelated user files and symlinks are
|
|
35
|
+
not replaced. Failure to write the Desktop does not prevent service startup.
|
|
36
|
+
No extra Mac app, SSH, SMB, file relay or changes to account entitlements.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
const crypto = require('crypto');
|
|
7
|
+
const {execFileSync} = require('child_process');
|
|
8
|
+
|
|
9
|
+
// The desktop shortcut is user-facing; the native Agent and the actual
|
|
10
|
+
// service always run from the npm package, never a second installed app.
|
|
11
|
+
const CONTENT = Object.freeze({
|
|
12
|
+
darwin: '#!/bin/zsh\n' +
|
|
13
|
+
'cd "$HOME"\n' +
|
|
14
|
+
'export PATH="$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:$PATH"\n' +
|
|
15
|
+
'exec npx -y @dns-data/remote@latest\n',
|
|
16
|
+
win32: '@echo off\r\n' +
|
|
17
|
+
'cd /d "%USERPROFILE%"\r\n' +
|
|
18
|
+
'npx -y @dns-data/remote@latest\r\n' +
|
|
19
|
+
'if errorlevel 1 pause\r\n'
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function windowsDesktop(home) {
|
|
23
|
+
// Supports OneDrive, redirected and non-English Windows desktop locations.
|
|
24
|
+
try {
|
|
25
|
+
const resolved = execFileSync('powershell.exe', [
|
|
26
|
+
'-NoLogo', '-NoProfile', '-NonInteractive', '-Command',
|
|
27
|
+
'[Environment]::GetFolderPath("Desktop")'
|
|
28
|
+
], {encoding:'utf8', timeout:6000, windowsHide:true, stdio:['ignore','pipe','ignore']}).trim();
|
|
29
|
+
if (resolved && fs.existsSync(resolved) && fs.statSync(resolved).isDirectory()) {
|
|
30
|
+
return resolved;
|
|
31
|
+
}
|
|
32
|
+
} catch (_) {}
|
|
33
|
+
const options = [
|
|
34
|
+
process.env.OneDrive ? path.join(process.env.OneDrive, 'Desktop') : '',
|
|
35
|
+
process.env.OneDriveCommercial ? path.join(process.env.OneDriveCommercial, 'Desktop') : '',
|
|
36
|
+
path.join(home, 'Desktop')
|
|
37
|
+
];
|
|
38
|
+
return options.find(x => x && fs.existsSync(x) && fs.statSync(x).isDirectory()) ||
|
|
39
|
+
path.join(home,'Desktop');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// No overwrite of arbitrary user scripts, folders or symlinks.
|
|
43
|
+
function recognizedOldLauncher(text) {
|
|
44
|
+
return text.includes('@dns-data/remote') ||
|
|
45
|
+
(text.includes('DNS-DATA') && text.includes('dns-data.js'));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function ensureDesktopShortcut({platform=process.platform, desktop=null, home=os.homedir()}={}) {
|
|
49
|
+
if (!Object.hasOwn(CONTENT,platform)) {
|
|
50
|
+
throw Error('Unsupported desktop shortcut platform');
|
|
51
|
+
}
|
|
52
|
+
const dir = desktop || (platform==='win32' ? windowsDesktop(home) : path.join(home,'Desktop'));
|
|
53
|
+
const dirInfo=fs.statSync(dir);
|
|
54
|
+
if (!dirInfo.isDirectory()) throw Error('Desktop directory is not a folder');
|
|
55
|
+
const name=platform==='darwin' ? 'DNS-DATA.command' : 'DNS-DATA.cmd';
|
|
56
|
+
const filename=path.join(dir,name);
|
|
57
|
+
const expected=CONTENT[platform];
|
|
58
|
+
let oldText=null;
|
|
59
|
+
try {
|
|
60
|
+
const st=fs.lstatSync(filename);
|
|
61
|
+
if (!st.isFile() || st.isSymbolicLink()) {
|
|
62
|
+
throw Error('Desktop shortcut path is not a regular file');
|
|
63
|
+
}
|
|
64
|
+
oldText=fs.readFileSync(filename,'utf8');
|
|
65
|
+
if (oldText===expected) {
|
|
66
|
+
if (platform==='darwin' && (st.mode & 0o111)===0) fs.chmodSync(filename,0o755);
|
|
67
|
+
return {path:filename, changed:false};
|
|
68
|
+
}
|
|
69
|
+
if (!recognizedOldLauncher(oldText)) {
|
|
70
|
+
throw Error('Existing desktop script is not a DNS-DATA launcher; preserved');
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
if (e.code!=='ENOENT') throw e;
|
|
74
|
+
}
|
|
75
|
+
const tmp=path.join(dir,'.dns-data-shortcut-'+process.pid+'-'+crypto.randomBytes(8).toString('hex'));
|
|
76
|
+
try {
|
|
77
|
+
const fd=fs.openSync(tmp,'wx',0o600);
|
|
78
|
+
try {
|
|
79
|
+
fs.writeFileSync(fd,expected,'utf8');
|
|
80
|
+
fs.fsyncSync(fd);
|
|
81
|
+
} finally { fs.closeSync(fd); }
|
|
82
|
+
fs.chmodSync(tmp,platform==='darwin' ? 0o755 : 0o644);
|
|
83
|
+
fs.renameSync(tmp,filename);
|
|
84
|
+
} finally {
|
|
85
|
+
try { fs.unlinkSync(tmp); } catch (e) { if(e.code!=='ENOENT') throw e; }
|
|
86
|
+
}
|
|
87
|
+
return {path:filename, changed:true};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
module.exports={ensureDesktopShortcut};
|
package/bin/dns-data.js
CHANGED
|
@@ -67,7 +67,7 @@ const args=process.argv.slice(2);
|
|
|
67
67
|
const safe=new Set(['--start','--pair-only','--hardware-check','--pair-probe','--policy-check']);
|
|
68
68
|
const isPreview=args.length===1&&args[0]==='--flow-preview';
|
|
69
69
|
if(isPreview){
|
|
70
|
-
console.log('DNS-DATA 0.2.
|
|
70
|
+
console.log('DNS-DATA 0.2.7: fresh motherboard/CPU/GPU + account -> native Go executor via npx');
|
|
71
71
|
console.log('New device: eight-digit pairing -> fresh hardware recheck -> built-in remote service (no .NET)');
|
|
72
72
|
console.log('V1 pairing, V1 device startup and legacy bootstrap: disabled');
|
|
73
73
|
process.exit(0);
|
|
@@ -79,6 +79,17 @@ const isNativeLANCopy=['win32','darwin'].includes(process.platform) &&
|
|
|
79
79
|
[args[1],args[3]].every(p=>typeof p==='string' && p.length>0 && p.length<4096 &&
|
|
80
80
|
path.isAbsolute(p) && [0,10,13].every(c=>!p.includes(String.fromCharCode(c))));
|
|
81
81
|
if(!isNativeLANCopy && (args.length>1||args.some(a=>!safe.has(a)))){console.error('[ERROR] Unknown or unsafe DNS-DATA arguments.');process.exit(2);}
|
|
82
|
+
// Create or repair one desktop shortcut on every ordinary npm startup, also
|
|
83
|
+
// for already-bound devices. Never trigger this for diagnostic or transfer verbs.
|
|
84
|
+
if(args.length===0 || (args.length===1 && (args[0]==='--start' || args[0]==='--pair-only'))){
|
|
85
|
+
try {
|
|
86
|
+
const shortcut=require('./desktop-shortcut').ensureDesktopShortcut();
|
|
87
|
+
if(shortcut.changed) console.log('DNS-DATA desktop launcher ready: '+shortcut.path);
|
|
88
|
+
} catch(e) {
|
|
89
|
+
// Desktop/OneDrive permissions must not prevent the existing service running.
|
|
90
|
+
console.warn('[WARN] DNS-DATA desktop launcher: '+e.message);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
82
93
|
console.log('DNS-DATA Remote Connection - V2');
|
|
83
94
|
const child=spawn(runtimeBinary,args,{stdio:'inherit',shell:false,windowsHide:false,env:process.env});
|
|
84
95
|
let done=false;
|
package/package.json
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@dns-data/remote",
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"description": "DNS-DATA native Windows and macOS launcher with automatic npm desktop shortcuts and LAN Direct v3",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": false,
|
|
7
|
+
"bin": {
|
|
8
|
+
"dns-data": "bin/dns-data.js"
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": "\u003e=18"
|
|
12
|
+
},
|
|
13
|
+
"os": [
|
|
14
|
+
"win32",
|
|
15
|
+
"darwin"
|
|
16
|
+
],
|
|
17
|
+
"files": [
|
|
18
|
+
"bin/dns-data.js",
|
|
19
|
+
"bin/desktop-shortcut.js",
|
|
20
|
+
"native/windows-x64.exe",
|
|
21
|
+
"native/macos-arm64",
|
|
22
|
+
"README.md",
|
|
23
|
+
"DISCLOSURE"
|
|
24
|
+
],
|
|
25
|
+
"keywords": [
|
|
26
|
+
"dns-data",
|
|
27
|
+
"mcp",
|
|
28
|
+
"remote",
|
|
29
|
+
"native-launcher"
|
|
30
|
+
],
|
|
31
|
+
"contentPolicy": {
|
|
32
|
+
"class": "dual-use"
|
|
33
|
+
}
|
|
33
34
|
}
|