Compare commits
21 Commits
8b9a0c1fc5
...
fe595d04ae
| Author | SHA1 | Date | |
|---|---|---|---|
| fe595d04ae | |||
| 40646f4196 | |||
| fd25f39ff7 | |||
| ab2a2a2083 | |||
| c18d50de12 | |||
| f96e1e3661 | |||
| 89eef9ed72 | |||
| 248ab88a41 | |||
| e23dbbde57 | |||
| 35a43fac27 | |||
| f255767dba | |||
| 602693ad2a | |||
| 414daaf5af | |||
| c845d2d60c | |||
| a7eae45464 | |||
| 3856d9d5a0 | |||
| 7930a06c07 | |||
| a753043dec | |||
| 3cba336484 | |||
| f533c1a3e7 | |||
| 2d73ccc99a |
@@ -69,6 +69,9 @@ services:
|
||||
# Should be comma separated and be the base domain
|
||||
# e.g. "youtube.com,google.com" NOT "https://youtube.com,https://videos.google.com"
|
||||
WHITELIST_BASE_DOMAIN: ""
|
||||
|
||||
# Specify a path to a certificate to trust, useful when using self-signed certificates.
|
||||
PROXY_TRUST_CA: ""
|
||||
|
||||
# Allow any domain in proxy
|
||||
# This shouldn't be used unless you KNOW what your doing
|
||||
|
||||
@@ -1 +1 @@
|
||||
Invidious klients ar modernu Material dizainu
|
||||
YouTube un Invidious klients ar modernu Material dizainu.
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2026-04-29T14:41:26.350324296Z">
|
||||
<DropdownSelection timestamp="2026-04-29T14:52:49.139078433Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=/home/wpearce/.android/avd/Pixel_9.avd" />
|
||||
|
||||
Generated
+7
-7
@@ -40,7 +40,7 @@
|
||||
"iso-3166": "^4.4.0",
|
||||
"iso-639-1": "^3.1.5",
|
||||
"jsdom": "^28.1.0",
|
||||
"libsodium-wrappers-sumo": "^0.8.2",
|
||||
"libsodium-wrappers-sumo": "^0.8.4",
|
||||
"mariadb": "^3.5.2",
|
||||
"material-dynamic-colors": "^1.1.1",
|
||||
"media-captions": "^0.0.18",
|
||||
@@ -10302,9 +10302,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
||||
"version": "1.16.0",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -12779,9 +12779,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/libsodium-wrappers-sumo": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.8.2.tgz",
|
||||
"integrity": "sha512-wd1xAY++Kr6VMikSaa4EPRAHJmFvNlGWiiwU3Jh3GR1zRYF3/I3vy/wYsr4k3LVsNzwb9sqfEQ4LdVQ6zEebyQ==",
|
||||
"version": "0.8.4",
|
||||
"resolved": "https://registry.npmjs.org/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.8.4.tgz",
|
||||
"integrity": "sha512-ql7hcgulKZ3ekfa2DGAogcCKsWU0diA/0nArz1CFzh93WQdb46/Kj18ka/Hifq6uA3Ush34Pc6vU/6HXeRwUkg==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"libsodium-sumo": "^0.8.0"
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
"iso-3166": "^4.4.0",
|
||||
"iso-639-1": "^3.1.5",
|
||||
"jsdom": "^28.1.0",
|
||||
"libsodium-wrappers-sumo": "^0.8.2",
|
||||
"libsodium-wrappers-sumo": "^0.8.4",
|
||||
"mariadb": "^3.5.2",
|
||||
"material-dynamic-colors": "^1.1.1",
|
||||
"media-captions": "^0.0.18",
|
||||
|
||||
@@ -42,13 +42,9 @@ export const fetchProxied = async (
|
||||
const nonProxiedUrl =
|
||||
requestInput instanceof Request ? requestInput.url : requestInput.toString();
|
||||
|
||||
console.log('nonProxiedUrl', nonProxiedUrl);
|
||||
|
||||
if (needsProxying(nonProxiedUrl)) {
|
||||
const proxiedUrl = corsProxyUrl + encodeUrl(nonProxiedUrl);
|
||||
|
||||
console.log('proxiedUrl', proxiedUrl);
|
||||
|
||||
if (requestInput instanceof Request) {
|
||||
requestInput = new Request(proxiedUrl, {
|
||||
method: requestInput.method,
|
||||
|
||||
@@ -134,7 +134,15 @@
|
||||
"darkMode": "Dunkler Modus",
|
||||
"lightMode": "Heller Modus",
|
||||
"AmoledTheme": "Amoled-Thema",
|
||||
"color": "Farbe"
|
||||
"color": "Farbe",
|
||||
"advanced": "Erweitertes Theming",
|
||||
"borderRadius": {
|
||||
"none": "Keine",
|
||||
"modern": "Modern",
|
||||
"rounded": "Abgerundet",
|
||||
"slight": "Leicht",
|
||||
"borderRadius": "Eckenabrundung"
|
||||
}
|
||||
},
|
||||
"searchSuggestions": "Suchvorschläge",
|
||||
"previewVideoOnHover": "Video-Vorschau beim Hovern",
|
||||
@@ -242,7 +250,8 @@
|
||||
"exportSub": "Abonnements exportieren",
|
||||
"exportToClipboard": "In die Zwischenablage exportieren",
|
||||
"exportToFile": "In eine Datei exportieren",
|
||||
"importFromFile": "Von einer Datei importieren"
|
||||
"importFromFile": "Von einer Datei importieren",
|
||||
"exportToShareUrl": "Exportieren um URL zu teilen"
|
||||
}
|
||||
},
|
||||
"subscribe": "Abonnieren",
|
||||
|
||||
@@ -70,7 +70,15 @@
|
||||
"darkMode": "Dunkle Modus",
|
||||
"lightMode": "Helle Modus",
|
||||
"AmoledTheme": "Amoled-Thema",
|
||||
"color": "Farb"
|
||||
"color": "Farb",
|
||||
"advanced": "Erwiiterts Theming",
|
||||
"borderRadius": {
|
||||
"none": "Keini",
|
||||
"slight": "Liecht",
|
||||
"modern": "Modern",
|
||||
"rounded": "Abgrundet",
|
||||
"borderRadius": "Eggeabrundig"
|
||||
}
|
||||
},
|
||||
"searchSuggestions": "Suechvorschläg",
|
||||
"previewVideoOnHover": "Video-Vorschau bim Hovere",
|
||||
@@ -139,7 +147,8 @@
|
||||
"exportSub": "Abonnements exportiere",
|
||||
"exportToClipboard": "I d Zwüscheablaag exportiere",
|
||||
"exportToFile": "In e Datei exportiere",
|
||||
"importFromFile": "Vonere Datei importiere"
|
||||
"importFromFile": "Vonere Datei importiere",
|
||||
"exportToShareUrl": "Exportiere zum d URL teile"
|
||||
}
|
||||
},
|
||||
"videos": "Videos",
|
||||
|
||||
@@ -69,7 +69,15 @@
|
||||
"darkMode": "Sötét mód",
|
||||
"lightMode": "Világos mód",
|
||||
"AmoledTheme": "Amoled téma",
|
||||
"color": "Szín"
|
||||
"color": "Szín",
|
||||
"advanced": "Speciális témázás",
|
||||
"borderRadius": {
|
||||
"none": "Nincs",
|
||||
"slight": "Enyhe",
|
||||
"modern": "Modern",
|
||||
"rounded": "Lekerekített",
|
||||
"borderRadius": "Szegélysugár"
|
||||
}
|
||||
},
|
||||
"searchSuggestions": "Keresési javaslatok",
|
||||
"previewVideoOnHover": "Videó előnézete az egérmutatóval",
|
||||
@@ -160,8 +168,10 @@
|
||||
"exportSub": "Feliratkozások exportálása",
|
||||
"exportToClipboard": "Vágólapra másolás",
|
||||
"exportToFile": "Mentés fájlba",
|
||||
"importFromFile": "Importálás fájlból"
|
||||
}
|
||||
"importFromFile": "Importálás fájlból",
|
||||
"exportToShareUrl": "Exportálás megosztási webcímre"
|
||||
},
|
||||
"preserveTranslation": "Eredeti fordítás használata"
|
||||
},
|
||||
"enabled": "Engedélyezve",
|
||||
"donate": "Adományozás",
|
||||
|
||||
@@ -138,7 +138,15 @@
|
||||
"darkMode": "ダークモード",
|
||||
"lightMode": "ライトモード",
|
||||
"color": "色",
|
||||
"AmoledTheme": "Amoled テーマ"
|
||||
"AmoledTheme": "Amoled テーマ",
|
||||
"advanced": "その他のテーマ設定",
|
||||
"borderRadius": {
|
||||
"none": "なし",
|
||||
"borderRadius": "角の丸み",
|
||||
"slight": "小",
|
||||
"modern": "中",
|
||||
"rounded": "大"
|
||||
}
|
||||
},
|
||||
"searchSuggestions": "検索候補を表示",
|
||||
"previewVideoOnHover": "マウスを乗せるとプレビュー",
|
||||
@@ -246,8 +254,10 @@
|
||||
"exportSub": "登録チャンネルをエクスポート",
|
||||
"exportToClipboard": "クリップボードへエクスポート",
|
||||
"exportToFile": "ファイルへエクスポート",
|
||||
"importFromFile": "ファイルからインポート"
|
||||
}
|
||||
"importFromFile": "ファイルからインポート",
|
||||
"exportToShareUrl": "共有URLにエクスポート"
|
||||
},
|
||||
"preserveTranslation": "オリジナルの翻訳を使用する"
|
||||
},
|
||||
"subscribe": "チャンネル登録",
|
||||
"invidiousBlockWarning": "Invidious は、現在Googleにブロックされています。このインスタンスで動画が読み込めない場合、{android} 版または {desktop} 版の Materialious でこのインスタンスを使用し、動画取得を直接行う代替接続を使ってください。",
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
"userJoined": "Lietotājs pievienojās jūsu skatīšanās ballītei.",
|
||||
"userLeft": "Lietotājs pameta jūsu skatīšanās ballīti."
|
||||
},
|
||||
"invidiousLogin": "Lūdzu, autorizējieties ar savu Invidious kontu",
|
||||
"invidiousLogin": "Lūdzu, autorizējieties ar savu Invidious kontu.",
|
||||
"noResult": "Bez rezultātiem",
|
||||
"letterCase": "Virsrakstu burtu reģistrs",
|
||||
"version": "Versija",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { isOwnBackend } from '$lib/shared';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { env as privateEnv } from '$env/dynamic/private';
|
||||
import { Agent } from 'undici';
|
||||
import fs from 'fs';
|
||||
import tls from 'tls';
|
||||
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { parse as tldParse } from 'tldts';
|
||||
@@ -59,6 +62,19 @@ for (const dynamicDomain of dynamicAllowDomainsEnvVars) {
|
||||
}
|
||||
}
|
||||
|
||||
let dispatcher: Agent;
|
||||
|
||||
const certPath = privateEnv.PROXY_TRUST_CA;
|
||||
if (certPath && fs.existsSync(certPath)) {
|
||||
dispatcher = new Agent({
|
||||
connect: {
|
||||
ca: [fs.readFileSync(certPath), ...tls.rootCertificates]
|
||||
}
|
||||
});
|
||||
} else {
|
||||
dispatcher = new Agent();
|
||||
}
|
||||
|
||||
async function proxyRequest(
|
||||
request: Request,
|
||||
urlToProxy: string,
|
||||
@@ -145,7 +161,9 @@ async function proxyRequest(
|
||||
response = await fetch(urlToProxyObj.toString(), {
|
||||
...requestOptions,
|
||||
body,
|
||||
signal: AbortSignal.timeout(10000)
|
||||
signal: AbortSignal.timeout(10000),
|
||||
// @ts-expect-error Node-specific option
|
||||
dispatcher
|
||||
});
|
||||
} catch (err) {
|
||||
errorMsg = (err as any).toString();
|
||||
|
||||
Reference in New Issue
Block a user