mirror of
https://github.com/RoastSlav/quickdrop.git
synced 2026-01-15 03:30:31 -06:00
CI/CD: Jenkins pipeline updates (specify JDK/Maven tools, version-based pipeline fixes, adjust for new Jenkins setup) Java/Spring upgrades & rollback (try Java 25 + Spring Boot 3.5.6 + GC/ObjectHeader experiments, then revert back to Java 21) Add/refresh Copilot instructions Controller logging + rename (add logging to FileViewController, rename PasswordController → PasswordViewController) UI refactors + formatting pass (general reformatting and readability improvements across templates/scripts) Tailwind migration cleanup (remove Bootstrap script references, Tailwind updates, dark theme fixes) Template layout/styling improvements (dashboard, settings, file history, file view pages—consistent layout and styling with Tailwind) Keep Indefinitely + Hide From List rules & option (add option to disable “Keep Indefinitely”, refine/adjust session + status checks, align UI layout) Unified file history logging (migrate download/renewal logs into one system; refactor repository/service; update downloads section to log uploads/renewals/downloads) Share token overhaul (better validation + uniqueness; download endpoint uses token directly; delete tokens when deleting a file; refine ShareViewController mappings) Security/static resources (permit static resources through filter chain) Notifications system (Discord + email settings, NotificationService, testing UI + endpoint, batching with configurable minutes, richer formatting + detailed results, improve deletion notifications) CSRF adjustments for notification testing (CSRF token handling, add allowed header X-XSRF-TOKEN, ignore CSRF for the test endpoint where needed) Folder upload support (SQL migration rename, directory picker + manifest improvements, better folder tree rendering with fallbacks, improved upload cleanup) Upload/file view UX refresh (new drop zone/buttons design, theme toggler improvements, responsive/accessibility navigation improvements incl. close-on-outside-click) File preview feature (enable/disable previews + max size settings; support images/text + PDF/JSON/CSV + more extensions; preview UI styling; normalize language extensions; add Highlight.js syntax highlighting + dark theme styles; remove integrity/crossorigin attrs) Navigation reorg + styling (reorganize nav links; ensure light/dark contrast; consistent hover/padding/spacing) Pagination + caching + search (pagination for dashboard/file list, caching config, search with pagination) Settings validation + cron UX (validate settings inputs; cron validation; show next run time; layout fixes for cron section) Service/util refactors & cleanup (dead code cleanup; DataValidator null handling; improve ScheduleService cron handling + deletion logic; improve NotificationService RestTemplate + flushing; refactor FileUtils file type/previewability; move static helpers; improve preview handling path) Dependencies/versioning/docs (update pom.xml parent/deps, bump version to 1.5.0 in pom.xml + application.properties, update README)
4.8 KiB
4.8 KiB
QuickDrop AI Working Guide (concise)
- Build/run: Java 21. Use
./mvnw clean packagethenjava -jar target/quickdrop.jar. SQLite DB atdb/quickdrop.db; Flyway auto-runs baseline-on-migrate. Docker imageroastslav/quickdrop:latestexposes 8080. - App shape: Spring Boot MVC + Thymeleaf. Controllers in src/main/java/org/rostislav/quickdrop/controller; services in service; interceptors in interceptor; entities/repos in entity and repository; static assets + templates under
src/main/resources/staticand.../templates. - Settings source of truth: Single-row settings (id=1) via ApplicationSettingsService. Startup seeds defaults (max size 1GB, life 30d, storage
files/logs, cron0 0 2 * * *, app password off, admin password empty, file list & admin button enabled, encryption on, default home upload) and schedules cleanup. Never create extra rows. - Security: SecurityConfig enables whole-app password mode (
/password/login), BCrypt auth, CSRF cookie, permissive CORS. Session timeout set in WebConfig. Admin and file tokens stored in-memory in SessionService. - Interceptors: AdminPasswordSetupInterceptor enforces
/admin/setupuntil admin password exists. AdminPasswordInterceptor gates/admin/**and file history. FilePasswordInterceptor redirects to/file/password/{uuid}when missing a valid file session token. - Upload pipeline:
/api/file/upload-chunkaccepts chunked uploads with metadata (description,keepIndefinitely,password,hidden,fileSize, folder fields). AsyncFileMergeService buffers/merges chunks; FileEncryptionService encrypts when password + encryption enabled; final persist via FileService. Intermediate chunk calls return null—frontends must handle. - Storage/model: Files stored on disk under
fileStoragePath(from settings) with UUID filenames; metadata infile_entity(description, keepIndefinitely, hidden, optional password hash, encrypted flag, folder fields). QuickdropApplication ensures./dband storage path exist. - Downloads & history:
/file/download/{uuid}decrypts on the fly; logs uploads/renewals/downloads with IP/UA intofile_history_log(typesUPLOAD,RENEWAL,DOWNLOAD). Share links via/api/file/share/{uuid}and/api/file/download/{uuid}/{token}decrement/delete tokens. - Admin UX: Dashboard lists files with download counts and actions (view, history, download, delete, keep indefinitely toggle, hidden toggle) plus analytics (total downloads, space, avg size). Public list and admin dashboard now paginated/searchable (page/size/query params) with in-memory caching of page results; cache evicted on uploads, deletions, renewals, hidden/keep toggles, downloads.
- Cleanup/scheduling: ScheduleService schedules deletions per cron/max life, missing-file cleanup, share token cleanup. App uses @EnableScheduling.
- Thymeleaf flags: GlobalControllerAdvice injects template booleans (file list enabled, app password set, admin button enabled, encryption enabled).
- Conventions: Route all file mutations through
FileServiceto ensure logging/notifications/encryption. Update interceptors when adding protected routes. Keep single settings row intact. For pagination/search, reuse Page-based service methods and propagatepage/size/queryto templates. Cache keys live inpublicFiles,adminFiles,analytics(see CacheConfig). - Dev tips: SQLite dialect configured; migrations live under
src/main/resources/db/migration. Few/no automated tests—manual./mvnw clean packageis typical. Logs atlog/quickdrop.log(see properties). Default port 8080.