home-hosted 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -326,7 +326,7 @@ can be told what to be: *"Help me build a UI for home-hosted: nostalgic game the
326
326
  | 🌐 **Dynamic DNS** | Keep hostnames pointed at your public IP — Cloudflare, Namecheap, Spaceship, Porkbun, GoDaddy, Gandi and more. [DDNS.md](./docs/DDNS.md) |
327
327
  | 🔀 **Reverse proxy** | One Caddy engine in front of everything, with automatic HTTPS: `git.example.com` → a Gitea entry, `panel.example.com` → the panel itself. Installed and supervised by it. [Details](./docs/REVERSE_PROXY.md) |
328
328
  | 💾 **Backups** | One `.zip` of the panel and the workspaces you pick — plain or AES-256, picked per item, from the panel or the CLI. [Details](#-backups). |
329
- | 🌍 **Nine languages** | English, Vietnamese, Chinese, Japanese, Spanish, Korean, Russian, French, German — picked on the login page or in **Global settings → Language**, kept per browser. Action toasts included. The NOC console ships English-only on purpose; its density is the point. |
329
+ | 🌍 **Translated UI** | English, Vietnamese, Chinese, Japanese, Spanish, Korean, Russian, French and German — picked on the login page or in **Global settings → Language**, kept per browser. Action toasts included. The NOC console ships English-only on purpose; its density is the point. |
330
330
  | 🎨 **BYOU — Bring Your Own UI** | Upload a static build, `ui-update` to follow its releases, `ui-revert` to go back. [UI_CREATION.md](./docs/UI_CREATION.md) |
331
331
  | 🔐 **Security** | Cookie sessions, API tokens, scrypt hashes, per-IP lockout, optional TLS, and a refusal to expose itself without a password. |
332
332
  | 🧩 **Bring any program** | A server is a `command`, its args and a working directory — plus optional `dataEnvs`, `dependsOn` and `dump`/`load` hooks. Presets fill the form; nothing requires one. [Fields](./docs/SERVERS.md) |
package/dist/cli.js CHANGED
@@ -1880,7 +1880,14 @@ maxRssBytes: "number.integer >= 0 = 0" }).onUndeclaredKey("reject");
1880
1880
  /** The last probe's reading, so the page can say "this works" without running it again. */
1881
1881
  "lastReadingCelsius?": "number | null",
1882
1882
  /** Why the last probe failed, if it did — a missing library and no sensor read differently. */
1883
- "lastError?": "string | null"
1883
+ "lastError?": "string | null",
1884
+ /**
1885
+ * The library is missing and installing it needs consent.
1886
+ *
1887
+ * The panel will not download a third-party binary on a click that did not mention one, so the
1888
+ * first press answers `needsDownload` and the page asks. Absent on an older panel.
1889
+ */
1890
+ "needsDownload?": "boolean"
1884
1891
  });
1885
1892
  backupFileSchema = type({
1886
1893
  name: "string",
@@ -13107,18 +13114,12 @@ function wslTemperatureStatus(scriptPath, tempCommand) {
13107
13114
  const wsl = isWsl();
13108
13115
  const scriptWritten = scriptPath !== null && fs.existsSync(scriptPath);
13109
13116
  const configured = tempCommand.trim().length > 0;
13110
- let libraryPresent = false;
13111
- try {
13112
- libraryPresent = fs.existsSync(path.join("/mnt", "c", "Tools", "LibreHardwareMonitor", "LibreHardwareMonitorLib.dll"));
13113
- } catch {
13114
- libraryPresent = false;
13115
- }
13116
13117
  return {
13117
13118
  wsl,
13118
13119
  supported: wsl,
13119
13120
  configured,
13120
13121
  scriptWritten,
13121
- libraryPresent,
13122
+ libraryPresent: lhmInstalled(),
13122
13123
  scriptPath: wsl ? scriptPath : null,
13123
13124
  tempCommand: configured ? tempCommand : null
13124
13125
  };
@@ -13225,7 +13226,7 @@ async function probeWslTemperature(tempCommand, timeoutMs) {
13225
13226
  const match = /-?\d+(?:\.\d+)?/.exec(stdout);
13226
13227
  if (match === null) return {
13227
13228
  celsius: null,
13228
- error: stderr.trim().length > 0 ? stderr.trim() : "the script printed no number — is LibreHardwareMonitor installed at C:\\Tools\\LibreHardwareMonitor?"
13229
+ error: stderr.trim().length > 0 ? stderr.trim() : "the script printed no number — is LibreHardwareMonitor installed?"
13229
13230
  };
13230
13231
  const celsius = Number.parseFloat(match[0]);
13231
13232
  if (!Number.isFinite(celsius) || celsius <= 0 || celsius >= 150) return {
@@ -13325,6 +13326,17 @@ function createWslTemperatureRoute(deps) {
13325
13326
  code: "SCRIPT_WRITE_FAILED"
13326
13327
  });
13327
13328
  }
13329
+ if (!lhmInstalled()) {
13330
+ if (c.req.query("download") !== "true") return c.json({
13331
+ ...status(deps),
13332
+ needsDownload: true
13333
+ });
13334
+ const install = await installLibreHardwareMonitor();
13335
+ if (install.error !== null) throw new DetailedError(`LibreHardwareMonitor could not be installed: ${install.error}`, {
13336
+ statusCode: 400,
13337
+ code: "LIBRARY_INSTALL_FAILED"
13338
+ });
13339
+ }
13328
13340
  const command = tempCommandFor(target);
13329
13341
  const probe = await probeWslTemperature(command, 5e3);
13330
13342
  if (probe.celsius === null) return c.json({