10127 Commits

Author SHA1 Message Date
Panagiotis Papadopoulos
903988fec5 i18n(backend_log): translate messages 2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
dcfdb67539 refactor(backend_log): improve handle 'file not found'
handle errors more "user friendly" and actually
let the user know, that either the file is not
existing (yet), or that reading the log failed.
2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
67d858441a refactor(backend_log): include filename in log 2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
c4ad84ab06 refactor(backend_log): print error to the log 2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
eb4b5a44df refactor(backend_log): use path.join for log file path 2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
06ebcc210e refactor(backend_log): use async readFile
using synchronous functions on the backend
is not recommended, as it is "blocking the event loop", i.e. no other tasks get executed/processed,
while the file is being read
2025-01-13 09:21:24 +01:00
Panagiotis Papadopoulos
b2e83caf4a chore(scripts): add test-playwright script to package.json 2025-01-13 09:11:14 +01:00
Elian Doran
b30164ef66
chore(e2e): add missing await to expect 2025-01-13 10:00:13 +02:00
Panagiotis Papadopoulos
5373ef509b chore(prettier): fix code style 2025-01-13 08:28:12 +01:00
Panagiotis Papadopoulos
6818b2d54c style: move "important" funcs to top of file 2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
c47522eb50 refactor(data_dir): pass DIR_NAME as argument to getTriliumDir
makes it a bit cleaner and easier to test in the future,
as it is one thing less that'd need mocking :-)
2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
e021c0cd0e test(data_dir): add tests for getDataDirs 2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
63079c0939 test(data_dir): add tests for getPlatformAppDataDir 2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
94b8bcf8c9 refactor(data_dir): export functions to allow for testing 2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
8b1071c459 refactor(data_dir): export dirs as frozen readonly object
previously exported object allowed the values to be changed
accidentally at runtime and buildtime
2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
759d24855b style(data_dir): fix indentation 2025-01-13 08:26:07 +01:00
Panagiotis Papadopoulos
7a1e8714af refactor(data_dir): logically order/split cases in getTriliumDataDir
- the blocks now clearly follow the intended logic described in the comments
- I renamed the `getAppDataDir` to more specific `getPlatformAppDataDir`
2025-01-13 08:25:53 +01:00
Panagiotis Papadopoulos
3481c8ba84 refactor(data_dir): use path.join for safer joins
https://nodejs.org/api/path.html#pathjoinpaths
2025-01-13 08:24:04 +01:00
Panagiotis Papadopoulos
8826021c63 refactor(data_dir): add createDirIfNotExisting function
removes some code duplication
2025-01-13 08:24:04 +01:00
Panagiotis Papadopoulos
61a19d5628 refactor(data_dir): add FOLDER_PERMISSION const
gets rid of previously "magic number"
2025-01-13 08:24:01 +01:00
Elian Doran
fbfee818b2
fix(ci): directory for e2e tests 2025-01-13 09:11:11 +02:00
Elian Doran
ffacc1f5f7
chore(e2e): disable reuse of server on CI 2025-01-13 00:08:56 +02:00
Elian Doran
e556137a25
feat(ci): run playwright for docker builds 2025-01-13 00:08:43 +02:00
Elian Doran
9fd8e4d030
fix(e2e): language change breaking other tests 2025-01-12 23:41:27 +02:00
Elian Doran
9b85a101a6
feat(e2e): test note settings 2025-01-12 19:43:29 +02:00
Elian Doran
8dbb5497f1
feat(e2e): test mind map display 2025-01-12 19:34:35 +02:00
Elian Doran
54c5ce9257
chore(e2e): port old test for checking mobile language 2025-01-12 18:05:44 +02:00
Elian Doran
c641ce26d1
chore(e2e): port old test for checking desktop language 2025-01-12 17:43:16 +02:00
Elian Doran
dc83ba51db
chore(e2e): port old test for changing language 2025-01-12 17:36:10 +02:00
Elian Doran
0db3bfd8ae
feat(e2e): add test for settings translations 2025-01-12 17:28:41 +02:00
Elian Doran
1abc8abee6
fix(e2e): missing method 2025-01-12 17:17:07 +02:00
Panagiotis Papadopoulos
ea621ef8e1 chore(prettier): fix code style 2025-01-12 13:30:02 +01:00
Panagiotis Papadopoulos
4cd18441e4 deps: Update package-lock 2025-01-12 13:16:26 +01:00
Panagiotis Papadopoulos
d1bd2d2812 refactor(routes/login): remove unused rendering of HTML 2025-01-12 13:13:59 +01:00
Panagiotis Papadopoulos
59ecc614c2 refactor: call logout route via JS
required for csrf-csrf to correctly protect against
CSRF, as it required the _csrf cookie AND the
x-csrf-token HTTP header, the latter cannot be set
via simple Form POST action

using "../login" here, because "server" method is automatically prepending all paths with "/api",
which we don't want here, as we want "/login"
2025-01-12 11:43:41 +01:00
Panagiotis Papadopoulos
c36085e580 chore: fix TS warning by type narrowing
`req.csrfToken` might be undefined according to `csrf-csrf`
provided types, so use type narrowing to make sure it exists,
before calling it
2025-01-12 10:22:05 +01:00
Panagiotis Papadopoulos
d20a3bab2a fix(csrfMiddleware): use sessionSecret instead
since `cookie-parser` is not configured with a secret,
req.secret is not set and hence is `undefined`,
which then is used as literal 'undefined' in the hashing function – making it less secure.

Instead we can use the existing sessionSecret:
the `csrf-csrf` developer confirmed in their Discord chat,
that it would be ok to use the same secret here.
2025-01-12 10:22:05 +01:00
Panagiotis Papadopoulos
b787610717 refactor: replace csurf with csrf-csrf
I've kept the identical same settings as before –
however they are not *ideal* from what I read.
More secure settings will need to be tested a bit more thoroughly first and will be a separate PR.
2025-01-12 10:22:05 +01:00
Panagiotis Papadopoulos
5268aaee4f deps: replace csurf with csrf-csrf 2025-01-12 10:22:05 +01:00
renovate[bot]
e3b8de8843
fix(deps): update dependency ts-loader to v9.5.2 2025-01-12 02:27:20 +00:00
renovate[bot]
0cf13ca559
fix(deps): update dependency mind-elixir to v4.3.6 2025-01-12 02:27:09 +00:00
Elian Doran
cdf4a7385d
Merge pull request #927 from pano9000/chore_package-lock
deps: update package-lock.json
2025-01-11 22:17:09 +02:00
Elian Doran
c2dedc24af
fix(build): webpack config for electron-forge 2025-01-11 18:58:51 +02:00
Elian Doran
d8f775608c
feat(editor): enable list styles 2025-01-11 18:26:28 +02:00
Elian Doran
d25812cc3b
fix(docker): not running due to missing file on Alpine 2025-01-11 18:14:23 +02:00
Elian Doran
b2ca87d7e8
fix(docker): not running due to missing file 2025-01-11 17:59:41 +02:00
Elian Doran
25e0dc3355
fix(electron): copy dist not working due to missing lib 2025-01-11 17:04:07 +02:00
Elian Doran
a8051b06fd
chore(e2e): disable webkit for now 2025-01-11 16:36:24 +02:00
Elian Doran
e442906265
chore(e2e): fix flaky tests 2025-01-11 16:22:09 +02:00
Panagiotis Papadopoulos
6885cc1399 deps: update package-lock.json 2025-01-11 14:57:37 +01:00