Commit Graph
891 Commits
Author SHA1 Message Date
SnapOtter d693d5e762 fix: update OG images from 45+ to 50+ tools 2026-05-17 10:13:27 +08:00
SnapOtter 4eb07ae2fd fix: allow demo indexing and update navbar test for Try Demo CTA
Remove noindex meta tag from demo so Google can index demo.snapotter.com.
Update navbar test to match renamed "Try Demo" button (was "Book a Demo").
2026-05-17 09:33:46 +08:00
SnapOtter 228f70d011 feat: add static demo site at demo.snapotter.com
- New apps/demo/ that reuses apps/web components with mocked API layer
- Full UI shell: login, change password, analytics consent, dashboard, all tool pages
- Stateful mock tracks session flow (password change, analytics consent)
- Demo banner with link to GitHub repo
- Processing attempts show info message with GitHub link
- Deployed to Cloudflare Pages as static site (no backend)

Also links demo across all surfaces:
- README: "Live Demo" badge
- Landing navbar: "Try Demo" CTA button (replaces "Book a Demo")
- Landing hero: "No sign-ups. No credit card." tagline
- Docs getting-started: "Try before installing" tip box

Other changes:
- Docs: move NVIDIA GPU section above GHCR, demote GHCR to collapsed details
- Fix before-after slider checkerboard background for transparency
- Fix remove-bg preview reset when no effects applied
2026-05-17 09:25:12 +08:00
SnapOtter df2d1286d6 fix(seo): add structured data for sitelinks and fix OG image
Replace Organization schema with WebSite schema, add SiteNavigationElement
for Documentation/FAQ/GitHub/Contact/Discord. Add BreadcrumbList to FAQ
and Contact pages. Remove outdated og-image.svg (source already uses PNG).
Update sitemap with lastmod and changefreq.
2026-05-16 23:11:39 +08:00
SnapOtter 148118d969 feat: add generate strong password button to Add Members form
Add a "Generate strong password" button with Sparkles icon to the
Add Members form in Settings > People. Generated passwords are shown
in plain text with a copy button and an amber warning to copy before
creating the user. Also upgraded the button style on the change
password page to match. Translated copy/warning strings for all 21
locales.

Closes #139
2026-05-16 23:08:19 +08:00
SnapOtter 2951161414 fix: prevent dropdown clipping in settings People and Teams tables
Remove overflow-hidden from table wrappers that was clipping the
actions dropdown menu. Apply rounded corners directly to header and
last-row elements to preserve the visual appearance.

Closes #139
2026-05-16 22:45:51 +08:00
SnapOtter fd69a60e48 feat: add "Hello from the otter side" easter eggs
Custom 404 pages for landing and docs sites, otter greeting on the
first-login sidebar, and a one-time welcome toast after password change.
2026-05-16 22:45:22 +08:00
SnapOtter b5db8f3192 docs: restructure README sponsor section and add pink fund button to docs
Fold the sponsor call-to-action into the Contributing section as a
natural bullet point instead of a standalone heavy section. Remove
the large badge buttons. Keep star history chart under Contributing.

Add a pink "Fund Development" button component to the docs site nav
bar (left of Star on GitHub), matching the landing page style.
Remove the plain-text nav link that replaced the heart icon.
2026-05-16 21:14:06 +08:00
SnapOtter 6e103d31f8 docs: add Fund Development button to landing navbar and docs nav
Add pink heart-styled "Fund Development" button to landing page
navbar (left of Star on GitHub) and mobile menu. Rename "Sponsor"
to "Fund Development" in the open-source section. Replace icon-only
heart in docs socialLinks with a named "Fund Development" nav link.
2026-05-16 20:00:25 +08:00
SnapOtter 50a25691d9 docs: add GitHub Sponsors CTAs across README, landing, and docs
Remove Ko-fi from FUNDING.yml since GitHub Sponsors is now active.
Add sponsor badge to README badge row and support section. Add
sponsor button to landing page open-source section and footer.
Add heart icon social link to docs site nav bar.
2026-05-16 19:38:12 +08:00
SnapOtter 7d617a2675 docs: update docs site to welcome pull requests and translations
Rewrite contributing page to match new CONTRIBUTING.md with PR types,
CLA process, and good-first-issue links. Update translation guide to
encourage direct PRs instead of issue-only workflow.
2026-05-16 16:24:03 +08:00
SnapOtter 92b85d3506 fix: update privacy copy from "your device/machine" to "your network" 2026-05-16 15:48:57 +08:00
SnapOtter 9b249a8662 fix: fetch library thumbnails with auth headers to show image previews
The <img src> tag cannot send Authorization headers, so thumbnail
requests returned 401 and browsers displayed the alt text (filename)
instead of the image. Replaced with AuthImage component that fetches
via fetch() with proper auth headers and renders blob URLs.
2026-05-16 15:00:32 +08:00
SnapOtter 2fc5e15fff fix: add docs sitemap to robots.txt and fix hero copy 2026-05-16 14:29:51 +08:00
SnapOtter d025a569e2 docs: add SEO descriptions to all doc pages and update hero subtitle 2026-05-16 12:48:23 +08:00
SnapOtter 3e06d68f4f chore: bump version to 1.17.0 and update docs for release
- Bump all workspace package versions to 1.17.0
- Update APP_VERSION constant and OpenAPI spec
- Update AI tool count from 15 to 16 across docs and i18n
- Update tool table with AI Canvas Expand, Meme Generator, Beautify
- Add image editor, OIDC, and 20 languages to README features
- Add release notes for v1.17.0
- Add JSON-LD structured data and SEO improvements to landing/docs
2026-05-16 12:48:02 +08:00
SnapOtter ec85f88746 fix: anonymous mode settings, permissions, and FK constraints (#135)
- Grant admin role to anonymous user when AUTH_ENABLED=false
- Add DEFAULT_TOOL_VIEW env var (sidebar|fullscreen)
- Hide auth-dependent settings sections when auth disabled
- Fix session endpoint to return admin role consistently
- Seed anonymous user row in DB to satisfy FK constraints
- Add 25 new tests covering anonymous mode behavior

Closes #135
2026-05-16 12:37:52 +08:00
SnapOtter 4c997f73e0 fix: seed anonymous user row in DB and add comprehensive test coverage
When AUTH_ENABLED=false, seed an "anonymous" user row in the users
table so API keys, pipelines, and user files don't fail with FK
constraint violations. Previously, the synthetic anonymous user only
existed in memory (attached by the middleware), but any DB operation
referencing userId "anonymous" would violate foreign key constraints.

Also adds 25 new tests covering:
- Integration: ensureAnonymousUser, FK constraints, settings save,
  API key and pipeline operations for anonymous mode
- Frontend: useAuth hook anonymous happy path (role, permissions,
  hasPermission, session endpoint bypass)
- Frontend: settings dialog nav filtering (authRequired hides
  security/people/teams/roles when auth disabled)
- Backend: session endpoint returns admin role when auth disabled
2026-05-16 12:36:06 +08:00
SnapOtter 0d0fd760e5 fix: return admin role from session endpoint when auth is disabled
The GET /api/auth/session endpoint still returned role "user" and
user-level permissions when AUTH_ENABLED=false, inconsistent with the
middleware which now assigns role "admin". Fix the session endpoint to
match so API clients get the correct role.
2026-05-16 12:25:28 +08:00
SnapOtter 212ef653b5 fix: resolve 5 Sentry production errors (668 total events)
- Filter known client-error noise (rate limit, empty body, unsupported
  media type, content-length mismatch, premature close) from Sentry
  via beforeSend to stop 644 events of non-actionable noise
- Sanitize x-output-filename header to prevent TypeError on non-ASCII
  filenames in optimize-for-web preview (23 events)
- Handle EPIPE on Python dispatcher stdin write with graceful fallback
  to per-request spawning instead of crashing (NODE-W)
- Map EACCES on storage directory/file write to proper 503 status
  instead of generic 500 (NODE-P, 3 events)
2026-05-16 12:22:24 +08:00
SnapOtter 4906865275 fix: hide auth-dependent settings sections when auth is disabled
Security, People, Teams, and Roles sections are meaningless without
auth and could cause problems (e.g., creating orphan users that block
admin bootstrap on re-enable). Hide them via an authRequired flag on
nav items, checked alongside the existing requiredPermission filter.
2026-05-16 12:17:56 +08:00
SnapOtter f86ef124c2 fix: grant admin role to anonymous user and add DEFAULT_TOOL_VIEW env var
When AUTH_ENABLED=false, the anonymous user was assigned the "user" role
which lacks settings:write permission, making all settings saves return
403. Since no admin exists when auth is disabled, settings were
permanently read-only. Promote the anonymous user to "admin" so the
single user has full control of the instance.

Also adds DEFAULT_TOOL_VIEW env var (sidebar|fullscreen) following the
existing DEFAULT_THEME pattern, seeded via ensureDefaultSettings() on
first boot.

Closes #135
2026-05-16 11:37:28 +08:00
SnapOtter 2c45a3a9e8 fix: update tool count to 52 and add ai-canvas-expand to landing page
ai-canvas-expand was added to constants.ts and route files but never
added to the landing page bento grid, causing all hardcoded counts
to remain at 51. This updates all references across source, docs,
i18n, and tests to reflect the correct count of 52 tools.
2026-05-16 10:02:19 +08:00
SnapOtter 00f408b45e docs: update landing page tool count and AI model count
- Change "52 tools" to "51 tools" in 6 places (bento-grid heading,
  typing cursor, pricing, meta description, OG description, Twitter)
- Change "14 AI models" to "15" in FAQ page
- Add "Available in 21 languages" to pricing feature list
2026-05-16 09:56:29 +08:00
SnapOtter a01a65e9ac docs: complete API sync and documentation audit
Audit all 52 tools and 119 API operations against the OpenAPI spec.
Fix schema mismatches, add missing endpoints, and update all doc surfaces.

OpenAPI spec (apps/api/src/openapi.yaml):
- Add operationId to all 119 operations for SDK code generation
- Add descriptions to 17 operations that only had summaries
- Fix 9 bare error responses with proper content/schema blocks
- Fix wrong $ref on GET /api/v1/settings/{key} 404 (was UnauthorizedError)
- Fix 10 async AI tools using 200 instead of 202 Accepted
- Add missing JXL format to 9 tool enums (convert, collage, stitch, split,
  svg-to-raster, pdf-to-image, optimize-for-web, erase-object, noise-removal)
- Add 3 missing endpoints: POST /api/v1/fetch-urls, GET /api/v1/config/locale,
  POST /api/v1/tools/ai-canvas-expand
- Add missing meme-templates/fonts/{filename} endpoint
- Fix watermark-image and compose: settings not required (all have defaults)
- Fix compare similarity description (0-100 percentage, not 0-1)
- Fix find-duplicates: add nullable thumbnail, add skippedFiles response field
- Fix upscale format default ("auto" not "png"), add clientJobId fields
- Fix restore-photo: remove phantom mode param, fix denoiseStrength default,
  add missing colorizeStrength
- Fix smart-crop: add 5 missing parameter defaults
- Add missing params: image-enhancement deepEnhance, transparency-fixer
  removeWatermark, image-to-pdf collate, image-to-base64 jxl enum
- Fix files/{id}/thumbnail security (requires auth, was marked public)
- Annotate 7 empty description strings in pipeline/role schemas

Documentation surfaces:
- VitePress config: "50 tools" to "51 tools" (2 locations)
- README: add OIDC/SSO docs link
- getting-started.md: add Color Blindness Simulation to tool table
- database.md: fix hash descriptions (bcrypt/SHA-256 to scrypt)
2026-05-15 23:13:42 +08:00
SnapOtter 51bc2d5732 fix: QA sweep fixes across migration, security, lint, and e2e tests
- fix(db): migration 0012 column order mismatch causing NOT NULL
  constraint failure on existing databases; use explicit column
  mapping instead of SELECT *
- fix(db): disable FK checks during migrations to allow SQLite
  table-recreation pattern (DROP + RENAME)
- fix(security): filter cookie_secret and instance_id from settings
  API response for non-admin users
- fix(lint): resolve all 7 API lint warnings (noParameterAssign,
  noImplicitAnyLet) in compose, image-enhancement, and workspace
- fix(docs): correct permission count from 16 to 14 in CLAUDE.md
- fix(e2e): resolve 44 Playwright test failures across 8 spec files
  including locator specificity, compress mode defaults, format count,
  restore-photo UI drift, stitch image count, GIF animated fixtures,
  submit button timing, and processing timeouts
2026-05-15 22:41:22 +08:00
SnapOtter d38621d7b9 feat: add multi-language support for 20 locales
Add complete i18n infrastructure with 21 supported languages:
English, Simplified Chinese, Traditional Chinese, Japanese, Korean,
Spanish, French, Italian, Brazilian Portuguese, German, Dutch, Swedish,
Russian, Polish, Ukrainian, Arabic (RTL), Turkish, Hindi, Vietnamese,
Indonesian, and Thai.

- I18nProvider context with three-tier locale detection
  (user preference > navigator.languages > instance default > English)
- ~1500 translation keys per locale with TypeScript-enforced completeness
- Dynamic code-splitting: only the active locale is loaded at runtime
- Language selectors in footer, login page, settings, and mobile sidebar
- Arabic RTL support with CSS logical properties across all components
- Tool names, descriptions, and categories translated via i18n helpers
- Public API endpoint GET /api/v1/config/locale for instance default
- Multi-script font stack (CJK, Arabic, Devanagari, Thai, Cyrillic)
- format() and plural() helpers for interpolation and pluralization
- API error translation mapping (translateApiError)
- 36 Playwright e2e tests verifying all 21 locales load correctly
- 25 unit tests for format, plural, locale detection, and completeness
- Updated translations.md docs and CLAUDE.md conventions
2026-05-15 17:02:49 +08:00
SnapOtter b449bd1a56 fix(security): correct Docker rate limit defaults
- LOGIN_ATTEMPT_LIMIT: 500 -> 30 in Dockerfile (matching code default)
- RATE_LIMIT_PER_MIN=0 now means no global limit (50K ceiling) instead
  of 1 req/min, preserving backward compatibility with existing deploys
  while keeping per-route limits (login brute-force) active
2026-05-14 23:02:25 +08:00
SnapOtter ca2ef5b3f4 feat: add OIDC/SSO authentication (#3)
Add OpenID Connect (OIDC) authentication alongside existing
username/password login. Users can log in via any standards-compliant
OIDC provider (Keycloak, Authentik, Authelia, Google, Azure AD, Okta)
while preserving full backward compatibility.

- OIDC Fastify plugin with lazy discovery, PKCE, cookie-based sessions
- Login page OIDC button, auth hook updates, settings dialog badges
- 28 integration tests, OIDC setup guide with provider examples
- Fix pre-existing test failures (content-aware-crop, watermark, SVGZ)
- WAL checkpoint fix for SQLite test stability

Closes #3

# Conflicts:
#	apps/api/src/lib/env.ts
#	apps/api/src/routes/tools/watermark-image.ts
#	pnpm-lock.yaml
#	tests/integration/color-palette.test.ts
#	tests/integration/compare.test.ts
#	tests/integration/watermark-image.test.ts
2026-05-14 22:31:26 +08:00
SnapOtter cb8ddab8ae Merge branch 'security/comprehensive-hardening'
# Conflicts:
#	tests/integration/color-palette.test.ts
#	tests/integration/compare.test.ts
#	tests/integration/watermark-image.test.ts
2026-05-14 20:54:33 +08:00
SnapOtter 20ab04c5bd fix(security): revert archiver v8 and @fastify/static v9 upgrades
archiver v8 changed its default export, breaking all ZIP-producing
tools (pdf-to-image, split, batch, favicon, bulk-rename, svg-to-raster).
Reverted to v7 -- the lodash vulnerability via archiver is _.template
which is never called directly.

@fastify/static v9 has breaking changes incompatible with the current
static file serving setup. Reverted to v8 -- the path traversal CVEs
in v8 are mitigated by the existing path traversal guards in files.ts.

Updated edge-cases test to expect 400 for >64KB settings payloads
(new security limit).
2026-05-14 16:59:40 +08:00
SnapOtter 98531db7ed fix: correct corrupted-image test expectations and SVGZ watermark filename
Tests expected 422 for corrupted image data, but the API correctly
returns 400 since corruption is caught during validation (unrecognized
format), not during processing. Also fix watermark-image route passing
a hardcoded "watermark" string instead of the actual uploaded filename
to validateImageBuffer, which broke SVGZ detection.
2026-05-14 10:47:46 +08:00
SnapOtter cd24bb92b6 fix: update corrupted image test expectations from 422 to 400
validateImageBuffer catches corrupt image data before processing
reaches the tool handler, so the correct status code is 400 (bad
request) rather than 422 (processing failure). Also fix SVGZ
watermark validation by returning early for compressed SVG (Sharp
cannot read gzip-compressed SVGZ directly) and passing the actual
watermark filename to validateImageBuffer for correct format
detection.
2026-05-14 00:09:31 +08:00
SnapOtter 4e64ee2779 fix(security): comprehensive security audit and hardening
Auth: login rate limit 30/min (was 500), global rate limit 1000/min (was
unlimited), password/username max lengths on all Zod schemas, session
invalidation on role change, API key legacy scan bounded to 100 keys.

SVG: hardened regex sanitizer with CDATA stripping, XML entity decoding,
set/animate/iframe/embed blocking, comprehensive data: URI blocking,
use element external href blocking. 11 attack payload fixtures added.

SSRF: fixed DNS rebinding TOCTOU by pinning resolved IPs via custom
HTTP/HTTPS agents. Added 6to4 and NAT64 to blocked IPv6 ranges.

Docker: capability dropping (cap_drop ALL + minimal cap_add), resource
limits (4g/8g mem, 512/1024 pids), healthcheck timeout, password
removed from startup banner, default password warning comments.

Network: CSP and HSTS applied in all environments (not just production),
stack traces removed from all error responses, internal paths stripped
from error details, per-route rate limits on uploads (60/min) and URL
fetches (200/hour).

Files: exclusive temp file creation (O_EXCL), disk space circuit
breaker, per-user storage quotas, settings payload 64KB size guard.

Python sidecar: script name allowlist in dispatcher, minimal environment
for subprocess spawns.

Dependencies: fixed 6 production CVEs (drizzle-orm, fastify, fast-uri,
@fastify/static, next, archiver/lodash). Pinned all GitHub Actions to
SHA hashes.

114 security tests added. Full OWASP Top 10 penetration test matrix
verified against production Docker container (30/30 pass after
hardening).
2026-05-13 21:33:50 +08:00
SnapOtter f467191e9b fix(oidc): preserve authProvider on auto-link
Linked users keep authProvider="local" so they can still log in
with their local password. Only externalId is set during linking.
2026-05-13 20:11:11 +08:00
SnapOtter eacdb867ac docs: add OIDC setup guide with provider examples 2026-05-13 19:17:14 +08:00
SnapOtter fda4e25296 test(oidc): add integration tests for OIDC auth flow
Covers session response fields, password guards, users list,
config endpoint, login redirect, callback edge cases, and
backward compatibility. Also adds migration to make password_hash
nullable (required for OIDC-only users) and vitest aliases for
@fastify/cookie and openid-client.
2026-05-13 19:14:34 +08:00
SnapOtter 42265af47b feat(oidc): update settings dialog with OIDC user handling and logout flow 2026-05-13 19:06:22 +08:00
SnapOtter 44f42c6866 feat(oidc): add OIDC login button and auth hook updates 2026-05-13 19:04:06 +08:00
SnapOtter aaebd14c60 feat(oidc): register cookie and OIDC plugins, extend config endpoint 2026-05-13 19:01:30 +08:00
SnapOtter 71b6489a0d feat(oidc): implement OIDC Fastify plugin with login redirect and callback 2026-05-13 18:58:35 +08:00
SnapOtter ad4ca27f03 feat(oidc): update auth middleware for cookie extraction and OIDC user handling 2026-05-13 18:52:39 +08:00
SnapOtter 5a95af70f4 feat(oidc): add OIDC environment variables with cross-field validation 2026-05-13 18:49:29 +08:00
SnapOtter 877475d1c9 feat(oidc): add OIDC columns to users and sessions tables 2026-05-13 18:47:54 +08:00
SnapOtter 446bad3b10 feat(oidc): install openid-client and @fastify/cookie 2026-05-13 18:45:59 +08:00
SnapOtter beb94b698c fix(web): redesign image editor icon for better clarity
Replace abstract curve-and-dots icon with a recognizable photo frame
and pencil design that reads clearly as an image editor at all sizes.
2026-05-13 18:18:20 +08:00
SnapOtter c6a5d3f33e refactor: remove content-aware-crop tool
Remove the content-aware-crop tool entirely -- API route, frontend
settings component, e2e and integration tests, and all registry
entries.
2026-05-13 17:55:01 +08:00
SnapOtter 05720f350a Revert "feat: replace AI matting with chroma-based checkerboard detection"
This reverts commit f1a4c94375.
2026-05-13 17:20:33 +08:00
SnapOtter f1a4c94375 feat: replace AI matting with chroma-based checkerboard detection
The transparency-fixer now directly detects the baked-in checkerboard
pattern using per-pixel chroma analysis instead of BiRefNet AI matting.
Achromatic pixels in the gray range are classified as background
(transparent), chromatic pixels as foreground (opaque), with smooth
transitions at anti-aliased edges.

- No longer requires Python sidecar or background-removal bundle
- Watermark removal uses Sharp median(5) filter pre-processing
- Moved tool from "ai" to "utilities" category
- Removed from PYTHON_SIDECAR_TOOLS and background-removal enablesTools
- Near-instant processing (pure Sharp, no model inference)
2026-05-13 17:16:02 +08:00
SnapOtter 443e9a4ffa fix: replace broken LaMa watermark detection with median filter approach
The luminance anomaly detection + LaMa inpainting approach failed because
watermark signal on the matted foreground was too weak (10-15 units vs
threshold of 25). Median filter with kernel=5 effectively removes
semi-transparent watermark text while preserving the stamp structure.

Pipeline is now: median filter (if toggle on) -> BiRefNet matting -> defringe.
No longer requires object-eraser-colorize bundle for watermark removal.
2026-05-13 17:08:15 +08:00