mirror of
https://github.com/gethomepage/homepage.git
synced 2026-10-15 15:09:56 -07:00
Compare commits
2
Commits
a6fcde2222
...
6b4c1e6a5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b4c1e6a5a | ||
|
|
6bf81a78f3 |
@@ -791,7 +791,7 @@
|
||||
"processing": "Processant",
|
||||
"processed": "Processat",
|
||||
"time": "Temps",
|
||||
"failed": "Failed"
|
||||
"failed": "Error"
|
||||
},
|
||||
"firefly": {
|
||||
"networth": "Valor Net",
|
||||
|
||||
@@ -791,7 +791,7 @@
|
||||
"processing": "Behandler",
|
||||
"processed": "Behandlet",
|
||||
"time": "Tid",
|
||||
"failed": "Failed"
|
||||
"failed": "Fejlet"
|
||||
},
|
||||
"firefly": {
|
||||
"networth": "Nettoformue",
|
||||
|
||||
@@ -871,12 +871,12 @@
|
||||
"finished": "Fertig"
|
||||
},
|
||||
"bookorbit": {
|
||||
"books": "Books",
|
||||
"authors": "Authors",
|
||||
"series": "Series",
|
||||
"books": "Bücher",
|
||||
"authors": "Autoren",
|
||||
"series": "Serien",
|
||||
"storage": "Storage",
|
||||
"reading": "Reading",
|
||||
"finished": "Finished"
|
||||
"finished": "Beendet"
|
||||
},
|
||||
"jdownloader": {
|
||||
"downloadCount": "Warteschlange",
|
||||
@@ -999,11 +999,11 @@
|
||||
"message": "Nachricht",
|
||||
"tags": "Schlagwörter",
|
||||
"none": "Keine",
|
||||
"min": "Min",
|
||||
"low": "Low",
|
||||
"default": "Default",
|
||||
"high": "High",
|
||||
"urgent": "Urgent"
|
||||
"min": "Minimal",
|
||||
"low": "Niedrig",
|
||||
"default": "Standard",
|
||||
"high": "Hoch",
|
||||
"urgent": "Dringend"
|
||||
},
|
||||
"plantit": {
|
||||
"events": "Ereignisse",
|
||||
@@ -1117,8 +1117,8 @@
|
||||
"beszel": {
|
||||
"name": "Name",
|
||||
"systems": "Systeme",
|
||||
"up": "Up",
|
||||
"down": "Down",
|
||||
"up": "Online",
|
||||
"down": "Offline",
|
||||
"paused": "Pausiert",
|
||||
"pending": "Wartend",
|
||||
"status": "Status",
|
||||
@@ -1268,10 +1268,10 @@
|
||||
"steps": "Schritte"
|
||||
},
|
||||
"syncthing": {
|
||||
"connected": "Connected",
|
||||
"synced": "Synced",
|
||||
"errors": "Errors",
|
||||
"storage": "Storage"
|
||||
"connected": "Verbunden",
|
||||
"synced": "Synchronisiert",
|
||||
"errors": "Fehler",
|
||||
"storage": "Speicher"
|
||||
},
|
||||
"sportarr": {
|
||||
"wanted": "Wanted",
|
||||
|
||||
@@ -257,14 +257,14 @@
|
||||
"seed": "Semillas"
|
||||
},
|
||||
"qui": {
|
||||
"leech": "Leech",
|
||||
"download": "Download",
|
||||
"seed": "Seed",
|
||||
"upload": "Upload",
|
||||
"leech": "Sanguijuela",
|
||||
"download": "Descargar",
|
||||
"seed": "Semilla",
|
||||
"upload": "Subir",
|
||||
"total": "Total",
|
||||
"errored": "Errored",
|
||||
"errored": "Con error",
|
||||
"ratio": "Ratio",
|
||||
"freeSpace": "Free"
|
||||
"freeSpace": "Libre"
|
||||
},
|
||||
"qnap": {
|
||||
"cpuUsage": "Uso de la CPU",
|
||||
@@ -791,7 +791,7 @@
|
||||
"processing": "Procesando",
|
||||
"processed": "Procesado",
|
||||
"time": "Tiempo",
|
||||
"failed": "Failed"
|
||||
"failed": "Fallido"
|
||||
},
|
||||
"firefly": {
|
||||
"networth": "Patrimonio neto",
|
||||
@@ -871,12 +871,12 @@
|
||||
"finished": "Finalizado"
|
||||
},
|
||||
"bookorbit": {
|
||||
"books": "Books",
|
||||
"authors": "Authors",
|
||||
"books": "Libros",
|
||||
"authors": "Autores",
|
||||
"series": "Series",
|
||||
"storage": "Storage",
|
||||
"reading": "Reading",
|
||||
"finished": "Finished"
|
||||
"storage": "Almacenamiento",
|
||||
"reading": "Lectura",
|
||||
"finished": "Finalizado"
|
||||
},
|
||||
"jdownloader": {
|
||||
"downloadCount": "En cola",
|
||||
@@ -1279,6 +1279,6 @@
|
||||
"leagues": "Ligas"
|
||||
},
|
||||
"feed": {
|
||||
"noItems": "No items"
|
||||
"noItems": "No hay elementos"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,14 +257,14 @@
|
||||
"seed": "Сид"
|
||||
},
|
||||
"qui": {
|
||||
"leech": "Leech",
|
||||
"download": "Download",
|
||||
"seed": "Seed",
|
||||
"upload": "Upload",
|
||||
"total": "Total",
|
||||
"errored": "Errored",
|
||||
"ratio": "Ratio",
|
||||
"freeSpace": "Free"
|
||||
"leech": "Лич",
|
||||
"download": "Скачивание",
|
||||
"seed": "Сид",
|
||||
"upload": "Загрузка",
|
||||
"total": "Всего",
|
||||
"errored": "Ошибок",
|
||||
"ratio": "Соотношение",
|
||||
"freeSpace": "Свободно"
|
||||
},
|
||||
"qnap": {
|
||||
"cpuUsage": "Использование ЦП",
|
||||
@@ -791,7 +791,7 @@
|
||||
"processing": "Обрабатывается",
|
||||
"processed": "Обработано",
|
||||
"time": "Время",
|
||||
"failed": "Failed"
|
||||
"failed": "Неудачно"
|
||||
},
|
||||
"firefly": {
|
||||
"networth": "Общая средства",
|
||||
@@ -871,12 +871,12 @@
|
||||
"finished": "Завершено"
|
||||
},
|
||||
"bookorbit": {
|
||||
"books": "Books",
|
||||
"authors": "Authors",
|
||||
"series": "Series",
|
||||
"storage": "Storage",
|
||||
"reading": "Reading",
|
||||
"finished": "Finished"
|
||||
"books": "Книги",
|
||||
"authors": "Авторы",
|
||||
"series": "Серии",
|
||||
"storage": "Память",
|
||||
"reading": "Чтение",
|
||||
"finished": "Завершено"
|
||||
},
|
||||
"jdownloader": {
|
||||
"downloadCount": "Очередь",
|
||||
@@ -1279,6 +1279,6 @@
|
||||
"leagues": "Лиги"
|
||||
},
|
||||
"feed": {
|
||||
"noItems": "No items"
|
||||
"noItems": "Ничего нет"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,11 @@ export function substituteEnvironmentVars(str) {
|
||||
const cachedVars = getCachedEnvironmentVars();
|
||||
cachedVars.forEach(([key, value]) => {
|
||||
if (key.startsWith(homepageVarPrefix)) {
|
||||
result = result.replaceAll(`{{${key}}}`, value);
|
||||
result = result.replaceAll(`{{${key}}}`, () => value);
|
||||
} else if (key.startsWith(homepageFilePrefix)) {
|
||||
const filename = value;
|
||||
const fileContents = readFileSync(filename, "utf8");
|
||||
result = result.replaceAll(`{{${key}}}`, fileContents);
|
||||
result = result.replaceAll(`{{${key}}}`, () => fileContents);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { mkdtempSync, writeFileSync } from "node:fs";
|
||||
import { mkdtempSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -37,6 +37,39 @@ describe("utils/config/config", () => {
|
||||
expect(mod.substituteEnvironmentVars("token={{HOMEPAGE_FILE_SECRET}}")).toBe("token=secret");
|
||||
});
|
||||
|
||||
it.each(["pa$$word", "pa$&word", "pa$`word", "pa$'word", "pa$1word"])(
|
||||
"substituteEnvironmentVars preserves literal environment value %j in every occurrence",
|
||||
async (secret) => {
|
||||
process.env.HOMEPAGE_VAR_SECRET = secret;
|
||||
|
||||
const mod = await import("./config");
|
||||
expect(
|
||||
mod.substituteEnvironmentVars("before {{HOMEPAGE_VAR_SECRET}} between {{HOMEPAGE_VAR_SECRET}} after"),
|
||||
).toBe(`before ${secret} between ${secret} after`);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(["pa$$word", "pa$&word", "pa$`word", "pa$'word", "pa$1word"])(
|
||||
"substituteEnvironmentVars preserves literal secret file contents %j in every occurrence",
|
||||
async (secret) => {
|
||||
const dir = mkdtempSync(path.join(tmpdir(), "homepage-config-test-"));
|
||||
const secretPath = path.join(dir, "secret.txt");
|
||||
writeFileSync(secretPath, secret, "utf8");
|
||||
|
||||
try {
|
||||
process.env.HOMEPAGE_FILE_SECRET = secretPath;
|
||||
|
||||
const mod = await import("./config");
|
||||
expect(
|
||||
mod.substituteEnvironmentVars("before {{HOMEPAGE_FILE_SECRET}} between {{HOMEPAGE_FILE_SECRET}} after"),
|
||||
).toBe(`before ${secret} between ${secret} after`);
|
||||
} finally {
|
||||
unlinkSync(secretPath);
|
||||
rmdirSync(dir);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it("getSettings reads from HOMEPAGE_CONFIG_DIR and converts layout list to an object", async () => {
|
||||
const dir = mkdtempSync(path.join(tmpdir(), "homepage-settings-test-"));
|
||||
process.env.HOMEPAGE_CONFIG_DIR = dir;
|
||||
|
||||
Reference in New Issue
Block a user