Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'main' into refactor/link-previews-in-core

Elian Doranbd1de7027894
diff --cc packages/trilium-core/src/routes/index.ts
index 137562b99d,9f2374fa6d..f7a636707b
--- a/packages/trilium-core/src/routes/index.ts
+++ b/packages/trilium-core/src/routes/index.ts
@@@ -143,12 -142,10 +143,14 @@@ export function buildSharedApiRoutes({
asyncApiRoute(PST, "/api/attachments/:attachmentId/compress-image", imageRoute.compressAttachmentImage);
asyncRoute(PST, "/api/notes/:noteId/attachments/upload", [checkApiAuthOrElectron, uploadMiddlewareWithErrorHandling, csrfMiddleware], attachmentsApiRoute.uploadAttachment, apiResultHandler);
+ // POSTed rather than taking the URL in a query string: a link can carry a one-time token or a
+ // signature, and a query string ends up in every access log along the way.
+ asyncApiRoute(PST, "/api/link-embed/metadata", linkEmbedRoute.getMetadata);
+
// group of the services below are meant to be executed from the outside
- route(GET, "/api/setup/status", [], setupApiRoute.getStatus, apiResultHandler);
+ // Not transactional: a status read needs no transaction, and one is unopenable during the moment
+ // a restore has the database detached — which is exactly when the wizard is polling hardest.
+ asyncRoute(GET, "/api/setup/status", [], setupApiRoute.getStatus, apiResultHandler);
asyncRoute(PST, "/api/setup/new-document", [checkAppNotInitialized], setupApiRoute.setupNewDocument, apiResultHandler);
asyncRoute(PST, "/api/setup/sync-from-server", [checkAppNotInitialized], setupApiRoute.setupSyncFromServer, apiResultHandler);
route(GET, "/api/setup/sync-seed", [loginRateLimiter, checkCredentials], setupApiRoute.getSyncSeed, apiResultHandler);