Skip to content

Commit 6fad5f2

Browse files
committed
Merge branch 'master' into excali-17-2
2 parents 8199073 + 36357bd commit 6fad5f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2867
-2396
lines changed

.eslintrc.js

Lines changed: 199 additions & 204 deletions
Large diffs are not rendered by default.

.husky/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 4 deletions
This file was deleted.

.prettierrc.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"recommendations": [
33
"dbaeumer.vscode-eslint",
4-
"esbenp.prettier-vscode",
54
]
65
}

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found.
643643
GNU Affero General Public License for more details.
644644

645645
You should have received a copy of the GNU Affero General Public License
646-
along with this program. If not, see <http://www.js.gnu.org/licenses/>.
646+
along with this program. If not, see <http://www.gnu.org/licenses/>.
647647

648648
Also add information on how to contact you by electronic and paper mail.
649649

@@ -658,4 +658,4 @@ specific requirements.
658658
You should also get your employer (if you work as a programmer) or school,
659659
if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661-
<http://www.js.gnu.org/licenses/>.
661+
<http://www.gnu.org/licenses/>.

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Trilium Notes
22

3+
## Trilium is in maintenance mode - see details in https://github.com/zadam/trilium/issues/4620
4+
5+
Preliminary disccusions on the successor organization are taking place in [Trilium Next discussions](https://github.com/orgs/TriliumNext/discussions).
6+
37
[![Join the chat at https://gitter.im/trilium-notes/Lobby](https://badges.gitter.im/trilium-notes/Lobby.svg)](https://gitter.im/trilium-notes/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [English](https://github.com/zadam/trilium/blob/master/README.md) | [Chinese](https://github.com/zadam/trilium/blob/master/README-ZH_CN.md) | [Russian](https://github.com/zadam/trilium/blob/master/README.ru.md) | [Japanese](https://github.com/zadam/trilium/blob/master/README.ja.md)
48

5-
Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases. See [screenshots](https://github.com/zadam/trilium/wiki/Screenshot-tour) for quick overview:
9+
Trilium Notes is a hierarchical note taking application with focus on building large personal knowledge bases.
10+
11+
See [screenshots](https://github.com/zadam/trilium/wiki/Screenshot-tour) for quick overview:
612

713
<a href="https://github.com/zadam/trilium/wiki/Screenshot-tour"><img src="https://raw.githubusercontent.com/wiki/zadam/trilium/images/screenshot.png" alt="Trilium Screenshot" width="1000"></a>
814

bin/build-linux-x64.sh

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,37 @@
22

33
SRC_DIR=./dist/trilium-linux-x64-src
44

5-
if [ "$1" != "DONTCOPY" ]
6-
then
7-
./bin/copy-trilium.sh $SRC_DIR
8-
fi
5+
[ "$1" != "DONTCOPY" ] && ./bin/copy-trilium.sh "$SRC_DIR"
96

10-
rm -r $SRC_DIR/src/public/app-dist/*.mobile.*
7+
rm -r "$SRC_DIR"/src/public/app-dist/*.mobile.*
118

129
echo "Copying required linux-x64 binaries"
13-
14-
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node $SRC_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node
10+
cp -r bin/better-sqlite3/linux-desktop-better_sqlite3.node "$SRC_DIR"/node_modules/better-sqlite3/build/Release/better_sqlite3.node
1511

1612
echo "Packaging linux x64 electron build"
17-
18-
./node_modules/.bin/electron-packager $SRC_DIR --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
13+
./node_modules/.bin/electron-packager "$SRC_DIR" --asar --out=dist --executable-name=trilium --platform=linux --arch=x64 --overwrite
1914

2015
BUILD_DIR=./dist/trilium-linux-x64
21-
rm -rf $BUILD_DIR
22-
23-
mv "./dist/Trilium Notes-linux-x64" $BUILD_DIR
24-
25-
cp images/app-icons/png/128x128.png $BUILD_DIR/icon.png
16+
rm -rf "$BUILD_DIR"
2617

27-
cp bin/tpl/anonymize-database.sql $BUILD_DIR/
18+
mv "./dist/Trilium Notes-linux-x64" "$BUILD_DIR"
2819

29-
cp -r dump-db $BUILD_DIR/
30-
rm -rf $BUILD_DIR/dump-db/node_modules
20+
cp images/app-icons/png/128x128.png "$BUILD_DIR"/icon.png
21+
cp bin/tpl/anonymize-database.sql "$BUILD_DIR"/
3122

32-
cp bin/tpl/trilium-portable.sh $BUILD_DIR/
33-
chmod 755 $BUILD_DIR/trilium-portable.sh
23+
cp -r dump-db "$BUILD_DIR"/
24+
rm -rf "$BUILD_DIR"/dump-db/node_modules
3425

35-
cp bin/tpl/trilium-safe-mode.sh $BUILD_DIR/
36-
chmod 755 $BUILD_DIR/trilium-safe-mode.sh
37-
38-
cp bin/tpl/trilium-no-cert-check.sh $BUILD_DIR/
39-
chmod 755 $BUILD_DIR/trilium-no-cert-check.sh
26+
for f in 'trilium-portable' 'trilium-safe-mode' 'trilium-no-cert-check'; do
27+
cp bin/tpl/"$f".sh "$BUILD_DIR"/
28+
chmod 755 "$BUILD_DIR"/"$f".sh
29+
done
4030

4131
echo "Packaging linux x64 electron distribution..."
4232
VERSION=`jq -r ".version" package.json`
4333

44-
cd dist
45-
46-
tar cJf trilium-linux-x64-${VERSION}.tar.xz trilium-linux-x64
47-
48-
cd ..
34+
pushd dist
35+
tar cJf "trilium-linux-x64-${VERSION}.tar.xz" trilium-linux-x64
36+
popd
4937

5038
bin/build-debian.sh

bin/copy-trilium.sh

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,49 @@ if [[ $# -eq 0 ]] ; then
44
echo "Missing argument of target directory"
55
exit 1
66
fi
7+
if ! [[ $(which npm) ]]; then
8+
echo "Missing npm"
9+
exit 1
10+
fi
711

8-
n exec 18.18.2 npm run webpack
12+
n exec 18.18.2 npm run webpack || npm run webpack
913

10-
DIR=$1
14+
DIR="$1"
1115

12-
rm -rf $DIR
13-
mkdir $DIR
16+
rm -rf "$DIR"
17+
mkdir -pv "$DIR"
1418

1519
echo "Copying Trilium to build directory $DIR"
1620

17-
cp -r images $DIR/
18-
cp -r libraries $DIR/
19-
cp -r src $DIR/
20-
cp -r db $DIR/
21-
cp -r package.json $DIR/
22-
cp -r package-lock.json $DIR/
23-
cp -r README.md $DIR/
24-
cp -r LICENSE $DIR/
25-
cp -r config-sample.ini $DIR/
26-
cp -r electron.js $DIR/
27-
cp webpack-* $DIR/
21+
for d in 'images' 'libraries' 'src' 'db'; do
22+
cp -r "$d" "$DIR"/
23+
done
24+
for f in 'package.json' 'package-lock.json' 'README.md' 'LICENSE' 'config-sample.ini' 'electron.js'; do
25+
cp "$f" "$DIR"/
26+
done
27+
cp webpack-* "$DIR"/ # here warning because there is no 'webpack-*', but webpack.config.js only
2828

2929
# run in subshell (so we return to original dir)
3030
(cd $DIR && n exec 18.18.2 npm install --only=prod)
3131

32+
if [[ -d "$DIR"/node_modules ]]; then
3233
# cleanup of useless files in dependencies
33-
rm -r $DIR/node_modules/image-q/demo
34-
rm -r $DIR/node_modules/better-sqlite3/Release
35-
rm -r $DIR/node_modules/better-sqlite3/deps/sqlite3.tar.gz
36-
rm -r $DIR/node_modules/@jimp/plugin-print/fonts
37-
rm -r $DIR/node_modules/jimp/browser
38-
rm -r $DIR/node_modules/jimp/fonts
34+
for d in 'image-q/demo' 'better-sqlite3/Release' 'better-sqlite3/deps/sqlite3.tar.gz' '@jimp/plugin-print/fonts' 'jimp/browser' 'jimp/fonts'; do
35+
[[ -e "$DIR"/node_modules/"$d" ]] && rm -rv "$DIR"/node_modules/"$d"
36+
done
3937

4038
# delete all tests (there are often large images as test file for jimp etc.)
41-
find $DIR/node_modules -name test -exec rm -rf {} \;
42-
find $DIR/node_modules -name docs -exec rm -rf {} \;
43-
find $DIR/node_modules -name demo -exec rm -rf {} \;
39+
for d in 'test' 'docs' 'demo'; do
40+
find "$DIR"/node_modules -name "$d" -exec rm -rf {} \;
41+
done
42+
fi
4443

4544
find $DIR/libraries -name "*.map" -type f -delete
4645

47-
cp $DIR/src/public/app/share.js $DIR/src/public/app-dist/
48-
cp -r $DIR/src/public/app/doc_notes $DIR/src/public/app-dist/
46+
d="$DIR"/src/public
47+
[[ -d "$d"/app-dist ]] || mkdir -pv "$d"/app-dist
48+
cp "$d"/app/share.js "$d"/app-dist/
49+
cp -r "$d"/app/doc_notes "$d"/app-dist/
4950

50-
rm -rf $DIR/src/public/app
51+
rm -rf "$d"/app
52+
unset f d DIR

db/migrations/0215__content_structure.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ CREATE TABLE IF NOT EXISTS "blobs" (
88

99
ALTER TABLE notes ADD blobId TEXT DEFAULT NULL;
1010
ALTER TABLE note_revisions ADD blobId TEXT DEFAULT NULL;
11+
12+
CREATE INDEX IF NOT EXISTS IDX_notes_blobId on notes (blobId);
13+
CREATE INDEX IF NOT EXISTS IDX_note_revisions_blobId on note_revisions (blobId);

0 commit comments

Comments
 (0)