40 Commits
Author SHA1 Message Date
Tom Moor 4fd8b0731e fix: Limit archive contents read during imports (#14576) 2026-11-13 08:04:58 -05:00
Tom Moor a40198a97d feat: Add expiry dates for public share links (#14513)
* wip

* fix: Treat null expiresAt as no expiry when creating a share

* fix: Add bottom padding to share notices
2026-11-09 22:29:49 -05:00
Tom Moor b4601a61ff feat: Support OAuth Client ID Metadata Documents for MCP clients (#14015)
* feat: Support OAuth Client ID Metadata Documents for MCP clients

MCP clients can send an https URL as their client_id. The server fetches
the metadata document at that URL and caches one team-less client row per
URL, so MCP works on the root domain without dynamic registration.

Closes #14010

* fix: Address review findings for client ID metadata documents

- Only count unexpired tokens when cleaning up metadata document clients
- Reject backslashes, whitespace and trailing host dots in client_id URLs
- Strip trailing dots before installation host comparisons
- Type clientSecret as nullable

* fix: Keep OAuth clients with pending authorization codes during cleanup

* refactor: Simplify client ID metadata document handling

- Gate metadata document fetches on the MCP preference inside the helper
- Add isMCPClient getter and a shared client ID prefix constant
- Enforce the team/metadata document CHECK in both directions
- Index oauthClientId on OAuth token and code tables
- Reuse parseDomain, clamp and time helpers

* revert: Remove pending authorization code check from OAuth client cleanup

* fix: Block all special-use addresses when fetching client metadata documents

ALLOWED_PRIVATE_IP_ADDRESSES no longer applies to client ID metadata
document requests (draft -02 section 8.6). The fetch wrapper takes an
allowIPAddressList option to override the environment list.

* fix: Reject empty userinfo in client metadata document URLs

https://@host and https://:@host have a userinfo component that the URL
parser drops, so check the raw authority (draft -02 section 3).

* fix: Accept a root path in client metadata document URLs

Draft -02 section 3 marks a root path as NOT RECOMMENDED, not invalid, so
https://example.com/ is a valid client_id. A URL with no path is still
rejected.

* fix: Reject client metadata documents with private key material

A jwks key with private or symmetric members (d, p, q, dp, dq, qi, oth,
k) makes the document invalid, so it is not cached (draft -02 section 4.1).
Public keys are still ignored.

* fix: Respect no-cache, no-store and Age for client metadata documents

no-store and no-cache now expire the cached document at once, so it is
fetched again before the next authorization. Freshness from max-age or
Expires (measured from Date) is reduced by Age before clamping (draft -02
section 5.2).

* feat: Copy DCR and CIMD client logos to file storage in the background

logo_uri was rendered directly on the consent screen, which lets the logo
host track users and change the image at any time (draft -02 sections 8.8
and 9.2). A background task now fetches the logo with the strict fetch
rules, accepts only PNG, JPEG, GIF and WebP by their leading bytes, and
stores it content addressed in the public bucket. Requests never wait for
the upload.

* fix: Match loopback redirect URIs on any port

Native apps such as Claude Code register http://localhost/callback and
then listen on a free port, so an exact match rejected them. Loopback
redirect URIs now match on any port (RFC 8252 section 7.3); the scheme,
host and path must still match, and other URIs still match exactly.

* fix: Only break the redirect URL mid-word on the consent screen

break-all on the whole notice split words such as "continue" in the
loopback warning. It now applies only to the redirect URL.

* chore: Shorten the loopback warning on the consent screen

* fix: Show the punycode host of client metadata documents on the consent screen

A lookalike Unicode host was shown as written. Hostnames now come from a
shared getHostname helper that returns the punycode form.

* refactor: Move image type detection to ImageHelper and use it for avatars

Avatars and integration logos copied from a URL are now stored only if
they are PNG, JPEG, GIF or WebP, with the content type detected from the
file data rather than the remote host.

* fix: Address review findings for OAuth client logos and metadata caching

- Count the time since the Date header as age when caching metadata
  documents, so a document is not cached past its Expires time
- Log logo scheduling failures instead of failing registration requests
- Run dynamic client registration in a transaction
- Delete copied logos from storage when no client uses them

* fix: Store one logo per OAuth client and return a distinct metadata document error

- Logos are stored per client, so a file is only deleted when its own
  client stops using it. This removes the reference count and its race.
- A metadata document that cannot be fetched or is invalid now returns
  invalid_client_metadata with the reason, not a 404. Network errors
  are only logged.
- Move scheduleOptional to BaseTask so that any task can use it.
2026-10-12 11:01:55 -04:00
Tom Moor 57cf871c9a Increase max comment length to 10k characters (#13814) 2026-09-20 11:40:23 -04:00
Tom Moor 7f00defd62 feat: Add archive and deletion reasons (#13784)
* feat: Add reasons for archived and deleted documents

* feat: Add deprecation reasons to archived collections

* fix: Refine deprecation reason display for readers

* feat: Accept reasons when archiving or deleting

* Support reasons in archive and delete MCP tools

* Fix placeholder after clearing content editable text

* Keep the caret before content editable placeholders

* Remove test

* feat: Add archive reasons to the confirmation dialog
2026-09-18 21:09:35 -04:00
Tom MoorandClaude Opus 5 d55e7f37e5 fix: Raise OAuth redirect_uris limit and log client errors (#13583)
Dynamic client registration rejected any client sending more than 10
redirect URIs. The limit is now 20, shared between the register and
update schemas, and the error reports how many were received.

OAuth client errors were swallowed without reaching logs or Sentry,
leaving a failing integration invisible beyond its status code. 4xx
responses are now logged with the reason.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-29 19:49:28 -04:00
Tom MoorandClaude Opus 5 d8d8f2fffe Support HEIC and HEIF avatar uploads with in-browser conversion (#13577)
* feat: Support HEIC avatar uploads with in-browser conversion

HEIC and HEIF images picked for an avatar are now converted to JPEG in
the browser before the cropper opens. The browser's own decoder is used
when it supports the format, otherwise a WebAssembly decoder is loaded
on demand.

Also collects the image utilities into an ImageHelper class, fixes the
crop dialog's submit button never disabling, and stops the upload from
forwarding request headers the browser controls itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* refactor: Use only the browser's own HEIC decoder

Drops the bundled WebAssembly decoder in favour of the browser's native
support. This removes an LGPL dependency and a 3MB lazy chunk, and lets
the Content Security Policy stay as it was.

Browsers without HEIC support now get a message asking for a JPEG or PNG.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* docs: Add class-level JSDoc to ImageHelper

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-28 00:13:56 -04:00
Tom Moor fc4fe65155 feat: Filter DSL (#12176)
* feat: Normalized filter DSL for documents.list and search

Add a structured filter expression language (field/operator/value leaves
composed with AND/OR groups) shared by documents.list, documents.search and
documents.searchTitles. Values are validated against each field's column type
and per-field operator allowlists at the input layer, and translated to
Sequelize where-clauses server-side.

Supersedes the ad-hoc statusFilter/dateFilter/collectionId/userId parameters,
adds ISO 8601 duration matching for date fields, documentId subtree expansion
for search, and preserves draft visibility and collection authorization.

* chore: Fix flaky Encrypted "different key" test

AES-256-CBC is unauthenticated, so decrypting with the wrong key only
raises "bad decrypt" when the garbage plaintext has invalid PKCS#7 padding
(~255/256 of the time). Roughly 1 in 245 runs it decrypts to a non-matching
value instead of throwing, failing the strict toThrow assertion. Accept
either outcome, mirroring the adjacent tampered-data test.

* Hardening
2026-08-15 13:25:10 -04:00
Tom Moor 6268bc149a fix: Add missing zod schema check for incoming document.text (#13143)
* fix: Add missing zod schema check for incoming document.text

* feedback

* test
2026-07-26 08:25:25 -04:00
Tom MoorandClaude Opus 4.8 1cc10f5fff fix: Increase valid user-supplied URL length to 1024 (#12585)
* fix: Increase valid user-supplied URL length to 1024

* fix: Wrap URL length migration in a transaction

Wrap the multi-column changeColumn operations in a transaction so a
failure on any column rolls back the whole migration rather than leaving
the database partially migrated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:30:55 -04:00
7ed41eadc6 Add per-share branding: title and logoUrl overrides (#12003)
* feat: add title and logoUrl to Share model

Agent-Logs-Url: https://github.com/outline/outline/sessions/9bc9d438-6892-4903-9d32-6b6868f4fd97

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>

* fix: use STRING(4096) for logoUrl column in migration

Agent-Logs-Url: https://github.com/outline/outline/sessions/9bc9d438-6892-4903-9d32-6b6868f4fd97

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>

* feat: use share title and logoUrl to override team branding on shared page

Agent-Logs-Url: https://github.com/outline/outline/sessions/854d6d22-e80b-4673-b3b2-0f9cf43a3246

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>

* refactor: use ShareValidation class constants for title/logoUrl max lengths

Agent-Logs-Url: https://github.com/outline/outline/sessions/ea462d6a-d4d3-4882-ab8e-88060bf64877

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>

* fix: use ShareValidation constants in @Length msg template literals

Agent-Logs-Url: https://github.com/outline/outline/sessions/694116c2-47e8-4001-a103-c8a62c7ac71e

Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>

* feat: add display settings popover with custom title and icon for shares

Move share toggles (search indexing, email subscriptions, show last
modified, show TOC) into a popover triggered by a settings cog. The
popover also includes inputs for a custom site title and icon upload
to override team branding on shared pages. Rename logoUrl to iconUrl,
loosen URL validation to allow relative attachment paths, and surface
the popover in the shared page header for users with edit permission.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* styling

* Display branding on single shared pages

* Review comments

* refactor

* PR feedback

* Lose 'Remove icon' button

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 21:23:13 -04:00
Tom Moor e49e3136b6 Increase MCP guidance limit (#12097)
* Increase MCP guidance limit
Add new controls for Input

* PR feedback
2026-04-17 23:22:50 -04:00
Tom Moor cbb53285a7 fix: Flaky test (#12087)
* fix: Flaky test

* fix: Validation values incorrect
2026-04-16 21:40:08 -04:00
Tom Moor 6874b02cc7 Add max character count to inputs (#12006) 2026-04-12 11:44:28 -04:00
Tom MoorandClaude Opus 4.6 fddf630e49 Add configurable MCP workspace guidance (#11839)
* Add configurable MCP workspace guidance

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix Instructions passing, tweak UI

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 10:45:09 -04:00
Tom Moor 57b6e9aca4 feat: Passkey support (#11065)
closes #6930
2026-01-05 19:58:46 -05:00
Tom Moor 94252672f8 feat: Allow PKCE clients to refresh tokens (#10769)
* Add clientType concept

* Add clientType mutations

* tsc

* i18n

* fix: Invalid input handling

* tsc
2025-12-03 18:09:43 -05:00
Salihu 430883f186 feat: Custom emoji (#10513)
Towards #9278
2025-12-01 02:31:50 +01:00
codegen-sh[bot]andTom Moor bf9065d6e6 Add description column to groups (#10511)
* Add description column to groups

- Add database migration to add description column to groups table
- Update server-side Group model with description field and validation
- Update group presenter to include description in API responses
- Update API schemas to validate description field in create/update operations
- Update client-side Group model with description field and search integration
- Update unfurl types and presenter to include description for hover cards
- Update HoverPreviewGroup component to display description in UI

The description field is optional with a 2000 character limit and is included
in group search functionality.

* Fix TypeScript error: Add missing description prop to HoverPreviewGroup

The HoverPreviewGroup component expects a description prop but it wasn't being passed from HoverPreview.tsx. This was causing the types check to fail with:

error TS2741: Property 'description' is missing in type '{ ref: MutableRefObject<HTMLDivElement | null>; name: any; memberCount: any; users: any; }' but required in type 'Props'.

Fixed by adding the description prop from data.description which is available in the UnfurlResponse[UnfurlResourceType.Group] type.

* Move 2000 char validation to shared constant

- Add GroupValidation.maxDescriptionLength constant to shared/validations.ts
- Update server Group model to use GroupValidation.maxDescriptionLength
- Update API schemas to use the shared constant instead of hardcoded value
- Ensures consistent validation across the entire application

* Add description field to CreateGroupDialog and EditGroupDialog

- Add description textarea input to both create and edit group dialogs
- Import GroupValidation constant for consistent character limit validation
- Set maxLength to GroupValidation.maxDescriptionLength (2000 chars)
- Include description in form submission for both create and update operations
- Add placeholder text for better UX
- Maintain backward compatibility with optional description field

* Add description column to GroupsTable

- Add description column between name and members columns
- Display group description with fallback to em dash (—) for empty descriptions
- Use secondary text styling for consistent visual hierarchy
- Set column width to 2fr for adequate space
- Maintain sortable functionality through accessor

* tweaks

* animation

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-10-31 11:36:26 -04:00
Tom Moor ca5c51a712 fix: Client and server validation differ for subdomains (#9468)
* fix: Client and server validation differ for subdomains

* Validation message

* Lower min subdomain length to 2
2025-06-18 16:50:17 -04:00
codegen-sh[bot]andTom Moor 76bd503581 Add description setting for workspaces (#9345)
* Add team description column and settings

- Add database migration to add description column to teams table
- Update server-side Team model with description field and validation
- Update client-side Team model to include description field
- Add description input field to team settings page
- Update renderApp to use team description in HTML metadata when public branding is enabled

* Applied automatic fixes

* tweaks

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-31 13:53:42 -04:00
codegen-sh[bot]andTom Moor 11cff77162 Add installation.create API endpoint (#9324)
* Add installation.create API endpoint

- Add new endpoint that accepts teamName, userName, userEmail
- Use accountProvisioner to create team and user
- Only allow when no existing teams exist (unauthenticated)
- Add comprehensive tests for success, failure, and validation cases
- Add schema validation with Zod
- Include rate limiting (5 per hour)
- Follow existing API patterns and conventions

* Remove changes to .env.test

* fix

* Centralize validation

* test

* test

* test

---------

Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2025-05-29 22:52:49 -04:00
Tom Moor b7e80036eb Add warning on large documents (#9282)
* Add warning on large documents

* Update Document.tsx
2025-05-23 08:55:03 -04:00
Tom Moor a06671e8ce OAuth provider (#8884)
This PR contains the necessary work to make Outline an OAuth provider including:

- OAuth app registration
- OAuth app management
- Private / public apps (Public in cloud only)
- Full OAuth 2.0 spec compatible authentication flow
- Granular scopes
- User token management screen in settings
- Associated API endpoints for programatic access
2025-05-03 19:40:18 -04:00
Hemachandar 6e98568e5b API importer for Notion (#8710) 2025-03-23 12:19:13 -07:00
Tom Moor 82cdebfb66 Add name column to revisions (#8603)
* fix: Flaky test

* Migration, model interface

* Add policies to revisions

* Add revisions.update endpoint

* tests

* lint
2025-03-02 05:07:30 -08:00
Tom Moor 82539cc348 Increase max length of collection overview 2025-02-12 20:51:13 -05:00
Tom Moor c8cbb9ef9c Add HEIC to supported mimes, closes #8122 2024-12-18 09:49:28 +09:00
Tom Moor cf16d25a67 chore: Tidy API key settings page 2024-06-05 07:13:35 -04:00
Tom Moor 55fccc895d Remove max domains restriction on self-hosted 2024-02-21 18:09:40 -05:00
Tom Moor 7555240413 Add summary column to documents 2024-02-16 13:25:17 -05:00
Tom Moor 787b893cd2 Increase max collection description 2023-10-16 19:38:11 -04:00
Tom Moor fc8c20149f feat: Comments (#4911)
* Comment model

* Framework, model, policy, presenter, api endpoint etc

* Iteration, first pass of UI

* fixes, refactors

* Comment commands

* comment socket support

* typing indicators

* comment component, styling

* wip

* right sidebar resize

* fix: CMD+Enter submit

* Add usePersistedState
fix: Main page scrolling on comment highlight

* drafts

* Typing indicator

* refactor

* policies

* Click thread to highlight
Improve comment timestamps

* padding

* Comment menu v1

* Change comments to use editor

* Basic comment editing

* fix: Hide commenting button when disabled at team level

* Enable opening sidebar without mark

* Move selected comment to location state

* Add comment delete confirmation

* Add comment count to document meta

* fix: Comment sidebar togglable
Add copy link to comment

* stash

* Restore History changes

* Refactor right sidebar to allow for comment animation

* Update to new router best practices

* stash

* Various improvements

* stash

* Handle click outside

* Fix incorrect placeholder in input
fix: Input box appearing on other sessions erroneously

* stash

* fix: Don't leave orphaned child comments

* styling

* stash

* Enable comment toggling again

* Edit styling, merge conflicts

* fix: Cannot navigate from insights to comments

* Remove draft comment mark on click outside

* Fix: Empty comment sidebar, tsc

* Remove public toggle

* fix: All comments are recessed
fix: Comments should not be printed

* fix: Associated mark should be removed on comment delete

* Revert unused changes

* Empty state, basic RTL support

* Create dont toggle comment mark

* Make it feel more snappy

* Highlight active comment in text

* fix animation

* RTL support

* Add reply CTA

* Translations
2023-02-25 12:03:05 -08:00
Tom Moor ed8176ca7d fix: Limit ws payload size 2022-08-16 10:27:55 +02:00
Tom Moor cfa7ecd7f8 fix: Add missing validation to document state 2022-08-16 09:35:31 +02:00
Tom Moor 7923a7e071 Enforce user invites/request on server 2022-08-08 11:02:37 +02:00
Tom Moor b37a848914 Add limit of 10 webhooks/team 2022-08-08 10:58:47 +02:00
Tom Moor 8fdd5bf734 fix: substitution of content when sending an image to a profile (#3869)
* fix: Limit public uploads to basic image types

* test
2022-07-26 12:10:00 -07:00
Tom Moor ec35af4bc5 Refactor validations 2022-07-24 13:40:04 +01:00
Tom Moor 7ae892fe06 fix: Long collection description prevents import (#3847)
* fix: Long collection description prevents import
fix: Parallelize attachment upload during import

* fix: Improve Notion image import matching

* chore: Bump JSZIP (perf)

* fix: Allow redirect from /doc/<id> to canonical url

* fix: Importing document with only title duplicates title in body
2022-07-24 01:37:20 -07:00