Commit graph

3679 commits

Author SHA1 Message Date
David Mehren
8997dc1797
Merge pull request #1178 from hedgedoc/renovate/develop-ts-loader-9.x 2021-04-25 21:15:52 +02:00
David Mehren
0e5552de4d
Merge pull request #1190 from hedgedoc/docs/fixMkdocsLink
Docs: Fix mkdocs link
2021-04-25 21:14:45 +02:00
Yannick Bungers
5423a7396a
Merge pull request #1186 from hedgedoc/reuse/licenseTypo
Reuse: Fix typo in HedgeDoc Icon Usage Guidelines
2021-04-25 21:14:29 +02:00
Philip Molares
902038106a Gitignore: Add .env
Because the new config is done via the file `.env`, it should not be possible to include it in the git repository.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 21:12:49 +02:00
Philip Molares
be199dc490 Reuse: Fix typo in HedgeDoc Icon Usage Guidelines
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 21:09:53 +02:00
Yannick Bungers
0bad4827bf
Merge pull request #1179 from hedgedoc/util/replaceNull 2021-04-25 21:03:45 +02:00
Philip Molares
96fdc15401 Docs: Fix mkdocs link
The link that was included in the reference was surrounded by paranthesis and therefore faulty.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 20:57:13 +02:00
David Mehren
84afd48650
Merge pull request #1185 from hedgedoc/docs/darkTheme 2021-04-25 20:56:51 +02:00
Philip Molares
1dfe84be1c Reuse: Add license information for dark mode logos
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 12:54:29 +02:00
Philip Molares
a15722b864 Documentation: Add toggleable dark theme
The dark theme is mostly built on top of the mkdocs slate theme.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
Co-Authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>

(cherry picked from commit 60251d89ee)
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-25 12:50:02 +02:00
Philip Molares
38ab6dc27b NotesE2ETest: Changed test for title and description
They should not return null and that's correctly tested now.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-24 21:33:47 +02:00
Philip Molares
841ad8428d Services: Use replaceNullWithEmptyString
Add the helper method replaceNullWithEmptyString to the services, where it is needed.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-24 21:22:31 +02:00
Renovate Bot
fceb413929
Update linters
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-24 15:33:20 +00:00
Renovate Bot
a164bd889c
Update dependency ts-loader to v9.1.1
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-24 11:22:22 +00:00
Philip Molares
75466c5202 PrivateApi: Add CORS-Header for rendererOrigin
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:34:51 +02:00
Philip Molares
526ee6e506 PrivateApi: Serve under /api/private
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:34:51 +02:00
Yannick Bungers
0c2900d1c0
Merge pull request #1094 from hedgedoc/notes/deleteMedia 2021-04-22 23:18:56 +02:00
David Mehren
c9ad3ad153
Merge pull request #1168 from hedgedoc/maintenance/develop/node_16
CI: Run tests with Node.js 16 [develop]
2021-04-22 23:14:09 +02:00
Philip Molares
1f897636bb PublicApi: Add option to keep media to DELETE /notes/{note}
This adds a body to the route DELETE /notes/{note} of the public api to specify if the associated media uploads of the note should be kept or deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:13:13 +02:00
Philip Molares
6ac267a226 PrivateApi: Add option to keep media to DELETE /notes/{note}
This adds a body to the route DELETE /notes/{note} of the private api to specify if the associated media uploads of the note should be kept or deleted.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:13:13 +02:00
Philip Molares
c29ce7eed5 MediaService: Add removeNoteFromMediaUpload method
This method replaces the associated note of a media upload with null.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:13:13 +02:00
Philip Molares
e7c9a214df MediaUpload: Make note nullable
As it is possible to delete a note without also deleting the associated media uploads this needs to changed in the media upload entity, too.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:13:10 +02:00
Philip Molares
17b442aff1 Notes: Add NoteMediaDeletionDto
This is used to specify if the media uploads should be kept or deleted, when deleting a note.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 23:12:46 +02:00
David Mehren
87e0ca54e1
Merge pull request #1164 from hedgedoc/fix/revision
RevisionsService: Add missing awaits
2021-04-22 22:50:44 +02:00
David Mehren
d0aa73dfb3
Merge pull request #1170 from hedgedoc/fix/fs_backend_logging
FilesystemBackend: Fix functionContext logging
2021-04-22 22:45:38 +02:00
David Mehren
5b77cb068c
Merge pull request #1165 from hedgedoc/renovate/develop-ts-loader-9.x
Update dependency ts-loader to v9.1.0 (develop)
2021-04-22 22:44:36 +02:00
Yannick Bungers
18dafc35f4
Merge pull request #1171 from hedgedoc/fix/mockLoglevel
AppConfigMock: Use correct loglevel
2021-04-22 22:44:29 +02:00
Philip Molares
421b951a62 AppConfigMock: Use correct loglevel
Until now the app config mock used ts-loader's LogLevel instead of our own Loglevel, which is obviously wrong.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 22:23:59 +02:00
Renovate Bot
1e3b7b2dd8
Update dependency ts-loader to v9.1.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-22 20:22:10 +00:00
David Mehren
6aa85345d1
FilesystemBackend: Fix functionContext logging
This commit adds a few missing `functionContext` parameters in calls to
`this.logger` and fixes a copy-paste error in `ensureDirectory`

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 21:58:03 +02:00
David Mehren
5b886c098c
CI: Run tests with Node.js 16
Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 21:49:22 +02:00
David Mehren
d8cff8a9b1
Merge pull request #1169 from hedgedoc/tests/ensure_deleted
Media E2E tests: Add error handling for upload cleanup
2021-04-22 21:48:50 +02:00
David Mehren
a60b959a64
Media E2E tests: Add error handling for upload cleanup
Previously, `fs.rmdir` was called multiple times on the same path,
even when the path was already deleted.
This causes test failures in Node 16.

This commit extracts the cleanup code into a utility function
and ensures that no error is thrown when the given path is already deleted.

Signed-off-by: David Mehren <git@herrmehren.de>
2021-04-22 21:29:23 +02:00
David Mehren
1d993e9e38
Merge pull request #1151 from hedgedoc/renovate/develop-ts-loader-9.x 2021-04-22 18:29:45 +02:00
Philip Molares
bcd434b201 RevisionsService: Add missing awaits
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-22 18:26:19 +02:00
Philip Molares
642af48cee GithubWorkflow: Removed build on Node 10
This is not helpful anymore, because node 10 is nearly at the end of its LTS and because ts-loader 9 has node 12 as it minimum supported version and this is a key part of this application.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-20 11:39:39 +02:00
Renovate Bot
0bc51d7043
Update dependency ts-loader to v9
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-19 22:32:09 +00:00
Yannick Bungers
2c75de747f
Merge pull request #992 from hedgedoc/privateApi/me 2021-04-19 23:09:19 +02:00
Philip Molares
c3047509aa PrivateE2EMe: Add E2E test for private api /me routes
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-19 23:04:15 +02:00
Philip Molares
24ee95282d Entities: Add onDelete CASCADE to entities
To better handle deletion of entities, all necessary other entities got the option onDelete CASCADE set. So everything that does not make any sense if something else is deleted will be deleted along side of it.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-19 23:04:09 +02:00
David Mehren
51d6bd73ce
Merge pull request #1154 from hedgedoc/renovate/develop-lock-file-maintenance
Lock file maintenance (develop)
2021-04-19 22:52:10 +02:00
Renovate Bot
4ca112c4c0
Lock file maintenance
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-19 20:47:15 +00:00
David Mehren
1707b43c80 Merge pull request #1149 from hedgedoc/renovate/develop-mkdocs-material-7.x
Update dependency mkdocs-material to v7.1.2 (develop)
2021-04-19 22:45:55 +02:00
Philip Molares
5758463b07 PrivateAPI: Add me controller
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-19 18:33:09 +02:00
Philip Molares
53d29c6e8a MediaService: Change deleteFile
The former deleteFile was moved to the public apis media controller and the actual deletion functionality was moved in a separate function to be called on user deletion.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-19 18:33:09 +02:00
Philip Molares
5f886b8a27 UsersService: Add unit tests
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-19 18:33:04 +02:00
Renovate Bot
3e2ab14c35
Update dependency mkdocs-material to v7.1.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2021-04-18 22:14:30 +00:00
Philip Molares
478e25e77c UsersService: Polish methods
Add test to createUser method to ensure an already used username triggers a AlreadyInDBError.
Add debug entry if user is deleted.
Add changeDisplayName method.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-18 22:49:24 +02:00
Philip Molares
c65ef80dd5 UsersService: Add JSDoc to all methods
Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-18 22:49:24 +02:00
Philip Molares
e591a65945 UserEntity: Make userName unique
Each username should only be given once.

Signed-off-by: Philip Molares <philip.molares@udo.edu>
2021-04-18 22:49:24 +02:00