feat: generic user, dynamic paths, simplified ISO build pipeline
This commit is contained in:
+13
-8
@@ -14,8 +14,9 @@ from PyQt5.QtWidgets import (
|
||||
QTreeWidget, QTreeWidgetItem, QAbstractItemView
|
||||
)
|
||||
|
||||
HOME_URL = "file:///home/jgitta/kiosk-home/index.html"
|
||||
BOOKMARKS_FILE = "/home/jgitta/kiosk-browser/bookmarks.json"
|
||||
_HOME = pathlib.Path.home()
|
||||
HOME_URL = f"file://{_HOME}/kiosk-home/index.html"
|
||||
BOOKMARKS_FILE = str(_HOME / "kiosk-browser/bookmarks.json")
|
||||
CDP_PORT = 9222
|
||||
TOOLBAR_H = 72 # single row — was 142 (82 + 60)
|
||||
# Screen size is detected dynamically in main() after QApplication starts
|
||||
@@ -736,7 +737,7 @@ class KioskOverlay(QWidget):
|
||||
|
||||
# ── Chrome launcher ───────────────────────────────────────────────
|
||||
def launch_chrome():
|
||||
profile_dir = pathlib.Path("/home/jgitta/chromium-kiosk")
|
||||
profile_dir = _HOME / "chromium-kiosk"
|
||||
profile_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
for name in ("SingletonLock", "SingletonSocket", "SingletonCookie"):
|
||||
@@ -767,12 +768,16 @@ def launch_chrome():
|
||||
cookies_db = profile_dir / "Default" / "Cookies"
|
||||
if cookies_db.exists():
|
||||
try:
|
||||
_cfg = json.loads((_HOME / "kiosk-browser/config.json").read_text())
|
||||
_email_url = _cfg.get("urls", {}).get("email", "")
|
||||
_email_host = _email_url.split("//")[-1].split("/")[0] if _email_url else ""
|
||||
conn = sqlite3.connect(str(cookies_db))
|
||||
conn.execute(
|
||||
"DELETE FROM cookies WHERE host_key LIKE '%mail.jgitta.com%'")
|
||||
conn.commit()
|
||||
if _email_host:
|
||||
conn.execute("DELETE FROM cookies WHERE host_key LIKE ?",
|
||||
(f"%{_email_host}%",))
|
||||
conn.commit()
|
||||
print(f"Cleared stale session cookie for {_email_host}")
|
||||
conn.close()
|
||||
print("Cleared stale Roundcube session cookie")
|
||||
except Exception as e:
|
||||
print(f"Cookie clear warning: {e}")
|
||||
|
||||
@@ -789,7 +794,7 @@ def launch_chrome():
|
||||
"--disable-extensions",
|
||||
"--disable-gpu",
|
||||
"--disable-dev-shm-usage",
|
||||
"--user-data-dir=/home/jgitta/chromium-kiosk",
|
||||
f"--user-data-dir={_HOME / 'chromium-kiosk'}",
|
||||
f"--remote-debugging-port={CDP_PORT}",
|
||||
"--remote-allow-origins=*",
|
||||
f"--window-position=0,{TOOLBAR_H}",
|
||||
|
||||
Reference in New Issue
Block a user