Commit Graph

164 Commits

Author SHA1 Message Date
Hugo Sales b72fcd2a05
[TESTS] Add code coverage annotations to entities 2021-08-18 17:35:10 +01:00
Hugo Sales 20901d26df
[Note] Fix scope check for group notes, move away from SQL, to DQL 2021-08-18 17:35:10 +01:00
Hugo Sales 7320c6834f
[UI][Attachment] Use Attachment methods to get the proper URL, rather than crafting it in a template 2021-08-18 17:35:09 +01:00
Diogo Peralta Cordeiro f7c426e81c
[ENTITY][Link] self urls can't be considered a remote url 2021-08-18 14:34:49 +01:00
Diogo Peralta Cordeiro d4ad0cc3d4
[DOCS][Developer] Update storage documentation 2021-08-17 23:37:19 +01:00
Hugo Sales 1e8beefb07
[PLUGINS][ENTITY][Cover][ProfileColor] Clean up after interns and move entity defintions to be inside the corresponding plugin, rather than in core 2021-08-16 17:20:33 +01:00
Hugo Sales 33bf99cfda
[ENTITY][Attachment] Raise mimetype max length to 64 characters and ensure we don't attempt to store more than that 2021-08-14 21:47:49 +01:00
Diogo Peralta Cordeiro 2e3ab5bdfb
[ENTITY][Link] Sometimes URLs don't work, handle that 2021-08-14 17:08:11 +01:00
Diogo Peralta Cordeiro 7b3ca428e9
[ATTACHMENT] Some attachments don't have thumbnails and that's okay 2021-08-14 17:04:58 +01:00
Diogo Peralta Cordeiro 4c1fc40c43
[ENTITY][Note] Add getter for note links 2021-08-14 17:04:57 +01:00
Diogo Peralta Cordeiro c381e58d33
[ENTITY] Refactor RemoteURL entities to Link
RemoteURL was being an awfully confusing term.
2021-08-14 17:04:51 +01:00
Diogo Peralta Cordeiro 3019048585
[Posting] Re-add original file to attachment on upload, if it was previously removed 2021-08-14 17:00:52 +01:00
Diogo Peralta Cordeiro 9781ddc8e0
[AttachmentToNote][Attachment] Add title getter to Attachment 2021-08-14 17:00:52 +01:00
Diogo Peralta Cordeiro d13da61d30
[StoreRemoteMedia] Implement the first version of it in v3 2021-08-14 17:00:51 +01:00
Diogo Peralta Cordeiro 91666f7d61
[RemoteURLToAttachment] Fix primary key, relation is: One Attachment Has Many URLs, One URL Has One Attachment 2021-08-14 17:00:51 +01:00
Diogo Peralta Cordeiro b20a4c89fb
[Attachment] Allow to delete the associated file 2021-08-14 17:00:50 +01:00
Diogo Peralta Cordeiro aec8521e4b
[ENTITY][Posting] Remove GSActorToRemoteURL, Fix URL database store 2021-08-14 17:00:49 +01:00
Diogo Peralta Cordeiro 32ad5dbd74
[ENTITY] Split Attachment in various new entities
Remove Attachment Scope
Fixed some minor bugs

Scope will be implemented later in v3. It doesn't make sense to have
the scope handling being per attachment. Different actors can post
the same attachment with different scopes. The attachment controller
will assume the highest level of scope applied to the attachment and
the rest will be handled at the note level.

Motivation:
* Remove title from attachment, as it's part of the relation between attachment and note.
* Remove actor from attachment, many actors may publish the same attachment.
* Remove is_local from attachment,  as it's part of the relation between attachment and note.
* Remove remote_url from attachment, different urls can return the same attachment.

Addition:
* Attachment now has a lives attribute,  it's a reference counter with a nicer name
* GSActorToAttachment
* GSActorToRemoteURL
* RemoteURL
* RemoteURLToNote
* RemoteURLToAttachment
* AttachmentToNote now has a title attribute
2021-08-14 17:00:46 +01:00
Hugo Sales 420b3f4aeb
[DB][Attachments] Use count function rathar than fetch and count, rename to refCount, rather than countDepencies 2021-08-14 16:13:01 +01:00
Hugo Sales 66b39d3607
[ENTITY] Add JsonSerializable interface to Entity base class and implement it for the Note class 2021-08-14 16:13:00 +01:00
Diogo Peralta Cordeiro 67f5421691
[ATTACHMENTS] Add dependencies counter 2021-08-05 14:44:05 +01:00
Diogo Peralta Cordeiro 5896f5bb82
[Avatar] Move entity from core to component 2021-08-05 03:23:05 +01:00
Hugo Sales 05e10589c3
[ENTITY] Refactor LocalUser::changePassword for easier use 2021-08-04 20:11:47 +00:00
Hugo Sales b89368bf6a
[AUTOGENERATED] Update entity fields for ResetPasswordRequest entity 2021-08-03 19:23:02 +00:00
Hugo Sales 56481c8289
[CORE] Add passowrd reset and forgot password functionality 2021-08-03 19:22:54 +00:00
Hugo Sales a01914ddac
[ENTITY][LocalUser] Add method 'findByNicknameOrEmail' 2021-08-03 19:22:16 +00:00
Hugo Sales e196a3577d
[ENTITY] Remove 'normalized_nickname' field from GSActor as that feature will be moved to a plugin 2021-08-03 19:15:30 +00:00
Hugo Sales 4f6f4aa512
[ENTITY] Fix foreign key type in Cover entity, as found by tests 2021-08-03 19:13:27 +00:00
Diogo Peralta Cordeiro 86e92fedc2
[MEDIA][Thumbnail] Fix non-instantiated variable 2021-07-26 21:19:40 +01:00
Diogo Peralta Cordeiro cc0ef73799 [MEDIA][AttachmentThumbnail] Add mimetype to Entity 2021-07-22 21:17:23 +01:00
Diogo Peralta Cordeiro 832a5c0bd9 [Media] Support any kind of thumbnails in the Core
Sanitize Attachments instead of Validate (part 1)
Ensure the intended filetypes and mimetypes during Vips conversions (part 1)
Various bug fixes
2021-07-22 21:10:45 +01:00
Diogo Peralta Cordeiro 143ecea376 [Media] File quota should be triggered by the Core 2021-07-22 21:10:45 +01:00
Diogo Peralta Cordeiro aada96beb7 [MEDIA] We need permissions to run chmod in directories
It's better to have in the filename data that we couldnt't otherwise rapidly retrieve
2021-07-22 12:32:52 +01:00
Diogo Peralta Cordeiro 218bec1826 [MEDIA] Fix database misses on thumbnail retrieval
We were storing the real scaling values instead of the predictions, but the core is never able to pre-compute the real values generated by the encoding plugins so, we have to rely on our own aproximation function ported from v2
2021-07-20 23:47:27 +01:00
Diogo Peralta Cordeiro 4d2131808a [FILE][TemporaryFile] Fix various issues now that we also have Symfony's file abstractions 2021-07-20 23:46:18 +01:00
Hugo Sales eecef99372 [TESTS] Raise test coverage for App\Controller\Network to 100% and fixup related code 2021-05-23 19:56:45 +00:00
Hugo Sales 5f9b61f4bf [AUTOGENERATED] Update autogenerated code 2021-05-05 16:03:03 +00:00
Hugo Sales 84399a76e3 [ENTITY] Add 'normalized_nickname' to GSActor, the result of Nickname::normalize, so we can make sure we don't have very similar nicknames duplicated 2021-05-05 12:46:08 +00:00
Hugo Sales 39ac043d59 [ENTITY] Add uniqueness constraint to Attachment::file_hash 2021-05-02 15:48:33 +00:00
Hugo Sales b99fab00e9 [UTILS][TemporaryFile] Change way TemporaryFile takes arguments and it's internal implementation 2021-05-02 15:48:33 +00:00
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
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
Hugo Sales 93e1e4b7a9 [ENTITY] Add field size to attachments, used for quota calculations 2021-04-30 23:08:08 +01:00
Hugo Sales c57a8481b1 [Avatar] Implement avatar deletion 2021-04-29 20:36:50 +00:00
Diogo Peralta Cordeiro 55c4ad40cd [ENTITY][GSActor] Fix getAvatarUrl method 2021-04-29 17:42:06 +01: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 495e66f4ae [AUTOGENERATED] Update autogenerated code 2021-04-27 21:24:48 +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 e105889a59 [AVATAR] Fix JS cropping script and save square image, in case other themes need it 2021-04-19 13:22:50 +01:00