refactor: rename Chrome references to Chromium
- Rename hook file: 0060-install-chrome -> 0060-install-chromium - Update all logs and comments to say "Chromium" instead of "Chrome" - Rename chromeStatus -> chromiumStatus in daemon - Update UI to show "Chromium Browser" instead of "Chrome Browser" - Update documentation (readme.plan.md, readme.hints.md) Note: Binary paths (/opt/chromium/chrome) remain as the actual Chromium executable is named "chrome"
This commit is contained in:
@@ -29,7 +29,7 @@ export class EcoDaemon {
|
||||
private uiServer: UIServer;
|
||||
private logs: string[] = [];
|
||||
private swayStatus: ServiceStatus = { state: 'stopped' };
|
||||
private chromeStatus: ServiceStatus = { state: 'stopped' };
|
||||
private chromiumStatus: ServiceStatus = { state: 'stopped' };
|
||||
|
||||
constructor(config?: Partial<DaemonConfig>) {
|
||||
this.config = {
|
||||
@@ -64,8 +64,8 @@ export class EcoDaemon {
|
||||
return {
|
||||
sway: this.swayStatus.state === 'running',
|
||||
swayStatus: this.swayStatus,
|
||||
chrome: this.chromeStatus.state === 'running',
|
||||
chromeStatus: this.chromeStatus,
|
||||
chromium: this.chromiumStatus.state === 'running',
|
||||
chromiumStatus: this.chromiumStatus,
|
||||
systemInfo: this.systemInfo.getInfo(),
|
||||
logs: this.logs.slice(-50),
|
||||
};
|
||||
@@ -79,7 +79,7 @@ export class EcoDaemon {
|
||||
await this.uiServer.start();
|
||||
this.log('Management UI started successfully');
|
||||
|
||||
// Start the Sway/Chrome initialization in the background
|
||||
// Start the Sway/Chromium initialization in the background
|
||||
// This allows the UI server to remain responsive even if Sway fails
|
||||
this.startServicesInBackground();
|
||||
|
||||
@@ -95,15 +95,15 @@ export class EcoDaemon {
|
||||
this.log('Checking seatd service...');
|
||||
await this.ensureSeatd();
|
||||
|
||||
// Try to start Sway and Chrome
|
||||
await this.tryStartSwayAndChrome();
|
||||
// Try to start Sway and Chromium
|
||||
await this.tryStartSwayAndChromium();
|
||||
} catch (error) {
|
||||
this.log(`Service initialization error: ${error}`);
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
private async tryStartSwayAndChrome(): Promise<void> {
|
||||
private async tryStartSwayAndChromium(): Promise<void> {
|
||||
// Try DRM mode first, fall back to headless if it fails
|
||||
const modes = ['drm', 'headless'] as const;
|
||||
|
||||
@@ -129,8 +129,8 @@ export class EcoDaemon {
|
||||
this.swayStatus = { state: 'running' };
|
||||
this.log(`Sway compositor running with ${mode} backend`);
|
||||
|
||||
// Start Chrome in kiosk mode
|
||||
await this.startChromeAfterSway();
|
||||
// Start Chromium in kiosk mode
|
||||
await this.startChromiumAfterSway();
|
||||
return;
|
||||
} else {
|
||||
this.log(`Sway ${mode} backend failed - Wayland socket did not appear`);
|
||||
@@ -147,21 +147,21 @@ export class EcoDaemon {
|
||||
this.log('All Sway backend modes failed');
|
||||
}
|
||||
|
||||
private async startChromeAfterSway(): Promise<void> {
|
||||
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
|
||||
this.log('Starting Chrome browser...');
|
||||
private async startChromiumAfterSway(): Promise<void> {
|
||||
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
|
||||
this.log('Starting Chromium browser...');
|
||||
|
||||
try {
|
||||
await this.startChrome();
|
||||
this.chromeStatus = { state: 'running' };
|
||||
this.log('Chrome browser started');
|
||||
await this.startChromium();
|
||||
this.chromiumStatus = { state: 'running' };
|
||||
this.log('Chromium browser started');
|
||||
} catch (error) {
|
||||
this.chromeStatus = {
|
||||
this.chromiumStatus = {
|
||||
state: 'failed',
|
||||
error: String(error),
|
||||
lastAttempt: new Date().toISOString()
|
||||
};
|
||||
this.log(`Failed to start Chrome: ${error}`);
|
||||
this.log(`Failed to start Chromium: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,11 +230,11 @@ export class EcoDaemon {
|
||||
return false;
|
||||
}
|
||||
|
||||
private async startChrome(): Promise<void> {
|
||||
private async startChromium(): Promise<void> {
|
||||
const uid = await this.getUserUid();
|
||||
const runtimeDir = `/run/user/${uid}`;
|
||||
|
||||
await this.processManager.startChrome({
|
||||
await this.processManager.startBrowser({
|
||||
runtimeDir,
|
||||
waylandDisplay: this.config.waylandDisplay,
|
||||
url: 'http://localhost:' + this.config.uiPort,
|
||||
@@ -278,26 +278,26 @@ export class EcoDaemon {
|
||||
if (this.swayStatus.state === 'running' && !this.processManager.isSwayRunning()) {
|
||||
this.log('Sway process died, attempting restart...');
|
||||
this.swayStatus = { state: 'stopped' };
|
||||
this.chromeStatus = { state: 'stopped' };
|
||||
await this.tryStartSwayAndChrome();
|
||||
this.chromiumStatus = { state: 'stopped' };
|
||||
await this.tryStartSwayAndChromium();
|
||||
}
|
||||
|
||||
// If Sway is running but Chrome died, restart Chrome
|
||||
if (this.swayStatus.state === 'running' && this.chromeStatus.state === 'running'
|
||||
&& !this.processManager.isChromeRunning()) {
|
||||
this.log('Chrome process died, attempting restart...');
|
||||
this.chromeStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
|
||||
// If Sway is running but Chromium died, restart Chromium
|
||||
if (this.swayStatus.state === 'running' && this.chromiumStatus.state === 'running'
|
||||
&& !this.processManager.isBrowserRunning()) {
|
||||
this.log('Chromium process died, attempting restart...');
|
||||
this.chromiumStatus = { state: 'starting', lastAttempt: new Date().toISOString() };
|
||||
try {
|
||||
await this.startChrome();
|
||||
this.chromeStatus = { state: 'running' };
|
||||
this.log('Chrome browser restarted');
|
||||
await this.startChromium();
|
||||
this.chromiumStatus = { state: 'running' };
|
||||
this.log('Chromium browser restarted');
|
||||
} catch (error) {
|
||||
this.chromeStatus = {
|
||||
this.chromiumStatus = {
|
||||
state: 'failed',
|
||||
error: String(error),
|
||||
lastAttempt: new Date().toISOString()
|
||||
};
|
||||
this.log(`Failed to restart Chrome: ${error}`);
|
||||
this.log(`Failed to restart Chromium: ${error}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ export class EcoDaemon {
|
||||
const now = Date.now();
|
||||
if (now - lastAttempt > 30000) {
|
||||
this.log('Retrying Sway startup...');
|
||||
await this.tryStartSwayAndChrome();
|
||||
await this.tryStartSwayAndChromium();
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user