Commit Graph

174 Commits

Author SHA1 Message Date
david_bai 0dfe627e25 docs: remove PM2/bare-metal references 2026-02-28 12:37:11 +08:00
david_bai 1a0467b439 chore(doc):Fix the issue of missing content in some language blog posts 2025-12-30 12:06:34 +08:00
david_bai bb90d0c0fd chore(doc):Apply a unified bold underline style to the links 2025-12-27 10:50:04 +08:00
david_bai 4328cd0a1c chore(doc):Add blog cover image 2025-12-27 10:11:16 +08:00
david_bai 0b82fc2d47 chore(doc):Polish the blog and translate it 2025-12-26 20:51:06 +08:00
david_bai 49e20edd80 chore(merge):merge sub-branch into main 2025-12-24 12:14:52 +08:00
david_bai 30d7a6c27b chore(doc):rename AGENTS.md to AGENTS.en.md;Add a blog draft 2025-12-22 12:38:58 +08:00
david_bai dceaae8efa fix(ssr): guard DOM/window access and client-only listeners
- Prevent server-side exceptions (Application error) on mobile after redirects
  - useOneShotSlowHint: guard document; use global setTimeout; conditionally attach visibilitychange
  - useConnectionFeedback: guard document.visibilityState; register/remove listeners only on client
  - usePageSetup: guard window before tracking referrer and parsing roomId
  - tracking: early return when window is undefined
  - docs(flows): add “SSR & DOM access guard (must-read)” checklist; renumber next section
2025-12-06 12:00:03 +08:00
david_bai 0d830114cd feat(ui): extract reusable one-shot slow-hint hook; refactor join(3s) and RTC negotiate(8s) hints; share rtcPhase mapper; update docs 2025-12-06 11:05:39 +08:00
david_bai 761921684c feat(ui): add 8s P2P slow-connect hint + i18n; document full connection feedback flows
- Hook (useConnectionFeedback):
      - Add SLOW_RTC_MS=8000 timer when entering negotiating
      - Foreground-only; pending while hidden; show once per negotiation attempt
      - Clear timers on connect/disconnect; reset attempt flags when leaving negotiating
      - Cleanup timers on unmount
  - i18n:
      - Add required key ClipboardApp.rtc_slow to types
      - Provide translations for zh, en, ja, es, de, fr, ko
  - Docs:
      - flows.zh-CN: add UI connection feedback state machine covering
        join_inProgress (immediate), join_slow (3s), join_timeout (15s),
        rtc_negotiating, rtc_slow (8s), rtc_connected, rtc_reconnecting, rtc_restored;
        document equivalent success signals and visibility gating
      - code-map.zh-CN: outline responsibilities/locations for useRoomManager (join slow/timeout)
        and useConnectionFeedback (negotiation slow, reconnect/restored)
2025-12-05 19:10:00 +08:00
david_bai a0befd06f4 fix(webrtc): avoid false "Join room timeout" with 15s timeout + early success
- Increase joinRoom timeout to 15s for slow networks/polling.
  - Early-resolve join on handshake signals:
      - Initiator: ready / recipient-ready
      - Recipient: offer
  - Single-settle guard; cleanup listeners/timer to prevent leaks.

  File: frontend/lib/webrtc_base.ts
2025-11-25 23:31:06 +08:00
david_bai 27375c1a4d refactor(theme): use design tokens and fix dark mode visuals
- Replace hardcoded Tailwind colors (bg-white, bg-gray-50/100, text-gray-, border-gray-, divide-gray-*, text-blue-600/800, bg-blue-50) with design tokens (bg-card, bg-muted, text-foreground, text-muted-foreground, border-
    border, text-primary, hover:bg-accent, bg-primary/10).
  - ClipboardApp: update RichTextEditor toolbar/editor, FileUploadHandler, ShareCard, FileListDisplay, SendTabPanel, RetrieveTabPanel, FileTransferButton.
  - Blog UI: unify styles in list page, tag page, post page, ArticleListItem, and TableOfContents.
  - MDX/prose: normalize pre/code/table/blockquote/lists and figure captions; switch rehype table divider to theme token.
  - Misc: adjust HomeClient and HowItWorks copy colors to tokens.
  - No functional changes; light mode parity; improved contrast and consistency in dark mode.
2025-11-25 21:52:45 +08:00
david_bai 17a43ec181 docs(blog): add “Cached ID reconnect” post in 7 languages with cover
- Add multi-language post “Cached ID reconnect: auto rejoin and resume”:
    zh, en, ja, ko, de, fr, es under: frontend/content/blog/cached-id-reconnect/*.mdx
  - Include cover asset: frontend/public/blog-assets/cached-id-reconnect.webp
  - Describe receiver auto-join, reconnect workflow, and resume behavior.
  - Tag with WebRTC/P2P/reconnect for discoverability.
2025-11-25 21:43:56 +08:00
david_bai 723a1ea086 feat(ux): cached roomId auto-join + theme toggle
- Receiver: auto-fill and join on Retrieve tab when input empty, not in room, no URL roomId, and cachedId exists (ClipboardApp + roomIdCache)
  - Sender: “Use cached ID” now immediately joins the room (add onUseCached + disabled to CachedIdActionButton; wire in SendTabPanel)
  - UI: add ThemeToggle and integrate into Header (desktop and mobile)
  - Styles: replace hardcoded white with design tokens in Retrieve panel (bg-card/text-card-foreground) for dark mode
  - Docs: update AI playbook flows and code-map
2025-11-25 12:24:28 +08:00
david_bai 89a38936b6 feat(blog-i18n): localize blog UI & SEO; add tag pages to sitemap
- Add Messages.meta.blog and text.blog (BlogTexts) to types/messages
  - Update all locales with blog UI strings and meta.blog
  - Localize blog list, tag pages, and article detail (titles, labels, dates)
  - Pass messages to ArticleListItem; TableOfContents supports localized title
  - Use dictionary-based metadata; alternates cover all supported locales
  - Sitemap: include /[lang]/blog/tag/{tag} and set blog list lastModified to newest post
  - JSON-LD: hardcode site URL in getSiteUrl() for consistency
2025-11-22 10:37:29 +08:00
david_bai 18f6703c6b fix(reconnect): auto rejoin on socket connect and widen reconnection triggers for mobile foreground resume
- Attempt reconnection on 'disconnected' | 'failed' | 'closed' states (BaseWebRTC)
  - Relax gating: rejoin when roomId exists and any of isPeerDisconnected, isSocketDisconnected, or socketId changed
  - Auto re-join room on socket 'connect' if lastJoinedSocketId differs or not in room; send initiator-online for initiators
  - Track lastJoinedSocketId after successful join and reset isInRoom when socketId changes to bypass early-return
  - Update flows to document mobile background/foreground reconnection and socketId-based rejoin
2025-11-21 20:23:47 +08:00
david_bai 415adfe638 chore(doc):Translate an existing blog into multiple languages 2025-11-12 00:01:32 +08:00
david_bai 2840da2f34 feat(blog): restructure blog files into language-specific directories
- Move from flat file structure (privydrop-open-source-en.mdx) to nested structure (privydrop-open-source/en.mdx)
  - Update blog.ts to handle new directory-based file organization
2025-11-11 23:22:30 +08:00
david_bai 2f5ed92188 feat(frontend): send initiator-online after sender rejoins with cached/long room ID
- Add forceInitiatorOnline flag to webrtcService.joinRoom
  - Trigger initiator-online for sender when joining with >=8-char IDs
2025-10-31 12:47:46 +08:00
david_bai 3d222fd316 chore(doc):improve UX message clarity and add cache optimization
- Update duplicate room ID messages across all languages for better clarity
- Enhance cached ID tips with double-click save mode functionality
- Add image optimization cache configuration to Nginx
- Document production environment variable sync requirements
- Add NEXT_IMAGE_UNOPTIMIZED to production config
2025-10-29 23:12:09 +08:00
david_bai b636953770 build(standalone): use pnpm hoisted
- Add frontend/.npmrc (node-linker=hoisted; public-hoist-pattern for @next/env, styled-jsx, @swc/helpers)
  - Keep explicit deps: styled-jsx, @swc/helpers, @next/env
  - Verified standalone starts without MODULE_NOT_FOUND
2025-10-25 11:55:21 +08:00
david_bai b2aa493e2d chore(code):"Use Cache ID" button double-click to temporarily switch to "Save ID" function 2025-10-23 23:05:34 +08:00
david_bai 5ca89d71ad chore(code):Add cache room ID feature, no need to manually input room ID 2025-10-23 20:47:49 +08:00
david_bai 0d308515a7 SEO: refine WebApplication alternateName and commit docs
- Home WebApplication JSON-LD: add alternateName "Open-source web-based AirDrop alternative"
- Docs: add troubleshooting for missing .next production build in deployment guides
  - docs/DEPLOYMENT.md
  - docs/DEPLOYMENT.zh-CN.md
2025-10-14 23:50:40 +08:00
david_bai 0621fb27db SEO: add JSON-LD structured data
- Add generic JSON-LD injector component and builders
  - components/seo/JsonLd.tsx
  - lib/seo/jsonld.ts
- Inject Organization and WebSite JSON-LD globally in [lang]/layout
- Inject WebApplication JSON-LD on the localized home page
  - Localize description/url/inLanguage and set alternateName ["PrivyDrop", "PrivyDrop APP"]
- Inject FAQPage JSON-LD only on /[lang]/faq (not on home)
  - Build Q&A from messages.text.faqs
- Inject BlogPosting + BreadcrumbList on blog post pages
  - Use frontmatter.cover as image, localized breadcrumbs

Notes
- Use stable @id anchors (/#organization, /#website, /[lang]#app, /[lang]/blog/[slug]#post)
- Respect multi-language setup across en/zh/ja/es/de/fr/ko
- SameAs limited to GitHub and X as provided
- Site URL resolved via NEXT_PUBLIC_SITE_URL or defaults to https://www.privydrop.app
2025-10-13 21:19:07 +08:00
david_bai ad6fc85df1 chore(doc): Move how-it-works position up; the prompt for exiting a room during a transfer has been modified. 2025-10-12 14:41:29 +08:00
david_bai ffa9f84c4a fix(sendString):Avoid using the file fragmentation parameter to prevent transmission failure 2025-10-11 10:59:42 +08:00
david_bai 8ef43029d5 fix(deploy+docker+frontend): enforce same-origin via Nginx, disable Next Image optimization in Docker, allow Socket.IO polling fallback, and improve health checks and access info
- generate-config.sh: add --with-nginx flag handling; when enabled, set NEXT_PUBLIC_API_URL empty to use same-origin /api and /socket.io; add BACKEND_INTERNAL_URL for SSR/internal fetch; adjust lan-tls HTTPS (8443) and TLS generation policy
- deploy.sh: show only valid access URLs when Nginx is enabled (gateway URLs), avoid misleading :3002/:3001 entries
- frontend (env/webrtc): return mutable transports [websocket,polling]; use empty signaling server for same-origin; comments in English
- frontend (next.config): support NEXT_IMAGE_UNOPTIMIZED to turn off image optimization in Docker
- frontend (health): prefer BACKEND_INTERNAL_URL for internal health checks, fallback to public URL/localhost
- docker-compose + Dockerfile(frontend): pass NEXT_IMAGE_UNOPTIMIZED and BACKEND_INTERNAL_URL envs
2025-10-10 20:49:17 +08:00
david_bai 663082efe1 chore(doc): Replace Chinese comments with English comments 2025-10-08 15:59:50 +08:00
david_bai 246eff196e feat(deploy,ssl): automate Let’s Encrypt (webroot), preserve SSL, and auto-enable HTTPS
- generate-config.sh
      - Add flags: --no-clean, --reset-ssl, --ssl-mode (letsencrypt|self-signed|provided)
      - Stop deleting docker/ssl by default; only wipe on explicit --reset-ssl
      - Inject ACME webroot route into HTTP (80) server; create docker/letsencrypt-www
      - Default SSL_MODE: full=letsencrypt, private/public=self-signed
      - Add enable_https_if_cert_present: append 443 server only when server-cert.pem/server-key.pem exist
      - Keep self-signed path generating HTTPS immediately (non-basic)
  - docker-compose.yml
      - Mount ./docker/letsencrypt-www:/var/www/certbot:ro for Nginx ACME challenges
  - deploy.sh
      - Add --le-email for Let’s Encrypt account email
      - Auto-install certbot once (apt-get) and enable systemd timer if available
      - Install deploy hook at /etc/letsencrypt/renewal-hooks/deploy/privydrop-reload.sh to:
          - Copy renewed certs into docker/ssl
          - Hot-reload Nginx; HUP or restart coturn
      - First-time issuance (webroot) for <domain> and turn.<domain> after Nginx:80 is up; copy certs
      - Re-run generate-config with --no-clean --ssl-mode letsencrypt to enable 443, then reload Nginx
  - Behavior changes
      - Full mode prefers Let’s Encrypt by default; HTTPS gets enabled as soon as certs exist
      - docker/ssl is no longer wiped by config generation
  - Notes
      - SNI-based turns:443 is not implemented yet (planned)
      - Backward compatible with private/public (self-signed)
2025-10-05 12:43:56 +08:00
david_bai 2ee6961634 build(docker): Private mode deployment test successful
Test steps:
bash docker/scripts/generate-config.sh --mode private [--local-ip 192.168.0.113]
bash ./deploy.sh --mode private

Front-end directly inlines NEXT_PUBLIC_API_URL, directly connecting to the backend.
CORS (production) supports comma-separated multiple origins, with localhost and local network IPs included by default.
2025-09-29 18:27:12 +08:00
david_bai cfcd60145a build: refresh docker deployment workflow 2025-09-26 14:02:55 +08:00
david_bai 67b46d0b30 Merge branch 'fea/docker2' into fea/docker 2025-09-21 22:10:30 +08:00
david_bai 3f075c4a97 fix:Fix a Type error 2025-09-14 23:47:42 +08:00
david_bai 55f118be9a chore:Temporarily comment out some debug logs 2025-09-14 23:30:47 +08:00
david_bai 95331cb8e6 chore:Remove the redundant safety save button; Use English comments 2025-09-14 23:25:16 +08:00
david_bai d0ba2eb9c4 chore:Folder resuming transfer is normal 2025-09-14 19:44:11 +08:00
david_bai 79089bed7e chore:Saving folders to disk now works correctly 2025-09-14 16:49:06 +08:00
david_bai 4dcdf0c3a0 chore:The breakpoint resuming file is saved normally 2025-09-14 11:44:35 +08:00
david_bai 327de90f52 chore:Fix the issue where the breakpoint resume receiver is missing one chunk of data 2025-09-14 11:29:51 +08:00
david_bai b5404cea72 chore:Split the fileReceiver.ts 2025-09-14 08:36:20 +08:00
david_bai 33f2f041ac fix:Try to fix the problem of incomplete file size in resumable download 2025-09-14 07:35:34 +08:00
david_bai 8627544946 chore:Exit the room even if it is in transit 2025-09-13 20:01:02 +08:00
david_bai 158433bb0b chore:Initial addition of Docker related content 2025-09-11 06:46:04 +08:00
david_bai 6f8f4f65bb chore:Save directory settings UI tip uses internationalization translation 2025-09-10 23:54:35 +08:00
david_bai 61e7c1db50 chore:The production environment only uses one STUN server to improve connection setup speed 2025-09-10 23:48:08 +08:00
david_bai 526e1b49c1 fix:Fix the issue of downloads failing in certain browsers 2025-09-08 23:59:29 +08:00
david_bai 0747898f3c chore:Use English notes 2025-09-08 00:38:59 +08:00
david_bai 8ff2302c14 code clear up 2025-09-08 00:12:02 +08:00
david_bai 5ca911d1e1 Using a simple backpressure mechanism 2025-09-07 23:38:15 +08:00