Compare commits

...

18 Commits

Author SHA1 Message Date
zadam
6547b66228 release 0.54.3 2022-08-26 22:16:49 +02:00
zadam
e9090b9154 added a release flatpack script
(cherry picked from commit e70a7bad1a)
2022-08-26 22:09:48 +02:00
zadam
5b73fe949e defensive programming, #3089 2022-08-26 22:08:05 +02:00
zadam
35fab7a23c fixes overwriting attributes after clicking on a relation in the attribute editor, closes #3090 2022-08-26 22:02:40 +02:00
zadam
df351a8d09 trilium safe mode now disables GPU usage 2022-08-20 22:39:59 +02:00
zadam
8abcf571e8 fixes for undefined parent note #3066 2022-08-16 23:46:56 +02:00
zadam
78bca2477d fix creating virtual "none" note in becca, closes #3066 2022-08-16 23:38:11 +02:00
zadam
28f620d51d update demo document, closes #3061 2022-08-14 15:05:10 +02:00
zadam
aebdbdf8be fix falsy check in setting custom widget positions, closes #3060 2022-08-14 15:00:18 +02:00
zadam
201ef7fcd5 fix "show recent note" button, closes #3051 2022-08-09 21:49:37 +02:00
zadam
6dee1f38f7 Merge pull request #3048 from DaiYuANg/master
add manifest.webmanifest into desktop make pwa install on ipad
2022-08-08 20:28:29 +02:00
DaiYuANg
87e2f50c6d add manifest.webmanifest into desktop make pwa install on ipad 2022-08-08 21:51:04 +08:00
zadam
2335e40262 release 0.54.2 2022-08-07 23:20:59 +02:00
zadam
3a07c5fcc0 release 0.54.2 2022-08-07 23:18:03 +02:00
zadam
0681ec9057 Merge pull request #3038 from DynamoFox/support-reverse-proxy-trust
Add optional support to trust reverse proxies (via X-Forwarded-For)
2022-08-04 21:14:48 +02:00
DynamoFox
912f79f1af Add optional support to trust reverse proxies (via X-Forwarded-For) 2022-08-04 00:19:54 +02:00
zadam
b6f1611218 less accented backlinks background (in dark mode esp.) 2022-08-03 19:24:26 +02:00
zadam
869c910801 fix "bulk actions" dialog title 2022-08-03 19:17:13 +02:00
22 changed files with 86 additions and 20 deletions

34
bin/release-flatpack.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/usr/bin/env bash
if [[ $# -eq 0 ]] ; then
echo "Missing argument of new version"
exit 1
fi
VERSION=$1
if ! [[ ${VERSION} =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-.+)?$ ]] ;
then
echo "Version ${VERSION} isn't in format X.Y.Z"
exit 1
fi
VERSION_DATE=$(git log -1 --format=%aI v${VERSION} | cut -c -10)
VERSION_COMMIT=$(git rev-list -n 1 v${VERSION})
echo "Updating files with version ${VERSION}, date ${VERSION_DATE} and commit ${VERSION_COMMIT}"
# expecting the directory at a specific path
cd ~/trilium-flathub
if ! git diff-index --quiet HEAD --; then
echo "There are uncommitted changes"
exit 1
fi
xmlstarlet ed --inplace --update "/component/releases/release/@version" --value "${VERSION}" --update "/component/releases/release/@date" --value "${VERSION_DATE}" ./trilium-flathub/com.github.zadam.trilium.metainfo.xml
yq --inplace "(.modules[0].sources[0].tag = \"v${VERSION}\") | (.modules[0].sources[0].commit = \"${VERSION_COMMIT}\")" ./trilium-flathub/com.github.zadam.trilium.yml
git commit -m "release $VERSION"
git push

View File

@@ -2,4 +2,4 @@ SET DIR=%~dp0
SET TRILIUM_SAFE_MODE=1
cd %DIR%
WHERE powershell.exe
IF %ERRORLEVEL% NEQ 0 (start trilium.exe) ELSE (powershell.exe ./trilium-safe-mode.ps1)
IF %ERRORLEVEL% NEQ 0 (start trilium.exe --disable-gpu) ELSE (powershell.exe ./trilium-safe-mode.ps1)

View File

@@ -1,2 +1,2 @@
Set-Item -Path Env:TRILIUM_SAFE_MODE -Value 1
./trilium.exe
./trilium.exe --disable-gpu

View File

@@ -3,5 +3,5 @@
DIR=`dirname "$0"`
export TRILIUM_SAFE_MODE=1
"$DIR/trilium"
"$DIR/trilium" --disable-gpu

View File

@@ -21,3 +21,9 @@ https=false
# path to certificate (run "bash bin/generate-cert.sh" to generate self-signed certificate). Relevant only if https=true
certPath=
keyPath=
# setting to give trust to reverse proxies, a comma-separated list of trusted rev. proxy IPs can be specified (CIDR notation is permitted),
# alternatively 'true' will make use of the leftmost IP in X-Forwarded-For, ultimately an integer can be used to tell about the number of hops between
# Trilium (which is hop 0) and the first trusted rev. proxy.
# once set, expressjs will use the X-Forwarded-For header set by the rev. proxy to determinate the real IPs of clients.
# expressjs shortcuts are supported: loopback(127.0.0.1/8, ::1/128), linklocal(169.254.0.0/16, fe80::/10), uniquelocal(10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, fc00::/7)
trustedReverseProxy=false

Binary file not shown.

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "trilium",
"version": "0.54.0-beta",
"version": "0.54.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "trilium",
"version": "0.54.0-beta",
"version": "0.54.2",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
"dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.54.1-beta",
"version": "0.54.3",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View File

@@ -105,9 +105,9 @@ class Branch extends AbstractEntity {
return this.childNote;
}
/** @returns {Note} */
/** @returns {Note|undefined} - root branch will have undefined parent, all other branches have to have a parent note */
get parentNote() {
if (!(this.parentNoteId in this.becca.notes)) {
if (!(this.parentNoteId in this.becca.notes) && this.parentNoteId !== 'none') {
// entities can come out of order in sync/import, create skeleton which will be filled later
this.becca.addNote(this.parentNoteId, new Note({noteId: this.parentNoteId}));
}

View File

@@ -699,9 +699,11 @@ class Note extends AbstractEntity {
sortParents() {
this.parentBranches.sort((a, b) =>
a.branchId.startsWith('virt-')
|| a.parentNote.hasInheritableOwnedArchivedLabel() ? 1 : -1);
|| a.parentNote?.hasInheritableOwnedArchivedLabel() ? 1 : -1);
this.parents = this.parentBranches.map(branch => branch.parentNote);
this.parents = this.parentBranches
.map(branch => branch.parentNote)
.filter(note => !!note);
}
/**

View File

@@ -281,7 +281,7 @@ async function findSimilarNotes(noteId) {
}
function gatherAncestorRewards(note) {
if (ancestorNoteIds.has(note.noteId)) {
if (!note || ancestorNoteIds.has(note.noteId)) {
return 0;
}

View File

@@ -5,7 +5,7 @@ import noteCreateService from './note_create.js';
import treeService from './tree.js';
import froca from "./froca.js";
// this key needs to have this value so it's hit by the tooltip
// this key needs to have this value, so it's hit by the tooltip
const SELECTED_NOTE_PATH_KEY = "data-note-path";
const SELECTED_EXTERNAL_LINK_KEY = "data-external-link";
@@ -89,6 +89,11 @@ function showRecentNotes($el) {
$el.setSelectedNotePath("");
$el.autocomplete("val", "");
$el.trigger('focus');
// simulate pressing down arrow to trigger autocomplete
const e = $.Event('keydown');
e.which = 40; // arrow down
$el.trigger(e);
}
function initNoteAutocomplete($el, options) {

View File

@@ -297,6 +297,12 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
}
async save() {
if (this.lastUpdatedNoteId !== this.noteId) {
// https://github.com/zadam/trilium/issues/3090
console.warn("Ignoring blur event because a different note is loaded.");
return;
}
const attributes = this.parseAttributes();
if (attributes) {
@@ -354,6 +360,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
}
dataChanged() {
this.lastUpdatedNoteId = this.noteId;
if (this.lastSavedContent === this.textEditor.getData()) {
this.$saveAttributesButton.fadeOut();
}

View File

@@ -17,7 +17,7 @@ export default class Container extends BasicWidget {
super.child(...components);
for (const component of components) {
if (!component.position) {
if (component.position === undefined) {
component.position = this.positionCounter;
this.positionCounter += 10;
}

View File

@@ -37,7 +37,7 @@ const TPL = `
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mr-auto">Bulk assign attributes</h5>
<h5 class="modal-title mr-auto">Bulk actions</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
<span aria-hidden="true">&times;</span>

View File

@@ -36,7 +36,7 @@ const TPL = `
right: 10px;
width: 400px;
border-radius: 10px;
background-color: var(--more-accented-background-color);
background-color: var(--accented-background-color);
color: var(--main-text-color);
padding: 20px;
overflow-y: auto;

View File

@@ -63,8 +63,6 @@ export default class EmptyTypeWidget extends TypeWidget {
appContext.tabManager.getActiveContext().setNote(suggestion.notePath);
});
noteAutocompleteService.showRecentNotes(this.$autoComplete);
this.$workspaceNotes = this.$widget.find('.workspace-notes');
super.doRender();

View File

@@ -7,7 +7,6 @@ const utils = require('../../services/utils');
const log = require('../../services/log');
const TaskContext = require('../../services/task_context');
const fs = require('fs');
const noteRevisionService = require("../../services/note_revisions");
const becca = require("../../becca/becca");
function getNote(req) {

View File

@@ -10,7 +10,7 @@ function getNotesAndBranchesAndAttributes(noteIds) {
const collectedBranchIds = new Set();
function collectEntityIds(note) {
if (collectedNoteIds.has(note.noteId)) {
if (!note || collectedNoteIds.has(note.noteId)) {
return;
}
@@ -97,6 +97,11 @@ function getNotesAndBranchesAndAttributes(noteIds) {
for (const attributeId of collectedAttributeIds) {
const attribute = becca.attributes[attributeId];
if (!attribute) {
log.error(`Could not find attribute for attributeId=${attributeId}`);
continue;
}
attributes.push({
attributeId: attribute.attributeId,
noteId: attribute.noteId,

View File

@@ -1 +1 @@
module.exports = { buildDate:"2022-08-02T21:56:34+02:00", buildRevision: "12af3d05f04b9406af55ac301c0069eb385957c8" };
module.exports = { buildDate:"2022-08-26T22:16:49+02:00", buildRevision: "e9090b9154f8578fa85f02113bbf4f1050638eb3" };

View File

@@ -3,6 +3,7 @@
<head>
<meta charset="utf-8">
<link rel="shortcut icon" href="favicon.ico">
<link rel="manifest" href="manifest.webmanifest">
<title>Trilium Notes</title>
</head>
<body class="desktop heading-style-<%= headingStyle %>">

View File

@@ -44,6 +44,14 @@ async function startTrilium() {
app.set('port', usedPort);
app.set('host', usedHost);
// Check from config whether to trust reverse proxies to supply user IPs, hostnames and protocols
if (config['Network']['trustedReverseProxy']) {
if (config['Network']['trustedReverseProxy'] === true || config['Network']['trustedReverseProxy'].trim().length) {
app.set('trust proxy', config['Network']['trustedReverseProxy'])
}
}
log.info('Trusted reverse proxy: ' + app.get('trust proxy'))
if (config['Network']['https']) {
if (!config['Network']['keyPath'] || !config['Network']['keyPath'].trim().length) {
throw new Error("keyPath in config.ini is required when https=true, but it's empty");