From 5e7324bca9c2ba4ec480ae6640130416bc52ba32 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Tue, 17 Sep 2024 14:05:25 +0000 Subject: [PATCH 01/48] web/SettingsCategory: add copy link to settings header --- .../settings/SettingsCategory.svelte | 56 ++++++++++++++++++- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/web/src/components/settings/SettingsCategory.svelte b/web/src/components/settings/SettingsCategory.svelte index 2b9503df0..1e4757610 100644 --- a/web/src/components/settings/SettingsCategory.svelte +++ b/web/src/components/settings/SettingsCategory.svelte @@ -1,6 +1,8 @@
-
+
showCopy = true} + on:mouseleave={() => showCopy = false} + role="link" + tabindex="0" + >

{title}

{#if beta}
{$t("general.beta")}
{/if} + {#if showCopy} + + {/if}
diff --git a/web/src/components/settings/SettingsCategory.svelte b/web/src/components/settings/SettingsCategory.svelte index 1e4757610..520be2dbe 100644 --- a/web/src/components/settings/SettingsCategory.svelte +++ b/web/src/components/settings/SettingsCategory.svelte @@ -1,8 +1,8 @@ @@ -63,7 +58,7 @@ padding: var(--padding) 5px; color: var(--sidebar-highlight); font-size: var(--sidebar-font-size); - opacity: 0.8; + opacity: 0.75; height: fit-content; border-radius: var(--border-radius); transition: transform 0.2s; @@ -88,19 +83,15 @@ color: var(--sidebar-bg); background: var(--sidebar-highlight); opacity: 1; - transition: none; transform: none; + animation: pressButton 0.3s; } - :global(.sidebar-tab.animate) { - animation: pressButton 0.2s; - } - - .sidebar-tab:active:not(.active) { + .sidebar-tab:active { transform: scale(0.95); } - :global([data-reduce-motion="true"]) .sidebar-tab:active:not(.active) { + :global([data-reduce-motion="true"]) .sidebar-tab:active { transform: none; } @@ -112,10 +103,10 @@ @keyframes pressButton { 0% { - transform: scale(0.95); + transform: scale(0.9); } 50% { - transform: scale(1.02); + transform: scale(1.015); } 100% { transform: scale(1); @@ -127,6 +118,7 @@ opacity: 1; background-color: var(--sidebar-hover); } + .sidebar-tab:hover:not(.active) { opacity: 1; background-color: var(--sidebar-hover); @@ -136,9 +128,15 @@ @media screen and (max-width: 535px) { .sidebar-tab { padding: 5px var(--padding); + gap: 3px; min-width: calc(var(--sidebar-width) / 2); } + .sidebar-tab :global(svg) { + height: 22px; + width: 22px; + } + .sidebar-tab.active { z-index: 2; } @@ -149,10 +147,10 @@ @keyframes pressButton { 0% { - transform: scale(0.9); + transform: scale(0.8); } - 60% { - transform: scale(1.015); + 50% { + transform: scale(1.02); } 100% { transform: scale(1); From 521eb4b64376f3dfe5e6c6469c8a0b624725270c Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 15:58:32 +0600 Subject: [PATCH 09/48] web/Sidebar: remove fixed width for tabs container --- web/src/components/sidebar/Sidebar.svelte | 2 -- 1 file changed, 2 deletions(-) diff --git a/web/src/components/sidebar/Sidebar.svelte b/web/src/components/sidebar/Sidebar.svelte index df03e6eae..ca3a963eb 100644 --- a/web/src/components/sidebar/Sidebar.svelte +++ b/web/src/components/sidebar/Sidebar.svelte @@ -70,7 +70,6 @@ #sidebar-tabs { height: 100%; - width: var(--sidebar-width); justify-content: space-between; padding: var(--sidebar-inner-padding); padding-bottom: var(--border-radius); @@ -110,7 +109,6 @@ overflow-x: scroll; padding-bottom: 0; padding: var(--sidebar-inner-padding) 0; - width: unset; height: fit-content; } From 02267b4db42f752d2db45542205d88deb5e4cf7b Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 16:17:22 +0600 Subject: [PATCH 10/48] web/i18n/about: use section heading component --- web/i18n/en/about/credits.md | 14 ++++++++---- web/i18n/en/about/general.md | 32 ++++++++++++++++++++-------- web/i18n/en/about/privacy.md | 41 ++++++++++++++++++++++++------------ web/i18n/en/about/terms.md | 32 ++++++++++++++++++++-------- 4 files changed, 84 insertions(+), 35 deletions(-) diff --git a/web/i18n/en/about/credits.md b/web/i18n/en/about/credits.md index 4002806a3..442499e40 100644 --- a/web/i18n/en/about/credits.md +++ b/web/i18n/en/about/credits.md @@ -1,10 +1,14 @@
+ -### meowbalt meowbalt is cobalt's speedy mascot. he is an extremely expressive cat that loves fast internet. all amazing drawings of meowbalt that you see in cobalt were made by [GlitchyPSI](https://glitchypsi.xyz/). @@ -13,11 +17,14 @@ he is also the original designer of the character. you cannot use or modify GlitchyPSI's artworks of meowbalt without his explicit permission. you cannot use or modify the meowbalt character design commercially or in any form that isn't fan art. -
+
+ -### cobalt licenses cobalt processing server is open source and licensed under [AGPL-3.0]({docs.apiLicense}). cobalt frontend is [source first](https://sourcefirst.com/) and licensed under [CC-BY-NC-SA 4.0]({docs.webLicense}). @@ -25,5 +32,4 @@ we decided to use this license to stop grifters from profiting off our work & fr we rely on many open source libraries, create & distribute our own. you can see the full list of dependencies on [github]({contacts.github}). -
diff --git a/web/i18n/en/about/general.md b/web/i18n/en/about/general.md index 5bdea833b..1b32e8150 100644 --- a/web/i18n/en/about/general.md +++ b/web/i18n/en/about/general.md @@ -1,19 +1,25 @@
+ -### best way to save what you love cobalt lets you save anything from your favorite websites: video, audio, photos or gifs — cobalt can do it all! no ads, trackers, or paywalls, no nonsense. just a convenient web app that works everywhere. -
+ -### leading privacy all requests to backend are anonymous and all tunnels are encrypted. we have a strict zero log policy and don't track *anything* about individual people. @@ -23,12 +29,14 @@ this technology is used when your request needs additional processing, such as w for even higher level of protection, you can [ask cobalt to always tunnel everything](/settings/privacy#tunnel). when enabled, cobalt will proxy everything through itself. no one will know what you download, even your network provider/admin. all they'll see is that you're using cobalt. -
+ -### blazing speed since we don't rely on any existing downloaders and develop our own from ground up, cobalt is extremely efficient and a processing server can run on basically any hardware. @@ -37,11 +45,14 @@ to reduce latency and distribute the traffic. we constantly improve our infrastructure along with our long-standing partner, [royalehosting.net]({partners.royalehosting})! you're in good hands, and will get what you need within seconds. -
+
+ -### open community cobalt is used by countless artists, educators, and content creators to do what they love. we're always on the line with our community and work together to create even more useful tools for them. feel free to [join the conversation](/about/community)! @@ -51,11 +62,14 @@ at any time, we welcome all contributions and suggestions. you can use any processing instances hosted by the community, including your own. if your friend hosts one, just ask them for a domain and [add it in instance settings](/settings/instances#community). -
+
+ -### on-device processing new features, such as [remuxing](/remux), work on-device. on-device processing is efficient and never sends anything over the internet. it perfectly aligns with our future goal of moving as much processing as possible to client. diff --git a/web/i18n/en/about/privacy.md b/web/i18n/en/about/privacy.md index 4a3d8b767..c76fdd4ca 100644 --- a/web/i18n/en/about/privacy.md +++ b/web/i18n/en/about/privacy.md @@ -1,40 +1,55 @@
+ -### general terms cobalt's privacy policy is simple: we don't collect or store anything about you. what you do is solely your business, not ours or anyone else's. these terms are applicable only when using the official cobalt instance. in other cases, you may need to contact the hoster for accurate info. -
+
+ -### on-device processing tools that use on-device processing work offline, locally, and never send any data anywhere. they are explicitly marked as such whenever applicable. -
+
+ -### saving when using saving functionality, in some cases cobalt will encrypt & temporarily store information needed for tunneling. it's stored in processing server's RAM for 90 seconds and irreversibly purged afterwards. no one has access to it, even instance owners, as long as they don't modify the official cobalt image. processed/tunneled files are never cached anywhere. everything is tunneled live. cobalt's saving functionality is essentially a fancy proxy service. -
+
+ -### encryption temporarily stored tunnel data is encrypted using the AES-256 standard. decryption keys are only included in the access link and never logged/cached/stored anywhere. only the end user has access to the link & encryption keys. keys are generated uniquely for each requested tunnel. -
{#if env.PLAUSIBLE_ENABLED}
+ -### anonymous traffic analytics for sake of privacy, we use [plausible's anonymous traffic analytics](https://plausible.io/) to get an approximate number of active cobalt users. no identifiable information about you or your requests is ever stored. all data is anonymized and aggregated. the plausible instance we use is hosted & managed by us. plausible doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR. @@ -42,18 +57,18 @@ plausible doesn't use cookies and is fully compliant with GDPR, CCPA, and PECR. [learn more about plausible's dedication to privacy.](https://plausible.io/privacy-focused-web-analytics) if you wish to opt out of anonymous analytics, you can do it in privacy settings. -
- {/if}
+ -### web privacy & security we use cloudflare services for ddos & bot protection. we also use cloudflare pages for deploying & hosting the static web app. all of these are required to provide the best experience for everyone. it's the most private & reliable provider that we know of. cloudflare is fully compliant with GDPR and HIPAA. [learn more about cloudflare's dedication to privacy.](https://www.cloudflare.com/trust-hub/privacy-and-data-protection/) -
diff --git a/web/i18n/en/about/terms.md b/web/i18n/en/about/terms.md index 1c82124c8..cd0c10fd5 100644 --- a/web/i18n/en/about/terms.md +++ b/web/i18n/en/about/terms.md @@ -1,32 +1,46 @@ + +
+ -### general terms these terms are applicable only when using the official cobalt instance. in other cases, you may need to contact the hoster for accurate info. -
+ -### saving saving functionality simplifies downloading content from the internet and takes zero liability for what the saved content is used for. processing servers work like advanced proxies and don't ever write any content to disk. everything is handled in RAM and permanently purged once the tunnel is done. we have no downloading logs and can't identify anyone. [you can read more about how tunnels work in our privacy policy.](/about/privacy) -
+ -### responsibilities you (end user) are responsible for what you do with our tools, how you use and distribute resulting content. please be mindful when using content of others and always credit original creators. make sure you don't violate any terms or licenses. when used in educational purposes, always cite sources and credit original creators. fair use and credits benefit everyone. -
-
-### reporting abuse -we have no way of detecting abusive behavior automatically, as cobalt is 100% anonymous. however, you can report such activities to us and we will do our best to comply manually: [safety@imput.net](mailto:safety@imput.net) +
+ +we have no way of detecting abusive behavior automatically, as cobalt is 100% anonymous. +however, you can report such activities to us and we will do our best to comply manually: [safety@imput.net](mailto:safety@imput.net)
From d1686be58339d92629c3ccd7b952180fc251595e Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 17:41:10 +0600 Subject: [PATCH 11/48] web/i18n/about: replace section titles with i18n strings --- web/i18n/en/about.json | 16 +++++++++++++++- web/i18n/en/about/credits.md | 6 ++++-- web/i18n/en/about/general.md | 12 +++++++----- web/i18n/en/about/privacy.md | 14 ++++++++------ web/i18n/en/about/terms.md | 9 +++++---- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/web/i18n/en/about.json b/web/i18n/en/about.json index e566faaaf..b441512e6 100644 --- a/web/i18n/en/about.json +++ b/web/i18n/en/about.json @@ -12,5 +12,19 @@ "community.twitter": "news account on twitter", "community.github": "github repo", "community.email": "support email", - "community.telegram": "news channel on telegram" + "community.telegram": "news channel on telegram", + + "heading.general": "general terms", + "heading.licenses": "licenses", + "heading.summary": "best way to save what you love", + "heading.privacy": "leading privacy", + "heading.speed": "blazing speed", + "heading.community": "open community", + "heading.local": "on-device processing", + "heading.saving": "saving", + "heading.encryption": "encryption", + "heading.plausible": "anonymous traffic analytics", + "heading.cloudflare": "web privacy & security", + "heading.responsibility": "user responsibilities", + "heading.abuse": "reporting abuse" } diff --git a/web/i18n/en/about/credits.md b/web/i18n/en/about/credits.md index 442499e40..27266ea41 100644 --- a/web/i18n/en/about/credits.md +++ b/web/i18n/en/about/credits.md @@ -1,11 +1,13 @@
@@ -21,7 +23,7 @@ you cannot use or modify the meowbalt character design commercially or in any fo
diff --git a/web/i18n/en/about/general.md b/web/i18n/en/about/general.md index 1b32e8150..333e119e7 100644 --- a/web/i18n/en/about/general.md +++ b/web/i18n/en/about/general.md @@ -1,11 +1,13 @@
@@ -16,7 +18,7 @@ no ads, trackers, or paywalls, no nonsense. just a convenient web app that works
@@ -33,7 +35,7 @@ all they'll see is that you're using cobalt.
@@ -49,7 +51,7 @@ you're in good hands, and will get what you need within seconds.
@@ -66,7 +68,7 @@ if your friend hosts one, just ask them for a domain and [add it in instance set
diff --git a/web/i18n/en/about/privacy.md b/web/i18n/en/about/privacy.md index c76fdd4ca..b19ca762b 100644 --- a/web/i18n/en/about/privacy.md +++ b/web/i18n/en/about/privacy.md @@ -1,11 +1,13 @@
@@ -16,7 +18,7 @@ these terms are applicable only when using the official cobalt instance. in othe
@@ -25,7 +27,7 @@ tools that use on-device processing work offline, locally, and never send any da
@@ -36,7 +38,7 @@ processed/tunneled files are never cached anywhere. everything is tunneled live.
@@ -46,7 +48,7 @@ temporarily stored tunnel data is encrypted using the AES-256 standard. decrypti {#if env.PLAUSIBLE_ENABLED}
@@ -62,7 +64,7 @@ if you wish to opt out of anonymous analytics, you can do it in diff --git a/web/i18n/en/about/terms.md b/web/i18n/en/about/terms.md index cd0c10fd5..453030cfb 100644 --- a/web/i18n/en/about/terms.md +++ b/web/i18n/en/about/terms.md @@ -1,10 +1,11 @@
@@ -13,7 +14,7 @@ these terms are applicable only when using the official cobalt instance. in othe
@@ -24,7 +25,7 @@ saving functionality simplifies downloading content from the internet and takes
@@ -37,7 +38,7 @@ fair use and credits benefit everyone.
From 97977efabd92375f270d1818f38de3b0682c2f19 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 18:44:24 +0600 Subject: [PATCH 12/48] web: generate `_headers` & add `Content-Security-Policy` header --- web/src/routes/_headers/+server.ts | 28 ++++++++++++++++++++++++++++ web/static/_headers | 3 --- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 web/src/routes/_headers/+server.ts delete mode 100644 web/static/_headers diff --git a/web/src/routes/_headers/+server.ts b/web/src/routes/_headers/+server.ts new file mode 100644 index 000000000..2cbf4e88a --- /dev/null +++ b/web/src/routes/_headers/+server.ts @@ -0,0 +1,28 @@ +export async function GET() { + const CSP = [ + "default-src 'none'", + "script-src 'self' challenges.cloudflare.com", + "frame-src challenges.cloudflare.com", + ] + + const _headers = { + "/*": { + "Cross-Origin-Opener-Policy": "same-origin", + "Cross-Origin-Embedder-Policy": "require-corp", + "Content-Security-Policy": CSP.join("; "), + } + } + + return new Response( + Object.entries(_headers).map( + ([path, headers]) => [ + path, + Object.entries(headers).map( + ([key, value]) => ` ${key}: ${value}` + ) + ].flat().join("\n") + ).join("\n\n") + ); +} + +export const prerender = true; diff --git a/web/static/_headers b/web/static/_headers deleted file mode 100644 index cabbdca54..000000000 --- a/web/static/_headers +++ /dev/null @@ -1,3 +0,0 @@ -/* - Cross-Origin-Opener-Policy: same-origin - Cross-Origin-Embedder-Policy: require-corp From 732199332e6d5669545a4970501a2a06a3497299 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 19:06:46 +0600 Subject: [PATCH 13/48] web/headers: fix CSP directives & refactor --- web/src/routes/_headers/+server.ts | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/web/src/routes/_headers/+server.ts b/web/src/routes/_headers/+server.ts index 2cbf4e88a..f8b3c81df 100644 --- a/web/src/routes/_headers/+server.ts +++ b/web/src/routes/_headers/+server.ts @@ -1,15 +1,32 @@ +import env from "$lib/env"; + export async function GET() { - const CSP = [ - "default-src 'none'", - "script-src 'self' challenges.cloudflare.com", - "frame-src challenges.cloudflare.com", - ] + const CSP = { + "connect-src": ["*"], + "default-src": ["'none'"], + + "font-src": ["'self'"], + "style-src": ["'self'"], + "img-src": ["'self'"], + "manifest-src": ["'self'"], + "worker-src": ["'self'"], + + "script-src": [ + "'self'", + "challenges.cloudflare.com", + env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : "" + ], + "frame-src": ["challenges.cloudflare.com"], + } const _headers = { "/*": { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp", - "Content-Security-Policy": CSP.join("; "), + "Content-Security-Policy": + Object.entries(CSP).map( + ([directive, values]) => `${directive} ${values.join(' ')}` + ).flat().join("; "), } } From 9024418aff0bab9cd07a54492ef19bd94ecef13b Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 19:12:13 +0600 Subject: [PATCH 14/48] web/headers: add more stuff to CSP again --- web/src/routes/_headers/+server.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/src/routes/_headers/+server.ts b/web/src/routes/_headers/+server.ts index f8b3c81df..96e00a8c6 100644 --- a/web/src/routes/_headers/+server.ts +++ b/web/src/routes/_headers/+server.ts @@ -1,5 +1,11 @@ import env from "$lib/env"; +const allowedScriptOrigins = [ + "'self'", + "challenges.cloudflare.com", + env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : "" +] + export async function GET() { const CSP = { "connect-src": ["*"], @@ -7,15 +13,14 @@ export async function GET() { "font-src": ["'self'"], "style-src": ["'self'"], - "img-src": ["'self'"], + "style-src-attr": ["'self'"], + "style-src-elem": ["'self'"], + "img-src": ["'self'", "data:"], "manifest-src": ["'self'"], "worker-src": ["'self'"], - "script-src": [ - "'self'", - "challenges.cloudflare.com", - env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : "" - ], + "script-src": allowedScriptOrigins, + "script-src-attr": allowedScriptOrigins, "frame-src": ["challenges.cloudflare.com"], } From 52599dd90035863726f7a28631305303eb061889 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 19:16:23 +0600 Subject: [PATCH 15/48] web/headers: update csp yet again whatever dude --- web/src/routes/_headers/+server.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/web/src/routes/_headers/+server.ts b/web/src/routes/_headers/+server.ts index 96e00a8c6..708d69acb 100644 --- a/web/src/routes/_headers/+server.ts +++ b/web/src/routes/_headers/+server.ts @@ -9,15 +9,7 @@ const allowedScriptOrigins = [ export async function GET() { const CSP = { "connect-src": ["*"], - "default-src": ["'none'"], - - "font-src": ["'self'"], - "style-src": ["'self'"], - "style-src-attr": ["'self'"], - "style-src-elem": ["'self'"], - "img-src": ["'self'", "data:"], - "manifest-src": ["'self'"], - "worker-src": ["'self'"], + "default-src": ["'self'"], "script-src": allowedScriptOrigins, "script-src-attr": allowedScriptOrigins, From 026cb634ecf9162dbec28e04f685f123821d199f Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 20:11:47 +0600 Subject: [PATCH 16/48] web: update & move csp to `svelte.config.js` ough --- pnpm-lock.yaml | 3 +++ web/package.json | 1 + web/src/routes/_headers/+server.ts | 21 --------------- web/svelte.config.js | 43 ++++++++++++++++++++++++++---- 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d3162777..90995fb6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -140,6 +140,9 @@ importers: compare-versions: specifier: ^6.1.0 version: 6.1.1 + dotenv: + specifier: ^16.0.1 + version: 16.4.5 eslint: specifier: ^8.57.0 version: 8.57.0 diff --git a/web/package.json b/web/package.json index 67c779bcc..2d4a3e61b 100644 --- a/web/package.json +++ b/web/package.json @@ -33,6 +33,7 @@ "@types/fluent-ffmpeg": "^2.1.25", "@types/node": "^20.14.10", "compare-versions": "^6.1.0", + "dotenv": "^16.0.1", "eslint": "^8.57.0", "glob": "^10.4.5", "mdsvex": "^0.11.2", diff --git a/web/src/routes/_headers/+server.ts b/web/src/routes/_headers/+server.ts index 708d69acb..cdeb1f9ce 100644 --- a/web/src/routes/_headers/+server.ts +++ b/web/src/routes/_headers/+server.ts @@ -1,29 +1,8 @@ -import env from "$lib/env"; - -const allowedScriptOrigins = [ - "'self'", - "challenges.cloudflare.com", - env.PLAUSIBLE_HOST ? env.PLAUSIBLE_HOST : "" -] - export async function GET() { - const CSP = { - "connect-src": ["*"], - "default-src": ["'self'"], - - "script-src": allowedScriptOrigins, - "script-src-attr": allowedScriptOrigins, - "frame-src": ["challenges.cloudflare.com"], - } - const _headers = { "/*": { "Cross-Origin-Opener-Policy": "same-origin", "Cross-Origin-Embedder-Policy": "require-corp", - "Content-Security-Policy": - Object.entries(CSP).map( - ([directive, values]) => `${directive} ${values.join(' ')}` - ).flat().join("; "), } } diff --git a/web/svelte.config.js b/web/svelte.config.js index 522638711..28602c1e6 100644 --- a/web/svelte.config.js +++ b/web/svelte.config.js @@ -1,8 +1,10 @@ -import adapter from '@sveltejs/adapter-static'; -import { mdsvex } from 'mdsvex'; -import { fileURLToPath } from 'node:url'; -import { dirname, join } from 'node:path'; -import { sveltePreprocess } from 'svelte-preprocess'; +import "dotenv/config"; +import adapter from "@sveltejs/adapter-static"; + +import { mdsvex } from "mdsvex"; +import { fileURLToPath } from "node:url"; +import { dirname, join } from "node:path"; +import { sveltePreprocess } from "svelte-preprocess"; /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -46,6 +48,37 @@ const config = { precompress: false, strict: true }), + csp: { + mode: "hash", + directives: { + "connect-src": ["*"], + "default-src": ["none"], + + "font-src": ["self"], + "style-src": ["self", "unsafe-inline"], + "img-src": ["self", "data:"], + "manifest-src": ["self"], + "worker-src": ["self"], + + "object-src": ["none"], + "frame-src": [ + "self", + "challenges.cloudflare.com" + ], + + "script-src": [ + "self", + "wasm-unsafe-eval", + "challenges.cloudflare.com", + + // eslint-disable-next-line no-undef + process.env.WEB_PLAUSIBLE_HOST ? process.env.WEB_PLAUSIBLE_HOST : "", + + // hash of the theme preloader in app.html + "sha256-g67gIjM3G8yMbjbxyc3QUoVsKhdxgcQzCmSKXiZZo6s=", + ] + } + }, env: { publicPrefix: 'WEB_' }, From b30b6957ce52fc3a0f5122cbcfe72473b0702784 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 20:15:56 +0600 Subject: [PATCH 17/48] web/package: move dependencies to devDependencies --- pnpm-lock.yaml | 45 ++++++++++++++++++++++----------------------- web/package.json | 20 +++++++++----------- 2 files changed, 31 insertions(+), 34 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90995fb6c..220a2cf33 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,41 +84,25 @@ importers: packages/version-info: {} web: - dependencies: + devDependencies: + '@eslint/js': + specifier: ^9.5.0 + version: 9.8.0 '@fontsource-variable/noto-sans-mono': specifier: ^5.0.20 version: 5.0.20 '@fontsource/ibm-plex-mono': specifier: ^5.0.13 version: 5.0.13 + '@fontsource/redaction-10': + specifier: ^5.0.2 + version: 5.0.2 '@imput/libav.js-remux-cli': specifier: ^5.5.6 version: 5.5.6 '@imput/version-info': specifier: workspace:^ version: link:../packages/version-info - '@tabler/icons-svelte': - specifier: 3.6.0 - version: 3.6.0(svelte@4.2.18) - '@vitejs/plugin-basic-ssl': - specifier: ^1.1.0 - version: 1.1.0(vite@5.3.5(@types/node@20.14.14)) - mime: - specifier: ^4.0.4 - version: 4.0.4 - sveltekit-i18n: - specifier: ^2.4.2 - version: 2.4.2(svelte@4.2.18) - ts-deepmerge: - specifier: ^7.0.0 - version: 7.0.1 - devDependencies: - '@eslint/js': - specifier: ^9.5.0 - version: 9.8.0 - '@fontsource/redaction-10': - specifier: ^5.0.2 - version: 5.0.2 '@sveltejs/adapter-static': specifier: ^3.0.2 version: 3.0.2(@sveltejs/kit@2.5.19(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.3.5(@types/node@20.14.14)))(svelte@4.2.18)(vite@5.3.5(@types/node@20.14.14))) @@ -128,6 +112,9 @@ importers: '@sveltejs/vite-plugin-svelte': specifier: ^3.0.0 version: 3.1.1(svelte@4.2.18)(vite@5.3.5(@types/node@20.14.14)) + '@tabler/icons-svelte': + specifier: 3.6.0 + version: 3.6.0(svelte@4.2.18) '@types/eslint__js': specifier: ^8.42.3 version: 8.42.3 @@ -137,6 +124,9 @@ importers: '@types/node': specifier: ^20.14.10 version: 20.14.14 + '@vitejs/plugin-basic-ssl': + specifier: ^1.1.0 + version: 1.1.0(vite@5.3.5(@types/node@20.14.14)) compare-versions: specifier: ^6.1.0 version: 6.1.1 @@ -152,6 +142,9 @@ importers: mdsvex: specifier: ^0.11.2 version: 0.11.2(svelte@4.2.18) + mime: + specifier: ^4.0.4 + version: 4.0.4 svelte: specifier: ^4.2.7 version: 4.2.18 @@ -161,6 +154,12 @@ importers: svelte-preprocess: specifier: ^6.0.2 version: 6.0.2(postcss@8.4.40)(svelte@4.2.18)(typescript@5.5.4) + sveltekit-i18n: + specifier: ^2.4.2 + version: 2.4.2(svelte@4.2.18) + ts-deepmerge: + specifier: ^7.0.1 + version: 7.0.1 tslib: specifier: ^2.4.1 version: 2.6.3 diff --git a/web/package.json b/web/package.json index 2d4a3e61b..645b077db 100644 --- a/web/package.json +++ b/web/package.json @@ -25,36 +25,34 @@ "homepage": "https://cobalt.tools/", "devDependencies": { "@eslint/js": "^9.5.0", + "@fontsource-variable/noto-sans-mono": "^5.0.20", + "@fontsource/ibm-plex-mono": "^5.0.13", "@fontsource/redaction-10": "^5.0.2", + "@imput/libav.js-remux-cli": "^5.5.6", + "@imput/version-info": "workspace:^", "@sveltejs/adapter-static": "^3.0.2", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@tabler/icons-svelte": "3.6.0", "@types/eslint__js": "^8.42.3", "@types/fluent-ffmpeg": "^2.1.25", "@types/node": "^20.14.10", + "@vitejs/plugin-basic-ssl": "^1.1.0", "compare-versions": "^6.1.0", "dotenv": "^16.0.1", "eslint": "^8.57.0", "glob": "^10.4.5", "mdsvex": "^0.11.2", + "mime": "^4.0.4", "svelte": "^4.2.7", "svelte-check": "^3.6.0", "svelte-preprocess": "^6.0.2", + "sveltekit-i18n": "^2.4.2", + "ts-deepmerge": "^7.0.1", "tslib": "^2.4.1", "turnstile-types": "^1.2.2", "typescript": "^5.4.5", "typescript-eslint": "^7.13.1", "vite": "^5.0.3" - }, - "dependencies": { - "@fontsource-variable/noto-sans-mono": "^5.0.20", - "@fontsource/ibm-plex-mono": "^5.0.13", - "@imput/libav.js-remux-cli": "^5.5.6", - "@imput/version-info": "workspace:^", - "@tabler/icons-svelte": "3.6.0", - "@vitejs/plugin-basic-ssl": "^1.1.0", - "mime": "^4.0.4", - "sveltekit-i18n": "^2.4.2", - "ts-deepmerge": "^7.0.0" } } From ce054e63fc0fbb2d11e3f52b43024952a9aaf361 Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 18 Sep 2024 20:23:29 +0600 Subject: [PATCH 18/48] web/settings: improve settings section ids --- web/src/routes/settings/audio/+page.svelte | 5 ++--- web/src/routes/settings/download/+page.svelte | 2 +- web/src/routes/settings/video/+page.svelte | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/web/src/routes/settings/audio/+page.svelte b/web/src/routes/settings/audio/+page.svelte index e2cda6f63..8ea9f34a2 100644 --- a/web/src/routes/settings/audio/+page.svelte +++ b/web/src/routes/settings/audio/+page.svelte @@ -9,7 +9,7 @@ import SettingsToggle from "$components/buttons/SettingsToggle.svelte"; - + {#each audioFormatOptions as value} - - + {#each audioBitrateOptions as value} @@ -34,7 +34,7 @@ Date: Wed, 18 Sep 2024 20:30:35 +0600 Subject: [PATCH 19/48] web/PageNav: add fade in animation for subtitle --- web/src/components/subnav/PageNav.svelte | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/web/src/components/subnav/PageNav.svelte b/web/src/components/subnav/PageNav.svelte index c3255c78a..ccb2afa18 100644 --- a/web/src/components/subnav/PageNav.svelte +++ b/web/src/components/subnav/PageNav.svelte @@ -73,7 +73,10 @@ {:else} {#if pageSubtitle} -