diff --git a/apps/client/package.json b/apps/client/package.json index eb6b7cf3a..4ef4b120b 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/client", - "version": "0.98.0", + "version": "0.98.1", "description": "JQuery-based client for TriliumNext, used for both web and desktop (via Electron)", "private": true, "license": "AGPL-3.0-only", @@ -62,7 +62,7 @@ "@ckeditor/ckeditor5-inspector": "5.0.0", "@preact/preset-vite": "2.10.2", "@types/bootstrap": "5.2.10", - "@types/jquery": "3.5.32", + "@types/jquery": "3.5.33", "@types/leaflet": "1.9.20", "@types/leaflet-gpx": "1.3.7", "@types/mark.js": "8.11.12", diff --git a/apps/client/src/services/note_autocomplete.ts b/apps/client/src/services/note_autocomplete.ts index 66031f482..9ca4fa86f 100644 --- a/apps/client/src/services/note_autocomplete.ts +++ b/apps/client/src/services/note_autocomplete.ts @@ -327,7 +327,7 @@ function initNoteAutocomplete($el: JQuery, options?: Options) { } // Add special class for search-notes action const actionClass = suggestion.action === "search-notes" ? "search-notes-action" : ""; - + // Choose appropriate icon based on action let iconClass = suggestion.icon ?? "bx bx-note"; if (suggestion.action === "search-notes") { @@ -337,18 +337,18 @@ function initNoteAutocomplete($el: JQuery, options?: Options) { } else if (suggestion.action === "external-link") { iconClass = "bx bx-link-external"; } - + // Simplified HTML structure without nested divs let html = `
`; - html += ``; - html += ``; - html += `${suggestion.highlightedNotePathTitle}`; - + html += ``; + html += ``; + html += `${suggestion.highlightedNotePathTitle}`; + // Add attribute snippet inline if available if (suggestion.highlightedAttributeSnippet) { - html += `${suggestion.highlightedAttributeSnippet}`; + html += `${suggestion.highlightedAttributeSnippet}`; } - + html += ``; html += `
`; return html; diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 290240b84..ae6e2109a 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -862,10 +862,34 @@ table.promoted-attributes-in-tooltip th { .aa-dropdown-menu .aa-suggestion { cursor: pointer; - padding: 5px; + padding: 6px 16px; margin: 0; } +.aa-dropdown-menu .aa-suggestion .icon { + display: inline-block; + line-height: inherit; + vertical-align: top; +} + +.aa-dropdown-menu .aa-suggestion .text { + display: inline-block; + width: calc(100% - 20px); + padding-left: 4px; +} + +.aa-dropdown-menu .aa-suggestion .search-result-title { + display: block; +} + +.aa-dropdown-menu .aa-suggestion .search-result-attributes { + display: block; + font-size: 0.8em; + color: var(--muted-text-color); + opacity: 0.6; + line-height: 1; +} + .aa-dropdown-menu .aa-suggestion p { padding: 0; margin: 0; @@ -1828,33 +1852,6 @@ textarea { width: 100%; } -.jump-to-note-results .aa-dropdown-menu .aa-suggestion { - white-space: normal; - padding: 2px 12px !important; - line-height: 1.1; - position: relative; - border-radius: 0; - margin: 0 !important; -} - -.jump-to-note-results .note-suggestion { - margin: 0; - padding: 0; - line-height: 1; -} - -.jump-to-note-results .aa-suggestion:not(:last-child)::after { - display: none; /* Remove dividers for more compact look */ -} - -.jump-to-note-results .aa-suggestion:last-child::after { - display: none; -} - -.jump-to-note-results .aa-suggestion.disabled::after { - display: none; -} - .jump-to-note-results .aa-dropdown-menu .aa-suggestion:hover, .jump-to-note-results .aa-dropdown-menu .aa-cursor { background-color: var(--hover-item-background-color, #f8f9fa); diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css index 6ab16a456..bee48c023 100644 --- a/apps/client/src/stylesheets/theme-next/base.css +++ b/apps/client/src/stylesheets/theme-next/base.css @@ -536,10 +536,9 @@ body.mobile .dropdown-menu .dropdown-item.submenu-open .dropdown-toggle::after { } /* List item */ -.jump-to-note-dialog .aa-suggestions div, -.note-detail-empty .aa-suggestions div { - border-radius: 0; - padding: 12px 16px; +.jump-to-note-dialog .aa-suggestion, +.note-detail-empty .aa-suggestion { + border-radius: 6px; color: var(--menu-text-color); cursor: default; } diff --git a/apps/client/src/translations/ro/translation.json b/apps/client/src/translations/ro/translation.json index 89fdcc9dc..02c7834dc 100644 --- a/apps/client/src/translations/ro/translation.json +++ b/apps/client/src/translations/ro/translation.json @@ -40,7 +40,7 @@ "add_relation": { "add_relation": "Adaugă relație", "allowed_characters": "Sunt permise doar caractere alfanumerice, underline și două puncte.", - "create_relation_on_all_matched_notes": "Crează relația pentru toate notițele găsite", + "create_relation_on_all_matched_notes": "Creează relația pentru toate notițele găsite.", "relation_name": "denumirea relației", "target_note": "notița destinație", "to": "către" @@ -76,9 +76,9 @@ "attachment_erasure_timeout": { "attachment_auto_deletion_description": "Atașamentele se șterg automat (permanent) dacă nu sunt referențiate de către notița lor părinte după un timp prestabilit de timp.", "attachment_erasure_timeout": "Perioadă de ștergere a atașamentelor", - "erase_attachments_after": "Erase unused attachments after:", + "erase_attachments_after": "Șterge atașamentele neutilizate după:", "erase_unused_attachments_now": "Elimină atașamentele șterse acum", - "manual_erasing_description": "Șterge acum toate atașamentele nefolosite din notițe", + "manual_erasing_description": "Puteți șterge atașamentele nefolosite manual (fără a lua în considerare timpul de mai sus):", "unused_attachments_erased": "Atașamentele nefolosite au fost șterse." }, "attachment_list": { @@ -141,7 +141,7 @@ "hide_promoted_attributes": "Ascunde lista atributelor promovate pentru această notiță", "hide_relations": "lista denumirilor relațiilor ce trebuie ascunse, delimitate prin virgulă. Toate celelalte vor fi afișate.", "icon_class": "valoarea acestei etichete este adăugată ca o clasă CSS la iconița notiței din ierarhia notițelor, fapt ce poate ajuta la identificarea vizuală mai rapidă a notițelor. Un exemplu ar fi „bx bx-home” pentru iconițe preluate din boxicons. Poate fi folosită în notițe de tip șablon.", - "inbox": "locația implicită în care vor apărea noile notițe atunci când se crează o noitiță utilizând butonul „Crează notiță” din bara laterală, notițele vor fi create în interiorul notiței cu această etichetă.", + "inbox": "locația implicită în care vor apărea noile notițe atunci când se crează o noitiță utilizând butonul „Crează notiță” din bara laterală, notițele vor fi create în interiorul notiței marcată cu eticheta #inbox.", "inherit": "atributele acestei notițe vor fi moștenite chiar dacă nu există o relație părinte-copil între notițe. A se vedea relația de tip șablon pentru un concept similar. De asemenea, a se vedea moștenirea atributelor în documentație.", "inheritable": "Moștenibilă", "inheritable_title": "Atributele moștenibile vor fi moștenite de către toți descendenții acestei notițe.", @@ -177,7 +177,7 @@ "render_note": "relație ce definește notița (de tip notiță de cod HTML sau script) ce trebuie randată pentru notițele de tip „Randare notiță HTML”", "run": "definește evenimentele la care să ruleze scriptul. Valori acceptate:\n", "run_at_hour": "La ce oră ar trebui să ruleze. Trebuie folosit împreună cu #run=hourly. Poate fi definit de mai multe ori pentru a rula de mai multe ori în cadrul aceleași zile.", - "run_on_attribute_change": "se execută atunci când atributele unei notițe care definește această relație se schimbă. Se apelează și atunci când un atribut este șters", + "run_on_attribute_change": " se execută atunci când atributele unei notițe care definește această relație se schimbă. Se apelează și atunci când un atribut este șters", "run_on_attribute_creation": "se execută atunci când un nou atribut este creat pentru notița care definește această relație", "run_on_branch_change": "se execută atunci când o ramură este actualizată.", "run_on_branch_creation": "se execută când o ramură este creată. O ramură este o legătură dintre o notiță părinte și o notiță copil și este creată, spre exemplu, la clonarea sau mutarea unei notițe.", @@ -198,7 +198,7 @@ "share_disallow_robot_indexing": "împiedică indexarea conținutului de către roboți utilizând antetul X-Robots-Tag: noindex", "share_external_link": "notița va funcționa drept o legătură către un site web extern în ierarhia de partajare", "share_favicon": "Notiță ce conține pictograma favicon pentru a fi setată în paginile partajate. De obicei se poate seta în rădăcina ierarhiei de partajare și se poate face moștenibilă. Notița ce conține favicon-ul trebuie să fie și ea în ierarhia de partajare. Considerați și utilizarea „share_hidden_from_tree”.", - "share_hidden_from_tree": "notița este ascunsă din arborele de navigație din stânga, dar încă este accesibilă prin intermediul unui URL.", + "share_hidden_from_tree": "notița este ascunsă din arborele de navigație din stânga, dar încă este accesibilă prin intermediul unui URL", "share_index": "notițele cu această etichetă vor afișa lista tuturor rădăcilor notițelor partajate", "share_js": "Notiță JavaScript ce va fi injectată în pagina de partajare. Notița respectivă trebuie să fie și ea în ierarhia de partajare. Considerați utilizarea 'share_hidden_from_tree'.", "share_omit_default_css": "CSS-ul implicit pentru pagina de partajare va fi omis. Se poate folosi atunci când se fac schimbări majore de stil la pagină.", @@ -214,7 +214,7 @@ "target_note_title": "Relația este o conexiune numită dintre o notiță sursă și o notiță țintă.", "template": "Șablon", "text": "Text", - "title_template": "titlul implicit al notițelor create în interiorul acestei notițe. Valoarea este evaluată ca un șir de caractere JavaScript\n și poate fi astfel îmbogățită cu un conținut dinamic prin intermediul variabilelow now și parentNote. Exemple:\n \n \n \n A se vedea wiki-ul pentru detalii, documentația API pentru parentNote și now pentru mai multe informații", + "title_template": "titlul implicit al notițelor create în interiorul acestei notițe. Valoarea este evaluată ca un șir de caractere JavaScript\n și poate fi astfel îmbogățită cu un conținut dinamic prin intermediul variabilelor now și parentNote. Exemple:\n \n \n \n A se vedea wiki-ul pentru detalii, documentația API pentru parentNote și now pentru mai multe informații.", "toc": "#toc sau #toc=show forțează afișarea tabelei de conținut, #toc=hide forțează ascunderea ei. Dacă eticheta nu există, se utilizează setările globale", "top": "păstrează notița la începutul listei (se aplică doar pentru notițe sortate automat)", "url": "URL", @@ -369,7 +369,7 @@ }, "confirm": { "also_delete_note": "Șterge și notița", - "are_you_sure_remove_note": "Doriți ștergerea notiței „{{title}}” din harta de relații?", + "are_you_sure_remove_note": "Doriți ștergerea notiței „{{title}}” din harta de relații? ", "cancel": "Anulează", "confirmation": "Confirm", "if_you_dont_check": "Dacă această opțiune nu este bifată, notița va fi ștearsă doar din harta de relații.", @@ -519,8 +519,8 @@ "export_status": "Starea exportului", "export_type_single": "Doar această notiță fără descendenții ei", "export_type_subtree": "Această notiță și toți descendenții ei", - "format_html_zip": "HTML în arhivă ZIP - recomandat deoarece păstrează toată formatarea", - "format_markdown": "Markdown - păstrează majoritatea formatării", + "format_html_zip": "HTML în arhivă ZIP - recomandat deoarece păstrează toată formatarea.", + "format_markdown": "Markdown - păstrează majoritatea formatării.", "format_opml": "OPML - format de interschimbare pentru editoare cu structură ierarhică (outline). Formatarea, imaginile și fișierele nu vor fi incluse.", "opml_version_1": "OPML v1.0 - text simplu", "opml_version_2": "OPML v2.0 - permite și HTML", @@ -640,7 +640,7 @@ "newTabNoteLink": "pe o legătură către o notiță va deschide notița într-un tab nou", "notSet": "nesetat", "noteNavigation": "Navigarea printre notițe", - "numberedList": "1. sau 1) urmat de spațiu pentru o listă numerotată", + "numberedList": "1. sau 1) urmat de spațiu pentru o listă numerotată", "onlyInDesktop": "Doar pentru desktop (aplicația Electron)", "openEmptyTab": "deschide un tab nou", "other": "Altele", @@ -807,7 +807,7 @@ "dialog_title": "Mută notițele în...", "error_no_path": "Nicio cale la care să poată fi mutate.", "move_button": "Mută la notița selectată", - "move_success_message": "Notițele selectate au fost mutate în", + "move_success_message": "Notițele selectate au fost mutate în ", "notes_to_move": "Notițe de mutat", "search_placeholder": "căutați notița după denumirea ei", "target_parent_note": "Notița părinte destinație" @@ -1058,7 +1058,7 @@ "download_button": "Descarcă", "file_size": "Dimensiune fișier:", "help_title": "Informații despre reviziile notițelor", - "mime": "MIME:", + "mime": "MIME: ", "no_revisions": "Nu există încă nicio revizie pentru această notiță...", "note_revisions": "Revizii ale notiței", "preview": "Previzualizare:", @@ -1193,7 +1193,7 @@ "enable": "Activează corectorul ortografic", "language_code_label": "Codurile de limbă", "language_code_placeholder": "de exemplu „en-US”, „de-AT”", - "multiple_languages_info": "Mai multe limbi pot fi separate prin virgulă, e.g. \"en-US, de-DE, cs\".", + "multiple_languages_info": "Mai multe limbi pot fi separate prin virgulă, e.g. \"en-US, de-DE, cs\". ", "title": "Corector ortografic", "restart-required": "Schimbările asupra setărilor corectorului ortografic vor fi aplicate după restartarea aplicației." }, @@ -1286,7 +1286,7 @@ "update_relation_target": { "allowed_characters": "Sunt permise doar caractere alfanumerice, underline și două puncte.", "change_target_note": "schimbă notița-țintă a unei relații existente", - "on_all_matched_notes": "Pentru toate notițele găsite:", + "on_all_matched_notes": "Pentru toate notițele găsite", "relation_name": "denumirea relației", "target_note": "notița destinație", "to": "la", @@ -1314,7 +1314,7 @@ "use_vim_keybindings_in_code_notes": "Combinații de taste Vim" }, "web_view": { - "create_label": "Pentru a începe, creați o etichetă cu adresa URL de încorporat, e.g. #webViewSrc=\"https://www.google.com\"", + "create_label": "Pentru a începe, creați o etichetă cu adresa URL de încorporat, e.g. #webViewSrc=\"https://www.google.com\"", "embed_websites": "Notițele de tip „Vizualizare web” permit încorporarea site-urilor web în Trilium.", "web_view": "Vizualizare web" }, @@ -1863,11 +1863,16 @@ }, "create_new_ai_chat": "Crează o nouă discuție cu AI-ul", "configuration_warnings": "Sunt câteva probleme la configurația AI-ului. Verificați setările.", - "experimental_warning": "Funcția LLM este experimentală!", + "experimental_warning": "Funcția LLM este experimentală.", "selected_provider": "Furnizor selectat", "selected_provider_description": "Selectați furnizorul de AI pentru funcțiile de discuție și completare", "select_model": "Selectați modelul...", - "select_provider": "Selectați furnizorul..." + "select_provider": "Selectați furnizorul...", + "ai_enabled": "Funcționalitățile AI au fost activate", + "ai_disabled": "Funcționalitățile AI au fost dezactivate", + "no_models_found_online": "Nu s-a găsit niciun model. Verificați cheia API și configurația.", + "no_models_found_ollama": "Nu s-a găsit niciun model Ollama. Verificați dacă Ollama rulează.", + "error_fetching": "Eroare la obținerea modelelor: {{error}}" }, "custom_date_time_format": { "title": "Format dată/timp personalizat", @@ -1998,6 +2003,26 @@ "call_to_action": { "background_effects_title": "Efectele de fundal sunt acum stabile", "background_effects_message": "Pe dispozitive cu Windows, efectele de fundal sunt complet stabile. Acestea adaugă un strop de culoare interfeței grafice prin estomparea fundalului din spatele ferestrei. Această tehnică este folosită și în alte aplicații precum Windows Explorer.", - "background_effects_button": "Activează efectele de fundal" + "background_effects_button": "Activează efectele de fundal", + "next_theme_title": "Încercați noua temă Trilium", + "next_theme_message": "Utilizați tema clasică, doriți să încercați noua temă?", + "next_theme_button": "Testează noua temă", + "dismiss": "Treci peste" + }, + "ui-performance": { + "title": "Setări de performanță", + "enable-motion": "Activează tranzițiile și animațiile", + "enable-shadows": "Activează umbrirea elementelor", + "enable-backdrop-effects": "Activează efectele de fundal pentru meniuri, popup-uri și panouri" + }, + "settings": { + "related_settings": "Setări similare" + }, + "settings_appearance": { + "related_code_blocks": "Tema de culori pentru blocuri de cod în notițe de tip text", + "related_code_notes": "Tema de culori pentru notițele de tip cod" + }, + "units": { + "percentage": "%" } } diff --git a/apps/client/src/widgets/dialogs/about.tsx b/apps/client/src/widgets/dialogs/about.tsx index 3a13ce869..7fa9c2390 100644 --- a/apps/client/src/widgets/dialogs/about.tsx +++ b/apps/client/src/widgets/dialogs/about.tsx @@ -76,7 +76,7 @@ function DirectoryLink({ directory, style }: { directory: string, style?: CSSPro openService.openDirectory(directory); }; - return + return {directory} } else { return {directory}; } diff --git a/apps/client/src/widgets/dialogs/add_link.tsx b/apps/client/src/widgets/dialogs/add_link.tsx index fc71d54bb..97440491d 100644 --- a/apps/client/src/widgets/dialogs/add_link.tsx +++ b/apps/client/src/widgets/dialogs/add_link.tsx @@ -29,6 +29,14 @@ export default function AddLinkDialog() { setShown(true); }); + useEffect(() => { + if (hasSelection) { + setLinkType("hyper-link"); + } else { + setLinkType("reference-link"); + } + }, [ hasSelection ]) + async function setDefaultLinkTitle(noteId: string) { const noteTitle = await tree.getNoteTitle(noteId); setLinkTitle(noteTitle); diff --git a/apps/client/src/widgets/note_tree.ts b/apps/client/src/widgets/note_tree.ts index 301a61b6b..85e098338 100644 --- a/apps/client/src/widgets/note_tree.ts +++ b/apps/client/src/widgets/note_tree.ts @@ -152,7 +152,7 @@ const TPL = /*html*/` const MAX_SEARCH_RESULTS_IN_TREE = 100; // this has to be hanged on the actual elements to effectively intercept and stop click event -const cancelClickPropagation: JQuery.TypeEventHandler = (e) => e.stopPropagation(); +const cancelClickPropagation: (e: JQuery.ClickEvent) => void = (e) => e.stopPropagation(); // TODO: Fix once we remove Node.js API from public type Timeout = NodeJS.Timeout | string | number | undefined; diff --git a/apps/client/src/widgets/view_widgets/calendar_view.ts b/apps/client/src/widgets/view_widgets/calendar_view.ts index 8da330ed8..ff32474f1 100644 --- a/apps/client/src/widgets/view_widgets/calendar_view.ts +++ b/apps/client/src/widgets/view_widgets/calendar_view.ts @@ -1,4 +1,4 @@ -import type { Calendar, DateSelectArg, DatesSetArg, EventChangeArg, EventDropArg, EventInput, EventSourceFunc, EventSourceFuncArg, EventSourceInput, PluginDef } from "@fullcalendar/core"; +import type { Calendar, DateSelectArg, DatesSetArg, EventChangeArg, EventDropArg, EventInput, EventSourceFunc, EventSourceFuncArg, EventSourceInput, LocaleInput, PluginDef } from "@fullcalendar/core"; import froca from "../../services/froca.js"; import ViewMode, { type ViewModeArgs } from "./view_mode.js"; import type FNote from "../../entities/fnote.js"; @@ -15,6 +15,22 @@ import type { EventImpl } from "@fullcalendar/core/internal"; import debounce, { type DebouncedFunction } from "debounce"; import type { TouchBarItem } from "../../components/touch_bar.js"; import type { SegmentedControlSegment } from "electron"; +import { LOCALE_IDS } from "@triliumnext/commons"; + +// Here we hard-code the imports in order to ensure that they are embedded by webpack without having to load all the languages. +const LOCALE_MAPPINGS: Record Promise<{ default: LocaleInput }>) | null> = { + de: () => import("@fullcalendar/core/locales/de"), + es: () => import("@fullcalendar/core/locales/es"), + fr: () => import("@fullcalendar/core/locales/fr"), + cn: () => import("@fullcalendar/core/locales/zh-cn"), + tw: () => import("@fullcalendar/core/locales/zh-tw"), + ro: () => import("@fullcalendar/core/locales/ro"), + ru: () => import("@fullcalendar/core/locales/ru"), + ja: () => import("@fullcalendar/core/locales/ja"), + "pt_br": () => import("@fullcalendar/core/locales/pt-br"), + uk: () => import("@fullcalendar/core/locales/uk"), + en: null +}; const TPL = /*html*/`
@@ -657,31 +673,11 @@ export default class CalendarView extends ViewMode<{}> { } -export async function getFullCalendarLocale(locale: string) { - // Here we hard-code the imports in order to ensure that they are embedded by webpack without having to load all the languages. - switch (locale) { - case "de": - return (await import("@fullcalendar/core/locales/de")).default; - case "es": - return (await import("@fullcalendar/core/locales/es")).default; - case "fr": - return (await import("@fullcalendar/core/locales/fr")).default; - case "cn": - return (await import("@fullcalendar/core/locales/zh-cn")).default; - case "tw": - return (await import("@fullcalendar/core/locales/zh-tw")).default; - case "ro": - return (await import("@fullcalendar/core/locales/ro")).default; - case "ru": - return (await import("@fullcalendar/core/locales/ru")).default; - case "ja": - return (await import("@fullcalendar/core/locales/ja")).default; - case "pt_br": - return (await import("@fullcalendar/core/locales/pt-br")).default; - case "uk": - return (await import("@fullcalendar/core/locales/uk")).default; - case "en": - default: - return undefined; +export async function getFullCalendarLocale(locale: LOCALE_IDS) { + const correspondingLocale = LOCALE_MAPPINGS[locale]; + if (correspondingLocale) { + return (await correspondingLocale()).default; + } else { + return undefined; } } diff --git a/apps/desktop/package.json b/apps/desktop/package.json index df9eb3122..c6147cee5 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/desktop", - "version": "0.98.0", + "version": "0.98.1", "description": "Build your personal knowledge base with Trilium Notes", "private": true, "main": "main.cjs", diff --git a/apps/server/package.json b/apps/server/package.json index d7b196499..46e4cc432 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/server", - "version": "0.98.0", + "version": "0.98.1", "description": "The server-side component of TriliumNext, which exposes the client via the web, allows for sync and provides a REST API for both internal and external use.", "private": true, "dependencies": { diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.html index c5d9d47b3..89d03b158 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.html @@ -1,24 +1,29 @@ -

Trilium supports configuration via a file named config.ini and environment variables. This document provides a comprehensive reference for all configuration options.

- +

Trilium supports configuration via a file named config.ini and + environment variables. This document provides a comprehensive reference + for all configuration options.

Configuration Precedence

-

Configuration values are loaded in the following order of precedence (highest to lowest):

+

Configuration values are loaded in the following order of precedence (highest + to lowest):

  1. Environment variables (checked first)
  2. -
  3. config.ini file values
  4. -
  5. Default values
  6. +
  7. config.ini file values +
  8. +
  9. Default values +
-

Environment Variable Patterns

-

Trilium supports multiple environment variable patterns for flexibility. The primary pattern is: TRILIUM_[SECTION]_[KEY]

+

Trilium supports multiple environment variable patterns for flexibility. + The primary pattern is: TRILIUM_[SECTION]_[KEY] +

Where:

  • SECTION is the INI section name in UPPERCASE
  • -
  • KEY is the camelCase configuration key converted to UPPERCASE (e.g., instanceNameINSTANCENAME)
  • +
  • KEY is the camelCase configuration key converted to UPPERCASE + (e.g., instanceNameINSTANCENAME)
-

Additionally, shorter aliases are available for common configurations (see Alternative Variables section below).

- +

Additionally, shorter aliases are available for common configurations + (see Alternative Variables section below).

Environment Variable Reference

-

General Section

@@ -31,31 +36,36 @@ - + - + - + - + - + @@ -75,55 +85,64 @@ - + - + - + - + - + - + - + - + - + @@ -143,7 +162,8 @@ - + @@ -163,19 +183,22 @@ - + - + - + @@ -195,37 +218,43 @@ - + - + - + - + - + - + - + @@ -245,7 +274,8 @@ - + @@ -254,22 +284,20 @@
TRILIUM_GENERAL_INSTANCENAMETRILIUM_GENERAL_INSTANCENAME + string "" Instance name for API identification
TRILIUM_GENERAL_NOAUTHENTICATIONTRILIUM_GENERAL_NOAUTHENTICATION + boolean false Disable authentication (server only)
TRILIUM_GENERAL_NOBACKUPTRILIUM_GENERAL_NOBACKUP + boolean false Disable automatic backups
TRILIUM_GENERAL_NODESKTOPICONTRILIUM_GENERAL_NODESKTOPICON + boolean false Disable desktop icon creation
TRILIUM_GENERAL_READONLYTRILIUM_GENERAL_READONLY + boolean false Enable read-only mode
TRILIUM_NETWORK_HOSTTRILIUM_NETWORK_HOST + string "0.0.0.0" Server host binding
TRILIUM_NETWORK_PORTTRILIUM_NETWORK_PORT + string "3000" Server port
TRILIUM_NETWORK_HTTPSTRILIUM_NETWORK_HTTPS + boolean false Enable HTTPS
TRILIUM_NETWORK_CERTPATHTRILIUM_NETWORK_CERTPATH + string "" SSL certificate path
TRILIUM_NETWORK_KEYPATHTRILIUM_NETWORK_KEYPATH + string "" SSL key path
TRILIUM_NETWORK_TRUSTEDREVERSEPROXYTRILIUM_NETWORK_TRUSTEDREVERSEPROXY + boolean/string false Reverse proxy trust settings
TRILIUM_NETWORK_CORSALLOWORIGINTRILIUM_NETWORK_CORSALLOWORIGIN + string "" CORS allowed origins
TRILIUM_NETWORK_CORSALLOWMETHODSTRILIUM_NETWORK_CORSALLOWMETHODS + string "" CORS allowed methods
TRILIUM_NETWORK_CORSALLOWHEADERSTRILIUM_NETWORK_CORSALLOWHEADERS + string "" CORS allowed headers
TRILIUM_SESSION_COOKIEMAXAGETRILIUM_SESSION_COOKIEMAXAGE + integer 1814400 Session cookie max age in seconds (21 days)
TRILIUM_SYNC_SYNCSERVERHOSTTRILIUM_SYNC_SYNCSERVERHOST + string "" Sync server host URL
TRILIUM_SYNC_SYNCSERVERTIMEOUTTRILIUM_SYNC_SYNCSERVERTIMEOUT + string "120000" Sync server timeout in milliseconds
TRILIUM_SYNC_SYNCPROXYTRILIUM_SYNC_SYNCPROXY + string "" Sync proxy URL
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURLTRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL + string "" OAuth/OpenID base URL
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTIDTRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID + string "" OAuth client ID
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRETTRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET + string "" OAuth client secret
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURLTRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL + string"https://accounts.google.com""https://accounts.google.com" OAuth issuer base URL
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAMETRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME + string "Google" OAuth issuer display name
TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICONTRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON + string "" OAuth issuer icon URL
TRILIUM_LOGGING_RETENTIONDAYSTRILIUM_LOGGING_RETENTIONDAYS + integer 90 Number of days to retain log files

Alternative Environment Variables

-

The following alternative environment variable names are also supported and work identically to their longer counterparts:

- +

The following alternative environment variable names are also supported + and work identically to their longer counterparts:

Network CORS Variables

  • TRILIUM_NETWORK_CORS_ALLOW_ORIGIN (alternative to TRILIUM_NETWORK_CORSALLOWORIGIN)
  • TRILIUM_NETWORK_CORS_ALLOW_METHODS (alternative to TRILIUM_NETWORK_CORSALLOWMETHODS)
  • TRILIUM_NETWORK_CORS_ALLOW_HEADERS (alternative to TRILIUM_NETWORK_CORSALLOWHEADERS)
-

Sync Variables

  • TRILIUM_SYNC_SERVER_HOST (alternative to TRILIUM_SYNC_SYNCSERVERHOST)
  • TRILIUM_SYNC_SERVER_TIMEOUT (alternative to TRILIUM_SYNC_SYNCSERVERTIMEOUT)
  • TRILIUM_SYNC_SERVER_PROXY (alternative to TRILIUM_SYNC_SYNCPROXY)
-

OAuth/MFA Variables

  • TRILIUM_OAUTH_BASE_URL (alternative to TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL)
  • @@ -279,32 +307,30 @@
  • TRILIUM_OAUTH_ISSUER_NAME (alternative to TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME)
  • TRILIUM_OAUTH_ISSUER_ICON (alternative to TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON)
-

Logging Variables

  • TRILIUM_LOGGING_RETENTION_DAYS (alternative to TRILIUM_LOGGING_RETENTIONDAYS)
-

Boolean Values

Boolean environment variables accept the following values:

    -
  • True: "true", "1", 1
  • -
  • False: "false", "0", 0
  • -
  • Any other value defaults to false
  • +
  • True: "true", "1", 1 +
  • +
  • False: "false", "0", 0 +
  • +
  • Any other value defaults to false +
-

Using Environment Variables

Both naming patterns are fully supported and can be used interchangeably:

    -
  • The longer format follows the section/key pattern for consistency with the INI file structure
  • +
  • The longer format follows the section/key pattern for consistency with + the INI file structure
  • The shorter alternatives provide convenience for common configurations
  • You can use whichever format you prefer - both are equally valid
-

Examples

- -

Docker Compose Example

-
services:
+

Docker Compose Example

services:
   trilium:
     image: triliumnext/notes
     environment:
@@ -319,9 +345,7 @@
       # TRILIUM_NETWORK_CORS_ALLOW_ORIGIN: "https://myapp.com"
       # TRILIUM_SYNC_SERVER_HOST: "https://sync.example.com"
       # TRILIUM_OAUTH_BASE_URL: "https://auth.example.com"
- -

Shell Export Example

-
# Using either format
+

Shell Export Example

# Using either format
 export TRILIUM_GENERAL_NOAUTHENTICATION=false
 export TRILIUM_NETWORK_HTTPS=true
 export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem
@@ -330,6 +354,7 @@ export TRILIUM_LOGGING_RETENTIONDAYS=30
 
 # Start Trilium
 npm start
-

config.ini Reference

-

For the complete list of configuration options and their INI file format, please review the config-sample.ini file in the Trilium repository.

\ No newline at end of file +

For the complete list of configuration options and their INI file format, + please review the config-sample.ini file + in the Trilium repository

\ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.html index 14166924f..292f4c585 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.html @@ -5,18 +5,19 @@

The Quick search function does a full-text search (that is, it searches through the content of notes and not just the title of a note) and displays the result in an easy-to-access manner.

-

The alternative to the quick search is the Search function, - which opens in a dedicated tab and has support for advanced queries.

-

For even faster navigation, it's possible to use Jump to Note which will only search +

The alternative to the quick search is the Search function, which opens in + a dedicated tab and has support for advanced queries.

+

For even faster navigation, it's possible to use Jump to... which will only search through the note titles instead of the content.

Layout

-

Based on the Vertical and horizontal layout, +

Based on the Vertical and horizontal layout, the quick search is placed:

@@ -30,37 +31,120 @@

Infinite Scrolling

Results are loaded progressively as you scroll:

    -
  • Initial display shows 15 results
  • -
  • Scrolling near the bottom automatically loads 10 more results
  • -
  • Continue scrolling to load all matching notes
  • +
  • Initial display shows 15 results
  • +
  • Scrolling near the bottom automatically loads 10 more results
  • +
  • Continue scrolling to load all matching notes

Visual Features

    -
  • Highlighting: Search terms appear in bold with accent +
  • Highlighting: Search terms appear in bold with accent colors
  • -
  • Separation: Results are separated with dividers
  • -
  • Theme Support: Highlighting colors adapt to light/dark +
  • Separation: Results are separated with dividers
  • +
  • Theme Support: Highlighting colors adapt to light/dark themes

Search Behavior

Quick search uses progressive search:

    -
  1. Shows exact matches first
  2. -
  3. Includes fuzzy matches when exact results are fewer than 5
  4. -
  5. Exact matches appear before fuzzy matches
  6. +
  7. Shows exact matches first
  8. +
  9. Includes fuzzy matches when exact results are fewer than 5
  10. +
  11. Exact matches appear before fuzzy matches

Keyboard Navigation

    -
  • Press Enter to open the first result
  • -
  • Use arrow keys to navigate through results
  • -
  • Press Escape to close the quick search
  • +
  • Press Enter to open the first result
  • +
  • Use arrow keys to navigate through results
  • +
  • Press Escape to close the quick search

Using Quick Search

    -
  1. Typo tolerance: Search finds results despite minor typos
  2. -
  3. Content previews: 200-character snippets show match context
  4. -
  5. Infinite scrolling: Additional results load on scroll
  6. -
  7. Specific terms: Specific search terms return more focused - results
  8. -
  9. Match locations: Bold text indicates where matches occur
  10. -
\ No newline at end of file +
  • Typo tolerance: Search finds results despite minor typos
  • +
  • Content previews: 200-character snippets show match context
  • +
  • Infinite scrolling: Additional results load on scroll
  • +
  • Specific terms: Specific search terms return more focused + results
  • +
  • Match locations: Bold text indicates where matches occur
  • + +

    Quick Search - Exact Match Operator

    +

    Quick Search now supports the exact match operator (=) at + the beginning of your search query. This allows you to search for notes + where the title or content exactly matches your search term, rather than + just containing it.

    +

    Usage

    +

    To use exact match in Quick Search:

    +
      +
    1. Start your search query with the = operator
    2. +
    3. Follow it immediately with your search term (no space after =)
    4. +
    +

    Examples

    +
      +
    • =example - Finds notes with title exactly "example" or content + exactly "example"
    • +
    • =Project Plan - Finds notes with title exactly "Project Plan" + or content exactly "Project Plan"
    • +
    • ='hello world' - Use quotes for multi-word exact matches
    • +
    +

    Comparison with Regular Search

    +
    + + + + + + + + + + + + + + + + + +
    QueryBehavior
    example + Finds all notes containing "example" anywhere in title or content
    =example + Finds only notes where the title equals "example" or content equals "example" + exactly
    +
    +

    Technical Details

    +

    When you use the = operator:

    +
      +
    • The search performs an exact match on note titles
    • +
    • For note content, it looks for exact matches of the entire content
    • +
    • Partial word matches are excluded
    • +
    • The search is case-insensitive
    • +
    +

    Limitations

    +
      +
    • The = operator must be at the very beginning of the search + query
    • +
    • Spaces after = will treat it as a regular search
    • +
    • Multiple = operators (like ==example) are treated + as regular text search
    • +
    +

    Use Cases

    +

    This feature is particularly useful when:

    +
      +
    • You know the exact title of a note
    • +
    • You want to find notes with specific, complete content
    • +
    • You need to distinguish between notes with similar but not identical titles
    • +
    • You want to avoid false positives from partial matches
    • +
    +

    Related Features

    +
      +
    • For more complex exact matching queries, use the full Search functionality
    • +
    • For fuzzy matching (finding results despite typos), use the ~= operator + in the full search
    • +
    • For partial matches with wildcards, use operators like *=*, =*, + or *= in the full search
    • +
    \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.html index 79c565cea..a4c7191eb 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.html @@ -134,7 +134,8 @@ docker run -d --name trilium -p 8080:8080 --user $(id -u):$(id -g) -v ~/trilium-
  • TRILIUM_DATA_DIR: Path to the data directory inside the container (default: /home/node/trilium-data)
  • -

    For a complete list of configuration environment variables (network settings, authentication, sync, etc.), see Configuration (config.ini or environment variables).

    +

    For a complete list of configuration environment variables (network settings, + authentication, sync, etc.), see Configuration (config.ini or environment variables).

    Volume Permissions

    If you encounter permission issues with the data volume, ensure that:

      diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.html index 93eba27c0..6650d0a4f 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.html @@ -51,8 +51,10 @@ class="admonition warning">
      1. You can also setup through environment variables:
          -
        • Standard: TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET
        • -
        • Legacy (still supported): TRILIUM_OAUTH_BASE_URL, TRILIUM_OAUTH_CLIENT_ID, TRILIUM_OAUTH_CLIENT_SECRET
        • +
        • Standard: TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET +
        • +
        • Legacy (still supported): TRILIUM_OAUTH_BASE_URL, TRILIUM_OAUTH_CLIENT_ID, TRILIUM_OAUTH_CLIENT_SECRET +
      2. oauthBaseUrl should be the link of your Trilium instance server, @@ -69,13 +71,15 @@ class="admonition warning">

        The default OAuth issuer is Google. To use other services such as Authentik or Auth0, you can configure the settings via oauthIssuerBaseUrl, oauthIssuerName, and oauthIssuerIcon in the config.ini file. Alternatively, - these values can be set using environment variables: -

          -
        • Standard: TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON
        • -
        • Legacy (still supported): TRILIUM_OAUTH_ISSUER_BASE_URL, TRILIUM_OAUTH_ISSUER_NAME, TRILIUM_OAUTH_ISSUER_ICON
        • -
        - oauthIssuerName and oauthIssuerIcon are - required for displaying correct issuer information at the Login page.

        + these values can be set using environment variables:

        +
          +
        • Standard: TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME, TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON +
        • +
        • Legacy (still supported): TRILIUM_OAUTH_ISSUER_BASE_URL, TRILIUM_OAUTH_ISSUER_NAME, TRILIUM_OAUTH_ISSUER_ICON +
        • +
        +

        oauthIssuerName and oauthIssuerIcon are required + for displaying correct issuer information at the Login page.

        Authentik

        If you don’t already have a running Authentik instance, please follow diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.html index 3bd1f0cf2..6eb68f890 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.html @@ -26,8 +26,8 @@ https=true certPath=/[username]/.acme.sh/[hostname]/fullchain.cer keyPath=/[username]/.acme.sh/[hostname]/example.com.key

    You can also review the configuration file - to provide all config.ini values as environment variables instead. For example, you can configure TLS using environment variables:

    -
    export TRILIUM_NETWORK_HTTPS=true
    +  to provide all config.ini values as environment variables instead.
    +  For example, you can configure TLS using environment variables:

    export TRILIUM_NETWORK_HTTPS=true
     export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem
     export TRILIUM_NETWORK_KEYPATH=/path/to/key.pem

    The above example shows how this is set up in an environment where the diff --git a/apps/server/src/services/auth.ts b/apps/server/src/services/auth.ts index df18fba49..8b56f1e5f 100644 --- a/apps/server/src/services/auth.ts +++ b/apps/server/src/services/auth.ts @@ -159,6 +159,7 @@ function checkCredentials(req: Request, res: Response, next: NextFunction) { if (!passwordEncryptionService.verifyPassword(password)) { res.setHeader("Content-Type", "text/plain").status(401).send("Incorrect password"); + log.info(`WARNING: Wrong password from ${req.ip}, rejecting.`); } else { next(); } diff --git a/apps/server/src/services/search/services/lex.spec.ts b/apps/server/src/services/search/services/lex.spec.ts index 06680af12..668522b18 100644 --- a/apps/server/src/services/search/services/lex.spec.ts +++ b/apps/server/src/services/search/services/lex.spec.ts @@ -59,6 +59,34 @@ describe("Lexer fulltext", () => { it("escaping special characters", () => { expect(lex("hello \\#\\~\\'").fulltextTokens.map((t) => t.token)).toEqual(["hello", "#~'"]); }); + + it("recognizes leading = operator for exact match", () => { + const result1 = lex("=example"); + expect(result1.fulltextTokens.map((t) => t.token)).toEqual(["example"]); + expect(result1.leadingOperator).toBe("="); + + const result2 = lex("=hello world"); + expect(result2.fulltextTokens.map((t) => t.token)).toEqual(["hello", "world"]); + expect(result2.leadingOperator).toBe("="); + + const result3 = lex("='hello world'"); + expect(result3.fulltextTokens.map((t) => t.token)).toEqual(["hello world"]); + expect(result3.leadingOperator).toBe("="); + }); + + it("doesn't treat = as leading operator in other contexts", () => { + const result1 = lex("==example"); + expect(result1.fulltextTokens.map((t) => t.token)).toEqual(["==example"]); + expect(result1.leadingOperator).toBe(""); + + const result2 = lex("= example"); + expect(result2.fulltextTokens.map((t) => t.token)).toEqual(["=", "example"]); + expect(result2.leadingOperator).toBe(""); + + const result3 = lex("example"); + expect(result3.fulltextTokens.map((t) => t.token)).toEqual(["example"]); + expect(result3.leadingOperator).toBe(""); + }); }); describe("Lexer expression", () => { diff --git a/apps/server/src/services/search/services/lex.ts b/apps/server/src/services/search/services/lex.ts index 5b80691d9..2fcd99ca2 100644 --- a/apps/server/src/services/search/services/lex.ts +++ b/apps/server/src/services/search/services/lex.ts @@ -10,10 +10,18 @@ function lex(str: string) { let quotes: boolean | string = false; // otherwise contains used quote - ', " or ` let fulltextEnded = false; let currentWord = ""; + let leadingOperator = ""; function isSymbolAnOperator(chr: string) { return ["=", "*", ">", "<", "!", "-", "+", "%", ","].includes(chr); } + + // Check if the string starts with an exact match operator + // This allows users to use "=searchterm" for exact matching + if (str.startsWith("=") && str.length > 1 && str[1] !== "=" && str[1] !== " ") { + leadingOperator = "="; + str = str.substring(1); // Remove the leading operator from the string + } function isPreviousSymbolAnOperator() { if (currentWord.length === 0) { @@ -128,7 +136,8 @@ function lex(str: string) { return { fulltextQuery, fulltextTokens, - expressionTokens + expressionTokens, + leadingOperator }; } diff --git a/apps/server/src/services/search/services/parse.ts b/apps/server/src/services/search/services/parse.ts index e96ca3896..b537ee562 100644 --- a/apps/server/src/services/search/services/parse.ts +++ b/apps/server/src/services/search/services/parse.ts @@ -24,7 +24,7 @@ import type SearchContext from "../search_context.js"; import type { TokenData, TokenStructure } from "./types.js"; import type Expression from "../expressions/expression.js"; -function getFulltext(_tokens: TokenData[], searchContext: SearchContext) { +function getFulltext(_tokens: TokenData[], searchContext: SearchContext, leadingOperator?: string) { const tokens: string[] = _tokens.map((t) => removeDiacritic(t.token)); searchContext.highlightedTokens.push(...tokens); @@ -33,8 +33,19 @@ function getFulltext(_tokens: TokenData[], searchContext: SearchContext) { return null; } + // If user specified "=" at the beginning, they want exact match + const operator = leadingOperator === "=" ? "=" : "*=*"; + if (!searchContext.fastSearch) { - return new OrExp([new NoteFlatTextExp(tokens), new NoteContentFulltextExp("*=*", { tokens, flatText: true })]); + // For exact match with "=", we need different behavior + if (leadingOperator === "=" && tokens.length === 1) { + // Exact match on title OR exact match on content + return new OrExp([ + new PropertyComparisonExp(searchContext, "title", "=", tokens[0]), + new NoteContentFulltextExp("=", { tokens, flatText: false }) + ]); + } + return new OrExp([new NoteFlatTextExp(tokens), new NoteContentFulltextExp(operator, { tokens, flatText: true })]); } else { return new NoteFlatTextExp(tokens); } @@ -428,9 +439,10 @@ export interface ParseOpts { expressionTokens: TokenStructure; searchContext: SearchContext; originalQuery?: string; + leadingOperator?: string; } -function parse({ fulltextTokens, expressionTokens, searchContext }: ParseOpts) { +function parse({ fulltextTokens, expressionTokens, searchContext, leadingOperator }: ParseOpts) { let expression: Expression | undefined | null; try { @@ -444,7 +456,7 @@ function parse({ fulltextTokens, expressionTokens, searchContext }: ParseOpts) { let exp = AndExp.of([ searchContext.includeArchivedNotes ? null : new PropertyComparisonExp(searchContext, "isarchived", "=", "false"), getAncestorExp(searchContext), - getFulltext(fulltextTokens, searchContext), + getFulltext(fulltextTokens, searchContext, leadingOperator), expression ]); diff --git a/apps/server/src/services/search/services/search.spec.ts b/apps/server/src/services/search/services/search.spec.ts index 773525caa..d448a04b0 100644 --- a/apps/server/src/services/search/services/search.spec.ts +++ b/apps/server/src/services/search/services/search.spec.ts @@ -234,6 +234,28 @@ describe("Search", () => { expect(findNoteByTitle(searchResults, "Austria")).toBeTruthy(); }); + it("leading = operator for exact match", () => { + rootNote + .child(note("Example Note").label("type", "document")) + .child(note("Examples of Usage").label("type", "tutorial")) + .child(note("Sample").label("type", "example")); + + const searchContext = new SearchContext(); + + // Using leading = for exact title match + let searchResults = searchService.findResultsWithQuery("=Example Note", searchContext); + expect(searchResults.length).toEqual(1); + expect(findNoteByTitle(searchResults, "Example Note")).toBeTruthy(); + + // Without =, it should find all notes containing "example" + searchResults = searchService.findResultsWithQuery("example", searchContext); + expect(searchResults.length).toEqual(3); + + // = operator should not match partial words + searchResults = searchService.findResultsWithQuery("=Example", searchContext); + expect(searchResults.length).toEqual(0); + }); + it("fuzzy attribute search", () => { rootNote.child(note("Europe") .label("country", "", true) diff --git a/apps/server/src/services/search/services/search.ts b/apps/server/src/services/search/services/search.ts index 0d3592455..22dbe6d9f 100644 --- a/apps/server/src/services/search/services/search.ts +++ b/apps/server/src/services/search/services/search.ts @@ -367,7 +367,7 @@ function mergeExactAndFuzzyResults(exactResults: SearchResult[], fuzzyResults: S } function parseQueryToExpression(query: string, searchContext: SearchContext) { - const { fulltextQuery, fulltextTokens, expressionTokens } = lex(query); + const { fulltextQuery, fulltextTokens, expressionTokens, leadingOperator } = lex(query); searchContext.fulltextQuery = fulltextQuery; let structuredExpressionTokens: TokenStructure; @@ -383,7 +383,8 @@ function parseQueryToExpression(query: string, searchContext: SearchContext) { fulltextTokens, expressionTokens: structuredExpressionTokens, searchContext, - originalQuery: query + originalQuery: query, + leadingOperator }); if (searchContext.debug) { diff --git a/apps/server/test_search_integration.js b/apps/server/test_search_integration.js new file mode 100644 index 000000000..bd23dc8c6 --- /dev/null +++ b/apps/server/test_search_integration.js @@ -0,0 +1,36 @@ +import lex from "./apps/server/dist/services/search/services/lex.js"; +import parse from "./apps/server/dist/services/search/services/parse.js"; +import SearchContext from "./apps/server/dist/services/search/search_context.js"; + +// Test the integration of the lexer and parser +const testCases = [ + "=example", + "example", + "=hello world" +]; + +for (const query of testCases) { + console.log(`\n=== Testing: "${query}" ===`); + + const lexResult = lex(query); + console.log("Lex result:"); + console.log(" Fulltext tokens:", lexResult.fulltextTokens.map(t => t.token)); + console.log(" Leading operator:", lexResult.leadingOperator || "(none)"); + + const searchContext = new SearchContext.default({ fastSearch: false }); + + try { + const expression = parse.default({ + fulltextTokens: lexResult.fulltextTokens, + expressionTokens: [], + searchContext, + originalQuery: query, + leadingOperator: lexResult.leadingOperator + }); + + console.log("Parse result: Success"); + console.log(" Expression type:", expression.constructor.name); + } catch (e) { + console.log("Parse result: Error -", e.message); + } +} diff --git a/docs/Developer Guide/!!!meta.json b/docs/Developer Guide/!!!meta.json index aee04e341..2117cdac6 100644 --- a/docs/Developer Guide/!!!meta.json +++ b/docs/Developer Guide/!!!meta.json @@ -1,6 +1,6 @@ { "formatVersion": 2, - "appVersion": "0.97.2", + "appVersion": "0.98.0", "files": [ { "isClone": false, diff --git a/docs/Release Notes/!!!meta.json b/docs/Release Notes/!!!meta.json index 472a9bd57..f2e31b84c 100644 --- a/docs/Release Notes/!!!meta.json +++ b/docs/Release Notes/!!!meta.json @@ -1,6 +1,6 @@ { "formatVersion": 2, - "appVersion": "0.97.2", + "appVersion": "0.98.0", "files": [ { "isClone": false, @@ -61,6 +61,32 @@ "attachments": [], "dirFileName": "Release Notes", "children": [ + { + "isClone": false, + "noteId": "QOJwjruOUr4k", + "notePath": [ + "hD3V4hiu2VW4", + "QOJwjruOUr4k" + ], + "title": "v0.98.1", + "notePosition": 10, + "prefix": null, + "isExpanded": false, + "type": "text", + "mime": "text/html", + "attributes": [ + { + "type": "relation", + "name": "template", + "value": "wyurrlcDl416", + "isInheritable": false, + "position": 60 + } + ], + "format": "markdown", + "dataFileName": "v0.98.1.md", + "attachments": [] + }, { "isClone": false, "noteId": "PLUoryywi0BC", @@ -69,7 +95,7 @@ "PLUoryywi0BC" ], "title": "v0.98.0", - "notePosition": 10, + "notePosition": 20, "prefix": null, "isExpanded": false, "type": "text", @@ -95,7 +121,7 @@ "lvOuiWsLDv8F" ], "title": "v0.97.2", - "notePosition": 20, + "notePosition": 30, "prefix": null, "isExpanded": false, "type": "text", @@ -121,7 +147,7 @@ "OtFZ6Nd9vM3n" ], "title": "v0.97.1", - "notePosition": 30, + "notePosition": 40, "prefix": null, "isExpanded": false, "type": "text", @@ -147,7 +173,7 @@ "SJZ5PwfzHSQ1" ], "title": "v0.97.0", - "notePosition": 40, + "notePosition": 50, "prefix": null, "isExpanded": false, "type": "text", @@ -173,7 +199,7 @@ "mYXFde3LuNR7" ], "title": "v0.96.0", - "notePosition": 50, + "notePosition": 60, "prefix": null, "isExpanded": false, "type": "text", @@ -199,7 +225,7 @@ "jthwbL0FdaeU" ], "title": "v0.95.0", - "notePosition": 60, + "notePosition": 70, "prefix": null, "isExpanded": false, "type": "text", @@ -225,7 +251,7 @@ "7HGYsJbLuhnv" ], "title": "v0.94.1", - "notePosition": 70, + "notePosition": 80, "prefix": null, "isExpanded": false, "type": "text", @@ -251,7 +277,7 @@ "Neq53ujRGBqv" ], "title": "v0.94.0", - "notePosition": 80, + "notePosition": 90, "prefix": null, "isExpanded": false, "type": "text", @@ -277,7 +303,7 @@ "VN3xnce1vLkX" ], "title": "v0.93.0", - "notePosition": 90, + "notePosition": 100, "prefix": null, "isExpanded": false, "type": "text", @@ -295,7 +321,7 @@ "WRaBfQqPr6qo" ], "title": "v0.92.7", - "notePosition": 100, + "notePosition": 110, "prefix": null, "isExpanded": false, "type": "text", @@ -321,7 +347,7 @@ "a2rwfKNmUFU1" ], "title": "v0.92.6", - "notePosition": 110, + "notePosition": 120, "prefix": null, "isExpanded": false, "type": "text", @@ -339,7 +365,7 @@ "fEJ8qErr0BKL" ], "title": "v0.92.5-beta", - "notePosition": 120, + "notePosition": 130, "prefix": null, "isExpanded": false, "type": "text", @@ -357,7 +383,7 @@ "kkkZQQGSXjwy" ], "title": "v0.92.4", - "notePosition": 130, + "notePosition": 140, "prefix": null, "isExpanded": false, "type": "text", @@ -375,7 +401,7 @@ "vAroNixiezaH" ], "title": "v0.92.3-beta", - "notePosition": 140, + "notePosition": 150, "prefix": null, "isExpanded": false, "type": "text", @@ -393,7 +419,7 @@ "mHEq1wxAKNZd" ], "title": "v0.92.2-beta", - "notePosition": 150, + "notePosition": 160, "prefix": null, "isExpanded": false, "type": "text", @@ -411,7 +437,7 @@ "IykjoAmBpc61" ], "title": "v0.92.1-beta", - "notePosition": 160, + "notePosition": 170, "prefix": null, "isExpanded": false, "type": "text", @@ -429,7 +455,7 @@ "dq2AJ9vSBX4Y" ], "title": "v0.92.0-beta", - "notePosition": 170, + "notePosition": 180, "prefix": null, "isExpanded": false, "type": "text", @@ -447,7 +473,7 @@ "3a8aMe4jz4yM" ], "title": "v0.91.6", - "notePosition": 180, + "notePosition": 190, "prefix": null, "isExpanded": false, "type": "text", @@ -465,7 +491,7 @@ "8djQjkiDGESe" ], "title": "v0.91.5", - "notePosition": 190, + "notePosition": 200, "prefix": null, "isExpanded": false, "type": "text", @@ -483,7 +509,7 @@ "OylxVoVJqNmr" ], "title": "v0.91.4-beta", - "notePosition": 200, + "notePosition": 210, "prefix": null, "isExpanded": false, "type": "text", @@ -501,7 +527,7 @@ "tANGQDvnyhrj" ], "title": "v0.91.3-beta", - "notePosition": 210, + "notePosition": 220, "prefix": null, "isExpanded": false, "type": "text", @@ -519,7 +545,7 @@ "hMoBfwSoj1SC" ], "title": "v0.91.2-beta", - "notePosition": 220, + "notePosition": 230, "prefix": null, "isExpanded": false, "type": "text", @@ -537,7 +563,7 @@ "a2XMSKROCl9z" ], "title": "v0.91.1-beta", - "notePosition": 230, + "notePosition": 240, "prefix": null, "isExpanded": false, "type": "text", @@ -555,7 +581,7 @@ "yqXFvWbLkuMD" ], "title": "v0.90.12", - "notePosition": 240, + "notePosition": 250, "prefix": null, "isExpanded": false, "type": "text", @@ -573,7 +599,7 @@ "veS7pg311yJP" ], "title": "v0.90.11-beta", - "notePosition": 250, + "notePosition": 260, "prefix": null, "isExpanded": false, "type": "text", @@ -591,7 +617,7 @@ "sq5W9TQxRqMq" ], "title": "v0.90.10-beta", - "notePosition": 260, + "notePosition": 270, "prefix": null, "isExpanded": false, "type": "text", @@ -609,7 +635,7 @@ "yFEGVCUM9tPx" ], "title": "v0.90.9-beta", - "notePosition": 270, + "notePosition": 280, "prefix": null, "isExpanded": false, "type": "text", @@ -627,7 +653,7 @@ "o4wAGqOQuJtV" ], "title": "v0.90.8", - "notePosition": 280, + "notePosition": 290, "prefix": null, "isExpanded": false, "type": "text", @@ -660,7 +686,7 @@ "i4A5g9iOg9I0" ], "title": "v0.90.7-beta", - "notePosition": 290, + "notePosition": 300, "prefix": null, "isExpanded": false, "type": "text", @@ -678,7 +704,7 @@ "ThNf2GaKgXUs" ], "title": "v0.90.6-beta", - "notePosition": 300, + "notePosition": 310, "prefix": null, "isExpanded": false, "type": "text", @@ -696,7 +722,7 @@ "G4PAi554kQUr" ], "title": "v0.90.5-beta", - "notePosition": 310, + "notePosition": 320, "prefix": null, "isExpanded": false, "type": "text", @@ -723,7 +749,7 @@ "zATRobGRCmBn" ], "title": "v0.90.4", - "notePosition": 320, + "notePosition": 330, "prefix": null, "isExpanded": false, "type": "text", @@ -741,7 +767,7 @@ "sCDLf8IKn3Iz" ], "title": "v0.90.3", - "notePosition": 330, + "notePosition": 340, "prefix": null, "isExpanded": false, "type": "text", @@ -759,7 +785,7 @@ "VqqyBu4AuTjC" ], "title": "v0.90.2-beta", - "notePosition": 340, + "notePosition": 350, "prefix": null, "isExpanded": false, "type": "text", @@ -777,7 +803,7 @@ "RX3Nl7wInLsA" ], "title": "v0.90.1-beta", - "notePosition": 350, + "notePosition": 360, "prefix": null, "isExpanded": false, "type": "text", @@ -795,7 +821,7 @@ "GyueACukPWjk" ], "title": "v0.90.0-beta", - "notePosition": 360, + "notePosition": 370, "prefix": null, "isExpanded": false, "type": "text", @@ -813,7 +839,7 @@ "wyurrlcDl416" ], "title": "Release Template", - "notePosition": 370, + "notePosition": 380, "prefix": null, "isExpanded": false, "type": "text", diff --git a/docs/Release Notes/Release Notes/v0.98.0.md b/docs/Release Notes/Release Notes/v0.98.0.md index 30a9e9a11..d4c5eb9aa 100644 --- a/docs/Release Notes/Release Notes/v0.98.0.md +++ b/docs/Release Notes/Release Notes/v0.98.0.md @@ -44,12 +44,14 @@ ## 🌍 Internationalization * Improvements to multiple languages: + * Chinese (Traditional) * Spanish * Some work started on new languages: Portuguese (Brazil), Japanese, Russian, Serbian, Italian, Greek, Catalan * Added new languages: + * Russian (translations by @questamor) * Japanese language (translations by [acwr47](https://hosted.weblate.org/user/acwr47/))\[…\] diff --git a/docs/Release Notes/Release Notes/v0.98.1.md b/docs/Release Notes/Release Notes/v0.98.1.md new file mode 100644 index 000000000..9cdcb1333 --- /dev/null +++ b/docs/Release Notes/Release Notes/v0.98.1.md @@ -0,0 +1,40 @@ +# v0.98.1 +> [!IMPORTANT] +> If you enjoyed this release, consider showing a token of appreciation by: +> +> * Pressing the “Star” button on [GitHub](https://github.com/TriliumNext/Trilium) (top-right). +> * Considering a one-time or recurrent donation to the [lead developer](https://github.com/eliandoran) via [GitHub Sponsors](https://github.com/sponsors/eliandoran) or [PayPal](https://paypal.me/eliandoran). + +## 🐞 Bugfixes + +* [Keyboard shortcut catches QWERTY keys instead of owner's](https://github.com/TriliumNext/Trilium/issues/6547) +* [\`-character doesn't work in shortcuts](https://github.com/TriliumNext/Trilium/issues/6784) +* Quick search: attribute search no longer working +* Settings not fitting well on mobile. +* [Attributes/tags not showing up in search results](https://github.com/TriliumNext/Trilium/pull/6752) +* [Note links always follow note title](https://github.com/TriliumNext/Trilium/issues/6776) + +## ✨ Improvements + +* Quick search: format multi-line results better +* [Add UI performance-related settings](https://github.com/TriliumNext/Trilium/pull/6747) by @adoriandoran +* [Reduce or disable search animation](https://github.com/TriliumNext/Trilium/issues/6698) by @adoriandoran +* Fuzzy search should have a "non fuzzy" option by @perfectra1n + +## 📖 Documentation + +* [Swagger UI for the internal API](https://github.com/TriliumNext/Trilium/pull/6719) by @perfectra1n +* [Improve documentation on environment variables](https://github.com/TriliumNext/Trilium/pull/6727) by @perfectra1n + +## 🌍 Internationalization + +* Thanks to our contributors on Weblate: +* Added support for the Ukrainian language. +* Increased coverage for most of the languages. + +## 🛠️ Technical updates + +* Mermaid diagrams: patch for CVE-2025-54880 +* The settings were ported to React. **If you notice any issues with the settings, let us know and we'll promptly fix them.** +* [Improve management for settings INI](https://github.com/TriliumNext/Trilium/pull/6726) by @perfectra1n +* Log same error message on API 401 as on login error to allow fail2ban blocking by @hulmgulm \ No newline at end of file diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json index c4a1899a3..cb90db5b3 100644 --- a/docs/User Guide/!!!meta.json +++ b/docs/User Guide/!!!meta.json @@ -1,6 +1,6 @@ { "formatVersion": 2, - "appVersion": "0.97.2", + "appVersion": "0.98.0", "files": [ { "isClone": false, diff --git a/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.md b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.md index 292451913..aca209e0e 100644 --- a/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.md +++ b/docs/User Guide/User Guide/Advanced Usage/Configuration (config.ini or e.md @@ -1,21 +1,22 @@ # Configuration (config.ini or environment variables) - Trilium supports configuration via a file named `config.ini` and environment variables. This document provides a comprehensive reference for all configuration options. ## Configuration Precedence Configuration values are loaded in the following order of precedence (highest to lowest): -1. **Environment variables** (checked first) -2. **config.ini file values** -3. **Default values** + +1. **Environment variables** (checked first) +2. **config.ini file values** +3. **Default values** ## Environment Variable Patterns Trilium supports multiple environment variable patterns for flexibility. The primary pattern is: `TRILIUM_[SECTION]_[KEY]` Where: -- `SECTION` is the INI section name in UPPERCASE -- `KEY` is the camelCase configuration key converted to UPPERCASE (e.g., `instanceName` → `INSTANCENAME`) + +* `SECTION` is the INI section name in UPPERCASE +* `KEY` is the camelCase configuration key converted to UPPERCASE (e.g., `instanceName` → `INSTANCENAME`) Additionally, shorter aliases are available for common configurations (see Alternative Variables section below). @@ -24,8 +25,8 @@ Additionally, shorter aliases are available for common configurations (see Alter ### General Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| -| `TRILIUM_GENERAL_INSTANCENAME` | string | "" | Instance name for API identification | +| --- | --- | --- | --- | +| `TRILIUM_GENERAL_INSTANCENAME` | string | "" | Instance name for API identification | | `TRILIUM_GENERAL_NOAUTHENTICATION` | boolean | false | Disable authentication (server only) | | `TRILIUM_GENERAL_NOBACKUP` | boolean | false | Disable automatic backups | | `TRILIUM_GENERAL_NODESKTOPICON` | boolean | false | Disable desktop icon creation | @@ -34,91 +35,97 @@ Additionally, shorter aliases are available for common configurations (see Alter ### Network Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| +| --- | --- | --- | --- | | `TRILIUM_NETWORK_HOST` | string | "0.0.0.0" | Server host binding | | `TRILIUM_NETWORK_PORT` | string | "3000" | Server port | | `TRILIUM_NETWORK_HTTPS` | boolean | false | Enable HTTPS | -| `TRILIUM_NETWORK_CERTPATH` | string | "" | SSL certificate path | -| `TRILIUM_NETWORK_KEYPATH` | string | "" | SSL key path | +| `TRILIUM_NETWORK_CERTPATH` | string | "" | SSL certificate path | +| `TRILIUM_NETWORK_KEYPATH` | string | "" | SSL key path | | `TRILIUM_NETWORK_TRUSTEDREVERSEPROXY` | boolean/string | false | Reverse proxy trust settings | -| `TRILIUM_NETWORK_CORSALLOWORIGIN` | string | "" | CORS allowed origins | -| `TRILIUM_NETWORK_CORSALLOWMETHODS` | string | "" | CORS allowed methods | -| `TRILIUM_NETWORK_CORSALLOWHEADERS` | string | "" | CORS allowed headers | +| `TRILIUM_NETWORK_CORSALLOWORIGIN` | string | "" | CORS allowed origins | +| `TRILIUM_NETWORK_CORSALLOWMETHODS` | string | "" | CORS allowed methods | +| `TRILIUM_NETWORK_CORSALLOWHEADERS` | string | "" | CORS allowed headers | ### Session Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| +| --- | --- | --- | --- | | `TRILIUM_SESSION_COOKIEMAXAGE` | integer | 1814400 | Session cookie max age in seconds (21 days) | ### Sync Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| -| `TRILIUM_SYNC_SYNCSERVERHOST` | string | "" | Sync server host URL | +| --- | --- | --- | --- | +| `TRILIUM_SYNC_SYNCSERVERHOST` | string | "" | Sync server host URL | | `TRILIUM_SYNC_SYNCSERVERTIMEOUT` | string | "120000" | Sync server timeout in milliseconds | -| `TRILIUM_SYNC_SYNCPROXY` | string | "" | Sync proxy URL | +| `TRILIUM_SYNC_SYNCPROXY` | string | "" | Sync proxy URL | ### MultiFactorAuthentication Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| -| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL` | string | "" | OAuth/OpenID base URL | -| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID` | string | "" | OAuth client ID | -| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` | string | "" | OAuth client secret | -| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL` | string | "https://accounts.google.com" | OAuth issuer base URL | +| --- | --- | --- | --- | +| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL` | string | "" | OAuth/OpenID base URL | +| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID` | string | "" | OAuth client ID | +| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` | string | "" | OAuth client secret | +| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL` | string | "[https://accounts.google.com](https://accounts.google.com)" | OAuth issuer base URL | | `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME` | string | "Google" | OAuth issuer display name | -| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` | string | "" | OAuth issuer icon URL | +| `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` | string | "" | OAuth issuer icon URL | ### Logging Section | Environment Variable | Type | Default | Description | -|------------------|------|---------|-------------| -| `TRILIUM_LOGGING_RETENTIONDAYS` | integer | 90 | Number of days to retain log files | +| --- | --- | --- | --- | +| `TRILIUM_LOGGING_RETENTIONDAYS` | integer | 90 | Number of days to retain log files | ## Alternative Environment Variables The following alternative environment variable names are also supported and work identically to their longer counterparts: ### Network CORS Variables -- `TRILIUM_NETWORK_CORS_ALLOW_ORIGIN` (alternative to `TRILIUM_NETWORK_CORSALLOWORIGIN`) -- `TRILIUM_NETWORK_CORS_ALLOW_METHODS` (alternative to `TRILIUM_NETWORK_CORSALLOWMETHODS`) -- `TRILIUM_NETWORK_CORS_ALLOW_HEADERS` (alternative to `TRILIUM_NETWORK_CORSALLOWHEADERS`) + +* `TRILIUM_NETWORK_CORS_ALLOW_ORIGIN` (alternative to `TRILIUM_NETWORK_CORSALLOWORIGIN`) +* `TRILIUM_NETWORK_CORS_ALLOW_METHODS` (alternative to `TRILIUM_NETWORK_CORSALLOWMETHODS`) +* `TRILIUM_NETWORK_CORS_ALLOW_HEADERS` (alternative to `TRILIUM_NETWORK_CORSALLOWHEADERS`) ### Sync Variables -- `TRILIUM_SYNC_SERVER_HOST` (alternative to `TRILIUM_SYNC_SYNCSERVERHOST`) -- `TRILIUM_SYNC_SERVER_TIMEOUT` (alternative to `TRILIUM_SYNC_SYNCSERVERTIMEOUT`) -- `TRILIUM_SYNC_SERVER_PROXY` (alternative to `TRILIUM_SYNC_SYNCPROXY`) + +* `TRILIUM_SYNC_SERVER_HOST` (alternative to `TRILIUM_SYNC_SYNCSERVERHOST`) +* `TRILIUM_SYNC_SERVER_TIMEOUT` (alternative to `TRILIUM_SYNC_SYNCSERVERTIMEOUT`) +* `TRILIUM_SYNC_SERVER_PROXY` (alternative to `TRILIUM_SYNC_SYNCPROXY`) ### OAuth/MFA Variables -- `TRILIUM_OAUTH_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL`) -- `TRILIUM_OAUTH_CLIENT_ID` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID`) -- `TRILIUM_OAUTH_CLIENT_SECRET` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET`) -- `TRILIUM_OAUTH_ISSUER_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL`) -- `TRILIUM_OAUTH_ISSUER_NAME` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME`) -- `TRILIUM_OAUTH_ISSUER_ICON` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON`) + +* `TRILIUM_OAUTH_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL`) +* `TRILIUM_OAUTH_CLIENT_ID` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID`) +* `TRILIUM_OAUTH_CLIENT_SECRET` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET`) +* `TRILIUM_OAUTH_ISSUER_BASE_URL` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL`) +* `TRILIUM_OAUTH_ISSUER_NAME` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME`) +* `TRILIUM_OAUTH_ISSUER_ICON` (alternative to `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON`) ### Logging Variables -- `TRILIUM_LOGGING_RETENTION_DAYS` (alternative to `TRILIUM_LOGGING_RETENTIONDAYS`) + +* `TRILIUM_LOGGING_RETENTION_DAYS` (alternative to `TRILIUM_LOGGING_RETENTIONDAYS`) ## Boolean Values Boolean environment variables accept the following values: -- **True**: `"true"`, `"1"`, `1` -- **False**: `"false"`, `"0"`, `0` -- Any other value defaults to `false` + +* **True**: `"true"`, `"1"`, `1` +* **False**: `"false"`, `"0"`, `0` +* Any other value defaults to `false` ## Using Environment Variables Both naming patterns are fully supported and can be used interchangeably: -- The longer format follows the section/key pattern for consistency with the INI file structure -- The shorter alternatives provide convenience for common configurations -- You can use whichever format you prefer - both are equally valid +* The longer format follows the section/key pattern for consistency with the INI file structure +* The shorter alternatives provide convenience for common configurations +* You can use whichever format you prefer - both are equally valid ## Examples ### Docker Compose Example + ```yaml services: trilium: @@ -138,7 +145,8 @@ services: ``` ### Shell Export Example -```bash + +```sh # Using either format export TRILIUM_GENERAL_NOAUTHENTICATION=false export TRILIUM_NETWORK_HTTPS=true diff --git a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md index 277a7feae..996cc0c46 100644 --- a/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md +++ b/docs/User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search.md @@ -3,16 +3,16 @@ The _Quick search_ function does a full-text search (that is, it searches through the content of notes and not just the title of a note) and displays the result in an easy-to-access manner. -The alternative to the quick search is the Search function, which opens in a dedicated tab and has support for advanced queries. +The alternative to the quick search is the Search function, which opens in a dedicated tab and has support for advanced queries. -For even faster navigation, it's possible to use Jump to Note which will only search through the note titles instead of the content. +For even faster navigation, it's possible to use Jump to... which will only search through the note titles instead of the content. ## Layout -Based on the Vertical and horizontal layout, the quick search is placed: +Based on the Vertical and horizontal layout, the quick search is placed: -* On the vertical layout, it is displayed right above the Note Tree. -* On the horizontal layout, it is displayed in the Launch Bar, where it can be positioned just like any other icon. +* On the vertical layout, it is displayed right above the Note Tree. +* On the horizontal layout, it is displayed in the Launch Bar, where it can be positioned just like any other icon. ## Search Features @@ -56,4 +56,58 @@ Quick search uses progressive search: 2. **Content previews**: 200-character snippets show match context 3. **Infinite scrolling**: Additional results load on scroll 4. **Specific terms**: Specific search terms return more focused results -5. **Match locations**: Bold text indicates where matches occur \ No newline at end of file +5. **Match locations**: Bold text indicates where matches occur + +## Quick Search - Exact Match Operator + +Quick Search now supports the exact match operator (`=`) at the beginning of your search query. This allows you to search for notes where the title or content exactly matches your search term, rather than just containing it. + +### Usage + +To use exact match in Quick Search: + +1. Start your search query with the `=` operator +2. Follow it immediately with your search term (no space after `=`) + +#### Examples + +* `=example` - Finds notes with title exactly "example" or content exactly "example" +* `=Project Plan` - Finds notes with title exactly "Project Plan" or content exactly "Project Plan" +* `='hello world'` - Use quotes for multi-word exact matches + +#### Comparison with Regular Search + +| Query | Behavior | +| --- | --- | +| `example` | Finds all notes containing "example" anywhere in title or content | +| `=example` | Finds only notes where the title equals "example" or content equals "example" exactly | + +### Technical Details + +When you use the `=` operator: + +* The search performs an exact match on note titles +* For note content, it looks for exact matches of the entire content +* Partial word matches are excluded +* The search is case-insensitive + +### Limitations + +* The `=` operator must be at the very beginning of the search query +* Spaces after `=` will treat it as a regular search +* Multiple `=` operators (like `==example`) are treated as regular text search + +### Use Cases + +This feature is particularly useful when: + +* You know the exact title of a note +* You want to find notes with specific, complete content +* You need to distinguish between notes with similar but not identical titles +* You want to avoid false positives from partial matches + +### Related Features + +* For more complex exact matching queries, use the full [Search](Search.md) functionality +* For fuzzy matching (finding results despite typos), use the `~=` operator in the full search +* For partial matches with wildcards, use operators like `*=*`, `=*`, or `*=` in the full search \ No newline at end of file diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md index b11c079a2..a484446d7 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker.md @@ -187,7 +187,7 @@ docker run -d --name trilium -p 8080:8080 --user $(id -u):$(id -g) -v ~/trilium- * `TRILIUM_GID`: GID to use for the container process (passed to Docker's `--user` flag) * `TRILIUM_DATA_DIR`: Path to the data directory inside the container (default: `/home/node/trilium-data`) -For a complete list of configuration environment variables (network settings, authentication, sync, etc.), see Configuration (config.ini or environment variables). +For a complete list of configuration environment variables (network settings, authentication, sync, etc.), see Configuration (config.ini or environment variables). ### Volume Permissions diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.md index ee6e93363..5ef20f3ac 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/Multi-Factor Authentication.md @@ -38,8 +38,8 @@ In order to setup OpenID, you will need to setup a authentication provider. This 1. Set the `oauthBaseUrl`, `oauthClientId` and `oauthClientSecret` in the `config.ini` file (check Configuration (config.ini or environment variables) for more information). 1. You can also setup through environment variables: - - Standard: `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` - - Legacy (still supported): `TRILIUM_OAUTH_BASE_URL`, `TRILIUM_OAUTH_CLIENT_ID`, `TRILIUM_OAUTH_CLIENT_SECRET` + * Standard: `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHBASEURL`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTID`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHCLIENTSECRET` + * Legacy (still supported): `TRILIUM_OAUTH_BASE_URL`, `TRILIUM_OAUTH_CLIENT_ID`, `TRILIUM_OAUTH_CLIENT_SECRET` 2. `oauthBaseUrl` should be the link of your Trilium instance server, for example, `https://`. 2. Restart the server 3. Go to "Menu" -> "Options" -> "MFA" @@ -49,8 +49,9 @@ In order to setup OpenID, you will need to setup a authentication provider. This > [!NOTE] > The default OAuth issuer is Google. To use other services such as Authentik or Auth0, you can configure the settings via `oauthIssuerBaseUrl`, `oauthIssuerName`, and `oauthIssuerIcon` in the `config.ini` file. Alternatively, these values can be set using environment variables: -> - Standard: `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` -> - Legacy (still supported): `TRILIUM_OAUTH_ISSUER_BASE_URL`, `TRILIUM_OAUTH_ISSUER_NAME`, `TRILIUM_OAUTH_ISSUER_ICON` +> +> * Standard: `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERBASEURL`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERNAME`, `TRILIUM_MULTIFACTORAUTHENTICATION_OAUTHISSUERICON` +> * Legacy (still supported): `TRILIUM_OAUTH_ISSUER_BASE_URL`, `TRILIUM_OAUTH_ISSUER_NAME`, `TRILIUM_OAUTH_ISSUER_ICON` > > `oauthIssuerName` and `oauthIssuerIcon` are required for displaying correct issuer information at the Login page. diff --git a/docs/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.md b/docs/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.md index d4004a8cb..eaa0bbba0 100644 --- a/docs/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.md +++ b/docs/User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration.md @@ -27,7 +27,7 @@ keyPath=/[username]/.acme.sh/[hostname]/example.com.key You can also review the [configuration](../../Advanced%20Usage/Configuration%20\(config.ini%20or%20e.md) file to provide all `config.ini` values as environment variables instead. For example, you can configure TLS using environment variables: -```bash +```sh export TRILIUM_NETWORK_HTTPS=true export TRILIUM_NETWORK_CERTPATH=/path/to/cert.pem export TRILIUM_NETWORK_KEYPATH=/path/to/key.pem diff --git a/package.json b/package.json index a12c2c002..ca22d70d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/source", - "version": "0.98.0", + "version": "0.98.1", "description": "Build your personal knowledge base with Trilium Notes", "directories": { "doc": "docs" diff --git a/packages/ckeditor5/package.json b/packages/ckeditor5/package.json index 7a2970aaf..49562a8cc 100644 --- a/packages/ckeditor5/package.json +++ b/packages/ckeditor5/package.json @@ -39,6 +39,6 @@ "ckeditor5-premium-features": "46.0.2" }, "devDependencies": { - "@types/jquery": "3.5.32" + "@types/jquery": "3.5.33" } } diff --git a/packages/commons/package.json b/packages/commons/package.json index b63385cb9..eff04806c 100644 --- a/packages/commons/package.json +++ b/packages/commons/package.json @@ -1,6 +1,6 @@ { "name": "@triliumnext/commons", - "version": "0.98.0", + "version": "0.98.1", "description": "Shared library between the clients (e.g. browser, Electron) and the server, mostly for type definitions and utility methods.", "private": true, "type": "module", diff --git a/packages/commons/src/lib/i18n.ts b/packages/commons/src/lib/i18n.ts index 5f2470aa3..d40f5ecc5 100644 --- a/packages/commons/src/lib/i18n.ts +++ b/packages/commons/src/lib/i18n.ts @@ -6,7 +6,7 @@ export interface Locale { /** `true` if the language is not supported by the application as a display language, but it is selectable by the user for the content. */ contentOnly?: boolean; /** The value to pass to `--lang` for the Electron instance in order to set it as a locale. Not setting it will hide it from the list of supported locales. */ - electronLocale?: "en" | "de" | "es" | "fr" | "zh_CN" | "zh_TW" | "ro" | "af" | "am" | "ar" | "bg" | "bn" | "ca" | "cs" | "da" | "el" | "en-GB" | "es-419" | "et" | "fa" | "fi" | "fil" | "gu" | "he" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "kn" | "ko" | "lt" | "lv" | "ml" | "mr" | "ms" | "nb" | "nl" | "pl" | "pt-BR" | "pt-PT" | "ru" | "sk" | "sl" | "sr" | "sv" | "sw" | "ta" | "te" | "th" | "tr" | "uk" | "ur" | "vi"; + electronLocale?: "en" | "de" | "es" | "fr" | "zh_CN" | "zh_TW" | "ro" | "af" | "am" | "ar" | "bg" | "bn" | "ca" | "cs" | "da" | "el" | "en_GB" | "es_419" | "et" | "fa" | "fi" | "fil" | "gu" | "he" | "hi" | "hr" | "hu" | "id" | "it" | "ja" | "kn" | "ko" | "lt" | "lv" | "ml" | "mr" | "ms" | "nb" | "nl" | "pl" | "pt_BR" | "pt_PT" | "ru" | "sk" | "sl" | "sr" | "sv" | "sw" | "ta" | "te" | "th" | "tr" | "uk" | "ur" | "vi"; } const UNSORTED_LOCALES: Locale[] = [ @@ -16,7 +16,7 @@ const UNSORTED_LOCALES: Locale[] = [ { id: "es", name: "Español", electronLocale: "es" }, { id: "fr", name: "Français", electronLocale: "fr" }, { id: "ja", name: "日本語", electronLocale: "ja" }, - { id: "pt_br", name: "Português (Brasil)", electronLocale: "pt-BR" }, + { id: "pt_br", name: "Português (Brasil)", electronLocale: "pt_BR" }, { id: "ro", name: "Română", electronLocale: "ro" }, { id: "ru", name: "Русский", electronLocale: "ru" }, { id: "tw", name: "繁體中文", electronLocale: "zh_TW" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c1e386b8..562f3ffe4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -314,8 +314,8 @@ importers: specifier: 5.2.10 version: 5.2.10 '@types/jquery': - specifier: 3.5.32 - version: 3.5.32 + specifier: 3.5.33 + version: 3.5.33 '@types/leaflet': specifier: 1.9.20 version: 1.9.20 @@ -442,7 +442,7 @@ importers: version: 1.6.3 tsx: specifier: ^4.19.3 - version: 4.20.4 + version: 4.20.5 yargs: specifier: ^18.0.0 version: 18.0.0 @@ -884,8 +884,8 @@ importers: version: 46.0.2(bufferutil@4.0.9)(ckeditor5@46.0.2(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41))(utf-8-validate@6.0.5) devDependencies: '@types/jquery': - specifier: 3.5.32 - version: 3.5.32 + specifier: 3.5.33 + version: 3.5.33 packages/ckeditor5-admonition: devDependencies: @@ -5737,8 +5737,8 @@ packages: '@types/istanbul-reports@3.0.4': resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} - '@types/jquery@3.5.32': - resolution: {integrity: sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ==} + '@types/jquery@3.5.33': + resolution: {integrity: sha512-SeyVJXlCZpEki5F0ghuYe+L+PprQta6nRZqhONt9F13dWBtR/ftoaIbdRQ7cis7womE+X2LKhsDdDtkkDhJS6g==} '@types/js-yaml@4.0.9': resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==} @@ -14413,11 +14413,6 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - tsx@4.20.4: - resolution: {integrity: sha512-yyxBKfORQ7LuRt/BQKBXrpcq59ZvSW0XxwfjAt3w2/8PmdxaFzijtMhTawprSHhpzeM5BgU2hXHG3lklIERZXg==} - engines: {node: '>=18.0.0'} - hasBin: true - tsx@4.20.5: resolution: {integrity: sha512-+wKjMNU9w/EaQayHXb7WA7ZaHY6hN8WgfvHNQ3t1PnU91/7O8TcTnIhCDYTZwnt8JsO9IBqZ30Ln1r7pPF52Aw==} engines: {node: '>=18.0.0'} @@ -17341,8 +17336,6 @@ snapshots: '@ckeditor/ckeditor5-widget': 46.0.2 ckeditor5: 46.0.2(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) es-toolkit: 1.39.5 - transitivePeerDependencies: - - supports-color '@ckeditor/ckeditor5-icons@46.0.2': {} @@ -17712,6 +17705,8 @@ snapshots: '@ckeditor/ckeditor5-ui': 46.0.2 '@ckeditor/ckeditor5-utils': 46.0.2 ckeditor5: 46.0.2(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41) + transitivePeerDependencies: + - supports-color '@ckeditor/ckeditor5-special-characters@46.0.2': dependencies: @@ -21846,7 +21841,7 @@ snapshots: dependencies: '@types/istanbul-lib-report': 3.0.3 - '@types/jquery@3.5.32': + '@types/jquery@3.5.33': dependencies: '@types/sizzle': 2.3.9 @@ -21894,7 +21889,7 @@ snapshots: '@types/mark.js@8.11.12': dependencies: - '@types/jquery': 3.5.32 + '@types/jquery': 3.5.33 '@types/mdast@4.0.4': dependencies: @@ -32484,13 +32479,6 @@ snapshots: tslib@2.8.1: {} - tsx@4.20.4: - dependencies: - esbuild: 0.25.9 - get-tsconfig: 4.10.1 - optionalDependencies: - fsevents: 2.3.3 - tsx@4.20.5: dependencies: esbuild: 0.25.9