Commit Graph

396 Commits

Author SHA1 Message Date
Diogo Peralta Cordeiro 4397d12fa4 [AUTOGENERATED] Update auto generated code 2021-05-02 00:00:03 +01:00
Diogo Peralta Cordeiro c58d7e470a [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-05-02 00:00:02 +01:00
Diogo Peralta Cordeiro 5a40d1f3e3 [Embed] Fix some bugs and change AttachmentEmbed::url to ::media_url 2021-05-01 23:58:49 +01:00
Diogo Peralta Cordeiro ced6e236ce [ATTACHMENTS][GSFile] Rename ValidateAndStore functions 2021-05-01 23:57:51 +01:00
Hugo Sales 650bfec699 [ATTACHMENTS] In sendFile, check that file exists or show a custom exception 2021-05-01 13:02:14 +00:00
Hugo Sales 6d842d60c5 [ENTITY] Change foreign key definition to new format for cover and profile_color tables 2021-05-01 12:50:49 +00:00
Diogo Peralta Cordeiro 0629c1434d [UTIL][Formatting] Add twigRenderFile 2021-04-30 23:08:08 +01:00
Hugo Sales 120571fa42 [DOCUMENTATION] Add high level code walkthrough to developer docs 2021-04-30 23:08:08 +01:00
Diogo Peralta Cordeiro c2f6665cce [AttachmentShowRelated] Move Attachment related to plugin 2021-04-30 23:08:08 +01:00
Hugo Sales 93e1e4b7a9 [ENTITY] Add field size to attachments, used for quota calculations 2021-04-30 23:08:08 +01:00
Hugo Sales e5ee31a2fe [UTIL] Add option for setting a file suffix on TemporaryFile constructor and add missing TemporaryFileException 2021-04-30 23:08:08 +01:00
Hugo Sales c57a8481b1 [Avatar] Implement avatar deletion 2021-04-29 20:36:50 +00:00
Hugo Sales ec0c551bb3 [AVATAR] Move avatar settings page to Avatar component 2021-04-29 18:14:49 +00:00
Diogo Peralta Cordeiro 55c4ad40cd [ENTITY][GSActor] Fix getAvatarUrl method 2021-04-29 17:42:06 +01:00
Hugo Sales bb56b24d8f [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-04-28 21:53:02 +00:00
Hugo Sales f264cd6125 [ATTACHMENTS] Add controller and templates for the attachment show page, which shows extra info about an attachment, such as related notes and tags 2021-04-28 21:25:35 +00:00
Hugo Sales d49de9d35e [CORE] Typo in GSFile and slight Twig weirdness in base template 2021-04-28 20:16:59 +00:00
Hugo Sales 7f765c530e [Embed][ENTITY] Fix embed route and use attachment_view rather than _show. Rename Entity::have to Entity::has, because grammar 2021-04-28 20:15:43 +00:00
Hugo Sales e699824b1d [Embed] Fix plugin. Only attempt to show an image, if we have one 2021-04-28 15:03:17 +00:00
Hugo Sales 6da8cf7f14 [ATTACHMENTS] Add event 'AttachmentFileInfo' to allow a plugin to override the file displayed 2021-04-28 15:01:40 +00:00
Hugo Sales e08767cec0 [UTIL] Fix remove affix utilities, so they only try to remove an affix if the string starts/ends with it 2021-04-28 15:00:04 +00:00
Hugo Sales 495e66f4ae [AUTOGENERATED] Update autogenerated code 2021-04-27 21:24:48 +00:00
Hugo Sales c6389c63b8 [ENTITY] Add meta method 'have*' to Entity base class, which checks if a field 'isset' 2021-04-27 20:56:13 +00:00
Hugo Sales f388554166 [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-04-27 20:53:59 +00:00
Hugo Sales b4ad396cd1 [FORMATTING] Add utilities to remove affixes from strings 2021-04-27 20:52:12 +00:00
Hugo Sales 075b495f5a [ENTITY] Add utils to Attachment and AttachmentThumbnail to get the corresponding URL and html representation parameters 2021-04-27 18:10:18 +00:00
Hugo Sales 9b3ccac246 [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-04-27 18:10:18 +00:00
Hugo Sales 1df7be7e8a [UTIL] Add method to validate url 2021-04-27 18:10:18 +00:00
Hugo Sales 792a9f097c [HTTPClient] Add utility functions for all HTTP methods 2021-04-27 18:10:18 +00:00
Hugo Sales 4649ee9e71 [DB] Make DB::findOneBy throw a different exception if two values are found 2021-04-27 18:10:18 +00:00
Hugo Sales c1db9bd0a3 [Posting] Extract and store URLs from note content. Introduce 'AttachmentStoreNew' event 2021-04-25 21:20:28 +00:00
Hugo Sales cc47cda3d1 [TESTS] Fix Nickname test 2021-04-23 15:38:26 +00:00
Hugo Sales 1503c98f26 [Favourite] Make twig event operate on array rather than string 2021-04-23 12:55:42 +00:00
Hugo Sales b82658e345 [SECURITY][DB] Make user register 'atomic', by using a single transaction for inserting all objects, to avoid partial inserts 2021-04-23 12:54:25 +00:00
Diogo Peralta Cordeiro 9814baf192 [UI] Use thumbnail path for thumbs 2021-04-19 13:22:50 +01:00
Hugo Sales 5ec7717fa1 [ATTACHMENTS] Move thumbnail controller to core and cleanup 2021-04-19 13:22:50 +01:00
Hugo Sales e105889a59 [AVATAR] Fix JS cropping script and save square image, in case other themes need it 2021-04-19 13:22:50 +01:00
Hugo Sales c37a75cf7b [ImageEncoder] Move DB::persist call to AttachmentThumbnail 2021-04-19 13:22:40 +01:00
Diogo Peralta Cordeiro 2f137f8b44 [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-04-19 13:22:04 +01:00
Diogo Peralta Cordeiro 0f52638a80 [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-04-19 13:21:32 +01:00
Hugo Sales bbc2fe1b5a [ENTITY] Cache AttachmentThumbnail query result 2021-04-16 20:28:39 +01:00
Hugo Sales 45a894c953 [Poll] Move tables from core to plugin 2021-04-16 20:28:39 +01:00
Hugo Sales c8915df31e [ImageThumbnail] Finish image thumbnailing functionality 2021-04-16 20:28:39 +01:00
Hugo Sales f6dea6e162 [DB] Fix bug in custom criteria format wrangling 2021-04-16 20:28:39 +01:00
Hugo Sales acf5bd1ff5 [ImageThumbnail] Implement image resizing with Intervention/Image 2021-04-16 20:28:39 +01:00
Hugo Sales 2f65311ae6 [DB] Allow DQL queries with table name rather than entity 2021-04-16 20:28:39 +01:00
Hugo Sales cadd48922d [CORE] Add functionality to App\Core\Controller to get and validate GET parameters 2021-04-16 20:28:39 +01:00
Hugo Sales b639ce906c [MEDIA] Rename File to Attachment 2021-04-16 20:28:39 +01:00
Hugo Sales d6414e51a2 [CORE] Rename NoteScope to VisibilityScope, as it will be used for attachment visbility too 2021-04-16 20:28:39 +01:00
Hugo Sales 1fda65bc3d [DB] Add table map which allows using table names rather than entities in Doctrine operations 2021-04-16 20:28:39 +01:00