From 83051e0ea37739bd8c692bbd1ebd51ae22d43aad Mon Sep 17 00:00:00 2001 From: Towsty Date: Tue, 25 Aug 2026 18:03:26 -0500 Subject: [PATCH] Add a persistent clip library with folders, optional password, and hidden-thumbnail glow. Generated videos save into a chosen folder, sensitive clips skip thumbnails until played, and Docker writes the catalog to a Coolify volume. Co-authored-by: Cursor --- .env.example | 2 +- Dockerfile | 3 +- assets/css/main.css | 23 ++ nuxt.config.ts | 1 + pages/index.vue | 319 +++++++++++++++++---- server/api/generate.post.ts | 26 +- server/api/library/clips/[id].delete.ts | 6 + server/api/library/clips/[id]/thumb.get.ts | 19 ++ server/api/library/clips/[id]/video.get.ts | 15 + server/api/library/folders.post.ts | 6 + server/api/library/folders/[id].delete.ts | 5 + server/api/library/folders/[id].patch.ts | 6 + server/api/library/index.get.ts | 3 + server/api/library/lock.post.ts | 4 + server/api/library/password.put.ts | 14 + server/api/library/unlock.post.ts | 12 + server/utils/jobs.ts | 16 ++ server/utils/library.ts | 280 ++++++++++++++++++ server/utils/session.ts | 13 + server/utils/watch.ts | 36 ++- 20 files changed, 749 insertions(+), 60 deletions(-) create mode 100644 server/api/library/clips/[id].delete.ts create mode 100644 server/api/library/clips/[id]/thumb.get.ts create mode 100644 server/api/library/clips/[id]/video.get.ts create mode 100644 server/api/library/folders.post.ts create mode 100644 server/api/library/folders/[id].delete.ts create mode 100644 server/api/library/folders/[id].patch.ts create mode 100644 server/api/library/index.get.ts create mode 100644 server/api/library/lock.post.ts create mode 100644 server/api/library/password.put.ts create mode 100644 server/api/library/unlock.post.ts create mode 100644 server/utils/library.ts diff --git a/.env.example b/.env.example index da07385..391c150 100644 --- a/.env.example +++ b/.env.example @@ -9,4 +9,4 @@ NUXT_OIDC_CLIENT_SECRET= NUXT_OIDC_ISSUER=https://auth.carrgarage.com/application/o/aigen/ NUXT_OIDC_AUTHORIZE_URL=https://auth.carrgarage.com/application/o/authorize/ NUXT_OIDC_TOKEN_URL=http://192.168.77.2:9000/application/o/token/ -NUXT_OIDC_USERINFO_URL=http://192.168.77.2:9000/application/o/userinfo/ +LIBRARY_DIR=/data/library diff --git a/Dockerfile b/Dockerfile index fa8da73..c23d0c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,8 @@ ENV HOST=0.0.0.0 ENV PORT=3000 ENV NITRO_HOST=0.0.0.0 ENV NITRO_PORT=3000 +ENV LIBRARY_DIR=/data/library COPY --from=build /app/.output ./.output +RUN mkdir -p /data/library EXPOSE 3000 -USER node CMD ["node", ".output/server/index.mjs"] diff --git a/assets/css/main.css b/assets/css/main.css index 5cca964..705190b 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -35,3 +35,26 @@ body { .progress-glow { box-shadow: 0 0 24px rgba(251, 191, 36, 0.35); } + +@keyframes sensitive-pulse { + 0%, 100% { + box-shadow: + 0 0 28px rgba(251, 191, 36, 0.25), + 0 0 90px rgba(251, 191, 36, 0.18), + inset 0 0 60px rgba(251, 191, 36, 0.08); + } + 50% { + box-shadow: + 0 0 48px rgba(251, 191, 36, 0.55), + 0 0 140px rgba(244, 114, 182, 0.28), + inset 0 0 80px rgba(251, 191, 36, 0.16); + } +} + +.sensitive-glow { + animation: sensitive-pulse 2.2s ease-in-out infinite; + background: + radial-gradient(circle at 50% 45%, rgba(251, 191, 36, 0.22), transparent 42%), + radial-gradient(circle at 50% 55%, rgba(244, 114, 182, 0.16), transparent 55%), + #09090b; +} diff --git a/nuxt.config.ts b/nuxt.config.ts index 1092bb6..40bbbe0 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -32,6 +32,7 @@ export default defineNuxtConfig({ oidcAuthorizeUrl: process.env.NUXT_OIDC_AUTHORIZE_URL || '', oidcTokenUrl: process.env.NUXT_OIDC_TOKEN_URL || '', oidcUserinfoUrl: process.env.NUXT_OIDC_USERINFO_URL || '', + libraryDir: process.env.LIBRARY_DIR || (process.env.NODE_ENV === 'production' ? '/data/library' : '.data/library'), public: { authEnabled: process.env.NUXT_PUBLIC_AUTH_ENABLED === 'true' } diff --git a/pages/index.vue b/pages/index.vue index 3e3df27..3152963 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -76,6 +76,34 @@

Output {{ outputSize.width }} × {{ outputSize.height }}{{ aspect === 'auto' ? ' · matching the still' : ' · override' }}

+
+

Save to library

+
+ Unlock the library to choose a folder. +
+
+
+ + + +
+ +
+
+
Generation settings
@@ -106,7 +134,7 @@
-
+