From e909922a5a773c3e732d8e363c8725ff54f03078 Mon Sep 17 00:00:00 2001 From: ccbikai Date: Wed, 12 Mar 2025 20:10:32 +0800 Subject: [PATCH] chore: decrease preview link validity to 5 minutes Reduces the preview link time-to-live from 24 hours to 5 minutes for improved security. Updates related user-facing message in the dashboard editor to reflect this change. --- app.config.ts | 2 +- components/dashboard/links/Editor.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.config.ts b/app.config.ts index d6419c0..2d16db2 100644 --- a/app.config.ts +++ b/app.config.ts @@ -8,7 +8,7 @@ export default defineAppConfig({ blog: 'https://sink.cool/blog', description: 'A Simple / Speedy / Secure Link Shortener with Analytics, 100% run on Cloudflare.', image: 'https://sink.cool/banner.png', - previewTTL: 24 * 3600, // 24h + previewTTL: 300, // 5 minutes slugRegex: /^[a-z0-9]+(?:-[a-z0-9]+)*$/i, reserveSlug: [ 'dashboard', diff --git a/components/dashboard/links/Editor.vue b/components/dashboard/links/Editor.vue index d21912e..404f1ad 100644 --- a/components/dashboard/links/Editor.vue +++ b/components/dashboard/links/Editor.vue @@ -147,7 +147,7 @@ const { previewMode } = useRuntimeConfig().public v-if="previewMode" class="text-sm text-muted-foreground" > - The preview mode link is valid for up to 24 hours. + The preview mode link is valid for up to 5 minutes.