Compare commits

..
4 Commits
Author SHA1 Message Date
dependabot[bot] 89b0d20655 Chore(deps): Bump release-drafter/release-drafter/autolabeler from 7.8.0 to 7.10.0 (#7248)
Docker CI / Docker Build & Push (push) Waiting to run
Lint / Linting Checks (push) Waiting to run
Release Drafter / Update Release Draft (push) Waiting to run
Release Drafter / Auto Label PR (push) Waiting to run
Tests / vitest (1) (push) Waiting to run
Tests / vitest (2) (push) Waiting to run
Tests / vitest (3) (push) Waiting to run
Tests / vitest (4) (push) Waiting to run
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-15 18:39:43 +00:00
dependabot[bot] d20a5c5322 Chore(deps): Bump release-drafter/release-drafter from 7.8.0 to 7.10.0 (#7250)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-15 18:32:18 +00:00
dependabot[bot] 84721f2769 Chore(deps): Bump actions/setup-node from 7.0.0 to 7.1.0 (#7249)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-15 11:25:12 -07:00
Mustafa 11ca29104a Chore: send Gitea/Forgejo API key as Authorization header (#7245)
Docker CI / Docker Build & Push (push) Canceled after 0s
Lint / Linting Checks (push) Canceled after 0s
Release Drafter / Update Release Draft (push) Canceled after 0s
Release Drafter / Auto Label PR (push) Canceled after 0s
Tests / vitest (1) (push) Canceled after 0s
Tests / vitest (2) (push) Canceled after 0s
Tests / vitest (3) (push) Canceled after 0s
Tests / vitest (4) (push) Canceled after 0s
2026-10-14 16:29:58 -07:00
12 changed files with 86 additions and 57 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ jobs:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: 'pnpm'
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: 'pnpm'
+3 -3
View File
@@ -26,14 +26,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != ''
uses: release-drafter/release-drafter@c345907820e0396f6f44bcfd9ac4763325f8feb0 # v7
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7
with:
config-name: release-drafter.yml
version: ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name != 'workflow_dispatch' || github.event.inputs.version == ''
uses: release-drafter/release-drafter@c345907820e0396f6f44bcfd9ac4763325f8feb0 # v7
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7
with:
config-name: release-drafter.yml
env:
@@ -47,7 +47,7 @@ jobs:
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter/autolabeler@c345907820e0396f6f44bcfd9ac4763325f8feb0
- uses: release-drafter/release-drafter/autolabeler@978bb0b30c5ee8cdd332ced253758157150d43f0
with:
config-name: release-drafter.yml
env:
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
with:
version: 9
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6
with:
node-version: 24
cache: pnpm
+1 -1
View File
@@ -791,7 +791,7 @@
"processing": "Processant",
"processed": "Processat",
"time": "Temps",
"failed": "Error"
"failed": "Failed"
},
"firefly": {
"networth": "Valor Net",
+1 -1
View File
@@ -791,7 +791,7 @@
"processing": "Behandler",
"processed": "Behandlet",
"time": "Tid",
"failed": "Fejlet"
"failed": "Failed"
},
"firefly": {
"networth": "Nettoformue",
+15 -15
View File
@@ -871,12 +871,12 @@
"finished": "Fertig"
},
"bookorbit": {
"books": "Bücher",
"authors": "Autoren",
"series": "Serien",
"books": "Books",
"authors": "Authors",
"series": "Series",
"storage": "Storage",
"reading": "Reading",
"finished": "Beendet"
"finished": "Finished"
},
"jdownloader": {
"downloadCount": "Warteschlange",
@@ -999,11 +999,11 @@
"message": "Nachricht",
"tags": "Schlagwörter",
"none": "Keine",
"min": "Minimal",
"low": "Niedrig",
"default": "Standard",
"high": "Hoch",
"urgent": "Dringend"
"min": "Min",
"low": "Low",
"default": "Default",
"high": "High",
"urgent": "Urgent"
},
"plantit": {
"events": "Ereignisse",
@@ -1117,8 +1117,8 @@
"beszel": {
"name": "Name",
"systems": "Systeme",
"up": "Online",
"down": "Offline",
"up": "Up",
"down": "Down",
"paused": "Pausiert",
"pending": "Wartend",
"status": "Status",
@@ -1268,10 +1268,10 @@
"steps": "Schritte"
},
"syncthing": {
"connected": "Verbunden",
"synced": "Synchronisiert",
"errors": "Fehler",
"storage": "Speicher"
"connected": "Connected",
"synced": "Synced",
"errors": "Errors",
"storage": "Storage"
},
"sportarr": {
"wanted": "Wanted",
+13 -13
View File
@@ -257,14 +257,14 @@
"seed": "Semillas"
},
"qui": {
"leech": "Sanguijuela",
"download": "Descargar",
"seed": "Semilla",
"upload": "Subir",
"leech": "Leech",
"download": "Download",
"seed": "Seed",
"upload": "Upload",
"total": "Total",
"errored": "Con error",
"errored": "Errored",
"ratio": "Ratio",
"freeSpace": "Libre"
"freeSpace": "Free"
},
"qnap": {
"cpuUsage": "Uso de la CPU",
@@ -791,7 +791,7 @@
"processing": "Procesando",
"processed": "Procesado",
"time": "Tiempo",
"failed": "Fallido"
"failed": "Failed"
},
"firefly": {
"networth": "Patrimonio neto",
@@ -871,12 +871,12 @@
"finished": "Finalizado"
},
"bookorbit": {
"books": "Libros",
"authors": "Autores",
"books": "Books",
"authors": "Authors",
"series": "Series",
"storage": "Almacenamiento",
"reading": "Lectura",
"finished": "Finalizado"
"storage": "Storage",
"reading": "Reading",
"finished": "Finished"
},
"jdownloader": {
"downloadCount": "En cola",
@@ -1279,6 +1279,6 @@
"leagues": "Ligas"
},
"feed": {
"noItems": "No hay elementos"
"noItems": "No items"
}
}
+16 -16
View File
@@ -257,14 +257,14 @@
"seed": "Сид"
},
"qui": {
"leech": "Лич",
"download": "Скачивание",
"seed": "Сид",
"upload": "Загрузка",
"total": "Всего",
"errored": "Ошибок",
"ratio": "Соотношение",
"freeSpace": "Свободно"
"leech": "Leech",
"download": "Download",
"seed": "Seed",
"upload": "Upload",
"total": "Total",
"errored": "Errored",
"ratio": "Ratio",
"freeSpace": "Free"
},
"qnap": {
"cpuUsage": "Использование ЦП",
@@ -791,7 +791,7 @@
"processing": "Обрабатывается",
"processed": "Обработано",
"time": "Время",
"failed": "Неудачно"
"failed": "Failed"
},
"firefly": {
"networth": "Общая средства",
@@ -871,12 +871,12 @@
"finished": "Завершено"
},
"bookorbit": {
"books": "Книги",
"authors": "Авторы",
"series": "Серии",
"storage": "Память",
"reading": "Чтение",
"finished": "Завершено"
"books": "Books",
"authors": "Authors",
"series": "Series",
"storage": "Storage",
"reading": "Reading",
"finished": "Finished"
},
"jdownloader": {
"downloadCount": "Очередь",
@@ -1279,6 +1279,6 @@
"leagues": "Лиги"
},
"feed": {
"noItems": "Ничего нет"
"noItems": "No items"
}
}
+3 -2
View File
@@ -55,6 +55,7 @@ export default async function credentialedProxyHandler(req, res, map) {
"authentik",
"cloudflared",
"ghostfolio",
"gitea",
"headscale",
"hoarder",
"karakeep",
@@ -143,7 +144,7 @@ export default async function credentialedProxyHandler(req, res, map) {
headers["X-API-Key"] = `${widget.key}`;
}
const [status, contentType, data] = await httpProxy(url, {
const [status, contentType, data, responseHeaders] = await httpProxy(url, {
method: req.method,
withCredentials: true,
credentials: "include",
@@ -178,7 +179,7 @@ export default async function credentialedProxyHandler(req, res, map) {
.status(500)
.json({ error: { message: "Invalid data", url: sanitizeErrorURL(url), data: resultData } });
}
if (map) resultData = map(resultData);
if (map) resultData = map(resultData, responseHeaders);
}
if (contentType) res.setHeader("Content-Type", contentType);
@@ -45,6 +45,7 @@ vi.mock("widgets/widgets", () => ({
autobrr: { api: "{url}/{endpoint}" },
jellystat: { api: "{url}/{endpoint}" },
trilium: { api: "{url}/{endpoint}" },
gitea: { api: "{url}/api/v1/{endpoint}" },
gitlab: { api: "{url}/{endpoint}" },
azuredevops: { api: "{url}/{endpoint}" },
glances: { api: "{url}/{endpoint}" },
@@ -135,6 +136,33 @@ describe("utils/proxy/handlers/credentialed", () => {
expect(res.body).toEqual({ ok: true });
});
it("uses Bearer auth for gitea widgets and keeps the key out of the URL", async () => {
getServiceWidget.mockResolvedValue({ type: "gitea", url: "http://example", key: "token" });
httpProxy.mockResolvedValue([200, "application/json", []]);
const req = { method: "GET", query: { group: "g", service: "s", endpoint: "notifications?limit=1", index: 0 } };
const res = createMockRes();
await credentialedProxyHandler(req, res);
const [url, params] = httpProxy.mock.calls[0];
expect(params.headers.Authorization).toBe("Bearer token");
expect(url.toString()).toBe("http://example/api/v1/notifications?limit=1");
});
it("passes response headers to the mapping function", async () => {
getServiceWidget.mockResolvedValue({ type: "gitea", url: "http://example", key: "token" });
httpProxy.mockResolvedValue([200, "application/json", [], { "x-total-count": "7" }]);
const req = { method: "GET", query: { group: "g", service: "s", endpoint: "notifications?limit=1", index: 0 } };
const res = createMockRes();
await credentialedProxyHandler(req, res, (data, headers) => ({ count: Number(headers["x-total-count"]) }));
expect(res.statusCode).toBe(200);
expect(res.body).toEqual({ count: 7 });
});
it("uses NC-Token auth for nextcloud widgets when key is provided", async () => {
getServiceWidget.mockResolvedValue({ type: "nextcloud", url: "http://example", key: "nc-token" });
httpProxy.mockResolvedValue([200, "application/json", { ok: true }]);
+3 -3
View File
@@ -1,4 +1,4 @@
import genericProxyHandler from "utils/proxy/handlers/generic";
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
// Get total from header to avoid pagination limit
export function totalCount(data, headers) {
@@ -7,8 +7,8 @@ export function totalCount(data, headers) {
}
const widget = {
api: "{url}/api/v1/{endpoint}?access_token={key}",
proxyHandler: genericProxyHandler,
api: "{url}/api/v1/{endpoint}",
proxyHandler: credentialedProxyHandler,
mappings: {
notifications: {