Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/frontend/src/lib/consts/encryption.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Deterministic derivation constants
export var HKDF_SALT_STR = 'chithi-salt-v1';
export var HKDF_SALT_STR = 'chithi-salt-v1';
export var HKDF_IV_STR = 'chithi-iv-v1';

// Argon2 parameter defaults and safety cap
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/src/lib/functions/encryption.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { DEFAULT_ARGON2_ITERATIONS, DEFAULT_ARGON2_MEMORY_KIB, MAX_ARGON2_MEMORY_KIB } from '#consts/encryption';
import {
DEFAULT_ARGON2_ITERATIONS,
DEFAULT_ARGON2_MEMORY_KIB,
MAX_ARGON2_MEMORY_KIB
} from '#consts/encryption';
import { argon2id } from 'hash-wasm';

export function bytesToBase64(u8: Uint8Array) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,7 @@
if (entry.directory || !entry.getData) return;
const rawBlob = await entry.getData(new BlobWriter('application/octet-stream'));
const detectedMime = await detectMimeFromBlob(rawBlob);
const viewBlob = detectedMime
? rawBlob.slice(0, rawBlob.size, detectedMime)
: rawBlob;
const viewBlob = detectedMime ? rawBlob.slice(0, rawBlob.size, detectedMime) : rawBlob;

const text = await createViewableText(viewBlob, entry.filename, detectedMime);
if (text !== null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { formatFileSize } from '#functions/bytes';
import { definePageMetaTags } from 'svelte-meta-tags';
import type { PageLoad } from './$types';


export const load: PageLoad = async ({ fetch, params, url }) => {
let filename = 'View File';
let description = 'View your encrypted file with a link that automatically expires.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import type { PageLoad } from './$types';
export const load: PageLoad = ({ url }) => {
const ogUrl = new URL('/og/speedtest', url.origin);
ogUrl.searchParams.set('title', 'Network Speedtest');
ogUrl.searchParams.set('description', 'Test your connection speed to the Chithi server for optimal transfers.');
ogUrl.searchParams.set(
'description',
'Test your connection speed to the Chithi server for optimal transfers.'
);

const pageTags = definePageMetaTags({
title: 'Speedtest',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export const load: PageLoad = async ({ parent, fetch, url }) => {

const ogUrl = new URL('/og/upload', url.origin);
ogUrl.searchParams.set('title', 'Upload Files');
ogUrl.searchParams.set('description', 'Securely upload and share encrypted files with auto-expiring links.');
ogUrl.searchParams.set(
'description',
'Securely upload and share encrypted files with auto-expiring links.'
);

const pageTags = definePageMetaTags({
title: 'Upload',
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<ModeWatcher />
<QueryClientProvider client={data.queryClient}>
{#if SvelteQueryDevtools}
<!-- <SvelteQueryDevtools buttonPosition="top-left" /> -->
<SvelteQueryDevtools buttonPosition="top-left" />
{/if}

{@render children()}
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/routes/informations/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export const load: PageLoad = async ({ url }) => {
const ogUrl = new URL('/og/info', url.origin);
ogUrl.searchParams.set('label', 'INSTANCE OVERVIEW');
ogUrl.searchParams.set('title', 'System Information');
ogUrl.searchParams.set('description', 'Explore the infrastructure, performance metrics, and configuration of your Chithi deployment.');
ogUrl.searchParams.set(
'description',
'Explore the infrastructure, performance metrics, and configuration of your Chithi deployment.'
);

const pageTags = definePageMetaTags({
title: 'Instance Information',
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/routes/informations/backend/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export const load: PageLoad = async ({ fetch, parent, url }) => {
const ogUrl = new URL('/og/info', url.origin);
ogUrl.searchParams.set('label', 'BACKEND INFRASTRUCTURE');
ogUrl.searchParams.set('title', 'Chithi Backend');
ogUrl.searchParams.set('description', 'Runtime environment, service versions, and architectural metadata.');
ogUrl.searchParams.set(
'description',
'Runtime environment, service versions, and architectural metadata.'
);

const pageTags = definePageMetaTags({
title: 'Backend Information',
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/routes/informations/frontend/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export const load: PageLoad = async ({ url }) => {
const ogUrl = new URL('/og/info', url.origin);
ogUrl.searchParams.set('label', 'SYSTEM INFORMATION');
ogUrl.searchParams.set('title', 'Chithi Instance');
ogUrl.searchParams.set('description', 'Version, source revision, and runtime metadata for this deployment.');
ogUrl.searchParams.set(
'description',
'Version, source revision, and runtime metadata for this deployment.'
);

const pageTags = definePageMetaTags({
title: 'Information',
Expand Down
5 changes: 4 additions & 1 deletion src/frontend/src/routes/informations/statistics/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ export const load: PageLoad = async ({ fetch, parent, url }) => {
const ogUrl = new URL('/og/info', url.origin);
ogUrl.searchParams.set('label', 'PERFORMANCE METRICS');
ogUrl.searchParams.set('title', 'Instance Statistics');
ogUrl.searchParams.set('description', 'Real-time instance metrics, storage usage, and system health.');
ogUrl.searchParams.set(
'description',
'Real-time instance metrics, storage usage, and system health.'
);

const pageTags = definePageMetaTags({
title: 'Instance Statistics',
Expand Down
13 changes: 4 additions & 9 deletions src/frontend/src/routes/og/info/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@
const displayLabel = $derived(label?.trim() || 'Information');
const displayTitle = $derived((title?.trim() || 'Chithi Instance').slice(0, 42));
const displayDescription = $derived(
(description?.trim() || 'System information, statistics, and metadata for this instance.').slice(
0,
90
)
(
description?.trim() || 'System information, statistics, and metadata for this instance.'
).slice(0, 90)
);
</script>

<OGLayout
label={displayLabel}
title={displayTitle}
subtitle={displayDescription}
/>
<OGLayout label={displayLabel} title={displayTitle} subtitle={displayDescription} />
4 changes: 2 additions & 2 deletions src/frontend/src/routes/og/login/+server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import style from '#css/tailwind.css?inline';
import { render } from 'svelte/server';
import ImageResponse from 'takumi-js/response';
import { read } from '$app/server';
import Geist from '$lib/assets/fonts/Geist.woff2';
import { render } from 'svelte/server';
import ImageResponse from 'takumi-js/response';
import type { RequestEvent } from './$types';
import Component from './Component.svelte';

Expand Down
6 changes: 1 addition & 5 deletions src/frontend/src/routes/og/login/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,4 @@
);
</script>

<OGLayout
label="Authentication"
title={displayTitle}
subtitle={displayDescription}
/>
<OGLayout label="Authentication" title={displayTitle} subtitle={displayDescription} />
4 changes: 2 additions & 2 deletions src/frontend/src/routes/og/once/+server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import style from '#css/tailwind.css?inline';
import { render } from 'svelte/server';
import ImageResponse from 'takumi-js/response';
import { read } from '$app/server';
import Geist from '$lib/assets/fonts/Geist.woff2';
import { render } from 'svelte/server';
import ImageResponse from 'takumi-js/response';
import type { RequestEvent } from './$types';
import Component from './Component.svelte';

Expand Down
9 changes: 3 additions & 6 deletions src/frontend/src/routes/og/once/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
const displayTitle = $derived((title?.trim() || 'One-time View').slice(0, 42));
const displayDescription = $derived(
(
description?.trim() || 'View your encrypted file once. The link will expire immediately after.'
description?.trim() ||
'View your encrypted file once. The link will expire immediately after.'
).slice(0, 90)
);
</script>

<OGLayout
label="Burn After Reading"
title={displayTitle}
subtitle={displayDescription}
/>
<OGLayout label="Burn After Reading" title={displayTitle} subtitle={displayDescription} />
9 changes: 3 additions & 6 deletions src/frontend/src/routes/og/speedtest/Component.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
const displayTitle = $derived((title?.trim() || 'Network Speedtest').slice(0, 42));
const displayDescription = $derived(
(
description?.trim() || 'Test your connection speed to the Chithi server for optimal transfers.'
description?.trim() ||
'Test your connection speed to the Chithi server for optimal transfers.'
).slice(0, 90)
);
</script>

<OGLayout
label="Performance"
title={displayTitle}
subtitle={displayDescription}
/>
<OGLayout label="Performance" title={displayTitle} subtitle={displayDescription} />
4 changes: 1 addition & 3 deletions src/frontend/src/routes/once/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@
entryFilename = entry.filename.split('/').pop() || 'file';
const rawBlob = await entry.getData(new BlobWriter('application/octet-stream'));
const detectedMime = await detectMimeFromBlob(rawBlob);
const viewBlob = detectedMime
? rawBlob.slice(0, rawBlob.size, detectedMime)
: rawBlob;
const viewBlob = detectedMime ? rawBlob.slice(0, rawBlob.size, detectedMime) : rawBlob;
const text = await createViewableText(viewBlob, entryFilename, detectedMime);

if (text !== null) {
Expand Down
Loading