From 79f1eb6e5eb6568e9f642d9083c446765fce2889 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 20 Feb 2023 21:21:32 +0100 Subject: [PATCH 1/5] improvements in the anonymization script --- bin/tpl/anonymize-database.sql | 155 ++++++++++++++++++++++++++++++++- 1 file changed, 152 insertions(+), 3 deletions(-) diff --git a/bin/tpl/anonymize-database.sql b/bin/tpl/anonymize-database.sql index afdff5168..d72e0b29a 100644 --- a/bin/tpl/anonymize-database.sql +++ b/bin/tpl/anonymize-database.sql @@ -1,12 +1,161 @@ UPDATE etapi_tokens SET tokenHash = 'API token hash value'; -UPDATE notes SET title = 'title' WHERE title NOT IN ('root', '_hidden', '_share'); +UPDATE notes SET title = 'title' WHERE noteId != 'root' AND noteId NOT LIKE '\_%' ESCAPE '\'; UPDATE note_contents SET content = 'text' WHERE content IS NOT NULL; UPDATE note_revisions SET title = 'title'; UPDATE note_revision_contents SET content = 'text' WHERE content IS NOT NULL; -UPDATE attributes SET name = 'name', value = 'value' WHERE type = 'label' AND name NOT IN('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon'); -UPDATE attributes SET name = 'name' WHERE type = 'relation' AND name NOT IN ('inbox', 'disableVersioning', 'calendarRoot', 'archived', 'excludeFromExport', 'disableInclusion', 'appCss', 'appTheme', 'hidePromotedAttributes', 'readOnly', 'autoReadOnlyDisabled', 'cssClass', 'iconClass', 'keyboardShortcut', 'run', 'runOnInstance', 'runAtHour', 'customRequestHandler', 'customResourceProvider', 'widget', 'noteInfoWidgetDisabled', 'linkMapWidgetDisabled', 'noteRevisionsWidgetDisabled', 'whatLinksHereWidgetDisabled', 'similarNotesWidgetDisabled', 'workspace', 'workspaceIconClass', 'workspaceTabBackgroundColor', 'searchHome', 'workspaceInbox', 'workspaceSearchHome', 'sqlConsoleHome', 'datePattern', 'pageSize', 'viewType', 'mapRootNoteId', 'bookmarkFolder', 'sorted', 'top', 'fullContentWidth', 'shareHiddenFromTree', 'shareAlias', 'shareOmitDefaultCss', 'shareRoot', 'shareDescription', 'internalLink', 'imageLink', 'relationMapLink', 'includeMapLink', 'runOnNoteCreation', 'runOnNoteTitleChange', 'runOnNoteContentChange', 'runOnNoteChange', 'runOnChildNoteCreation', 'runOnAttributeCreation', 'runOnAttributeChange', 'template', 'widget', 'renderNote', 'shareCss', 'shareJs', 'shareFavicon'); +UPDATE attributes SET name = 'name', value = 'value' + WHERE type = 'label' + AND name NOT IN ('inbox', + 'disableVersioning', + 'calendarRoot', + 'archived', + 'excludeFromExport', + 'disableInclusion', + 'appCss', + 'appTheme', + 'hidePromotedAttributes', + 'readOnly', + 'autoReadOnlyDisabled', + 'cssClass', + 'iconClass', + 'keyboardShortcut', + 'run', + 'runOnInstance', + 'runAtHour', + 'customRequestHandler', + 'customResourceProvider', + 'widget', + 'noteInfoWidgetDisabled', + 'linkMapWidgetDisabled', + 'noteRevisionsWidgetDisabled', + 'whatLinksHereWidgetDisabled', + 'similarNotesWidgetDisabled', + 'workspace', + 'workspaceIconClass', + 'workspaceTabBackgroundColor', + 'searchHome', + 'workspaceInbox', + 'workspaceSearchHome', + 'sqlConsoleHome', + 'datePattern', + 'pageSize', + 'viewType', + 'mapRootNoteId', + 'bookmarkFolder', + 'sorted', + 'top', + 'fullContentWidth', + 'shareHiddenFromTree', + 'shareAlias', + 'shareOmitDefaultCss', + 'shareRoot', + 'internalLink', + 'imageLink', + 'relationMapLink', + 'includeMapLink', + 'runOnNoteCreation', + 'runOnNoteTitleChange', + 'runOnNoteContentChange', + 'runOnNoteChange', + 'runOnChildNoteCreation', + 'runOnAttributeCreation', + 'runOnAttributeChange', + 'template', + 'inherit', + 'widget', + 'renderNote', + 'shareCss', + 'shareJs', + 'shareFavicon', + 'executeButton', + 'keepCurrentHoisting', + 'color', + 'toc', + 'excludeFromNoteMap', + 'docName', + 'launcherType', + 'builtinWidget', + 'baseSize', + 'growthFactor' + ); + +UPDATE attributes SET name = 'name' + AND name NOT IN ('inbox', + 'disableVersioning', + 'calendarRoot', + 'archived', + 'excludeFromExport', + 'disableInclusion', + 'appCss', + 'appTheme', + 'hidePromotedAttributes', + 'readOnly', + 'autoReadOnlyDisabled', + 'cssClass', + 'iconClass', + 'keyboardShortcut', + 'run', + 'runOnInstance', + 'runAtHour', + 'customRequestHandler', + 'customResourceProvider', + 'widget', + 'noteInfoWidgetDisabled', + 'linkMapWidgetDisabled', + 'noteRevisionsWidgetDisabled', + 'whatLinksHereWidgetDisabled', + 'similarNotesWidgetDisabled', + 'workspace', + 'workspaceIconClass', + 'workspaceTabBackgroundColor', + 'searchHome', + 'workspaceInbox', + 'workspaceSearchHome', + 'sqlConsoleHome', + 'datePattern', + 'pageSize', + 'viewType', + 'mapRootNoteId', + 'bookmarkFolder', + 'sorted', + 'top', + 'fullContentWidth', + 'shareHiddenFromTree', + 'shareAlias', + 'shareOmitDefaultCss', + 'shareRoot', + 'internalLink', + 'imageLink', + 'relationMapLink', + 'includeMapLink', + 'runOnNoteCreation', + 'runOnNoteTitleChange', + 'runOnNoteContentChange', + 'runOnNoteChange', + 'runOnChildNoteCreation', + 'runOnAttributeCreation', + 'runOnAttributeChange', + 'template', + 'inherit', + 'widget', + 'renderNote', + 'shareCss', + 'shareJs', + 'shareFavicon', + 'executeButton', + 'keepCurrentHoisting', + 'color', + 'toc', + 'excludeFromNoteMap', + 'docName', + 'launcherType', + 'builtinWidget', + 'baseSize', + 'growthFactor' + ); + UPDATE branches SET prefix = 'prefix' WHERE prefix IS NOT NULL AND prefix != 'recovered'; UPDATE options SET value = 'anonymized' WHERE name IN ('documentId', 'documentSecret', 'encryptedDataKey', From c16537aecfab36b942cddb6685174074966f1a0c Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 21 Feb 2023 10:37:53 +0100 Subject: [PATCH 2/5] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f7576bea9..b602093cc 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,8 @@ Ukraine is currently defending itself from Russian aggression, please consider [ drawing +Trilium Notes supports Ukraine! + ## Features * Notes can be arranged into arbitrarily deep tree. Single note can be placed into multiple places in the tree (see [cloning](https://github.com/zadam/trilium/wiki/Cloning-notes)) From 3fd0c01c05f0cae29ce9f3c5520ba61f71dde50d Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 21 Feb 2023 10:38:12 +0100 Subject: [PATCH 3/5] Update README.ru.md --- README.ru.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.ru.md b/README.ru.md index 25c520898..794e6c4b2 100644 --- a/README.ru.md +++ b/README.ru.md @@ -10,6 +10,7 @@ Trilium Notes – это приложение для заметок с иера Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/). drawing +Trilium Notes supports Ukraine! ## Возможности From a88582c610097d24ed8d9da2b9b0d5e270e107fe Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 21 Feb 2023 10:38:37 +0100 Subject: [PATCH 4/5] Update README-ZH_CN.md --- README-ZH_CN.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README-ZH_CN.md b/README-ZH_CN.md index 23612ce07..a31caa2a1 100644 --- a/README-ZH_CN.md +++ b/README-ZH_CN.md @@ -10,6 +10,7 @@ Trilium Notes 是一个层次化的笔记应用程序,专注于建立大型个 Ukraine is currently suffering from Russian aggression, please consider donating to [one of these charities](https://old.reddit.com/r/ukraine/comments/s6g5un/want_to_support_ukraine_heres_a_list_of_charities/). drawing +Trilium Notes supports Ukraine! ## 特性 From 44c0ecdbfa8adccafb0042c6ec09f3ae69ea03bb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 26 Feb 2023 22:45:58 +0200 Subject: [PATCH 5/5] Fix middle vertical align on table cells For merged cells, middle vertical alignment would not work properly (it was either aligned to the top or bottom). --- src/public/stylesheets/print.css | 7 +++++++ src/public/stylesheets/style.css | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/public/stylesheets/print.css b/src/public/stylesheets/print.css index afc77970d..118a0d0d3 100644 --- a/src/public/stylesheets/print.css +++ b/src/public/stylesheets/print.css @@ -13,4 +13,11 @@ .relation-map-wrapper { height: 100vh !important; } + + .table thead th, + .table td, .table th { + /* Fix center vertical alignment of table cells */ + vertical-align: middle; + } + } diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index e32fb4a47..bfa6a3a22 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -990,3 +990,9 @@ button.close:hover { textarea { cursor: auto; } + +.table thead th, +.table td, .table th { + /* Fix center vertical alignment of table cells */ + vertical-align: middle; +}