43 Commits

Author SHA1 Message Date
Panagiotis Papadopoulos
8d09ff4299 fix(routes): remove unused wildcard in apiRoute "/api/options/:name/:value*"
the updateOption function that handles the req.param is just destructuring `const { name, value } = req.params;` and does nothing else with the path or any params.
The remaining parts of the wildcard (which can be accessed via req.param[0]) are just ignored here.

even with express v4, this would *always* just take and process the very first part of the path, in the exact wildcard's place, e.g.

`/api/options/locale/de` and
`/api/options/locale/de/test/whatever`
would *both* end up destructuring "value" from req.param as "de" (because it is in the exact place of the 'value' wildcard)

in express v5 the wildcard behaviour changes -> here req.param.value would return an array with the paths split into separate string.

but since the code previously regarded only the first part of the path -> we can just get rid of the wildcard and use a named route param

the only thing to keep in mind: if a request with more than one "value" is received, (e.g. `/api/options/locale/de/test/whatever`) -> since we don't have the wildcard anymore  -> this will turn to a 404.
IMHO that is actually desirable here though
2025-04-08 23:50:53 +02:00
Panagiotis Papadopoulos
3f0dbb9063 chore: fix typo in verifyRecoveryCode function name 2025-04-02 21:41:48 +02:00
SiriusXT
adcb803caa To prevent search lag when there are a large number of notes 2025-04-01 21:07:15 +08:00
SiriusXT
a7799d32b0 To prevent search lag when there are a large number of notes 2025-04-01 18:47:07 +08:00
Jin
0871d16fbc feat: 🎸 remove conflict code 2025-03-22 12:41:22 +01:00
Jin
8df1e3263b Merge branch 'develop' into feature/MFA 2025-03-22 12:35:00 +01:00
Panagiotis Papadopoulos
c120132cbb
Merge branch 'develop' into chore_eslint-fixes_src-routes 2025-03-08 17:15:53 +01:00
Panagiotis Papadopoulos
ecf1a0e4ad refactor(utils): add safeExtractMessageAndStackFromError util to remove code duplication 2025-03-08 17:07:25 +01:00
Panagiotis Papadopoulos
e3d0c53d03 chore(routes): fix no-explicit-any lint/ts error for catch blocks 2025-03-08 16:03:30 +01:00
Panagiotis Papadopoulos
d8ce385134 refactor(routes): refactor handleException and get rid of "any" type 2025-03-07 22:27:13 +01:00
Elian Doran
00e576b052
Revert "Merge pull request #1234 from TriliumNext/feature/task_list"
This reverts commit 58a8821c229898c45551da16476d44c010c345ef, reversing
changes made to 50d491b432ce811c4d5e597e952eb18a89ae6c19.
2025-03-06 23:52:01 +02:00
Elian Doran
fcd7b986aa
feat(tasks): make due date editable 2025-02-25 18:36:46 +02:00
Elian Doran
c0d3e8d834
feat(tasks): filter by parent note 2025-02-19 22:13:13 +02:00
Elian Doran
7c0b43db85
feat(tasks): mark tasks as completed 2025-02-19 19:22:38 +02:00
Elian Doran
17f9fa7e89
feat(tasks): add POST API 2025-02-18 19:30:02 +02:00
Elian Doran
98dff61305
feat(tasks): add GET API 2025-02-18 19:06:02 +02:00
perf3ct
18f5f1b759
add Swagger UI endpoint and add to router 2025-02-09 21:15:12 +00:00
Panagiotis Papadopoulos
ca2bb94200 refactor(server/utils): isElectron - replace fn with boolean
this values cannot change during runtime,
=> there is no need to have these checks
as dynamic function, instead just
export the boolean value directly
2025-01-29 10:55:53 +01:00
Panagiotis Papadopoulos
e3d89ce2a5 refactor(csrf): move csrf to own file 2025-01-16 20:14:23 +01:00
Panagiotis Papadopoulos
ea621ef8e1 chore(prettier): fix code style 2025-01-12 13:30:02 +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
Elian Doran
4cbb529fd4
chore(prettier): fix all files 2025-01-09 18:07:02 +02:00
Elian Doran
2eb4d4fb66
Merge remote-tracking branch 'origin/develop' into feature/MFA 2024-12-24 13:30:37 +02:00
Elian Doran
f96a3ce32e
fix(server): HTTP streaming notes with unicode names (closes #757) 2024-12-13 22:05:05 +02:00
Elian Doran
5190b28d3c
chore(types): adapt to new express type definitions 2024-12-10 22:35:23 +02:00
Elian Doran
e65d4cdfbf
client: Rename endpoint to codeblock-themes 2024-10-27 21:40:22 +02:00
Elian Doran
7354fb5b4a
client,server: List syntax highlighting themes 2024-10-27 12:41:53 +02:00
chesspro13
9dd185e37e
Removed unused files/code/imports/comments. 2024-09-07 14:25:48 -07:00
chesspro13
df3cbf85e1
Removed references to disconnecting OpenID Accounts. For now. 2024-09-07 14:12:27 -07:00
chesspro13
c74da18e23
OAuth working 2024-09-07 13:18:47 -07:00
chesspro13
9c748f326a
Ported from branch OIDC 2024-09-07 10:21:41 -07:00
SiriusXT
898afb7ed7 Add revision number limit 2024-09-04 08:41:17 +00:00
Elian Doran
317505484e
integration-test: Set up system for resetting in-memory DB 2024-08-15 00:06:37 +03:00
Elian Doran
51afb63e25
server: Add endpoint to get list of locales 2024-08-11 07:36:09 +03:00
Elian Doran
212d61c1d2
server: Fix missing .js import for route-interface 2024-07-24 20:23:05 +03:00
Elian Doran
1dc894e279
server-esm: Fix the remaining compilation errors 2024-07-18 21:56:20 +03:00
Elian Doran
55eecb0f61
server-esm: Change export object to export default object 2024-07-18 21:42:44 +03:00
Elian Doran
2750df04a3
server-esm: Change simple library import statements 2024-07-18 21:37:45 +03:00
Elian Doran
35d11cc0d2
server-esm: Change simple local import statements 2024-07-18 21:35:17 +03:00
Elian Doran
8fb67c9766
server-esm: Normalize quotes in require imports 2024-07-18 21:28:51 +03:00
Elian Doran
0d700d6951
server-ts: Address review 2024-04-17 23:00:02 +03:00
Elian Doran
dededcd303
server-ts: Port routes/routes 2024-04-11 23:00:24 +03:00