Prepare verified laboratory 6 implementation and evidence

This commit is contained in:
rey
2026-11-17 17:32:06 +03:00
parent 470d9d6f1e
commit 7d56e52fd0
335 changed files with 31206 additions and 72 deletions
+5
View File
@@ -0,0 +1,5 @@
import {mkdir,writeFile,access} from 'node:fs/promises';import {resolve} from 'node:path';
const root=resolve(import.meta.dir,'..'),local=resolve(root,'.local');await mkdir(local,{recursive:true,mode:0o700});
const files=['openobserve-v2.env','openobserve_root-v2.json','openobserve_ingest_auth-v2'];const present=await Promise.all(files.map(async f=>{try{await access(resolve(local,f));return true}catch{return false}}));
if(present.some(Boolean)&&!present.every(Boolean))throw new Error('Incomplete own OpenObserve bootstrap; preserve and inspect');
if(!present.some(Boolean)){const email='vp6-owner@example.invalid',password='Aa1!'+crypto.randomUUID()+crypto.randomUUID();const data=[`ZO_ROOT_USER_EMAIL=${email}\nZO_ROOT_USER_PASSWORD=${password}\n`,JSON.stringify({email,password})+'\n','Basic '+Buffer.from(email+':'+password).toString('base64')];for(let i=0;i<files.length;i++)await writeFile(resolve(local,files[i]),data[i],{flag:'wx',mode:files[i]==='openobserve_ingest_auth-v2'?0o644:0o600});console.log('Created isolated synthetic OpenObserve owner and temporary native probe ingest credential; Grafana does not use it.');}else console.log('Existing own OpenObserve bootstrap preserved.');