Commit Graph

398 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro
1e7d8cac9a
[ATTACHMENTS] Follow URL redirects and don't duplicate attachments 2021-09-14 13:12:57 +01:00
Diogo Peralta Cordeiro
adb6680a01
[ATTACHMENTS] Respect config for smart crop 2021-09-14 13:12:57 +01:00
Diogo Peralta Cordeiro
8f43c8b405
[AUTOGENERATED] Update auto generated code 2021-09-14 13:12:57 +01:00
Diogo Peralta Cordeiro
4fcccb1d1c
[CORE][ImageEncoder] Add width and height back in attachment entity and allow for differently sized thumbs
The strategy adopted involves predicting the thumb size as we did in v2 before having vips resize
2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro
1c9f807595
[Embed] Fix some bugs and change AttachmentEmbed::url to ::media_url 2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro
c9090e6cee
[ATTACHMENTS][GSFile] Rename ValidateAndStore functions 2021-09-14 13:12:56 +01:00
Hugo Sales
6d31945401
[ATTACHMENTS] In sendFile, check that file exists or show a custom exception 2021-09-14 13:12:56 +01:00
Hugo Sales
38cf8f8efe
[ENTITY] Change foreign key definition to new format for cover and profile_color tables 2021-09-14 13:12:56 +01:00
Diogo Peralta Cordeiro
837f644458
[UTIL][Formatting] Add twigRenderFile 2021-09-14 13:12:55 +01:00
Hugo Sales
e9a96f1c9b
[DOCUMENTATION] Add high level code walkthrough to developer docs 2021-09-14 13:12:55 +01:00
Diogo Peralta Cordeiro
8cb64ede7f
[AttachmentShowRelated] Move Attachment related to plugin 2021-09-14 13:12:55 +01:00
Hugo Sales
7509913fcf
[ENTITY] Add field size to attachments, used for quota calculations 2021-09-14 13:12:54 +01:00
Hugo Sales
29457ef50d
[UTIL] Add option for setting a file suffix on TemporaryFile constructor and add missing TemporaryFileException 2021-09-14 13:12:54 +01:00
Hugo Sales
e9b2b18093
[Avatar] Implement avatar deletion 2021-09-14 13:12:53 +01:00
Hugo Sales
2ec7059076
[AVATAR] Move avatar settings page to Avatar component 2021-09-14 13:12:53 +01:00
Diogo Peralta Cordeiro
88e5cec8fc
[ENTITY][GSActor] Fix getAvatarUrl method 2021-09-14 13:12:53 +01:00
Hugo Sales
aea8639d44
[ATTACHMENTS] Restrict thumbnail generation to allowed sizes. Defaults to only configured sizes, but can be extended with the event 'GetAllowedThumbnailSizes'. The intention is to prevent DoS attacks, since handling a thumbnail request is a relatively slow process 2021-09-14 13:12:53 +01:00
Hugo Sales
436528172c
[ATTACHMENTS] Add controller and templates for the attachment show page, which shows extra info about an attachment, such as related notes and tags 2021-09-14 13:12:53 +01:00
Hugo Sales
be91fb754d
[CORE] Typo in GSFile and slight Twig weirdness in base template 2021-09-14 13:12:52 +01:00
Hugo Sales
b1e514832b
[Embed][ENTITY] Fix embed route and use attachment_view rather than _show. Rename Entity::have to Entity::has, because grammar 2021-09-14 13:12:52 +01:00
Hugo Sales
30107de079
[Embed] Fix plugin. Only attempt to show an image, if we have one 2021-09-14 13:12:52 +01:00
Hugo Sales
2adb3c3521
[ATTACHMENTS] Add event 'AttachmentFileInfo' to allow a plugin to override the file displayed 2021-09-14 13:12:52 +01:00
Hugo Sales
708a910870
[UTIL] Fix remove affix utilities, so they only try to remove an affix if the string starts/ends with it 2021-09-14 13:12:52 +01:00
Hugo Sales
a7ef2babe6
[AUTOGENERATED] Update autogenerated code 2021-09-14 13:12:52 +01:00
Hugo Sales
7adc198a52
[ENTITY] Add meta method 'have*' to Entity base class, which checks if a field 'isset' 2021-09-14 13:12:51 +01:00
Hugo Sales
34059a8d3d
[ATTACHMENTS][EVENT] Add onHashFile event, which can be used to deduplicate files
Currently, we simply hash the contents of the file with sha256, but in the future we can use something smarter,
which could find visual feature similarity between images
2021-09-14 13:12:51 +01:00
Hugo Sales
60a9085e56
[FORMATTING] Add utilities to remove affixes from strings 2021-09-14 13:12:51 +01:00
Hugo Sales
9a7f1358c2
[ENTITY] Add utils to Attachment and AttachmentThumbnail to get the corresponding URL and html representation parameters 2021-09-14 13:12:51 +01:00
Hugo Sales
2a74dced22
[UTIL] Add TemporaryFile class, courtesy of Alexei Sorokin from v2, a class that ensures files stored in /tmp are removed, as it doesn't happen in some cases 2021-09-14 13:12:51 +01:00
Hugo Sales
94edad43d9
[UTIL] Add method to validate url 2021-09-14 13:12:23 +01:00
Hugo Sales
5c78def973
[HTTPClient] Add utility functions for all HTTP methods 2021-09-14 13:12:23 +01:00
Hugo Sales
1b8f5b7bf0
[DB] Make DB::findOneBy throw a different exception if two values are found 2021-09-14 13:12:23 +01:00
Hugo Sales
e94df546c3
[Posting] Extract and store URLs from note content. Introduce 'AttachmentStoreNew' event 2021-09-14 13:12:23 +01:00
Hugo Sales
ae0e410986
[TESTS] Fix Nickname test 2021-09-14 13:12:23 +01:00
Hugo Sales
8dff0b1d0c
[Favourite] Make twig event operate on array rather than string 2021-09-14 13:12:23 +01:00
Hugo Sales
7a90e844b7
[SECURITY][DB] Make user register 'atomic', by using a single transaction for inserting all objects, to avoid partial inserts 2021-09-14 13:12:23 +01:00
Diogo Peralta Cordeiro
3afa872cec
[UI] Use thumbnail path for thumbs 2021-09-14 13:12:22 +01:00
Hugo Sales
e1995f44ce
[ATTACHMENTS] Move thumbnail controller to core and cleanup 2021-09-14 13:12:22 +01:00
Hugo Sales
e6c6e7afd7
[AVATAR] Fix JS cropping script and save square image, in case other themes need it 2021-09-14 13:12:22 +01:00
Hugo Sales
d2bb5bba14
[ImageEncoder] Move DB::persist call to AttachmentThumbnail 2021-09-14 13:12:22 +01:00
Diogo Peralta Cordeiro
e385a9ac29
[ATTACHMENTS] Even more further refactoring
Introduce Encoder plugins Instead of abstract upload and thumb modules

Ported attachment routes. In v3 thumbnail depends on existing attachment
so route updated accordingly.
2021-09-14 13:12:18 +01:00
Diogo Peralta Cordeiro
0eaccc32fe
[ATTACHMENTS] Further refactoring
Some key points:
- Components and Plugins shouldn't extend Module directly
- Avatars should be fetched via GSActor ID, not by nickname as that isn't unique
- Avatar now is a separate Component
- Common file utilities are now to be placed in Core\GSFile, this will
  handle storage and trigger validation
- Some bug fixes
2021-09-14 13:11:51 +01:00
Hugo Sales
cdef6858ce
[ENTITY] Cache AttachmentThumbnail query result 2021-09-14 13:11:51 +01:00
Hugo Sales
65999bd183
[Poll] Move tables from core to plugin 2021-09-14 13:11:51 +01:00
Hugo Sales
716ca063d5
[ImageThumbnail] Finish image thumbnailing functionality 2021-09-14 13:11:51 +01:00
Hugo Sales
19850b5e0d
[DB] Fix bug in custom criteria format wrangling 2021-09-14 13:11:51 +01:00
Hugo Sales
4358656c55
[ImageThumbnail] Implement image resizing with Intervention/Image 2021-09-14 13:11:50 +01:00
Hugo Sales
7284c833a6
[DB] Allow DQL queries with table name rather than entity 2021-09-14 13:11:50 +01:00
Hugo Sales
0d01f1d060
[CORE] Add functionality to App\Core\Controller to get and validate GET parameters 2021-09-14 13:11:50 +01:00
Hugo Sales
5579f4fa5d
[MEDIA] Rename File to Attachment 2021-09-14 13:11:50 +01:00