Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Merge branch 'v082-inmut1' (rebased onto 0.8.1) into v082-integration

Federico Pereira5801aa1c0041
diff --cc CHANGELOG.md
index f5bfeee,c77f291..8014405
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,45 -10,40 +10,79 @@@ of the matching [GitHub release](https:
## [0.8.2] - Unreleased
+### Added
+
+- **Monitor → Disks: each disk's temperature and health.** The Disks tab now shows every physical
+ disk's live temperature, read from the kernel without root: NVMe and M.2 drives through the nvme
+ driver's own sensor (also on a Raspberry Pi 5 with an M.2 HAT), SATA disks through the `drivetemp`
+ module, which the `lordos` package now loads at boot. Memory cards, virtual disks and adapters
+ without a sensor say "No sensor", never a made-up value. The chosen disk gets a 30-minute
+ temperature chart with the drive's own limits when it reports them, and an OK / Check / Failing
+ light from a cached SMART summary, with "Open in Disks". Spinning disks are only read while they
+ are in use, so a resting disk is never woken up
+ ([docs/MONITOR.md](docs/MONITOR.md#disk-temperature-and-health-082)).
+- **Disks: the full SMART report with smartmontools.** The first time, the health card offers to
+ install Debian's smartmontools through the Store's package engine (an administrator). Then it
+ shows the overall health and why in plain words, temperature and limits, SSD wear (% of its rated
+ life used), power-on hours and cycles, reallocated and pending sectors, every attribute with a plain
+ name, the NVMe health log, the error log, the disk's own temperature history, and short and long
+ self-tests with progress and results. USB disks behind adapters that pass SMART through work too.
+ `smartctl` runs only through four new closed, validated root helper actions (`smart-info`,
+ `smart-health`, `smart-test`, `smart-abort`) on real whole disks, at a fixed path, with JSON output
+ ([docs/SYSTEM.md](docs/SYSTEM.md#smart-with-smartmontools-082)).
+- **Notifications when a disk gets too hot or its health gets worse**, at most once per disk every
+ 30 minutes for heat, and only when the health is worse than last seen. On by default, with a switch
+ in Monitor → Disks.
+- **Smooth video in the browser without hardware decoding.** Video sites that send VP9 or AV1
+ make the browser decode them on the processor when the graphics card can't (virtual machines,
+ older PCs, the Raspberry Pi 5), and the video stutters. LordOS now checks at every boot what the
+ hardware decodes (VA-API profiles through `lord-media`, V4L2 memory-to-memory decoders on ARM,
+ virtual graphics cards count as "no"; cached per boot) and, when VP9 or AV1 is missing, asks the
+ browsers for H.264 instead, which is far lighter to decode. Settings → Displays → Video in the
+ browser: "Optimize video for this computer" (Automatic by default, Always, Never) and "Lower
+ quality automatically when video stutters" (off by default). Nothing is sent anywhere
+ ([docs/VIDEO.md](docs/VIDEO.md)).
+- **Our own small browser extension** (`/usr/share/chromium/extensions/lordos-video`, MIT), loaded
+ by Debian's Chromium: on YouTube it reports VP9/AV1 as unsupported so the site sends H.264, and
+ when a video keeps dropping frames it shows a small notice that offers a lower quality (or lowers
+ it by itself, if enabled). Its settings come from a managed policy written by the closed admin
+ action `video-optimize` (fixed text, no user text). Firefox ESR only loads signed extensions, so
+ for now it gets AV1 turned off through a default preference (it then uses VP9); the extension
+ for Firefox waits for signing.
+ ### Security
+
+ - **LordOS checks its own code before running it.** Every bundle LordOS runs as its own code — the
+ themes with the shell and every native app, the login screen, the app host of isolated apps and
+ the system apps that run as their own process — is listed with its SHA-256 in
+ `/usr/lib/lordos/code-manifest.json`, signed with the LordOS release key (Ed25519).
+ lord-server verifies the signature with the public key compiled in, and the hash of each bundle
+ as it loads it, from the same read (no window to swap the file). A bundle that doesn't match is
+ not run: the desktop falls back to another theme and shows "This LordOS component was modified and
+ was not loaded"; with nothing left to load (or at the login screen) a built-in recovery screen
+ explains it and how to repair it, never a blank screen. It protects against changes by non-root
+ processes and offline modification; root can still replace lord-server itself, which phase 3
+ (fs-verity, A/B images) will cover. Cost on a session start: about 7 ms on a Raspberry Pi 5,
+ 18–34 ms on a 1.8 GHz Xeon VM
+ ([docs/SIGNING.md](docs/SIGNING.md#verified-system-code-082)).
+ - **System apps can't be removed.** Store → Installed shows "System app — part of LordOS" instead
+ of Remove for the apps that come with LordOS, and the `lordos` package is marked `Protected` so the
+ Store's package engine refuses to remove it.
+
+ ### Added
+
+ - About LordOS shows a "System app" badge and the state of the system code: "Verified", or
+ "Development build" for an unsigned development tree.
+ - `lord-server --check-code [<folder>]` checks a whole installed tree against the signed manifest
+ (troubleshooting, and the `.deb` build).
+ - SHA-256 uses the CPU's SHA-256 instructions on the Raspberry Pi 5 (5× faster there), and the
+ portable code is about twice as fast.
+
+ ### Changed
+
+ - Releases: `tools/release/sign-code.sh` signs the system-code manifest on the maintainer's machine
+ before the build; `make -C server RELEASE=1` builds a lord-server that only runs signed code, and
+ `tools/iso/mkdeb.sh` refuses to package bundles that don't match
+ ([docs/RELEASING.md](docs/RELEASING.md)).
## [Unreleased]
diff --cc apps/store/index.jsx
index 2e927fc,d6b3b52..97b7fec
--- a/apps/store/index.jsx
+++ b/apps/store/index.jsx
@@@ -2,8 -2,7 +2,8 @@@
// server/src/pkg; install and remove go through the administration helper).
import {
View, Text, Image, useTheme, useLocale, useAppWindow, useStore, Button, ScrollView, SidebarItem, SectionTitle, SearchField, Hairline, EmptyState, GroupBox,
- packages, packageList, refreshPackages, useLauncherApps, launchApp, fs, formatBytes, wm, direction, typeScale, spacing,
+ packages, packageList, refreshPackages, useLauncherApps, launchApp, fs, formatBytes, wm, direction, typeScale, spacing, isSystemApp,
+ suggestions, unseenSuggestions, refreshSuggestions,
} from '@lordos/sdk';
import { useEffect, useMemo, useState } from 'react';
import { debian, useDebian } from './debian.js';
diff --cc assets/locales/en/errors.json
index fac7dd3,f6b7760..d3923cd
--- a/assets/locales/en/errors.json
+++ b/assets/locales/en/errors.json
@@@ -560,8 -559,5 +560,9 @@@
"proc.failed": "Could not stop the process",
"proc.badArgument": "Invalid process request",
"proc.notOwn": "This process belongs to another user",
+ "disk.noSmartctl": "smartmontools is not installed",
+ "disk.smartFailed": "Could not read the disk health",
+ "disk.smartTestFailed": "The disk did not start the self-test",
- "hw.noKernelLog": "The kernel log could not be read"
++ "hw.noKernelLog": "The kernel log could not be read",
+ "app.codeRefused": "This app's code was modified and was not loaded"
}
diff --cc assets/locales/en/store.json
index 0290e4f,8dc356c..8d07f79
--- a/assets/locales/en/store.json
+++ b/assets/locales/en/store.json
@@@ -149,79 -149,5 +149,80 @@@
},
"updates.auto": "Check for updates automatically",
"updates.autoHint": "Once a day, and only to tell you. Nothing is installed without asking.",
+ "suggest.confirmNonfree": "This is not free software: its source code isn't available, and Debian can't fix or audit it. You can remove it later like any other package.",
+ "suggest.dismiss": "Don't suggest again",
+ "suggest.firmware.bluetooth.detail": "{packages} has it. The device starts working after you install it and restart the computer (or unplug it and plug it back in).",
+ "suggest.firmware.bluetooth.title": "Bluetooth firmware",
+ "suggest.firmware.bluetooth.unavailable": "{packages} is in Debian's {component} component, which isn't enabled in this computer's package sources.",
+ "suggest.firmware.bluetooth.why": "Your Bluetooth device asked for firmware that isn't installed ({files}).",
+ "suggest.firmware.graphics.detail": "{packages} has it. The device starts working after you install it and restart the computer (or unplug it and plug it back in).",
+ "suggest.firmware.graphics.title": "Graphics firmware",
+ "suggest.firmware.graphics.unavailable": "{packages} is in Debian's {component} component, which isn't enabled in this computer's package sources.",
+ "suggest.firmware.graphics.why": "Your graphics card asked for firmware that isn't installed ({files}).",
+ "suggest.firmware.network.detail": "{packages} has it. The device starts working after you install it and restart the computer (or unplug it and plug it back in).",
+ "suggest.firmware.network.title": "Network adapter firmware",
+ "suggest.firmware.network.unavailable": "{packages} is in Debian's {component} component, which isn't enabled in this computer's package sources.",
+ "suggest.firmware.network.why": "Your network adapter asked for firmware that isn't installed ({files}).",
+ "suggest.firmware.other.detail": "{packages} has it. The device starts working after you install it and restart the computer (or unplug it and plug it back in).",
+ "suggest.firmware.other.title": "Device firmware",
+ "suggest.firmware.other.unavailable": "{packages} is in Debian's {component} component, which isn't enabled in this computer's package sources.",
+ "suggest.firmware.other.why": "A device asked for firmware that isn't installed ({files}).",
+ "suggest.firmware.wifi.detail": "{packages} has it. The device starts working after you install it and restart the computer (or unplug it and plug it back in).",
+ "suggest.firmware.wifi.title": "Wi-Fi firmware",
+ "suggest.firmware.wifi.unavailable": "{packages} is in Debian's {component} component, which isn't enabled in this computer's package sources.",
+ "suggest.firmware.wifi.why": "Your Wi-Fi device asked for firmware that isn't installed ({files}).",
+ "suggest.fixture": "Test data",
+ "suggest.installNonfree": "Review and install",
+ "suggest.ippUsb.detail": "{packages} makes it show up like a network printer and scanner.",
+ "suggest.ippUsb.title": "Printing and scanning over USB without drivers",
+ "suggest.ippUsb.unavailable": "{packages} isn't in this computer's package sources.",
+ "suggest.ippUsb.why": "We detected a USB printer that can print and scan without a vendor driver (IPP over USB).",
+ "suggest.job": "Installing {name}",
+ "suggest.nonfreeBadge": "Not free software",
+ "suggest.note.firmware": "Firmware is a small program that runs inside the device itself, not on the computer's processor; its license doesn't allow changing it.",
+ "suggest.note.nonfree": "Not free software: it comes from Debian's {component} component, under its vendor's license.",
+ "suggest.notify.body": {
+ "one": "{name}, and {count} more. See them in the Store.",
+ "other": "{name}, and {count} more. See them in the Store."
+ },
+ "suggest.notify.open": "Open the Store",
+ "suggest.notify.title": {
+ "one": "A suggestion for your computer",
+ "other": "{count} suggestions for your computer"
+ },
+ "suggest.nvidiaDriver.detail": "Right now it uses nouveau, the free driver included with LordOS. The vendor's driver ({packages}) usually gives better 3D performance and power management.",
+ "suggest.nvidiaDriver.note.nouveau": "Until you install it, the free nouveau driver stays in use; removing the package goes back to it.",
+ "suggest.nvidiaDriver.note.older": "Cards older than about 2014 aren't supported by this driver version; keep the free driver on them. The LordOS desktop hasn't been tested with this driver yet.",
+ "suggest.nvidiaDriver.note.secureBoot": "The driver is built for your kernel on this computer (DKMS) and again after every kernel update. With Secure Boot on, you have to enroll its signing key at the next restart, or the driver won't load.",
+ "suggest.nvidiaDriver.title": "Proprietary graphics driver",
+ "suggest.nvidiaDriver.unavailable": "The vendor's driver needs Debian's contrib and non-free components, and they aren't both enabled in this computer's package sources. The free driver, nouveau, keeps working.",
+ "suggest.nvidiaDriver.why": "We detected an NVIDIA graphics card.",
+ "suggest.printer.detail": "{packages} adds the {vendor} driver to the printing system. Many printers also work without it.",
+ "suggest.printer.title": "{vendor} printer driver",
+ "suggest.printer.unavailable": "{packages} isn't in this computer's package sources.",
+ "suggest.printer.why": "We detected a printer from {vendor} connected by USB.",
+ "suggest.qemuAgent.detail": "{packages} lets the host shut down LordOS cleanly, pause disk writes for consistent backups and see the network address.",
+ "suggest.qemuAgent.title": "Guest agent for this virtual machine",
+ "suggest.qemuAgent.unavailable": "{packages} isn't in this computer's package sources.",
+ "suggest.qemuAgent.why": "We detected a virtual machine with a guest agent channel.",
+ "suggest.rpi5Tools.detail": "{packages}: bootloader (EEPROM) updates, board tools such as vcgencmd and pinctrl, and command-line tools for the GPIO pins.",
+ "suggest.rpi5Tools.title": "Raspberry Pi tools",
+ "suggest.rpi5Tools.unavailable": "These tools aren't in this computer's package sources.",
+ "suggest.rpi5Tools.why": "We detected a Raspberry Pi 5.",
+ "suggest.scanner.detail": "{packages} lets scanning apps use it.",
+ "suggest.scanner.title": "{vendor} scanner driver",
+ "suggest.scanner.unavailable": "{packages} isn't in this computer's package sources.",
+ "suggest.scanner.why": "We detected a scanner from {vendor} connected by USB.",
+ "suggest.subtitle": "Packages for the hardware LordOS found in this computer. Detection happens only on this computer: nothing is sent anywhere.",
+ "suggest.title": "Suggested for your computer",
+ "suggest.virtualboxGuest.detail": "{packages} adds shared folders and time sync with the host.",
+ "suggest.virtualboxGuest.title": "Guest utilities for this virtual machine",
+ "suggest.virtualboxGuest.unavailable": "Its guest utilities ({packages}) aren't part of Debian 13, so LordOS can't offer them. The kernel already includes the guest drivers for the display and shared folders; for the best display, choose the VMSVGA graphics controller in the virtual machine's settings.",
+ "suggest.virtualboxGuest.why": "We detected a VirtualBox virtual machine.",
+ "suggest.vmwareTools.detail": "{packages} lets the host shut down or restart LordOS cleanly, keeps the clock in sync and reports the network address. Clipboard sharing and automatic resizing will be added when LordOS supports them.",
+ "suggest.vmwareTools.title": "Guest tools for this virtual machine",
+ "suggest.vmwareTools.unavailable": "{packages} isn't in this computer's package sources.",
+ "suggest.vmwareTools.why": "We detected a VMware virtual machine.",
- "suggest.whatChanges": "What changes"
++ "suggest.whatChanges": "What changes",
+ "systemApp": "System app — part of LordOS"
}
diff --cc assets/locales/es/errors.json
index f6306a5,6956d67..8068ecc
--- a/assets/locales/es/errors.json
+++ b/assets/locales/es/errors.json
@@@ -560,8 -559,5 +560,9 @@@
"proc.failed": "No se pudo detener el proceso",
"proc.badArgument": "Pedido de proceso no válido",
"proc.notOwn": "Este proceso es de otro usuario",
+ "disk.noSmartctl": "smartmontools no está instalado",
+ "disk.smartFailed": "No se pudo leer la salud del disco",
+ "disk.smartTestFailed": "El disco no inició la autoprueba",
- "hw.noKernelLog": "No se pudo leer el registro del kernel"
++ "hw.noKernelLog": "No se pudo leer el registro del kernel",
+ "app.codeRefused": "El código de esta app fue modificado y no se cargó"
}
diff --cc assets/locales/es/store.json
index 4c3eec2,2a5d0d7..b659ea0
--- a/assets/locales/es/store.json
+++ b/assets/locales/es/store.json
@@@ -149,79 -149,5 +149,80 @@@
},
"updates.auto": "Buscar actualizaciones automáticamente",
"updates.autoHint": "Una vez por día, y solo para avisarte. No se instala nada sin preguntar.",
+ "suggest.confirmNonfree": "Esto no es software libre: su código fuente no está disponible y Debian no puede corregirlo ni auditarlo. Podés quitarlo después como cualquier otro paquete.",
+ "suggest.dismiss": "No sugerir de nuevo",
+ "suggest.firmware.bluetooth.detail": "{packages} lo trae. El dispositivo empieza a funcionar después de instalarlo y reiniciar el equipo (o desconectarlo y volver a conectarlo).",
+ "suggest.firmware.bluetooth.title": "Firmware de Bluetooth",
+ "suggest.firmware.bluetooth.unavailable": "{packages} está en el componente {component} de Debian, que no está habilitado en los orígenes de paquetes de este equipo.",
+ "suggest.firmware.bluetooth.why": "Tu dispositivo Bluetooth pidió un firmware que no está instalado ({files}).",
+ "suggest.firmware.graphics.detail": "{packages} lo trae. El dispositivo empieza a funcionar después de instalarlo y reiniciar el equipo (o desconectarlo y volver a conectarlo).",
+ "suggest.firmware.graphics.title": "Firmware de gráficos",
+ "suggest.firmware.graphics.unavailable": "{packages} está en el componente {component} de Debian, que no está habilitado en los orígenes de paquetes de este equipo.",
+ "suggest.firmware.graphics.why": "Tu placa de video pidió un firmware que no está instalado ({files}).",
+ "suggest.firmware.network.detail": "{packages} lo trae. El dispositivo empieza a funcionar después de instalarlo y reiniciar el equipo (o desconectarlo y volver a conectarlo).",
+ "suggest.firmware.network.title": "Firmware del adaptador de red",
+ "suggest.firmware.network.unavailable": "{packages} está en el componente {component} de Debian, que no está habilitado en los orígenes de paquetes de este equipo.",
+ "suggest.firmware.network.why": "Tu adaptador de red pidió un firmware que no está instalado ({files}).",
+ "suggest.firmware.other.detail": "{packages} lo trae. El dispositivo empieza a funcionar después de instalarlo y reiniciar el equipo (o desconectarlo y volver a conectarlo).",
+ "suggest.firmware.other.title": "Firmware de un dispositivo",
+ "suggest.firmware.other.unavailable": "{packages} está en el componente {component} de Debian, que no está habilitado en los orígenes de paquetes de este equipo.",
+ "suggest.firmware.other.why": "Un dispositivo pidió un firmware que no está instalado ({files}).",
+ "suggest.firmware.wifi.detail": "{packages} lo trae. El dispositivo empieza a funcionar después de instalarlo y reiniciar el equipo (o desconectarlo y volver a conectarlo).",
+ "suggest.firmware.wifi.title": "Firmware de Wi-Fi",
+ "suggest.firmware.wifi.unavailable": "{packages} está en el componente {component} de Debian, que no está habilitado en los orígenes de paquetes de este equipo.",
+ "suggest.firmware.wifi.why": "Tu dispositivo Wi-Fi pidió un firmware que no está instalado ({files}).",
+ "suggest.fixture": "Datos de prueba",
+ "suggest.installNonfree": "Revisar e instalar",
+ "suggest.ippUsb.detail": "{packages} hace que aparezca como una impresora y un escáner de red.",
+ "suggest.ippUsb.title": "Imprimir y escanear por USB sin drivers",
+ "suggest.ippUsb.unavailable": "{packages} no está en los orígenes de paquetes de este equipo.",
+ "suggest.ippUsb.why": "Detectamos una impresora USB que puede imprimir y escanear sin driver del fabricante (IPP por USB).",
+ "suggest.job": "Instalando {name}",
+ "suggest.nonfreeBadge": "No es software libre",
+ "suggest.note.firmware": "El firmware es un pequeño programa que corre dentro del propio dispositivo, no en el procesador del equipo; su licencia no permite modificarlo.",
+ "suggest.note.nonfree": "No es software libre: viene del componente {component} de Debian, con la licencia de su fabricante.",
+ "suggest.notify.body": {
+ "one": "{name} y {count} más. Miralas en la Tienda.",
+ "other": "{name} y {count} más. Miralas en la Tienda."
+ },
+ "suggest.notify.open": "Abrir la Tienda",
+ "suggest.notify.title": {
+ "one": "Una sugerencia para tu equipo",
+ "other": "{count} sugerencias para tu equipo"
+ },
+ "suggest.nvidiaDriver.detail": "Ahora usa nouveau, el driver libre que viene con LordOS. El driver del fabricante ({packages}) suele dar mejor rendimiento 3D y mejor manejo de energía.",
+ "suggest.nvidiaDriver.note.nouveau": "Hasta que lo instales se sigue usando el driver libre nouveau; si quitás el paquete, se vuelve a él.",
+ "suggest.nvidiaDriver.note.older": "Las placas anteriores a 2014, aproximadamente, no son compatibles con esta versión del driver; en ellas conviene seguir con el driver libre. El escritorio de LordOS todavía no se probó con este driver.",
+ "suggest.nvidiaDriver.note.secureBoot": "El driver se compila para tu kernel en este equipo (DKMS) y de nuevo después de cada actualización del kernel. Con el Arranque seguro activado, tenés que registrar su clave de firma en el próximo reinicio, o el driver no carga.",
+ "suggest.nvidiaDriver.title": "Driver gráfico propietario",
+ "suggest.nvidiaDriver.unavailable": "El driver del fabricante necesita los componentes contrib y non-free de Debian, y no están los dos habilitados en los orígenes de paquetes de este equipo. El driver libre, nouveau, sigue funcionando.",
+ "suggest.nvidiaDriver.why": "Detectamos una placa de video NVIDIA.",
+ "suggest.printer.detail": "{packages} agrega el driver de {vendor} al sistema de impresión. Muchas impresoras también funcionan sin él.",
+ "suggest.printer.title": "Driver de impresora {vendor}",
+ "suggest.printer.unavailable": "{packages} no está en los orígenes de paquetes de este equipo.",
+ "suggest.printer.why": "Detectamos una impresora {vendor} conectada por USB.",
+ "suggest.qemuAgent.detail": "{packages} permite que el anfitrión apague LordOS de forma ordenada, pause las escrituras en disco para copias de seguridad consistentes y vea la dirección de red.",
+ "suggest.qemuAgent.title": "Agente de invitado para esta máquina virtual",
+ "suggest.qemuAgent.unavailable": "{packages} no está en los orígenes de paquetes de este equipo.",
+ "suggest.qemuAgent.why": "Detectamos una máquina virtual con un canal de agente de invitado.",
+ "suggest.rpi5Tools.detail": "{packages}: actualizaciones del cargador de arranque (EEPROM), herramientas de la placa como vcgencmd y pinctrl, y herramientas de línea de comandos para los pines GPIO.",
+ "suggest.rpi5Tools.title": "Herramientas de la Raspberry Pi",
+ "suggest.rpi5Tools.unavailable": "Estas herramientas no están en los orígenes de paquetes de este equipo.",
+ "suggest.rpi5Tools.why": "Detectamos una Raspberry Pi 5.",
+ "suggest.scanner.detail": "{packages} permite que las apps de escaneo lo usen.",
+ "suggest.scanner.title": "Driver de escáner {vendor}",
+ "suggest.scanner.unavailable": "{packages} no está en los orígenes de paquetes de este equipo.",
+ "suggest.scanner.why": "Detectamos un escáner {vendor} conectado por USB.",
+ "suggest.subtitle": "Paquetes para el hardware que LordOS encontró en este equipo. La detección se hace solo en este equipo: no se envía nada a ningún lado.",
+ "suggest.title": "Sugeridas para tu equipo",
+ "suggest.virtualboxGuest.detail": "{packages} agrega carpetas compartidas y sincronización de la hora con el anfitrión.",
+ "suggest.virtualboxGuest.title": "Utilidades de invitado para esta máquina virtual",
+ "suggest.virtualboxGuest.unavailable": "Sus utilidades de invitado ({packages}) no forman parte de Debian 13, así que LordOS no puede ofrecerlas. El kernel ya incluye los drivers de invitado para la pantalla y las carpetas compartidas; para la mejor pantalla, elegí el controlador gráfico VMSVGA en la configuración de la máquina virtual.",
+ "suggest.virtualboxGuest.why": "Detectamos una máquina virtual de VirtualBox.",
+ "suggest.vmwareTools.detail": "{packages} permite que el anfitrión apague o reinicie LordOS de forma ordenada, mantiene la hora sincronizada e informa la dirección de red. El portapapeles compartido y el ajuste automático de la resolución llegarán cuando LordOS los admita.",
+ "suggest.vmwareTools.title": "Herramientas de invitado para esta máquina virtual",
+ "suggest.vmwareTools.unavailable": "{packages} no está en los orígenes de paquetes de este equipo.",
+ "suggest.vmwareTools.why": "Detectamos una máquina virtual de VMware.",
- "suggest.whatChanges": "Qué cambia"
++ "suggest.whatChanges": "Qué cambia",
+ "systemApp": "App del sistema — parte de LordOS"
}
diff --cc assets/locales/pt/errors.json
index 0e9c175,9c2e380..6c42413
--- a/assets/locales/pt/errors.json
+++ b/assets/locales/pt/errors.json
@@@ -560,8 -559,5 +560,9 @@@
"proc.failed": "Não foi possível parar o processo",
"proc.badArgument": "Pedido de processo inválido",
"proc.notOwn": "Este processo pertence a outro usuário",
+ "disk.noSmartctl": "O smartmontools não está instalado",
+ "disk.smartFailed": "Não foi possível ler a saúde do disco",
+ "disk.smartTestFailed": "O disco não iniciou o autoteste",
- "hw.noKernelLog": "Não foi possível ler o registro do kernel"
++ "hw.noKernelLog": "Não foi possível ler o registro do kernel",
+ "app.codeRefused": "O código deste app foi modificado e não foi carregado"
}
diff --cc assets/locales/pt/store.json
index 9e50c88,dcbcbf4..4b67b84
--- a/assets/locales/pt/store.json
+++ b/assets/locales/pt/store.json
@@@ -149,79 -149,5 +149,80 @@@
},
"updates.auto": "Procurar atualizações automaticamente",
"updates.autoHint": "Uma vez por dia, e só para avisar. Nada é instalado sem perguntar.",
+ "suggest.confirmNonfree": "Isto não é software livre: o código-fonte não está disponível e o Debian não pode corrigi-lo nem auditá-lo. Você pode removê-lo depois como qualquer outro pacote.",
+ "suggest.dismiss": "Não sugerir de novo",
+ "suggest.firmware.bluetooth.detail": "{packages} o contém. O dispositivo começa a funcionar depois de instalá-lo e reiniciar o computador (ou desconectá-lo e conectá-lo de novo).",
+ "suggest.firmware.bluetooth.title": "Firmware de Bluetooth",
+ "suggest.firmware.bluetooth.unavailable": "{packages} está no componente {component} do Debian, que não está habilitado nas fontes de pacotes deste computador.",
+ "suggest.firmware.bluetooth.why": "Seu dispositivo Bluetooth pediu um firmware que não está instalado ({files}).",
+ "suggest.firmware.graphics.detail": "{packages} o contém. O dispositivo começa a funcionar depois de instalá-lo e reiniciar o computador (ou desconectá-lo e conectá-lo de novo).",
+ "suggest.firmware.graphics.title": "Firmware de gráficos",
+ "suggest.firmware.graphics.unavailable": "{packages} está no componente {component} do Debian, que não está habilitado nas fontes de pacotes deste computador.",
+ "suggest.firmware.graphics.why": "Sua placa de vídeo pediu um firmware que não está instalado ({files}).",
+ "suggest.firmware.network.detail": "{packages} o contém. O dispositivo começa a funcionar depois de instalá-lo e reiniciar o computador (ou desconectá-lo e conectá-lo de novo).",
+ "suggest.firmware.network.title": "Firmware do adaptador de rede",
+ "suggest.firmware.network.unavailable": "{packages} está no componente {component} do Debian, que não está habilitado nas fontes de pacotes deste computador.",
+ "suggest.firmware.network.why": "Seu adaptador de rede pediu um firmware que não está instalado ({files}).",
+ "suggest.firmware.other.detail": "{packages} o contém. O dispositivo começa a funcionar depois de instalá-lo e reiniciar o computador (ou desconectá-lo e conectá-lo de novo).",
+ "suggest.firmware.other.title": "Firmware de um dispositivo",
+ "suggest.firmware.other.unavailable": "{packages} está no componente {component} do Debian, que não está habilitado nas fontes de pacotes deste computador.",
+ "suggest.firmware.other.why": "Um dispositivo pediu um firmware que não está instalado ({files}).",
+ "suggest.firmware.wifi.detail": "{packages} o contém. O dispositivo começa a funcionar depois de instalá-lo e reiniciar o computador (ou desconectá-lo e conectá-lo de novo).",
+ "suggest.firmware.wifi.title": "Firmware de Wi-Fi",
+ "suggest.firmware.wifi.unavailable": "{packages} está no componente {component} do Debian, que não está habilitado nas fontes de pacotes deste computador.",
+ "suggest.firmware.wifi.why": "Seu dispositivo Wi-Fi pediu um firmware que não está instalado ({files}).",
+ "suggest.fixture": "Dados de teste",
+ "suggest.installNonfree": "Revisar e instalar",
+ "suggest.ippUsb.detail": "{packages} faz com que ela apareça como uma impressora e um scanner de rede.",
+ "suggest.ippUsb.title": "Imprimir e digitalizar por USB sem drivers",
+ "suggest.ippUsb.unavailable": "{packages} não está nas fontes de pacotes deste computador.",
+ "suggest.ippUsb.why": "Detectamos uma impressora USB que pode imprimir e digitalizar sem driver do fabricante (IPP por USB).",
+ "suggest.job": "Instalando {name}",
+ "suggest.nonfreeBadge": "Não é software livre",
+ "suggest.note.firmware": "Firmware é um pequeno programa que roda dentro do próprio dispositivo, não no processador do computador; a licença não permite modificá-lo.",
+ "suggest.note.nonfree": "Não é software livre: vem do componente {component} do Debian, com a licença do fabricante.",
+ "suggest.notify.body": {
+ "one": "{name} e mais {count}. Veja na Loja.",
+ "other": "{name} e mais {count}. Veja na Loja."
+ },
+ "suggest.notify.open": "Abrir a Loja",
+ "suggest.notify.title": {
+ "one": "Uma sugestão para o seu computador",
+ "other": "{count} sugestões para o seu computador"
+ },
+ "suggest.nvidiaDriver.detail": "Agora ela usa o nouveau, o driver livre incluído no LordOS. O driver do fabricante ({packages}) costuma dar melhor desempenho 3D e melhor gerenciamento de energia.",
+ "suggest.nvidiaDriver.note.nouveau": "Até você instalá-lo, o driver livre nouveau continua em uso; remover o pacote volta para ele.",
+ "suggest.nvidiaDriver.note.older": "Placas anteriores a cerca de 2014 não são suportadas por esta versão do driver; nelas, mantenha o driver livre. O desktop do LordOS ainda não foi testado com este driver.",
+ "suggest.nvidiaDriver.note.secureBoot": "O driver é compilado para o seu kernel neste computador (DKMS) e de novo após cada atualização do kernel. Com a Inicialização segura ativada, você precisa registrar a chave de assinatura dele na próxima reinicialização, ou o driver não carrega.",
+ "suggest.nvidiaDriver.title": "Driver gráfico proprietário",
+ "suggest.nvidiaDriver.unavailable": "O driver do fabricante precisa dos componentes contrib e non-free do Debian, e os dois não estão habilitados nas fontes de pacotes deste computador. O driver livre, nouveau, continua funcionando.",
+ "suggest.nvidiaDriver.why": "Detectamos uma placa de vídeo NVIDIA.",
+ "suggest.printer.detail": "{packages} adiciona o driver da {vendor} ao sistema de impressão. Muitas impressoras também funcionam sem ele.",
+ "suggest.printer.title": "Driver de impressora {vendor}",
+ "suggest.printer.unavailable": "{packages} não está nas fontes de pacotes deste computador.",
+ "suggest.printer.why": "Detectamos uma impressora {vendor} conectada por USB.",
+ "suggest.qemuAgent.detail": "{packages} permite que o hospedeiro desligue o LordOS de forma limpa, pause as gravações em disco para backups consistentes e veja o endereço de rede.",
+ "suggest.qemuAgent.title": "Agente de convidado para esta máquina virtual",
+ "suggest.qemuAgent.unavailable": "{packages} não está nas fontes de pacotes deste computador.",
+ "suggest.qemuAgent.why": "Detectamos uma máquina virtual com um canal de agente de convidado.",
+ "suggest.rpi5Tools.detail": "{packages}: atualizações do carregador de inicialização (EEPROM), ferramentas da placa como vcgencmd e pinctrl, e ferramentas de linha de comando para os pinos GPIO.",
+ "suggest.rpi5Tools.title": "Ferramentas do Raspberry Pi",
+ "suggest.rpi5Tools.unavailable": "Estas ferramentas não estão nas fontes de pacotes deste computador.",
+ "suggest.rpi5Tools.why": "Detectamos um Raspberry Pi 5.",
+ "suggest.scanner.detail": "{packages} permite que os apps de digitalização o usem.",
+ "suggest.scanner.title": "Driver de scanner {vendor}",
+ "suggest.scanner.unavailable": "{packages} não está nas fontes de pacotes deste computador.",
+ "suggest.scanner.why": "Detectamos um scanner {vendor} conectado por USB.",
+ "suggest.subtitle": "Pacotes para o hardware que o LordOS encontrou neste computador. A detecção acontece só neste computador: nada é enviado para lugar nenhum.",
+ "suggest.title": "Sugeridos para o seu computador",
+ "suggest.virtualboxGuest.detail": "{packages} adiciona pastas compartilhadas e sincronização do relógio com o hospedeiro.",
+ "suggest.virtualboxGuest.title": "Utilitários de convidado para esta máquina virtual",
+ "suggest.virtualboxGuest.unavailable": "Os utilitários de convidado ({packages}) não fazem parte do Debian 13, então o LordOS não pode oferecê-los. O kernel já inclui os drivers de convidado para a tela e as pastas compartilhadas; para a melhor tela, escolha o controlador gráfico VMSVGA nas configurações da máquina virtual.",
+ "suggest.virtualboxGuest.why": "Detectamos uma máquina virtual VirtualBox.",
+ "suggest.vmwareTools.detail": "{packages} permite que o hospedeiro desligue ou reinicie o LordOS de forma limpa, mantém o relógio sincronizado e informa o endereço de rede. A área de transferência compartilhada e o redimensionamento automático virão quando o LordOS os suportar.",
+ "suggest.vmwareTools.title": "Ferramentas de convidado para esta máquina virtual",
+ "suggest.vmwareTools.unavailable": "{packages} não está nas fontes de pacotes deste computador.",
+ "suggest.vmwareTools.why": "Detectamos uma máquina virtual VMware.",
- "suggest.whatChanges": "O que muda"
++ "suggest.whatChanges": "O que muda",
+ "systemApp": "App do sistema — parte do LordOS"
}
diff --cc docs/PRIVACY.md
index 4c5051e,b1ca8ce..bad8048
--- a/docs/PRIVACY.md
+++ b/docs/PRIVACY.md
@@@ -415,144 -413,6 +415,146 @@@ through `globalThis.__lordos.monitorDev
| `apps/settings/Privacy.jsx` | Settings → Privacy |
| `tests/lpk-evil`, `tests/lpk-legit` | test apps (malicious and legitimate) |
| `server/tests/sandbox_test.c` | sandbox tests (app, network, helper) |
+| `server/src/sec/brokermail.c`, `server/src/ui/js_brokermail.c` | lord-maild for the isolated Mail, Calendar, Contacts and Reminders (`BOP_MAIL`, `BOP_SYS_OPEN`) |
+| `server/src/app/apphost_bc.c` | the app host compiled to bytecode once per session |
+| `sdk/sysopen.js` | the session opens attachments and apps for the isolated system apps |
+| `server/tests/brokermail_test.c` | `build/brokermail-test` |
+
+## System apps in their own process (0.8.2)
+
+Mail parses mail from anyone; Calendar, Contacts and Reminders show invitations, `.ics` and
+`.vcf` files and synced data. Since 0.8.2 their windows are no longer drawn by the session's
+JavaScript: like Passwords, each one is a system package (`"process": "isolated"` in its manifest,
+built into `assets/sysapps/<id>/`) that runs as `lord-server --app <id>`, with the same sandbox as an
+`.lpk` app. If a message ever exploited a bug in Mail's interface code, it would be locked in that
+process: it could not read your files, your SSH keys, Passwords' data or the other apps' data, open
+a socket, or hang the desktop. Parsing itself (IMAP, MIME, HTML, iCalendar, vCard, images) was
+already done in `lord-maild` ([MAIL.md](MAIL.md)) and still is.
+
+| | Mail | Calendar | Contacts | Reminders |
+|---|---|---|---|---|
+| Process, scope | `lord-server --app mail`, `app-lordos-lpk-mail.scope` | `… --app calendar`, `app-lordos-lpk-calendar.scope` | `… --app contacts`, `app-lordos-lpk-contacts.scope` | `… --app reminders`, `app-lordos-lpk-reminders.scope` |
+| Files it can open itself | its data folder `~/.local/share/lordos/appdata/mail` and read-only system data (its package, the app host, fonts, language packs) | the same, for `calendar` | the same, for `contacts` | the same, for `reminders` |
+| Your files | only what you pick in the system's open/save dialog (attachments to send, saving an attachment) | — (no file use) | only the `.vcf` to import and a contact's photo, picked in the system dialog | — |
+| Network | **none** (no sockets: Landlock + seccomp, `net=no`). lord-maild's connections are made by `lord-server` exactly as before, only to the configured servers | none | none | none |
+| lord-maild requests (`BOP_MAIL`) | all of them | `cal-*`, `ev-*`, `todo-*`, `alarms`, `status` | `book-*`, `contact-*`, `autocomplete`, `status` | `cal-*`, `todo-*`, `alarms`, `status` |
+| lord-maild events | all (new mail, status, certificates, PIM changes) | only "PIM data changed" | only "PIM data changed" | only "PIM data changed" |
+| Accounts file, remote images | through `lord-server` (`mail_save_config`, same validation; no passwords) | no | no | no |
+| Keyring (`BOP_KEYRING`) | its own items, owner `mail` (the owner Mail always had: the session's need-auth handler reads the same items); another app's only after the system prompt | own items (unused) | own items (unused) | own items (unused) |
+| Mail's cache (`~/.local/share/lordos/mail`) | not readable; one cached attachment as a read-only fd (to save it), or the session opens it with your apps | no | no | no |
+| Opening another app | Calendar (an invitation), through the session (`BOP_SYS_OPEN`) | Mail, Contacts, Reminders likewise | Mail (a new message to a contact) | likewise |
+
+What did not change: new-mail notifications, calendar and reminder alarms, passwords on demand
+and the unread count are the session's services (`startMail`, `startReminders`), so they work
+with the apps closed. Notifications, Dock grouping and quick actions (Mail's **New Message**),
+several windows (a compose window is a second window of the same process), the system menu bar,
+theme, language and RTL, and Monitor and the firewall all work as for any isolated app.
+
+| ![Mail in its own process](isolated-apps-mail.png) | ![Saving an attachment: the system's dialog](isolated-apps-powerbox.png) |
+|---|---|
+| Mail in its own process: remote images held back, a deceptive link flagged, an attachment | Saving an attachment: the system draws the dialog; Mail gets one fd |
+| ![Monitor: each app is its own process](isolated-apps-monitor.png) | ![Monitor: scope and restrictions of Calendar](isolated-apps-monitor-detail.png) |
+| Monitor lists Mail, Calendar and Contacts as their own processes, with their names and icons | Calendar's scope and its restrictions (Landlock, seccomp, own cgroup) |
+| ![A firewall restriction on Mail](isolated-apps-firewall.png) | ![The notification opens the message](isolated-apps-notification.png) |
+| Settings → Privacy → Restricted apps → Mail (`lpk:mail`) "no access to your files": attaching is refused | With Mail closed, the new-mail notification's **Open** starts Mail on that message |
+| ![Contacts opens a new message in Mail](isolated-apps-contacts-to-mail.png) | |
+| Contacts → an email address: the session opens Mail's new message (`BOP_SYS_OPEN`) | |
+
+### How it works
+
+- **lord-maild through lord-server** (`sec/brokermail.c`, app side `ui/js_brokermail.c`). The app
+ process has the same `lord.mail` API as the session (so `sdk/mail.js`, `calendar.js` and
+ `contacts.js` are unchanged), but every call is a `BOP_MAIL` broker request, only for a system
+ package (`brokersrv_conn_system`, set by `app_spawn` for `assets/sysapps`) named `mail`,
+ `calendar`, `contacts` or `reminders`. `lord-server` checks the request JSON as `js_mail.c` does,
+ then the per-app allow list above, then the files: only fds the app already holds (from the
+ system dialog), only readable regular files of at most 64 MB, only for `send`, `draft`,
+ `contact-save`, `contact-import` and `ev-import`. Other fds that arrive with any broker request
+ are closed. Large requests travel in a memfd (`reqm`).
+- **Replies and events are per app.** `mailc.c` keeps one owner queue per app process: a reply goes
+ only to the process that asked (an app cannot read another app's results or images), broadcast
+ events go to the session and to each app by its mask. They reach the app as `mail` events in
+ chunks of 60 KB; `lord-server` never blocks on a full socket (it resumes on `POLLOUT`).
+- **Images** (remote images, inline images, contact photos) stay owned by the app that asked:
+ `lord.mail.bind` receives a sealed memfd with the pixels.
+- **Attachments.** *Open* → `lord-server` resolves the cached file (`att/…` inside the cache, no
+ `..`, no links out) and the session opens it with your apps (`sdk/sysopen.js`, the same rules as
+ Files). *Save* → a read-only fd of that one file, then the system's save dialog.
+- **Args for an isolated app.** `wm.open('mail', { args })` in the session (a notification's
+ *Open*, a Dock quick action, a link from another app) reaches the process as an `open` broker event
+ (`lord.broker.openArgs`, `brokersrv_open_args`): now if it runs, or right after it starts. Args are a
+ JSON object of at most 16 KiB; `BOP_SYS_OPEN` from an app only reaches Mail, Calendar, Contacts
+ and Reminders, with at most 1.5 KiB and never a `path`.
+- **Time zone and text.** The app reads the local time zone before the sandbox (`tzset()`), so
+ dates are local; `lord.measureText` is available in app processes (Mail's body editor).
+- **Process name.** The app process is named after its id (`PR_SET_NAME`), so `ps` and Monitor
+ show `mail`, not `exe`; Monitor draws it with the app's name and icon.
+
+### Proof from inside the Mail process (VM 118)
+
+`gdb -p <pid of lord-server --app mail>` calling `open()` and `socket()` inside the running,
+sandboxed Mail process (root attaches with `ptrace`; the calls run as the app):
+
+```
+open ~/.ssh/authorized_keys = -1 errno = 13 (EACCES)
+open ~/.config/lordos/mail/accounts.json = -1 errno = 13
+open ~/.local/share/lordos/mail (cache) = -1 errno = 13
+open appdata/passwords (another app) = -1 errno = 13
+open ~/Documents/inmut2-budget.txt = -1 errno = 13
+open appdata/mail (its own) = 6 allowed
+socket(AF_INET, SOCK_STREAM) = -1 errno = 13
+```
+
+`kill -9` of the Mail process, six times in a row while it was open: each time only its windows
+went away; the desktop, lord-maild (and its sync), the notifications and the other apps kept
+running, and Mail opened again normally. `build/brokermail-test` (47 checks) runs the real
+`brokermail.c`: who may ask, each app's allow list, malformed requests, sockets/folders/write-only
+fds refused, the memfd path, the Mail-only verbs, attachment paths (`..`, outside `att/`, a symlink
+out of the cache) and `BOP_SYS_OPEN` targets and args. `build/brokerkr-e2e` checks that a system
+package keeps its plain owner while a user `.lpk` with the same id does not reach it.
+
+### Startup and memory (VM 118: Xeon Silver 4108 @ 1.8 GHz, 4 vCPU on a shared host, CPU composition)
+
+| | In-process (0.8.1) | Isolated (0.8.2) |
+|---|---|---|
+| Mail: Dock click → first frame of the window | ~72 ms (React render in the session) | **~145 ms** (launch → the app's first frame, 6 runs: 135–152 ms) + the frame the session draws around it (~70 ms, the same work an in-process window does) |
+| Calendar / Contacts: launch → first frame | — | 128 ms / 97 ms |
+| App host JavaScript in the app | — | **23 ms** (bytecode) instead of 110 ms (parsing 430 KB) |
+| Memory | the session grows ~5 MB when Mail opens | Mail 26 MB RSS / 18 MB PSS; Calendar 22 / 15 MB; Contacts 20 / 13.5 MB; Reminders ~21 MB RSS |
+
- - **The app host as bytecode** (`app/apphost_bc.c`): three seconds after the session starts,
- `lord-server` compiles `assets/app-host.bundle.js` once, on a thread with its own QuickJS
- runtime, into a sealed memfd (1.7 MB). Each app process gets a read-only fd of it
- (`LORD_APPHOST_BC_FD`) and uses it only if its header names the very file it would load (device,
- inode, size, modification time); otherwise it parses the source. This took Mail from ~225 ms to
- ~145 ms.
++- **The app host as bytecode** (`app/apphost_bc.c`): when the session starts, `lord-server` reads
++ `assets/app-host.bundle.js` once through the verified-code check (`codesig_load`, see
++ [SIGNING.md](SIGNING.md), "Verified system code") and, three seconds later, compiles exactly those
++ verified bytes on a thread with its own QuickJS runtime into a sealed memfd (1.7 MB); if the check
++ refuses the file nothing is compiled. Each app process gets a read-only fd of it
++ (`LORD_APPHOST_BC_FD`), loads and verifies the source itself as before, and uses the bytecode only
++ if its header carries the size and SHA-256 of those same bytes; otherwise it parses the source.
++ This took Mail from ~225 ms to ~145 ms.
+- Painting the window early (before the JavaScript) was tried and dropped: on this VM the session's
+ frame drawing then competed with the app's start-up and the content arrived ~55 ms later.
+- With `"debugTiming": true` in `~/.config/lordos/settings.json` (no UI), opening an app logs
+ `timing:` lines to the session log; each isolated app always logs its first frame.
+
+### What stays in-process and why
+
+- **Store** stays in the session's process for now. It drives the package engine (`lord.pkg`:
+ plans, installs and removals through the root helper), signature checks and trust
+ (`lord.sign`), reads `.lpk`/`.deb` files you pick, lists every installed app and drives updates
+ of LordOS itself. Isolating it means a broker op for each of those powers with its own checks —
+ a set of new privileged operations, not a move — and the Store is being changed by another
+ 0.8.2 item ("Suggested for your computer"). It is not shipped half-isolated.
+- **Photos** stays in-process: it is a library over your picture folders (it lists them and
+ saves edits as copies next to the originals) and prints. The system dialog hands over one file,
+ not a folder, and isolated apps cannot print yet, so isolating it needs a folder grant and
+ printing over the broker first. The untrusted part, decoding images, already happens in the
+ sandboxed `lord-media` helper (`media.image`, `media.edit`), not in the window's process.
+- **Not covered for the isolated four:** printing (none of them prints today) and drag and drop
+ (none of them accepts drops today). Links in mail are shown and copied (LordOS has no web engine),
+ as before.
+- **Limits.** A firewall *network* rule for `lpk:mail` does not stop mail syncing: the connections
+ are opened by `lord-server` for `lord-maild` (firewall id `lordos`), as in 0.8.1; the Mail window
+ process itself has no network at all. Certificate warnings that happened while Mail was closed are
+ shown again on the next connection attempt (the account shows its error meanwhile).
## Root-owned app scopes
diff --cc sdk/index.js
index 117d8cc,573c7ff..7586e8c
--- a/sdk/index.js
+++ b/sdk/index.js
@@@ -55,9 -53,11 +55,11 @@@ export * as fwRule from './fwrule.js'
export { packages, packageList, refreshPackages, packageFile, loadWasm } from './packages.js';
import { refreshPackages } from './packages.js';
export {
- windows, wm, useWindows, configureWindows, getApp, listApps, isLiveSystem, appIdOf, workArea, workAreaOf, pointerWorkArea, appMenus, useAppMenus, windowTitle, appRegistry, appMenuClick,
+ windows, wm, openedAt, useWindows, configureWindows, getApp, listApps, isLiveSystem, appIdOf, workArea, workAreaOf, pointerWorkArea, appMenus, useAppMenus, windowTitle, appRegistry, appMenuClick,
- registerBuiltinApp,
+ registerBuiltinApp, isSystemApp,
} from './windows.js';
+ export { codeStatus } from './codesig.js';
+ import { reportRefusedCode } from './codesig.js';
export { WindowShell, WINDOW_EDGE } from './windowshell.jsx';
export { term } from './terminal.js';
export { clipboard, clipboardHistory, clipboardPanel, clipboardKind } from './clipboard.js';
@@@ -180,8 -174,7 +182,9 @@@ export function startShell(element)
startReminders(); // calendar and reminder alarms, with the apps closed
maybeStartTour(); // "Welcome to LordOS", the first time
startHardware(); // Night Light, idle timers, battery in the menu bar (hardware.jsx)
+ startDiskWatch(); // notices when a disk gets too hot or its health gets worse
+ startVideo(); // browser video without hardware decoding (video.js, docs/VIDEO.md)
+ setTimeout(reportRefusedCode, 800); // "This LordOS component was modified and was not loaded" (docs/SIGNING.md)
}
// Changing the language remounts the whole interface (windows, tabs and
diff --cc server/Makefile
index e1b89c9,0566685..17ea601
--- a/server/Makefile
+++ b/server/Makefile
@@@ -48,12 -48,12 +48,12 @@@ QJS_OBJ := $(patsubst %,build/qjs/%.o,q
# .lpk app isolation, permissions and signing (src/sec, see docs/PRIVACY.md and docs/SIGNING.md)
# Monitor: metrics, connections and the country of an IP (src/monitor, see docs/MONITOR.md)
-MON_SRC := src/monitor/mon.c src/monitor/conn.c src/monitor/procctl.c src/monitor/proc_admin.c src/monitor/mmdb.c src/monitor/map.c src/ui/js_monitor.c
+MON_SRC := src/monitor/mon.c src/monitor/disktemp.c src/monitor/nethist.c src/monitor/netrec.c src/monitor/conn.c src/monitor/procctl.c src/monitor/proc_admin.c src/monitor/mmdb.c src/monitor/map.c src/ui/js_monitor.c
# Media (src/media, docs/MEDIA.md): only the lord-server side. Only lord-media links FFmpeg.
-MEDIA_SRC := src/media/media.c src/media/mview.c src/media/capture.c src/media/annot.c src/media/maudio.c src/media/mpulse.c src/media/proto.c src/ui/js_media.c
-SEC_SRC := src/sec/json.c src/sec/sign.c src/sec/pkgstate.c src/sec/perms.c src/sec/cgroup.c src/sec/sandbox.c src/sec/brokersrv.c src/sec/brokercam.c src/sec/brokerkr.c src/sec/restrict.c src/sec/appid.c src/sec/pwguard.c src/sec/codesig.c
+MEDIA_SRC := src/media/media.c src/media/hwdec.c src/media/mview.c src/media/capture.c src/media/annot.c src/media/maudio.c src/media/mpulse.c src/media/proto.c src/ui/js_media.c
- SEC_SRC := src/sec/json.c src/sec/sign.c src/sec/pkgstate.c src/sec/perms.c src/sec/cgroup.c src/sec/sandbox.c src/sec/brokersrv.c src/sec/brokercam.c src/sec/brokerkr.c src/sec/brokermail.c src/sec/restrict.c src/sec/appid.c src/sec/pwguard.c
++SEC_SRC := src/sec/json.c src/sec/sign.c src/sec/pkgstate.c src/sec/perms.c src/sec/cgroup.c src/sec/sandbox.c src/sec/brokersrv.c src/sec/brokercam.c src/sec/brokerkr.c src/sec/brokermail.c src/sec/restrict.c src/sec/appid.c src/sec/pwguard.c src/sec/codesig.c
# App mode: lord-server --app <id> runs an .lpk app as an isolated Wayland client (src/app)
-APP_SRC := src/app/appclient.c src/app/appspawn.c src/ui/js_broker.c src/ui/js_brokercam.c
+APP_SRC := src/app/appclient.c src/app/appspawn.c src/ui/js_broker.c src/ui/js_brokercam.c src/ui/js_brokermail.c src/app/apphost_bc.c
SRC := src/main.c src/kms.c src/gpu/gpu.c src/input.c src/canvas.c src/admin.c src/install/install.c src/apps.c src/lpk.c src/fsops.c src/remote/mirror.c src/remote/remote_admin.c src/remote/ssh_admin.c src/users/users_admin.c src/users/homedirs.c src/keyboard.c src/keylag.c src/ime.c src/wl/wl.c \
src/ui/node.c src/ui/style.c src/ui/layout.c src/ui/transform.c src/ui/text.c src/ui/image.c \
src/ui/paint.c src/ui/js.c src/ui/js_sys.c src/ui/js_term.c src/ui/js_wasm.c src/wasm/wasm.c src/wasm/wasm_run.c src/ui/js_sound.c src/ui/js_net.c src/sound/snd.c src/sound/pulse.c src/ui/otf.c src/ui/fonts.c \
diff --cc server/src/app/appclient.c
index d363b7c,5b13011..d9dee84
--- a/server/src/app/appclient.c
+++ b/server/src/app/appclient.c
@@@ -465,12 -461,9 +469,13 @@@ static int manifest_pair(const char *di
}
int app_main(const char *id, const char *theme_bundle, const char *fonts) {
+ t_start = now_ms();
if (!lpk_valid_id(id)) { fprintf(stderr, "lord-server --app: invalid id\n"); return 2; }
+ /* the process name is the app's id ("mail"), not "exe" (it was started through /proc/self/exe):
+ * ps, top and the Monitor's process list show which app it is */
+ prctl(PR_SET_NAME, id, 0, 0, 0);
char dir[PATH_MAX];
+ int sys;
{
/* <assets> = the parent of the fonts folder; a system app there wins over a user .lpk */
char assets[PATH_MAX];
@@@ -521,12 -516,12 +528,15 @@@
snprintf(langs, sizeof langs, "%s/.local/share/lordos/locales", home ? home : "/nonexistent");
const char *ro[] = { fonts, hostdir, "/usr/share/fonts", langs, NULL }; /* + fuentes del sistema (emoji, respaldo por escritura) */
SandboxConfig sb = { .id = id, .pkg_dir = dir, .data_dir = data, .runtime_dir = getenv("XDG_RUNTIME_DIR"), .ro_extra = ro, .network = net };
+ /* the local time zone is read now (libc keeps it): /etc/localtime and the zone files are
+ * outside the sandbox, and without this dates in Mail and Calendar would be in UTC */
+ tzset();
sandbox_apply(&sb);
- if (js_init_app(theme_bundle, id)) { fprintf(stderr, "lord-server --app: could not load the app\n"); return 1; }
+ int jr = js_init_app(theme_bundle, id);
+ if (jr == JS_REFUSED) fprintf(stderr, "lord-server --app: the app host was modified and was not loaded (recovery screen)\n");
+ else if (jr) { fprintf(stderr, "lord-server --app: could not load the app\n"); return 1; }
+ int recovered = jr == JS_REFUSED;
int wfd = wl_display_get_fd(dpy);
double start = now_ms();
diff --cc server/src/app/apphost_bc.c
index 84ef034,0000000..60e1b5d
mode 100644,000000..100644
--- a/server/src/app/apphost_bc.c
+++ b/server/src/app/apphost_bc.c
@@@ -1,136 -1,0 +1,142 @@@
+/* apphost_bc.c — the app host (assets/app-host.bundle.js: React, the runtime and the SDK) compiled
+ * to QuickJS bytecode once per session, so an isolated app does not parse 430 KB of JavaScript
+ * every time it starts (~80 ms on a 1.8 GHz core; reading the bytecode takes ~3 ms).
+ *
- * lord-server compiles it on a thread of its own, with its own QuickJS runtime, a few seconds
- * after the session starts, into a sealed memfd. app_spawn() hands the app process a read-only fd
- * of it (LORD_APPHOST_BC_FD). The app uses it only if the header names the very file it would
- * load (device, inode, size, modification time); otherwise, or with no fd, it parses the source as
- * before. The bytecode comes from lord-server (the same binary and QuickJS), never from the app or
- * from a file a user can write. */
++ * lord-server reads the bundle once through the verified-code check (codesig_load: the bytes that
++ * were hashed against the signed manifest are the bytes returned) and compiles exactly those bytes
++ * on a thread of its own, with its own QuickJS runtime, a few seconds after the session starts,
++ * into a sealed memfd. app_spawn() hands the app process a read-only fd of it
++ * (LORD_APPHOST_BC_FD). The app process loads and verifies the source itself as before and uses
++ * the bytecode only if its header carries the size and SHA-256 of those same bytes; otherwise, or
++ * with no fd, it parses the source. The bytecode comes from lord-server (the same binary and
++ * QuickJS), never from the app or from a file a user can write. */
+#include "apphost_bc.h"
++#include "../pkg/crypto.h"
++#include "../sec/codesig.h"
+#include "quickjs.h"
+
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdatomic.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <unistd.h>
+
+#define BC_MAGIC "LORDQBC1"
+#define BC_MAX (64u << 20)
+
+typedef struct {
+ char magic[8];
- uint64_t dev, ino, size;
- int64_t mtime_sec, mtime_nsec;
++ uint64_t size; /* source bytes it was compiled from */
++ uint8_t sha256[32]; /* and their SHA-256 */
+ uint64_t len; /* bytecode bytes that follow */
+} BcHeader;
+
+static _Atomic int bc_fd = -1;
+static char bc_path[1024];
++static char *bc_src; /* the verified bytes (codesig_load), owned by the thread */
++static size_t bc_len;
+
- static void header_of(const struct stat *st, BcHeader *h) {
++static void header_of(const char *src, size_t len, BcHeader *h) {
+ memset(h, 0, sizeof *h);
+ memcpy(h->magic, BC_MAGIC, 8);
- h->dev = (uint64_t)st->st_dev;
- h->ino = (uint64_t)st->st_ino;
- h->size = (uint64_t)st->st_size;
- h->mtime_sec = (int64_t)st->st_mtim.tv_sec;
- h->mtime_nsec = (int64_t)st->st_mtim.tv_nsec;
++ h->size = (uint64_t)len;
++ sha256(src, len, h->sha256);
+}
+
+static void *compile_thread(void *arg) {
+ (void)arg;
+ struct timespec pause = { 3, 0 }; /* after the desktop has drawn its first frames */
+ nanosleep(&pause, NULL);
- int fd = open(bc_path, O_RDONLY | O_CLOEXEC);
- struct stat st;
- if (fd < 0 || fstat(fd, &st) || !S_ISREG(st.st_mode) || st.st_size <= 0 || st.st_size > (off_t)BC_MAX) { if (fd >= 0) close(fd); return NULL; }
- char *src = malloc((size_t)st.st_size + 1);
- ssize_t got = src ? read(fd, src, (size_t)st.st_size) : -1;
- close(fd);
- if (got != st.st_size) { free(src); return NULL; }
- src[got] = 0;
++ char *src = bc_src;
++ size_t got = bc_len;
++ bc_src = NULL;
+ JSRuntime *rt = JS_NewRuntime();
+ JSContext *cx = rt ? JS_NewContext(rt) : NULL;
+ uint8_t *bc = NULL;
+ size_t bl = 0;
+ if (cx) {
- JSValue fn = JS_Eval(cx, src, (size_t)got, bc_path, JS_EVAL_TYPE_GLOBAL | JS_EVAL_FLAG_COMPILE_ONLY);
++ JSValue fn = JS_Eval(cx, src, got, bc_path, JS_EVAL_TYPE_GLOBAL | JS_EVAL_FLAG_COMPILE_ONLY);
+ if (!JS_IsException(fn)) bc = JS_WriteObject(cx, &bl, fn, JS_WRITE_OBJ_BYTECODE);
+ else JS_FreeValue(cx, JS_GetException(cx));
+ JS_FreeValue(cx, fn);
+ }
- free(src);
+ int mfd = -1;
+ if (bc && bl && bl < BC_MAX) {
+ BcHeader h;
- header_of(&st, &h);
++ header_of(src, got, &h);
+ h.len = bl;
+ mfd = memfd_create("lordos-apphost-bc", MFD_CLOEXEC | MFD_ALLOW_SEALING);
+ int ok = mfd >= 0 && write(mfd, &h, sizeof h) == (ssize_t)sizeof h;
+ size_t off = 0;
+ while (ok && off < bl) { ssize_t w = write(mfd, bc + off, bl - off); if (w <= 0) ok = 0; else off += (size_t)w; }
+ ok = ok && !fcntl(mfd, F_ADD_SEALS, F_SEAL_SHRINK | F_SEAL_GROW | F_SEAL_WRITE | F_SEAL_SEAL);
+ if (!ok && mfd >= 0) { close(mfd); mfd = -1; }
+ }
++ free(src);
+ if (bc) js_free(cx, bc);
+ if (cx) JS_FreeContext(cx);
+ if (rt) JS_FreeRuntime(rt);
+ if (mfd >= 0) {
+ atomic_store(&bc_fd, mfd);
+ fprintf(stderr, "lord-server: app host compiled to bytecode (%zu KB) for isolated apps\n", bl / 1024);
+ }
+ return NULL;
+}
+
+void apphost_bc_start(const char *bundle_path) {
+ static int started;
+ if (started || !bundle_path || strlen(bundle_path) >= sizeof bc_path) return;
+ started = 1;
+ snprintf(bc_path, sizeof bc_path, "%s", bundle_path);
++ /* in this thread: the verified-code state is the process's own (sec/codesig.c) */
++ char why[160];
++ bc_src = codesig_load(bc_path, BC_MAX, &bc_len, why, sizeof why);
++ if (!bc_src) { fprintf(stderr, "lord-server: no app host bytecode: %s\n", why); return; }
+ pthread_t t;
+ pthread_attr_t at;
+ pthread_attr_init(&at);
+ pthread_attr_setdetachstate(&at, PTHREAD_CREATE_DETACHED);
- if (pthread_create(&t, &at, compile_thread, NULL)) fprintf(stderr, "lord-server: no thread for the app host bytecode\n");
++ if (pthread_create(&t, &at, compile_thread, NULL)) {
++ fprintf(stderr, "lord-server: no thread for the app host bytecode\n");
++ free(bc_src);
++ bc_src = NULL;
++ }
+ pthread_attr_destroy(&at);
+}
+
+int apphost_bc_dup_ro(void) {
+ int fd = atomic_load(&bc_fd);
+ if (fd < 0) return -1;
+ char proc[64];
+ snprintf(proc, sizeof proc, "/proc/self/fd/%d", fd);
+ return open(proc, O_RDONLY | O_CLOEXEC); /* read-only: the app can only map it PROT_READ */
+}
+
- int apphost_bc_eval(JSContext *ctx, const char *bundle_path, int fd, int *ok) {
++int apphost_bc_eval(JSContext *ctx, const char *src, size_t len, int fd, int *ok) {
+ *ok = 0;
- struct stat st, fst;
- if (fd < 0 || !bundle_path || stat(bundle_path, &st) || fstat(fd, &fst) || fst.st_size < (off_t)sizeof(BcHeader) || fst.st_size > (off_t)BC_MAX) return -1;
++ struct stat fst;
++ if (fd < 0 || !src || fstat(fd, &fst) || fst.st_size < (off_t)sizeof(BcHeader) || fst.st_size > (off_t)BC_MAX) return -1;
+ void *m = mmap(NULL, (size_t)fst.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+ if (m == MAP_FAILED) return -1;
+ BcHeader want, h;
- header_of(&st, &want);
+ memcpy(&h, m, sizeof h);
- want.len = h.len;
- if (memcmp(&h, &want, sizeof h) || h.len != (uint64_t)fst.st_size - sizeof h) { munmap(m, (size_t)fst.st_size); return -1; }
++ if (memcmp(h.magic, BC_MAGIC, 8) || h.size != (uint64_t)len || h.len != (uint64_t)fst.st_size - sizeof h) { munmap(m, (size_t)fst.st_size); return -1; }
++ header_of(src, len, &want); /* compiled from exactly these bytes? */
++ if (memcmp(want.sha256, h.sha256, sizeof h.sha256)) { munmap(m, (size_t)fst.st_size); return -1; }
+ JSValue fn = JS_ReadObject(ctx, (const uint8_t *)m + sizeof h, (size_t)h.len, JS_READ_OBJ_BYTECODE);
+ munmap(m, (size_t)fst.st_size);
+ if (JS_IsException(fn)) { JS_FreeValue(ctx, JS_GetException(ctx)); return -1; }
+ JSValue r = JS_EvalFunction(ctx, fn); /* takes fn */
+ *ok = !JS_IsException(r);
+ if (!*ok) { /* it ran: the caller reports the exception, not a fallback */
+ JS_FreeValue(ctx, r);
+ return 1;
+ }
+ JS_FreeValue(ctx, r);
+ return 0;
+}
diff --cc server/src/app/apphost_bc.h
index 9416664,0000000..2b4aa2c
mode 100644,000000..100644
--- a/server/src/app/apphost_bc.h
+++ b/server/src/app/apphost_bc.h
@@@ -1,18 -1,0 +1,21 @@@
+/* apphost_bc.h — the app host compiled to QuickJS bytecode once per session (see apphost_bc.c). */
+#ifndef LORD_APPHOST_BC_H
+#define LORD_APPHOST_BC_H
+
+#include "quickjs.h"
+
+#define APPHOST_BC_ENV "LORD_APPHOST_BC_FD"
+
- /* lord-server: compile <bundle_path> on a thread of its own, a few seconds from now (once). */
++/* lord-server: read <bundle_path> once through the verified-code check (codesig_load, sec/codesig.c)
++ * and compile exactly those bytes on a thread of its own, a few seconds from now. Nothing is
++ * compiled if the check refuses the file. */
+void apphost_bc_start(const char *bundle_path);
+/* lord-server: a read-only fd of the bytecode for a new app process, or -1 if not ready yet. */
+int apphost_bc_dup_ro(void);
- /* The app process: run the bytecode in fd if it was compiled from exactly <bundle_path>.
++/* The app process: run the bytecode in fd if it was compiled from exactly src[0..len) (the bytes the
++ * app process itself loaded and verified: same size and SHA-256).
+ * -1: not usable (parse the source instead); 0: ran (*ok = 1); 1: ran and threw (*ok = 0, the
+ * exception is pending in ctx). */
- int apphost_bc_eval(JSContext *ctx, const char *bundle_path, int fd, int *ok);
++int apphost_bc_eval(JSContext *ctx, const char *src, size_t len, int fd, int *ok);
+
+#endif
diff --cc server/src/main.c
index f8fd771,637b746..5e9dc98
--- a/server/src/main.c
+++ b/server/src/main.c
@@@ -49,7 -48,10 +49,11 @@@
#include "hw/hw.h"
#include "hw/modes.h"
#include "outputs.h"
+#include "monitor/netrec.h"
+ #include "sec/codesig.h"
+
+ #include <libgen.h>
+ #include <limits.h>
#include <errno.h>
#include <fcntl.h>
@@@ -1567,16 -1578,8 +1643,13 @@@ int main(int argc, char **argv)
remote_refresh, remote_resize, remote_greeter, display_attach, display_detach,
remote_scroll, remote_pinch, remote_input_add };
if (ok && mirror_start(s.W, s.H, &mirror_in)) fprintf(stderr, "lord-server: no remote desktop (socket)\n");
- if (ok) {
- char path[1024];
- snprintf(path, sizeof path, "%s", theme);
- ok = js_init(path) == 0;
- }
+ char current[sizeof ui.theme_request];
+ if (ok) ok = start_theme(theme, s.greeter, current, sizeof current) == 0;
+ if (ok && !s.greeter) { /* the app host as bytecode for isolated apps (app/apphost_bc.c) */
+ char host[1200];
+ snprintf(host, sizeof host, "%s/app-host.bundle.js", js_sys_assets());
- apphost_bc_start(host);
++ apphost_bc_start(host); /* reads it through codesig_load and compiles those bytes */
+ }
if (!ok) {
input_close(&s.input);
if (!s.headless) kms_close(K0(&s));
diff --cc server/src/ui/js.c
index b829c8a,aec63fb..22ed94f
--- a/server/src/ui/js.c
+++ b/server/src/ui/js.c
@@@ -472,21 -556,26 +558,38 @@@ static void app_context(const char *app
js_wasm_register(ctx, g); /* WebAssembly for the app's loadWasm */
JS_SetPropertyStr(ctx, g, "lord", lord);
JS_FreeValue(ctx, g);
+ }
- double t0 = now_ms();
- int r = eval(prelude, sizeof prelude - 1, "<prelude>");
- /* the app host as bytecode lord-server compiled for this session (app/apphost_bc.c), else the source */
+ int js_init_app(const char *host_bundle, const char *app_id) {
+ char dir[1024];
+ snprintf(dir, sizeof dir, "%s", host_bundle);
+ snprintf(ui.theme_dir, sizeof ui.theme_dir, "%s", dirname(dir));
++ /* the app host as bytecode lord-server compiled for this session (app/apphost_bc.c) */
+ const char *bcs = getenv(APPHOST_BC_ENV);
+ int bcfd = bcs ? atoi(bcs) : -1, bcok = 0, how = -1;
+ unsetenv(APPHOST_BC_ENV);
+ size_t len = 0;
+ int refused = 0;
- char *src = load_code(host_bundle, &len, &refused);
++ char *src = load_code(host_bundle, &len, &refused); /* verified (sec/codesig.c) */
+ if (!src) {
++ if (bcfd > 2) close(bcfd);
+ if (!refused) return -1;
+ app_context(app_id); /* the window shows why instead of closing */
+ run_recovery("app", 0);
+ return JS_REFUSED;
+ }
+ app_context(app_id);
+ double t0 = now_ms();
+ int r = eval(prelude, sizeof prelude - 1, "<prelude>");
- if (!r) r = eval(src, len, host_bundle);
- fprintf(stderr, "js: app %s loaded in %.1f ms\n", app_id, now_ms() - t0);
++ /* the bytecode runs only if it was compiled from exactly the bytes just verified; else the source */
+ if (!r && bcfd > 2) {
- how = apphost_bc_eval(ctx, host_bundle, bcfd, &bcok);
++ how = apphost_bc_eval(ctx, src, len, bcfd, &bcok);
+ if (how == 1) { dump_exception(ctx); r = -1; }
+ drain_jobs();
+ }
+ if (bcfd > 2) close(bcfd);
- if (!r && how < 0) r = eval(src, (size_t)len, host_bundle);
++ if (!r && how < 0) r = eval(src, len, host_bundle);
+ fprintf(stderr, "js: app %s loaded in %.1f ms%s\n", app_id, now_ms() - t0, how == 0 ? " (bytecode)" : "");
free(src);
return r;
}