Commit graph

828 commits

Author SHA1 Message Date
Philip Molares
a7c3d06216
Config: Add rendererOrigin and maxDocumentLength to AppConfig
These are used in the /config private API call.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 21:00:55 +01:00
Philip Molares
22081756b0
Config: Add identifier to all multi auth provider to AuthConfig
These are used in the /config private API call and needed to distinguish with which of the multiple auth providers a login should occur.
This also fixes the types of the multiple auth provider arrays to something that works, as `[{}]` specifics exactly on object in an array.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 21:07:43 +01:00
Philip Molares
e3f1d1b0f4
Config: Create new config mocks for tests
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 21:12:48 +01:00
Philip Molares
64846eb641
Config: Add two new Subconfigs
CustomizationConfig holds all possible customization configs.
ExternalConfig holds external services that may be configured.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 21:10:16 +01:00
Philip Molares
c6e341aab9
Config: Extend AppConfig mock
This is now more in line what you would get from the regular config code

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-02 10:49:39 +01:00
Philip Molares
c1a9eee6a4
Config: Move config mocks in own folder
To clean up the config folder, all mocks are now in it's own folder.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 21:12:01 +01:00
Philip Molares
4dc18c01fb
Utils: Extract getServerVersionFromPackageJson into own file
We need this function in at least on other part of the application so extracting it into an util file was only logical.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-01 20:52:46 +01:00
Philip Molares
4aca8ada4c
NotesE2ETest: Add GET /api/v2/notes/{note}/media test
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 16:54:24 +01:00
Philip Molares
935d5cd548
PublicApi: Add GET /api/v2/notes/{note}/media
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 16:53:04 +01:00
Philip Molares
890de2dea1
MediaService: Add listUploadsByNote method
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 16:47:52 +01:00
Philip Molares
53f5093630
Docs: Add more documentation to the public api
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 12:10:46 +01:00
Philip Molares
0e44f545a1
Docs: Add description for common http codes
These are the descriptions for all 401, 403, 404 and 204 HTTP responses in HedgeDoc.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 12:09:50 +01:00
Philip Molares
47ca8be78b
Docs: Add ApiProperty to all Dtos
This makes it possible for the autogenerated openapi file to contain all the dtos instead of nothing.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-19 12:08:34 +01:00
Renovate Bot
3f4f5936cb
Update dependency @nestjs/swagger to v4.8.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-19 14:43:34 +00:00
Philip Molares
3594d904f7
PrivateE2E: Add history test
Test the /me/history route in the private API.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-04 10:20:58 +01:00
Philip Molares
29dbf0b657
PrivateAPI: Add history controller
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-03 15:25:11 +01:00
Philip Molares
b872694158
HistoryService: Add deleteHistory method
This method deletes all history entries of a user.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-03 15:23:45 +01:00
Renovate Bot
8273d8a5b9
Update dependency @types/jest to v26.0.21
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-17 16:05:02 +00:00
Renovate Bot
14e3035e96
Update dependency ts-jest to v26.5.4
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-17 13:46:03 +00:00
Renovate Bot
dc825bc200
Update dependency @types/node to v13.13.47
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 22:49:00 +00:00
Philip Molares
6e29ffba65
MediaService: Remove allowedMimeType application/pdf
Uploading PDFs does not work with imgur and therefore HedgeDoc should not offer that.

See #533

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-15 22:41:40 +01:00
Renovate Bot
96396ea237
Update linters to v4.18.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 19:22:12 +00:00
Yannick Bungers
f47d85b301
Add GET /me/media
Returns all media files uploaded by the authenticated user.

Signed-off-by: Yannick Bungers <git@innay.de>
2021-03-14 17:47:16 +01:00
Philip Molares
7a7b3d3a50
AppConfig: Fix bug in the schema of forbiddenNoteIds
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-14 17:54:50 +01:00
Renovate Bot
d09bbf661d
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-15 07:54:51 +00:00
Renovate Bot
981aecaa99
Update dependency ts-loader to v8.0.18
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:52:33 +00:00
Renovate Bot
4942b4b922
Update dependency @azure/storage-blob to v12.5.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:49:35 +00:00
Renovate Bot
793ab84e0f
Update dependency @types/node to v13.13.46
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:46:28 +00:00
Renovate Bot
9d192567e5
Update NestJS packages
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 17:42:57 +00:00
Renovate Bot
45a0bae1e8
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 16:21:22 +00:00
Renovate Bot
10835b53bd
Update dependency mkdocs-material to v7.0.6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-14 14:36:58 +00:00
Philip Molares
50d950c5f2
PublicE2E: Add test for GET /me/history/{note} in me.e2e-spec.ts
add test for GET /me/history/{note}
add error cases to PUT /me/history/{note} and DELETE /me/history/{note}
activate missing test GET /me/notes/

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:04:06 +01:00
Philip Molares
82ef4a10cb
PublicAPI: Add /me/history/:note
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:01:43 +01:00
Philip Molares
521ddc36c6
HistoryService: Add unit test for getEntryByNoteIdOrAlias
Also add extra test to deleteHistoryEntry

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 12:01:04 +01:00
Philip Molares
6ed686e657
HistoryService: Add JSDocs for all methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 11:59:07 +01:00
Philip Molares
66e2340009
NotesService: Add e2e tests for forbidden note alias
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:24:17 +01:00
Philip Molares
54d0aa2197
NotesService: Add unit tests for forbidden note alias
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:23:52 +01:00
Philip Molares
c82f317ef0
NotesService: Check if note alias is forbidden
If the note alias is forbidden return a BadRequest.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:21:31 +01:00
Philip Molares
dbbee13913
Errors: Add ForbiddenIdError
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:16:50 +01:00
Philip Molares
966f5ee2fe
Config: Add forbiddenNoteIds to AppConfig
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-20 22:15:04 +01:00
Renovate Bot
2a83c9b2ac
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:36:19 +00:00
Renovate Bot
68fdfebc23
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:23:35 +00:00
Renovate Bot
2abc81134d
Update dependency typescript to v4.2.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:16:23 +00:00
Renovate Bot
aeda6fb577
Update dependency file-type to v16.3.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 21:16:11 +00:00
Renovate Bot
8bbc89bed2
Update dependency mkdocs-material to v7.0.5
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-07 19:04:16 +00:00
Philip Molares
bb6d34c88c
Docs: Add Azure, Filesystem, Imgur and S3
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-28 17:46:00 +01:00
Philip Molares
0ac88439ea
Fix compilation with ts-node
ts-node by default does not respect the `files` setting in `tsconfig.json`
and therefore does not respect the d.ts file under `types/`.

This commit adds an explicit `typeRoots` option, as recommended by
https://github.com/TypeStrong/ts-node#help-my-types-are-missing

Fixes #989

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-03-05 00:37:35 +01:00
Renovate Bot
e1cf539b1c
Update dependency ts-jest to v26.5.3
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-03-04 08:30:33 +00:00
Renovate Bot
4e532a2c5a
Pin dependencies
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-02-27 22:12:19 +00:00
Philip Molares
b2008ae734
AppModule: Add reminder to remove synchronize
This auto creates schema on startup and is not intended for production use
See https://typeorm.io/#/connection-options/common-connection-options

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-02-27 22:58:34 +01:00