mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-20 00:57:22 -05:00
changed electron to tauri v2
This commit is contained in:
@@ -39,19 +39,26 @@ class ServiceManager {
|
||||
throw new Error(`Service script not found: ${scriptPath}`);
|
||||
}
|
||||
|
||||
const tokenSecret = process.env.TOKEN_SECRET ||
|
||||
process.env.STREAM_API_TOKEN_SECRET ||
|
||||
this.credentialManager.getCredential('stream-api', 'TOKEN_SECRET') ||
|
||||
require('crypto').randomBytes(32).toString('hex');
|
||||
|
||||
const env = {
|
||||
...process.env,
|
||||
TOKEN_SECRET: tokenSecret,
|
||||
STREAM_API_TOKEN_SECRET: tokenSecret,
|
||||
...(this.envConfig[name] || {}),
|
||||
...(this.credentialManager.getServiceCredentials(name) || {}),
|
||||
ELECTRON_RUN_AS_NODE: '1'
|
||||
...(this.credentialManager.getServiceCredentials(name) || {})
|
||||
};
|
||||
|
||||
this.logToFile(name, `--- Starting ${name} in ${serviceDir} ---`);
|
||||
|
||||
const child = spawn(process.execPath, [scriptPath], {
|
||||
const child = spawn('node', [scriptPath], {
|
||||
cwd: serviceDir,
|
||||
env,
|
||||
stdio: ['ignore', 'pipe', 'pipe']
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
shell: process.platform === 'win32'
|
||||
});
|
||||
|
||||
this.processes[name] = {
|
||||
@@ -70,11 +77,13 @@ class ServiceManager {
|
||||
|
||||
child.stdout.on('data', (data) => {
|
||||
const text = data.toString().trim();
|
||||
console.log(`[${name}] STDOUT: ${text}`);
|
||||
this.logToFile(name, `STDOUT: ${text}`);
|
||||
});
|
||||
|
||||
child.stderr.on('data', (data) => {
|
||||
const text = data.toString().trim();
|
||||
console.error(`[${name}] STDERR: ${text}`);
|
||||
this.logToFile(name, `STDERR: ${text}`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user