Commit Graph

241 Commits

Author SHA1 Message Date
Hugo Sales 4e30e5aad9
[TOOLS] Fix all issues found by PHPStan level 2 2021-09-14 13:13:44 +01:00
Hugo Sales add8f4a52f
[TOOLS] Fix all errors found by PHPStan level 1 2021-09-14 13:13:42 +01:00
Hugo Sales eb833b62e2
[TOOLS] Fix all level 0 errors found by PHPStan and move constant definition to bootstrap file 2021-09-14 13:13:42 +01:00
Hugo Sales 4916c8cbda
[CONTROLLER][AdminPanel] Add missing Exception import 2021-09-14 13:13:41 +01:00
Diogo Peralta Cordeiro e4aa3ae968
[NOTE] Add route and controller 2021-09-14 13:13:37 +01:00
Diogo Peralta Cordeiro 2a3db65216
[CONTROLLER][Attachment] Some attachments may not have dimensions 2021-09-14 13:13:34 +01:00
Hugo Sales 458b6d0009
[UI] Rename all forms to more specific names, to avoid form name collisions 2021-09-14 13:13:33 +01:00
Hugo Sales 6799052ff5
[ATTACHMENTS] Ensure thumbnail dimensions are bounded and change way cropping is implemented 2021-09-14 13:13:32 +01:00
Hugo Sales e2e6c7a5bf
[TESTS] Hot-fix Security controller tests, broken with ongoing form rendering changes 2021-09-14 13:13:30 +01:00
Eliseu Amaro 87d7318de5
[CONTROLLER][SECURITY] Added class names. Help labels for each form element. Each form element now has a proper block prefix (the resulting HTML won't simply concatenate the form's name to the element's label). 2021-09-14 13:13:30 +01:00
Hugo Sales 3843348c1b
[CONTROLLER][Attachment] Small refactor and add testing annotation 2021-09-14 13:13:28 +01:00
Diogo Peralta Cordeiro 968e3431e1
[Attachment] Sometimes we can't provide download of original file 2021-09-14 13:13:26 +01:00
Diogo Peralta Cordeiro 3f61537140
[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-09-14 13:13:24 +01:00
Hugo Sales 061a85d6b3
[EVENTS] Change FormatNoteList do separate in and out arguments
This is necessary due to some weird problem which I wasn't able to figure out (but which doesn't matter)
that somehow causes the event to be called twice during testing, and thus the function was exploding
2021-09-14 13:13:23 +01:00
Hugo Sales b5de80303a
[TEST] Raise test coverage for UserPanel to 100% 2021-09-14 13:13:23 +01:00
Hugo Sales 480665afc8
[CONTROLLER][UserPanel] Finish implementation of ::notifications so it actually saves the values in the database 2021-09-14 13:13:23 +01:00
Hugo Sales cdf3426567
[CONTROLLR][UserPanel][PLUGINS] Add submit button to notification settings for each transport 2021-09-14 13:13:23 +01:00
Hugo Sales afbcb179b2
[CONTROLLER][AdminPanel] Further ensure form validity 2021-09-14 13:13:23 +01:00
Hugo Sales 1b623a85ae
[UTIL][FormFields] Move FormFields class to Util\Form namespace 2021-09-14 13:13:22 +01:00
Hugo Sales 0ae67d96ea
[TESTS] Raise test coverage for AdminPanel to 100% 2021-09-14 13:13:19 +01:00
Diogo Peralta Cordeiro b77e35ef09
[SECURITY] Do not require email when in development 2021-09-14 13:13:19 +01:00
Hugo Sales fe7c2b5115
[TESTS] Raise test coverage for AdminPanel controller to 100% 2021-09-14 13:13:19 +01:00
Hugo Sales e0a0df502e
[TESTS] Raise test coverage for Attachment controller to 100% 2021-09-14 13:13:19 +01:00
Hugo Sales dfc97d2607
[TESTS] Raise test coverage for Controller/Security to 100% 2021-09-14 13:13:18 +01:00
Hugo Sales 8139a21eb9
[TESTS] Add coverage ignore to TemplateController and ResetPassword (as it requires sending emails) 2021-09-14 13:13:18 +01:00
Hugo Sales 518995d155
[CONTROLLER][Attachment] Assert that the supplied is positive and add documentation 2021-09-14 13:13:17 +01:00
Hugo Sales 0c54a3297f
[UTIL] Add a class that defines commonly used form fields 2021-09-14 13:13:17 +01:00
Hugo Sales ccd5ebf8e4
[CORE] Add passowrd reset and forgot password functionality 2021-09-14 13:13:17 +01:00
Hugo Sales 769fff2448
[CORE][SECURITY][EMAIL] Move email confirmation functionality to it's own static wrapper, in preparation for adding password reset functionality 2021-09-14 13:13:17 +01:00
Hugo Sales e27823ae6c
[CONTROLLER][Security] Refactor and make clearer errors with duplicate nicknames and emails. Return notes as a callable, since they're not used in the default template, in the login and register pages 2021-09-14 13:13:17 +01:00
Hugo Sales 1c09aefd5a
[CONFIG] Make password length limits configurable 2021-09-14 13:13:14 +01:00
Eliseu Amaro 6dd0292397
[SETTINGS][ROUTES][CONTROLLER] Settings overhaul, refactoring to accommodate new global settings view. WIP, component settings aren't shown at the moment.
Signed-off-by: Eliseu Amaro <mail@eliseuama.ro>
2021-09-14 13:13:12 +01:00
Diogo Peralta Cordeiro 861732176e
[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-09-14 13:13:03 +01:00
Hugo Sales 74f477489b
[TESTS] Raise test coverage for App\Controller\Network to 100% and fixup related code 2021-09-14 13:13:02 +01:00
Hugo Sales bd249b508b
[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-09-14 13:12:59 +01:00
Diogo Peralta Cordeiro 091f4b5194
[ATTACHMENTS] Do not create thumbnails for attachments with mimetype different from 'image|video' 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 8cb64ede7f
[AttachmentShowRelated] Move Attachment related to plugin 2021-09-14 13:12:55 +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 2adb3c3521
[ATTACHMENTS] Add event 'AttachmentFileInfo' to allow a plugin to override the file displayed 2021-09-14 13:12:52 +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
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 5579f4fa5d
[MEDIA] Rename File to Attachment 2021-09-14 13:11:50 +01:00
Hugo Sales dc5bdfa1fb
[CORE] Rename NoteScope to VisibilityScope, as it will be used for attachment visbility too 2021-09-14 13:11:50 +01:00
Hugo Sales 539f1861a6
[NETWORK] Fix big brain bug 2021-09-14 13:10:55 +01:00
Hugo Sales faa362e2e2
[DB] Remove unique constraint from GSActor.nickname and fix register and related functionality 2021-09-14 13:10:23 +01:00
Hugo Sales 78548365da
[WEB] Fix translations and small inconsistency when opening on web 2021-09-14 13:10:23 +01:00
Daniel f04923405f
[REVERSEFAV] Added reverse favorourites stream/template 2021-09-14 13:10:19 +01:00
João Brandão 5516a77b33
[UI][TIMELINES] Refactored query for public stream 2021-09-14 13:10:19 +01:00
Angelo D. Moura fe170ff508
[Directory] Finished implementing groups stream using Directory plugin 2021-09-14 13:10:18 +01:00
Angelo D. Moura 098fdb3361
[Directory] Changed the route so the plugin Directory doesn't take over - query is not working for some reason 2021-09-14 13:10:18 +01:00
Angelo D. Moura eb1ef4dd0f
[Directory] Added the route, controller and a blank template file - something is broken 2021-09-14 13:10:18 +01:00
Angelo D. Moura 4f85efa071
[Directory] Actors are now organized by nickname 2021-09-14 13:10:18 +01:00
Angelo D. Moura 505e60d89f
[Directory] Actors are no longer related with notes, and the logged in user now shows on the stream 2021-09-14 13:10:18 +01:00
Angelo D. Moura 0c5941f515
[Directory] Almost finishied creating the /actors stream - problems with the css files 2021-09-14 13:10:17 +01:00
Angelo D. Moura 517cba3510
[Directory] Add the route, controller function, and blank template file 2021-09-14 13:10:17 +01:00
Hugo Sales 460712e15e
[GIT] Change my email to the new one in all files and bump copyright year 2021-09-14 13:06:56 +01:00
Hugo Sales fc015c6fdf
[NETWORK][TreeNotes] Add TreeNotes plugin which takes over the responsibility of displaying a conversation as a tree, in order to reduce the number of queries 2021-09-14 13:06:56 +01:00
Hugo Sales e8feb2ae84
[DOCUMENTATION][REFACTOR] Add documentation to all flagged function and do some small cleanup 2021-09-14 13:06:55 +01:00
Hugo Sales 1949e0b987
[EVENT] Rename event names to camel case to make finding handlers easier 2021-09-14 13:06:55 +01:00
Hugo Sales 0b759da780
[REGISTER] Add self follow when registering, fixing the '-1 followers' bug 2021-09-14 13:06:54 +01:00
Hugo Sales 089c710711
[SETTINGS][NOTIFICATIONS] Fix error when displaying the user notification settings page 2021-09-14 13:06:54 +01:00
Hugo Sales be324bb390
[CONTROLLER] Fix use of undefined variable 2021-09-14 13:06:54 +01:00
Hugo Sales e949dd654a
[CONFIG] Various fixes to use new configuration format 2021-09-14 13:06:54 +01:00
Hugo Sales 4c15271d36
[UI] Display error when submitted form is invalid 2021-09-14 13:06:51 +01:00
Hugo Sales b906dde059
[EXCEPTION][UI][UX] Add RedirectException, which can be thrown anywhere to redirect somewhere, and an exception handler 2021-09-14 13:06:51 +01:00
rainydaysavings 492360ceeb
[CONTROLLER][ROUTE] Favourites page initial query implementation and routing 2021-09-14 13:06:50 +01:00
Hugo Sales 55466143f2
[UI][FEED] Fix scope in timelines; major rewrite of home timeline query, still missing scoping and paging 2021-09-14 13:06:49 +01:00
rainydaysavings 413247d344
[CONTROLLER] Replies and network queries implemented 2021-09-14 13:06:47 +01:00
rainydaysavings 04f43a9d37
[Controller] Attempting to fix home timeline query 2021-09-14 13:06:46 +01:00
Hugo Sales 459f0bf41f
[CACHE] Fix bug in list caching 2021-09-14 13:06:45 +01:00
rainydaysavings d08757d0a4
[CONTROLLER] Home timeline controller work 2021-09-14 13:06:44 +01:00
Hugo Sales 38cfec8593
[UI][TWIG] Small UI cleanup and change twig 'active' function to check for starts with, rather than equals 2021-09-14 13:05:58 +01:00
Hugo Sales 6ed89c77f4
[UI][NOTE] Post and see attachments 2021-09-14 13:05:57 +01:00
Hugo Sales 9649bec01e
[MEDIA][CACHE] Cache avatar queries and delete stale values; small refactoring 2021-09-14 13:05:57 +01:00
Hugo Sales de22f18abf
[SECURITY] Fix error in user registering where password wasn't hashed 2021-09-14 13:05:57 +01:00
Hugo Sales 2486eb1949
[UI][ACCOUNT][SETTINGS] Hack to fix error related to phone number, until a solution is found upstream 2021-09-14 13:05:57 +01:00
Hugo Sales 7e4138399c
[UI][FAQ] Fix static pages 2021-09-14 13:05:56 +01:00
Hugo Sales 7f1ce816ae
[UserPanel] Fix upload of avatar 2021-09-14 13:05:55 +01:00
Hugo Sales 72876fe8dc
[MODULE][Posting] Add Posting module, which handles notice posting 2021-09-14 13:05:55 +01:00
Hugo Sales eb138ebdae
[STREAM][NetworkPublic] Add skeleton of public timeline and posting 2021-09-14 13:05:54 +01:00
Hugo Sales 8716d700a6
[CORE][DB] Fix uses of db tables after previous restructure 2021-09-14 13:05:53 +01:00
Hugo Sales 08e5b313ce
[SECURITY] Refactor 2021-09-14 13:05:51 +01:00
Hugo Sales bd8f4bd277
[AVATAR] Fixed avatar upload, added avatar inline download and updated template and base controller 2021-09-14 13:05:51 +01:00
Hugo Sales 2bf914f96f
[AVATAR] Handle avatar upload without js and save and validate uploaded files 2021-09-14 13:05:51 +01:00
Hugo Sales 5a68fd287b
[UI][SETTINGS] User notification settings with configurable transports (through plugins) 2021-09-14 13:05:50 +01:00
rainydaysavings 574fb38225
[CONTROLLER][UI] Avatar JS cropping added 2021-09-14 13:05:48 +01:00
rainydaysavings f840d4350f
[UI] Controller and Route for FAQ page created as well as basic template structure 2021-09-14 13:05:48 +01:00
Hugo Sales b436a0641d
[CONTROLLER][UI] Add notification settings form 2021-09-14 13:05:48 +01:00
Hugo Sales fe3a3978af
[UI][CONTROLLER] Work on tabbed notification settings panel 2021-09-14 13:05:46 +01:00
Hugo Sales fe394e9b20
[UI][CONTROLLER] Refactor UserPanel to use the new Form::handle method and add placeholders in the password fields 2021-09-14 13:05:46 +01:00
rainydaysavings 199fa0278c
[CONTROLLER][UI] Fixing controller display errors, Settings CSS fixes 2021-09-14 13:05:45 +01:00
rainydaysavings 6d729de07c
[UI][ROUTES][CONTROLLER] Fixing Settings navs and templates 2021-09-14 13:05:45 +01:00
Hugo Sales d08c4a1f62
[Controller] Update settings/avatar 2021-09-14 13:05:44 +01:00
Hugo Sales db52e282b9
[UI] Update settings/account to reflect the current values 2021-09-14 13:05:44 +01:00
Hugo Sales 8b7dd48344
[UI][USERPANEL] Add prefilled fields, mark some as optional and handle self tags in the profile settings page 2021-09-14 13:05:44 +01:00
Hugo Sales 3ba46a9a60
[SECURITY][CONTROLLER] Remove unreachable code from the Security controller 2021-09-14 13:05:42 +01:00
Hugo Sales c26ffe09b6
[CONTROLLER][ADMIN][CONFIG] Fix form to use static strings as keys and add labels seperately; convert input from string to appropriate type 2021-09-14 13:05:42 +01:00
Hugo Sales c973517397
[USER][UI][AUTHENTICATION] Add registration form 2021-09-14 13:05:42 +01:00
Hugo Sales cac00dd6d4
[CONTROLLER][ROUTES] Refactor the base Controller to not reinvent the wheel too much and rely on Symfony's events 2021-09-14 13:05:40 +01:00
Hugo Sales 56f74fffe8
[CONTROLLER][ROUTES] Refactor controllers to use the new base class and remove controller from the class name 2021-09-14 13:05:40 +01:00
Hugo Sales df4d246ede
[CONTROLLER] Remove example enqueue 2021-09-14 13:05:40 +01:00
Hugo Sales 3313897671
[UI][SESSION] Add login and logout pages 2021-09-14 13:05:39 +01:00
rainydaysavings d6320943ce
[UI] Settings routes refactor, avatar and misc settings added. 2021-09-14 13:05:37 +01:00
rainydaysavings 6dd966bd3f
[UI][CONTROLLER][ROUTES] UserPanel account page form added, account page CSS work 2021-09-14 13:05:37 +01:00
rainydaysavings c9f731507b
[UI][CONTROLLER] Form help messages added, fixed checkbox trick hitbox 2021-09-14 13:05:37 +01:00
rainydaysavings 63a443e78e
[UI][CONTROLLER][ROUTES] Corrected core action name, UserPanel CSS work 2021-09-14 13:05:37 +01:00
rainydaysavings 02318d954c
[UI][CONTROLLER] Profile settings action functionality working 2021-09-14 13:05:36 +01:00
Hugo Sales 643a937152
[DATABASE][WRAPPER] Update DATABASE wrapper so entity names are provided without the namespace 2021-09-14 13:05:36 +01:00
Hugo Sales d48cb3f0b8
[QUEUE] Add queueing wrapper, default configuration and example usage 2021-09-14 13:05:33 +01:00
Hugo Sales 423129486c
[CONTROLLER] Show dummy notices in main/all 2021-09-14 13:05:33 +01:00
Hugo Sales 59b2b98537
[CONTROLLER] Add Controller base class, which handles rendering templates if requested HTML or json, accordingly 2021-09-14 13:05:32 +01:00
rainydaysavings 996f2338a5
[CONTROLLER] UserAdminPanel handle request fix
[UI] Minor CSS font size corrections
2021-09-14 13:05:32 +01:00
rainydaysavings 82d50cc962
[TWIG][UI] Settings: removed unnecessary pages, responsive CSS work 2021-09-14 13:05:32 +01:00
rainydaysavings 1498c44e74
[UI][CONTROLLER] Settings page styling almost done. 2021-09-14 13:05:31 +01:00
rainydaysavings 17d737b590
[UI][Mobile][FAQ][ROUTES] FAQ sub pages and routing added, small screen css work started. 2021-09-14 13:05:31 +01:00
rainydaysavings 432dfdd0ae
[UI][ROUTES][CONTROLLER] Settings pages routes and styling done. 2021-09-14 13:05:31 +01:00
rainydaysavings ad107542d9
[TWIG][UI] CSS refactoring, containerized twig blocks and settings initial work 2021-09-14 13:05:30 +01:00
rainydaysavings 02ddf96371
[UI][ROUTES] Better use of icons, fixing static pages routing. 2021-09-14 13:05:30 +01:00
rainydaysavings ecd7aedf0c
[UI][Mobile][FAQ] FAQ sub pages and routing added, small screen css work started. 2021-09-14 13:05:30 +01:00
rainydaysavings 124e1a70c1
[UI][FAQ] Controller and Route for FAQ page created as well as basic template structure 2021-09-14 13:05:30 +01:00
Hugo Sales 44eaf43ba9
[ROUTE][ADMIN][CONFIG] Add route to update values in the config table 2021-09-14 13:05:29 +01:00
Hugo Sales b7a8861f55
[CORE][Event] Move GSEvent to Event, no longer a name collision 2021-09-14 13:05:28 +01:00
Hugo Sales f283613443
[I18N] Refactor since rfc/use-static-function is not implemented
As the above mentioned RFC is not implemented, `_m` needs to be
outside of the I18n class, otherwise it would have to always be called
with `I18n::_m`.
2021-09-14 13:05:27 +01:00
Hugo Sales 4ffb7c338f
[CORE] Refactoring core 2021-09-14 13:05:26 +01:00
Hugo Sales 87bc60a806
[UI][CONFIG] Added admin configuration form 2021-09-14 13:05:26 +01:00
Hugo Sales 7c18f10bd2
[TOOLS] Fixed all licence blocks, to use the same, foldable, format 2021-09-14 13:05:26 +01:00
Hugo Sales b9bc88ddbf
[DATABASE][CONFIG] Loading defaults into database, doctrine static wrapper 2021-09-14 13:05:25 +01:00
Hugo Sales dd559402cd
[CORE][UTIL] Moved classes from util to core
And splitted up Common
2021-09-14 13:05:25 +01:00
Hugo Sales 596009c924
[DOCUMENTATION] Document All The Things! 2021-09-14 13:04:33 +01:00
Hugo Sales 6df658a987
[CORE][EXTENSIONS] Added extension (modules, plugins) loading and test plugin, which is able to handle events 2021-09-14 13:01:34 +01:00
Hugo Sales cc72373e3d
[DOCTRINE][SCHEMADEF] Create a new metadata driver to allow us to continue using static schemaDef functions
This has the benefit of requiring fewer code changes, as well as providing a better isolation
between GNU social and symfony, useful in case the framework needs to be changed
2021-09-14 13:01:34 +01:00
Hugo Sales feaee1b238
[CORE][EVENTS] Bring existing Events and Boostrapper back
- Adapt the existing event system to rely on Symfony's event dispatcher
2021-09-14 13:01:33 +01:00
Hugo Sales b396f1227a
[CORE][ROUTES] Example route 2021-09-14 13:01:33 +01:00
Hugo Sales 4b31c1f48f
[V3] Big Bang
Beginning anew, this time with a modern framework: symfony
2021-09-14 13:01:33 +01:00