Commit Graph

242 Commits (2a2698e4501094ca52b8b166c2c51fab26ce7427)

Author SHA1 Message Date
nullkal c2af138113 Allow multiple pinned statuses to be shown and make them be ordered b… ()
* Allow multiple pinned statuses to be shown and make them be ordered by pinned date

* Set timestamps NOT NULL

* Make single-line pinned_statuses

* Spec for pinned_statuses

* Remove redundant empty line
Eugen Rochko 9caa90025f Pinned statuses ()
* Pinned statuses

* yarn manage:translations
unarist b01a19fe39 Fetch reblogs as Announce activity instead of Note object ()
* Process Create / Announce activity in FetchRemoteStatusService

* Use activity URL in ActivityPub for reblogs

* Redirect to the original status on StatusesController#show
Eugen Rochko c66fe2aeba Minor performance improvement for test suite ()
nullkal 80393a23d0 Use checkboxes for application scope setting ()
Eugen Rochko c1b086a538 Fix up the applications area ()
- Section it into "Development" area
- Improve UI of application form, index, and details
Colin Mitchell 871c0d251a Application prefs section ()
* Add code for creating/managing apps to settings section

* Add specs for app changes

* Fix controller spec

* Fix view file I pasted over by mistake

* Add locale strings. Add 'my apps' to nav

* Add Client ID/Secret to App page. Add some visual separation

* Fix rubocop warnings

* Fix embarrassing typo

I lost an `end` statement while fixing a merge conflict.

* Add code for creating/managing apps to settings section

- Add specs for app changes
- Add locale strings. Add 'my apps' to nav
- Add Client ID/Secret to App page. Add some visual separation
- Fix some bugs/warnings

* Update to match code standards

* Trigger notification

* Add warning about not sharing API secrets

* Tweak spec a bit

* Cleanup fixture creation by using let!

* Remove unused key

* Add foreign key for application<->user
Eugen Rochko 74e5078795 Fix - Re-add missing doorkeeper_authorize for /api/v1/verify_credentials ()
Yamagishi Kazutoshi 2edfdab6e6 Don't send Link header when don't know prev and next links ()
Eugen Rochko 6df8bd277b Set correct content-type for ActivityPub JSON ()
Eugen Rochko 4e75f0d889 Hook up URL-based resource look-up to ActivityPub ()
Eugen Rochko a2aeacbfee Add alternate links to ActivityPub resources from HTML/HEAD variants ()
Eugen Rochko b7370ac8ba ActivityPub delivery ()
* Deliver ActivityPub Like

* Deliver ActivityPub Undo-Like

* Deliver ActivityPub Create/Announce activities

* Deliver ActivityPub creates from mentions

* Deliver ActivityPub Block/Undo-Block

* Deliver ActivityPub Accept/Reject-Follow

* Deliver ActivityPub Undo-Follow

* Deliver ActivityPub Follow

* Deliver ActivityPub Delete activities

Incidentally fix 

* Adjust BatchedRemoveStatusService for ActivityPub

* Add tests for ActivityPub workers

* Add tests for FollowService

* Add tests for FavouriteService, UnfollowService and PostStatusService

* Add tests for ReblogService, BlockService, UnblockService, ProcessMentionsService

* Add tests for AuthorizeFollowService, RejectFollowService, RemoveStatusService

* Add tests for BatchedRemoveStatusService

* Deliver updates to a local account to ActivityPub followers

* Minor adjustments
Eugen Rochko fdea173237 Add Digest header to requests with body, handle acct and URI keyId ()
Eugen Rochko dd7ef0dc41 Add ActivityPub inbox ()
* Add ActivityPub inbox

* Handle ActivityPub deletes

* Handle ActivityPub creates

* Handle ActivityPub announces

* Stubs for handling all activities that need to be handled

* Add ActivityPub actor resolving

* Handle conversation URI passing in ActivityPub

* Handle content language in ActivityPub

* Send accept header when fetching actor, handle JSON parse errors

* Test for ActivityPub::FetchRemoteAccountService

* Handle public key and icon/image when embedded/as array/as resolvable URI

* Implement ActivityPub::FetchRemoteStatusService

* Add stubs for more interactions

* Undo activities implemented

* Handle out of order activities

* Hook up ActivityPub to ResolveRemoteAccountService, handle
Update Account activities

* Add fragment IDs to all transient activity serializers

* Add tests and fixes

* Add stubs for missing tests

* Add more tests

* Add more tests
Eugen Rochko df605f0f8b Add "signed in as" header to some pages ()
nullkal dfcd2834f9 Redirect to PasswordController#new when reset_password_token is invalid ()
Akihiko Odaki 0f92119ceb Cover Api::V1:FavouritesController more ()
Akihiko Odaki 4f0b638cda Introduce access token fabricators ()
Akihiko Odaki bdf573d140 Remove redundant fabrication in the spec for Api::V1::FavouritesController ()
Sorin Davidoi 9075c90c46 feat: Enable push subscription for mobile devices by default ()
Eugen Rochko 1fcdaafa6f Fix webfinger retries ()
* Do not raise unretryable exceptions in ResolveRemoteAccountService

* Removed fatal exceptions from ResolveRemoteAccountService

Exceptions that cannot be retried should not be raised. New exception
class for those that can be retried (Mastodon::UnexpectedResponseError)
abcang 4d42a38954 Improve admin page ()
* Improve admin page

* Fix test

* Add spec

* Improve select style
Eugen Rochko 8c45cd0e36 Improve ActivityPub representations ()
* Improve webfinger templates and make tests more flexible

* Clean up AS2 representation of actor

* Refactor outbox

* Create activities representation

* Add representations of followers/following collections, do not redirect /users/:username route if format is empty

* Remove unused translations

* ActivityPub endpoint for single statuses, add ActivityPub::TagManager for better
URL/URI generation

* Add ActivityPub::TagManager#to

* Represent all attachments as Document instead of Image/Video specifically
(Because for remote ones we may not know for sure)

Add mentions and hashtags representation to AP notes

* Add AP-resolvable hashtag URIs

* Use ActiveModelSerializers for ActivityPub

* Clean up unused translations

* Separate route for object and activity

* Adjust cc/to matrices

* Add to/cc to activities, ensure announce activity embeds target status and
not the wrapper status, add "id" to all collections
Eugen Rochko cd9b2ab2f7 Fix - Connect signed PuSH subscription requests to instance domain ()
* Fix  - Connect signed PuSH subscription requests to instance domain

Resolves 

* Fix return of locate_subscription

* Fix tests
Eugen Rochko 1618b68bfa HTTP signatures ()
* Add Request class with HTTP signature generator

Spec: https://tools.ietf.org/html/draft-cavage-http-signatures-06

* Add HTTP signature verification concern

* Add test for SignatureVerification concern

* Add basic test for Request class

* Make PuSH subscribe/unsubscribe requests use new Request class

Accidentally fix lease_seconds not being set and sent properly, and
change the new minimum subscription duration to 1 day

* Make all PuSH workers use new Request class

* Make Salmon sender use new Request class

* Make FetchLinkService use new Request class

* Make FetchAtomService use the new Request class

* Make Remotable use the new Request class

* Make ResolveRemoteAccountService use the new Request class

* Add more tests

* Allow +-30 seconds window for signed request to remain valid

* Disable time window validation for signed requests, restore 7 days
as PuSH subscription duration (which was previous default due to a bug)
Sorin Davidoi 0c7c188c45 Web Push Notifications ()
* feat: Register push subscription

* feat: Notify when mentioned

* feat: Boost, favourite, reply, follow, follow request

* feat: Notification interaction

* feat: Handle change of public key

* feat: Unsubscribe if things go wrong

* feat: Do not send normal notifications if push is enabled

* feat: Focus client if open

* refactor: Move push logic to WebPushSubscription

* feat: Better title and body

* feat: Localize messages

* chore: Fix lint errors

* feat: Settings

* refactor: Lazy load

* fix: Check if push settings exist

* feat: Device-based preferences

* refactor: Simplify logic

* refactor: Pull request feedback

* refactor: Pull request feedback

* refactor: Create /api/web/push_subscriptions endpoint

* feat: Spec PushSubscriptionController

* refactor: WebPushSubscription => Web::PushSubscription

* feat: Spec Web::PushSubscription

* feat: Display first media attachment

* feat: Support direction

* fix: Stuff broken while rebasing

* refactor: Integration with session activations

* refactor: Cleanup

* refactor: Simplify implementation

* feat: Set VAPID keys via environment

* chore: Comments

* fix: Crash when no alerts

* fix: Set VAPID keys in testing environment

* fix: Follow link

* feat: Notification actions

* fix: Delete previous subscription

* chore: Temporary logs

* refactor: Move migration to a later date

* fix: Fetch the correct session activation and misc bugs

* refactor: Move migration to a later date

* fix: Remove follow request (no notifications)

* feat: Send administrator contact to push service

* feat: Set time-to-live

* fix: Do not show sensitive images

* fix: Reducer crash in error handling

* feat: Add badge

* chore: Fix lint error

* fix: Checkbox label overlap

* fix: Check for payload support

* fix: Rename action "type" (crash in latest Chrome)

* feat: Action to expand notification

* fix: Lint errors

* fix: Unescape notification body

* fix: Do not allow boosting if the status is hidden

* feat: Add VAPID keys to the production sample environment

* fix: Strip HTML tags from status

* refactor: Better error messages

* refactor: Handle browser not implementing the VAPID protocol (Samsung Internet)

* fix: Error when target_status is nil

* fix: Handle lack of image

* fix: Delete reference to invalid subscriptions

* feat: Better error handling

* fix: Unescape HTML characters after tags are striped

* refactor: Simpify code

* fix: Modify to work with 

* Sort strings alphabetically

* i18n: Updated Polish translation

it annoys me that it's not fully localized :P

* refactor: Use current_session in PushSubscriptionController

* fix: Rebase mistake

* fix: Set cacheName to mastodon

* refactor: Pull request feedback

* refactor: Remove logging statements

* chore(yarn): Fix conflicts with master

* chore(yarn): Copy latest from master

* chore(yarn): Readd offline-plugin

* refactor: Use save! and update!

* refactor: Send notifications async

* fix: Allow retry when push fails

* fix: Save track for failed pushes

* fix: Minify sw.js

* fix: Remove account_id from fabricator
Eugen Rochko 056b5ed72f Improve UI of admin site settings ()
STJrInuyasha 7a889a8e12 Remote following success page ()
* Added a success page to remote following
Includes follow-through links to web (the old redirect target) and back to the remote user's profile

* Use Account.new in spec instead of a fake with only id
(fixes spec)

* Fabricate(:account) over Account.new

* Remove self from the success text
(and all HTML with it)
Eugen Rochko 864e3f8d9c Replace OEmbed and initial state Rabl templates with serializers ()
* Replace OEmbed Rabl template with serializer

* Replace initial state rabl with serializer
Matt Jankowski 6dd5eac7fc Add controller spec for manifests controller ()
Akihiko Odaki (@fn_aki@pawoo.net) 0a53ca444a Cover Admin::AccountsController more ()
Eugen Rochko 42b8220632 Fix - Send e-mail notifications to admins about new reports ()
Eugen Rochko 5e8d037e27 Fix - Require OTP authentication to disable 2FA ()
* Fix  - Require OTP authentication to disable 2FA. Also, remove ability
to generate new OTP backup codes *after* initial backup codes were handed
out during activation

* Restore recovery code re-generation

* Improve display of some 2FA elements
Akihiko Odaki (@fn_aki@pawoo.net) 67243bda31 Cover Auth::RegistrationsController more ()
Akihiko Odaki (@fn_aki@pawoo.net) 8f991831b8 Cover Admin::DomainBlocksController more ()
Also domain_block fabricator now sets unique domains
masarakki ff142eb64d setting-for-account-deletable ()
Eugen Rochko f3be605286 Rename FollowRemoteAccountService to ResolveRemoteAccountService ()
Rename Activitypub to ActivityPub
Eugen Rochko 91c71471ab Fix account delete form not accepting password, update suspended ()
account before removing content for quicker feedback to end-users
Eugen Rochko 4a618908e8 Account deletion ()
* Add form for account deletion

* If avatar or header are gone from source, remove them

* Add option to have SuspendAccountService remove user record, add tests

* Exclude suspended accounts from search
unarist abbdacedc5 Fix locale related specs ()
* Use I18n.locale instead of ":en"
* Reset I18n.locale value after locale changing tests
René Klačan dcf0530218 Make sure email is case insensitive on all places ()
When case insensitivity is enabled via devise's `config.case_insensitive_keys` then `.find_for_authentication` method needs to be used instead of `.find_by` because second mentioned returns `nil` when valid email with different cases is passed.

More info https://github.com/plataformatec/devise/wiki/How-To:-Use-case-insensitive-emails
Akihiko Odaki (@fn_aki@pawoo.net) 4919b89ab8 Improve default language decision and spec ()
* Improve default language decision

This change allows to takes account of accepted language determined by
the user agent even if the custom default locale of the instance is
configured.

* Cover Localized more

* Fix code style
Matt Jankowski 2925372ff4 Move create/destroy actions for api/v1/statuses to namespace ()
Each of mute, favourite, reblog has been updated to:

- Have a separate controller with just a create and destroy action
- Preserve historical route names to not break the API
- Mild refactoring to break up long methods
Matt Jankowski 5282ba862a Move reblogged_by and favourited_by actions out of api/v1/statuses and into unique controllers ()
* Add specs for api statuses routes

* Update favourited_by and reblogged_by api routes

* Move methods into new controllers

* Use load_accounts methods to simplify index actions

* Clean up load_accounts methods

* Clean up link header generation

* Check for link headers in specs

* Remove unused actions from api/v1/statuses controller

* Remove specs for moved actions
Matt Jankowski 73540ffe6b Clean up for api/base controller ()
* Move ApiController to Api/BaseController

* API controllers inherit from Api::BaseController

* Add coverage for various error cases in api/base controller
unarist 0f1b1d78b1 Use "match_array" only for order independent assertions ()
Matt Jankowski f0634ba876 Coverage improvement and concern extraction for rate limit headers in API controller ()
* Coverage for rate limit headers

* Move rate limit headers methods to concern

* Move throttle check to condition on before_action

* Move match_data variable into method

* Move utc timestamp to separate method

* Move header setting into smaller methods

* specs cleanup
Daigo 3 Dango 2985d08951 Redirect to streaming_api_base_url ()
* Redirect to streaming_api_base_url

When Rails receives a request to streaming API, it most likely
means that there is another host which is configured to respond
to it. This is to redirect clients to that host if
`STREAMING_API_BASE_URL` is set as another host.

* Use the new Ruby 1.9 hash syntax
Yamagishi Kazutoshi e878ddb7c0 Fix spec for ()