mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-05 16:26:15 +02:00
Users reported slow download speeds from the default Kiwix CDN. This adds the ability to browse and download ZIM files from alternative Kiwix mirrors or self-hosted repositories, all through the GUI. - Add "Custom Libraries" button next to "Browse the Kiwix Library" - Source dropdown to switch between Default (Kiwix) and custom libraries - Browsable directory structure with breadcrumb navigation - 5 pre-seeded official Kiwix mirrors (US, DE, DK, UK, Global CDN) - Built-in mirrors protected from deletion - Downloads use existing pipeline (progress, cancel, Kiwix restart) - Source selection persists across page loads via localStorage - Scrollable directory browser (600px max) with sticky header - SSRF protection on all custom library URLs Closes #576 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
751 B
TypeScript
37 lines
751 B
TypeScript
import vine from '@vinejs/vine'
|
|
|
|
export const listRemoteZimValidator = vine.compile(
|
|
vine.object({
|
|
start: vine.number().min(0).optional(),
|
|
count: vine.number().min(1).max(100).optional(),
|
|
query: vine.string().optional(),
|
|
})
|
|
)
|
|
|
|
export const addCustomLibraryValidator = vine.compile(
|
|
vine.object({
|
|
name: vine.string().trim().minLength(1).maxLength(100),
|
|
base_url: vine
|
|
.string()
|
|
.url({ require_tld: false })
|
|
.trim(),
|
|
})
|
|
)
|
|
|
|
export const browseLibraryValidator = vine.compile(
|
|
vine.object({
|
|
url: vine
|
|
.string()
|
|
.url({ require_tld: false })
|
|
.trim(),
|
|
})
|
|
)
|
|
|
|
export const idParamValidator = vine.compile(
|
|
vine.object({
|
|
params: vine.object({
|
|
id: vine.number(),
|
|
}),
|
|
})
|
|
)
|