@backedrelay/relay 0.3.14 → 0.3.15
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/bin/relay.mjs +6 -6
- package/package.json +1 -1
package/bin/relay.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import {chmodSync,closeSync,copyFileSync,existsSync,linkSync,mkdirSync,openSync,
|
|
|
4
4
|
import {homedir} from 'node:os';
|
|
5
5
|
import {join,resolve,dirname,isAbsolute} from 'node:path';
|
|
6
6
|
import {spawnSync} from 'node:child_process';
|
|
7
|
-
const REPO='jtravelsworld/relay-hybrid-private-release',TAG='relay-hybrid-0.3.
|
|
8
|
-
const DIST_SHA='
|
|
7
|
+
const REPO='jtravelsworld/relay-hybrid-private-release',TAG='relay-hybrid-0.3.15-private';
|
|
8
|
+
const DIST_SHA='06fa724ba6b147ca949c567b1310bc8523ff7a4c853cefd9f9de1451ec108776';
|
|
9
9
|
const cacheBase=process.env.RELAY_CACHE_DIR;
|
|
10
10
|
if(cacheBase!==undefined&&!isAbsolute(cacheBase))throw new Error('RELAY_CACHE_DIR must be an absolute directory');
|
|
11
|
-
const cache=cacheBase===undefined?join(homedir(),'.local','share','relay-private','0.3.
|
|
11
|
+
const cache=cacheBase===undefined?join(homedir(),'.local','share','relay-private','0.3.15'):join(cacheBase,'0.3.15');
|
|
12
12
|
function hash(path){const h=createHash('sha256'),fd=openSync(path,'r'),buf=Buffer.alloc(1024*1024);try{let n;while((n=readSync(fd,buf,0,buf.length,null))>0)h.update(buf.subarray(0,n));}finally{closeSync(fd);}return h.digest('hex');}
|
|
13
13
|
function run(cmd,args){const r=spawnSync(cmd,args,{stdio:'inherit'});if(r.error)throw r.error;if(r.status!==0)throw new Error(`${cmd} failed (${r.status})`);}
|
|
14
14
|
function privateDir(path){mkdirSync(path,{recursive:true,mode:0o700});chmodSync(path,0o700);}
|
|
@@ -28,14 +28,14 @@ function fetchRelease(){
|
|
|
28
28
|
if(!checked(path,entry.sha256))downloadAsset(name,downloads,tag);
|
|
29
29
|
if(!checked(path,entry.sha256)||statSync(path).size!==entry.bytes)throw new Error(`Downloaded asset mismatch: ${name}`);
|
|
30
30
|
}
|
|
31
|
-
privateDir(release);run('tar',['-xzf',join(downloads,'relay-private-0.3.
|
|
31
|
+
privateDir(release);run('tar',['-xzf',join(downloads,'relay-private-0.3.15-payload.tar.gz'),'-C',release]);
|
|
32
32
|
for(const name of ['images-linux-amd64.tar.zst', 'runtime-selfhost-0312-source.tar.gz', 'parent-history-035-source.tar.gz', 'composer-dependencies-0313-source.tar.gz']){const to=join(release,name);if(!checked(to,dist.assets[name].sha256))renameSync(join(downloads,name),to);}
|
|
33
33
|
if(hash(join(release,'FILE-MANIFEST.json'))!==dist.fileManifestSha256||hash(join(release,'release.json'))!==dist.releaseManifestSha256)throw new Error('Release manifest mismatch');releaseFiles(release);return release;
|
|
34
34
|
}
|
|
35
35
|
let args=process.argv.slice(2),dir=process.env.RELAY_RELEASE_DIR;
|
|
36
36
|
const index=args.indexOf('--release-dir');if(index>=0){if(!args[index+1])throw new Error('--release-dir requires a path');dir=args[index+1];args.splice(index,2);}
|
|
37
|
-
if(args.length===1&&['--version','-v'].includes(args[0])){process.stdout.write('0.3.
|
|
38
|
-
if(args.length===1&&['--help','-h','help'].includes(args[0])){process.stdout.write('Relay 0.3.
|
|
37
|
+
if(args.length===1&&['--version','-v'].includes(args[0])){process.stdout.write('0.3.15\n');process.exit(0);}
|
|
38
|
+
if(args.length===1&&['--help','-h','help'].includes(args[0])){process.stdout.write('Relay 0.3.15: install/setup, doctor, health, status, start, stop, snapshot, restore-local, inference-ollama, inference-configure. Invite-only Runtime downloads require authenticated gh access. See START-HERE.md.'+'\n');process.exit(0);}
|
|
39
39
|
if(args[0]==='fetch'){const path=fetchRelease();process.stdout.write(path+'\n');process.exit(0);}
|
|
40
40
|
if(!args.length)args=['install'];
|
|
41
41
|
if(!args.length){process.stderr.write('Usage: relay [--release-dir PATH] <doctor|install|health|status|start|stop|backup|restore|upgrade|rollback|inference-doctor|inference-ollama|inference-configure|inference-recover> ...\n');process.exit(2);}
|