Commit Graph

886 Commits (eae6b98ace80277853f099ac95cd90b60a734610)

Author SHA1 Message Date
Matt Jankowski 30f5ec7303
Rubocop fix: `Perfomance/UnfreezeString` (#26217) 1 year ago
Renaud Chaput 4d1b67f664
Add end-to-end (system) tests (#25461) 1 year ago
Misty De Méo 12a6cf569e
Storage: add :azure to remaining callers (#26080) 1 year ago
Claire b4e739ff0f
Change interaction modal in web UI (#26075)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
1 year ago
Claire f2c683336b
Bump version to v4.1.5 (#26108) 1 year ago
Renaud Chaput 42698b4c5c
Fix the crossorigin attribute (#26096) 1 year ago
Matt Jankowski f831452037
Refactor `Snowflake` to avoid brakeman sql injection warnings (#25879) 1 year ago
Matt Jankowski b8b2470cf8
Fix `Style/SlicingWithRange` cop (#25923) 1 year ago
Nick Schonning 1d557305d2
Enable Rubocop Style/FrozenStringLiteralComment (#23793) 1 year ago
Claire 0051128387
Bump version to v4.1.4 (#25805) 1 year ago
Claire 71d44949bf
Fix branding:generate_app_icons failing because of disallowed ICO coder (#25794) 1 year ago
Claire 5e1752ce3f
Bump version to v4.1.3 (#25757) 2 years ago
Claire dc8f1fbd97
Merge pull request from GHSA-9928-3cp5-93fm
* Fix attachments getting processed despite failing content-type validation

* Add a restrictive ImageMagick security policy tailored for Mastodon

* Fix misdetection of MP3 files with large cover art

* Reject unprocessable audio/video files instead of keeping them unchanged
2 years ago
Claire 6d8e0fae3e
Merge pull request from GHSA-ccm4-vgcc-73hp
* Tighten allowed HTML in oEmbed-based preview cards

* Sanitize preview cards at render time

* Add `sandbox` attribute to preview card iframes
2 years ago
Claire fed9cbfd2b
Add hardened headers to user-uploaded files (#25756) 2 years ago
Claire c78280a8ce
Add translate="no" to outgoing mentions and links (#25524) 2 years ago
Matt Jankowski b5675e265e
Add coverage for `CLI::Feeds` command (#25319) 2 years ago
Matt Jankowski 07933db788
Add coverage for `CLI::Cache` command (#25238) 2 years ago
Nick Schonning c66250abf1
Autofix Rubocop Regex Style rules (#23690)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2 years ago
Jed Fox 768b00c4d0
Consistently use middle dot (·) instead of bullet (•) to separate items (#25248) 2 years ago
Matt Jankowski cd4f0feab8
Extract verify options method in search cli (#25121) 2 years ago
Matt Jankowski 35c1c3e57a
Add CLI area progress bar helper (#25208) 2 years ago
Matt Jankowski dc26140d54
Use thor methods instead of tty prompt in maintenance cli (#25207) 2 years ago
Matt Jankowski 1baf40077b
Fix FormatStringToken cop in CLI (#25122) 2 years ago
Matt Jankowski 80c7de9984
Fix Rails/WhereExists cop in CLI (#25123) 2 years ago
Matt Jankowski b7b96efd17
Extract helper method for error report in cli/accounts command (#25119) 2 years ago
Matt Jankowski 2cecb2dc9e
Increment index which was previously not used in maintenance CLI loop (#25118) 2 years ago
Matt Jankowski ec9bc7e604
Consistent usage of CLI `dry_run?` method (#25116) 2 years ago
Matt Jankowski 55785b1603
Extract methods for user de-duping in maintenance CLI (#25117) 2 years ago
Claire 1d588d58f1
Improve various queries against account domains (#25126) 2 years ago
Matt Jankowski 384345b0de
Add CLI Base class for command line code (#25106) 2 years ago
Matt Jankowski b6b4ea4ca5
Move the mastodon/*_cli files to mastodon/cli/* (#24139) 2 years ago
Nick Schonning 99e2e9b81f
Fix minor typos in comments and spec names (#21831) 2 years ago
Daniel M Brasil 536dd046d4
Add ability to block sign-ups from IP using the CLI (#24870) 2 years ago
Daniel M Brasil ffb3fef7db
Fix uncaught `ActiveRecord::StatementInvalid` in Mastodon::IpBlocksCLI (#24861) 2 years ago
Renaud Chaput 830e6cefae
Add version suffixes to nightly & edge image builds (#24823) 2 years ago
Nick Schonning 569b39256b
Bump rubocop-rails 2.19.1 with update .rubocop_todo.yml (#24469) 2 years ago
Nick Schonning da3bd913ae
Autofix Rubocop Style/HashSyntax (#23754) 2 years ago
Matt Jankowski 2c6c398c60
Fix Performance/CollectionLiteralInLoop cop (#24819) 2 years ago
Matt Jankowski 24491abf6d
Fix Rails/DeprecatedActiveModelErrorsMethods cop (#24742) 2 years ago
Matt Jankowski 5e060e1f44
Fix Performance/Sum cop (#24788) 2 years ago
Claire 1ed0ff30d3
Fix `tootctl accounts cull` crashing when encountering a domain resolving to a private address (#23378) 2 years ago
Matt Jankowski 88d33f361f
Fix Lint/DuplicateBranch cop (#24766) 2 years ago
Daniel M Brasil e8fe941015
Fix `tootctl accounts approve --number N` not aproving N earliest registrations (#24605) 2 years ago
Matt Jankowski 2e43461100
Fix Rails/Output cop (#24687) 2 years ago
Matt Jankowski 60ac9e8634
Fix Rails/SquishedSQLHeredocs cop (#24694) 2 years ago
Daniel M Brasil 1d9969fadf
Fix `tootctl accounts create --reattach --force` not working with confirmed accounts (#24680) 2 years ago
Claire 528b8e7e3a
Fix crash in `tootctl accounts create --reattach --force` (#24557) 2 years ago
Daniel M Brasil faf657d709
Fix uncaught ActiveRecord::StatementInvalid exception in `Mastodon::AccountsCLI#approve` (#24590) 2 years ago
Eugen Rochko e98c86050a
Refactor `Cache-Control` and `Vary` definitions (#24347) 2 years ago
Daniel M Brasil 3afa1fda7a
Fix email confirmation skip option in `tootctl accounts modify USERNAME --email EMAIL --confirm` (#24578) 2 years ago
Daniel M Brasil b0800d602e
tootctl: add --approve option to tootctl accounts create (#24533) 2 years ago
Matt Jankowski a2a66300d9
Clean up the post deployment migration generator (#24233) 2 years ago
Claire 3d8bd093b9
Bump version to v4.1.2 (#24427) 2 years ago
Claire 5c499f54e3
Change root Chewy strategy to emit a warning instead of erroring out in production mode (#24327) 2 years ago
Alison Wheeler 2f7c3cb628
Update redis_config.rb to remove warning message (#24352) 2 years ago
Eugen Rochko a9b5598c97
Change user settings to be stored in a more optimal way (#23630)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2 years ago
Claire 0d70deee53
Add migration tests for user mail notification settings (#24277) 2 years ago
Matt Jankowski b9e34ef098
Migration warning helper, and only run in production env (#24253) 2 years ago
Claire 7f8e1bede4
Bump version to v4.1.1 (#24201) 2 years ago
Claire bdeb6ff180
Fix crash in `tootctl` commands making use of parallelization when Elasticsearch is enabled (#24182) 2 years ago
Nick Schonning aa947a143b
Regen rubocop-todo without Max shadowing (#24076) 2 years ago
Eugen Rochko f0e727f958
Add cache headers to static files served through Rails (#24120) 2 years ago
Nick Schonning 25d36b6edd
Autofix Rubocop Style/RedundantArgument (#23798) 2 years ago
Claire 1d0ad558ff
Change sidekiq-bulk's batch size from 10,000 to 1,000 jobs in one Redis call (#24034) 2 years ago
Nick Schonning e762a14c0a
Enable Rubocop Performance/DeleteSuffix (#24077) 2 years ago
Claire f432db7b9f
Fix sidekiq jobs not triggering Elasticsearch index updates (#24046) 2 years ago
9p4 b715bd8e53
Add refreshing many accounts at once with "tootctl accounts refresh" (#23304) 2 years ago
Jean byroot Boussier 922837dc96
Upgrade to latest redis-rb 4.x and fix deprecations (#23616)
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2 years ago
Claire 8784498ebf
Fix tootctl accounts migrate error due to typo (#23567) 2 years ago
Claire 3a6451c867
Add support for incoming rich text (#23913) 2 years ago
Nick Schonning 8fd3fc404d
Autofix Rubocop Rails/RootPathnameMethods (#23760) 2 years ago
Nick Schonning 0cfdd1a401
Enable Rubocop Style/StringConcatenation defaults (#23792) 2 years ago
Nick Schonning 59c8d43d94
Autofix Rubocop Style/RescueStandardError (#23745) 2 years ago
Nick Schonning af4c95100c
Autofix Rubocop Style/FormatString (#23743) 2 years ago
Nick Schonning 717683d1c3
Autofix Rubocop remaining Layout rules (#23679) 2 years ago
Nick Schonning d2dcb6c45a
Autofix Rubocop Style/UnpackFirst (#23741) 2 years ago
Nick Schonning bf785df9fe
Audofix Rubocop Style/WordArray (#23739) 2 years ago
Nick Schonning 81ad6c2e39
Autofix Rubocop Style/StringLiterals (#23695) 2 years ago
Nick Schonning 2177daeae9
Autofix Rubocop Style/RedundantBegin (#23703) 2 years ago
Nick Schonning ab7816a414
Autofix Rubocop Style/Lambda (#23696) 2 years ago
Nick Schonning e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier (#23697) 2 years ago
Nick Schonning a6f77aa28a
Autofix Rubocop Lint/AmbiguousOperatorPrecedence (#23681) 2 years ago
Nick Schonning e2567df860
Enable Lint/RedundantCopDisableDirective (#23687) 2 years ago
Nick Schonning d65b2c1924
Apply Rubocop Style/RedundantConstantBase (#23463) 2 years ago
Nick Schonning ac59d6f19f
Enable Rubocop Style/NumericLiterals (#23647) 2 years ago
Nick Schonning 669f6d2c0a
Run rubocop formatting except line length (#23632) 2 years ago
Nick Schonning 0c9d455ea5
Upgrade to Stylelint 15 with Prettier (#23558) 2 years ago
Claire 70c0d754a6
Bump version to 4.1.0 (#23471)
* Bump version to 4.1.0

* Editorialize changelog some more and highlight API changes

* Update changelog
2 years ago
Nick Schonning 11557d1c5a
Apply Rubocop Rails/RootPublicPath (#23447) 2 years ago
Nick Schonning f68bb52556
Apply Rubocop Style/NegatedIfElseCondition (#23451) 2 years ago
Nick Schonning 203739dd3a
Apply Rubocop Performance/StringIdentifierArgument (#23444) 2 years ago
Nick Schonning c92e033cdd
Apply Rubocop Performance/BindCall (#23437) 2 years ago
Claire 79ca19e9b2
Bump version to 4.1.0rc3 (#23384) 2 years ago
Claire 2f112432e6
Bump version to 4.1.0rc2 (#23220) 2 years ago
Claire 8180f7ba19
Bump version to 4.1.0rc1 (#23112) 2 years ago
JT Olio a5fd2fe1cb
Add Storj DCS to cloud object storage options (#21929)
* Add Storj DCS to cloud object storage options

More explanation here: https://forum.storj.io/t/object-storage-provider-for-mastodon-instance/11464/37

* more help for which command to use
2 years ago
Claire cb4e28f405
Add `tootctl domains purge` options to select subdomains and keep domain blocks (#22063)
* Add --include-subdomains option to tootctl domains purge

* Add support for '*.' subdomain wildcard patterns in `tootctl domains purge`

* Fix custom emojis deletion not following subdomain and URI options

* Change `tootctl domains purge` to not purge domain blocks unless --purge-domain-blocks is passed

* Refactor `tootctl domains purge`

* Add feedback on deleted domain blocks
2 years ago
Jeong Arm 0e8f8a1a1c
Implement tootctl accounts prune (#18397)
* Implement tootctl accounts prune

* Optimise query

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2 years ago
Claire 745bdb11a0
Add `tootctl accounts migrate` (#22330)
* Add tootctl accounts replay-migration

Fixes #22281

* Change `tootctl accounts replay-migration` to `tootctl accounts migrate`
2 years ago
Claire a3a5aa1597
Fix incorrect env file generation in mastodon:setup (#23072)
Regression from #23012
2 years ago
Claire 15b88a83ab
Fix sanitizer parsing link text as HTML when stripping unsupported links (#22558) 2 years ago
Claire a65f86ae55
Fix `$` not being escaped in `.env.production` file generated by `mastodon:setup` (#23012)
* Fix `$` not being escaped in `.env.production` file generated by `mastodon:setup`

* Improve robustness of dotenv escaping
2 years ago
Nick Schonning 558ac411c4
Expand Stylelint glob to include CSS files (#22469) 2 years ago
Dan Peterson 3d3429243f
Fix default S3_HOSTNAME used in mastodon:setup (#19932)
s3-us-east-1.amazonaws.com does not exist.

Co-authored-by: Effy Elden <effy@effy.space>
2 years ago
Claire f239d31f23
Add --email and --dry-run options to `tootctl accounts delete` (#22328) 2 years ago
Evan 78ef635980
Add command to remove avatar and header images of inactive remote accounts from the local database (#22149)
* Add tootctl subcommand media remove-profile-media

* Trigger workflows

* Correcting external linting

* External linting error

* External linting fix

* Merging with remove command

* Linting

* Correct long option names

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Correct long option names

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Correct long option names

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Remove saving a list of purged accounts

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2 years ago
Claire 55b210b3e5
Fix crash and incorrect behavior in tootctl domains crawl (#19004) 2 years ago
Claire c52263f6f8
Fix deprecation warning in `tootctl accounts rotate` (#22120) 2 years ago
Claire 66a70ebb6e
Fix pre-4.0 admin action logs (#22091)
* Fix BackfillAdminActionLogs post-deployment migration

* Improve migration tests

* Backfill admin action logs again
2 years ago
Claire 098ced7420
Remove support for Ruby 2.6 (#21477)
As pointed out by https://github.com/mastodon/mastodon/pull/21297#discussion_r1028372193
at least one of our dependencies already dropped support for Ruby 2.6, and we
had removed Ruby 2.6 tests from the CI over a year ago (#16861).

So stop advertising Ruby 2.6 support, bump targeted version, and drop some
compatibility code.
2 years ago
Claire d587a268fd
Add logging for Rails cache timeouts (#21667)
* Reduce redis cache store connect timeout from default 20 seconds to 5 seconds

* Log cache store errors
2 years ago
Eugen Rochko 03b0f3ac83
Bump version to 4.0.2 (#20725) 2 years ago
Eugen Rochko 4415dd6036
Bump version to 4.0.1 (#20696) 2 years ago
Eugen Rochko fb389bd73c
Bump version to 4.0.0 (#20636) 2 years ago
Eugen Rochko 75299a042c
Bump version to 4.0.0rc4 (#20634) 2 years ago
Claire 457c37e47a
Fix index name in fix-duplicates task (#20632) 2 years ago
Eugen Rochko b31afc6294
Fix error when passing unknown filter param in REST API (#20626)
Fix #19156
2 years ago
Claire bd806a3090
Update fix-duplicates (#20502)
Fixes #19133
2 years ago
Arthur Isac 1af482659d
Copied Spaces support from packer .rake (#20573) 2 years ago
Eugen Rochko 53028af10e
Bump version to 4.0.0rc3 (#20378) 2 years ago
Pierre Bourdon 36bc90e8aa
blurhash_transcoder: prevent out-of-bound reads with <8bpp images (#20388)
The Blurhash library used by Mastodon requires an input encoded as 24
bits raw RGB data. The conversion to raw RGB using Imagemagick did not
previously specify the desired bit depth. In some situations, this leads
Imagemagick to output in a pixel format using less bpp than expected.
This then manifested as segfaults of the Sidekiq process due to
out-of-bounds read, or potentially a (highly noisy) memory infoleak.

Fixes #19235.
2 years ago
Yamagishi Kazutoshi 19a8563905
Fix `ENV` (#20377) 2 years ago
F 9feba112a7
Make enable_starttls configurable by envvars (#20321)
ENABLE_STARTTLS is designed to replace ENABLE_STARTTLS_AUTO by accepting
three values: 'auto' (the default), 'always', and 'never'. If
ENABLE_STARTTLS isn't provided, we fall back to ENABLE_STARTTLS_AUTO. In
this way, this change should be fully backwards compatible.

Resolves #20311
2 years ago
Eugen Rochko 5187e4e758
Bump version to 4.0.0rc2 (#19831) 2 years ago
Eugen Rochko e02812d5b6
Add assets from Twemoji 14.0 (#19733) 2 years ago
Claire 1dca08b76f
Fix admin action logs page (#19649)
* Add tests

* Fix crash when trying to display orphaned action logs

* Add migration for older admin action logs
2 years ago
Claire e91418436a
Fix mastodon:setup not setting the admin's role properly (#19670)
* Fix mastodon:setup not setting the admin's role properly

* Set contact username when creating admin account in mastodon:setup
2 years ago
pea-sys c68e6b52d9
png optimization(loss less) (#19630) 2 years ago
Eugen Rochko 8ae0936ddd
Bump version to 4.0.0rc1 (#19473) 2 years ago
Eugen Rochko d7595adbf4
Add `--remove-role` option to `tootctl accounts modify` (#19477)
Fix #19152
2 years ago
Jeong Arm 882e54c786
Fix Ambiguous SQL error on tootctl media refresh (#19206) 2 years ago
Claire 1145dbd327
Improve error reporting and logging when processing remote accounts (#15605)
* Add a more descriptive PrivateNetworkAddressError exception class

* Remove unnecessary exception class to rescue clause

* Remove unnecessary include to JsonLdHelper

* Give more neutral error message when too many webfinger redirects

* Remove unnecessary guard condition

* Rework how “ActivityPub::FetchRemoteAccountService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteAccountService#call (default/previous behavior).

* Rework how “ActivityPub::FetchRemoteKeyService” handles errors

Add “suppress_errors” keyword argument to avoid raising errors in
ActivityPub::FetchRemoteKeyService#call (default/previous behavior).

* Fix Webfinger::RedirectError not being a subclass of Webfinger::Error

* Add suppress_errors option to ResolveAccountService

Defaults to true (to preserve previous behavior). If set to false,
errors will be raised instead of caught, allowing the caller to be
informed of what went wrong.

* Return more precise error when failing to fetch account signing AP payloads

* Add tests

* Fixes

* Refactor error handling a bit

* Fix various issues

* Add specific error when provided Digest is not 256 bits of base64-encoded data

* Please CodeClimate

* Improve webfinger error reporting
2 years ago
luzpaz 4aa3b9bd01
Fix typos (#18604)
* Fix typos

Found via `codespell -q 3 -S ./CHANGELOG.md,./AUTHORS.md,./config/locales,./app/javascript/mastodon/locales -L ba,keypair,medias,pixelx,ro`

* Follow-up typo fix
2 years ago
Eugen Rochko c556c3a0d1
Add admin API for managing canonical e-mail blocks (#19067) 2 years ago
Jeong Arm e682975afd
Add '--days' option to tootctl media refresh (#18425)
* Add '--days' option to tootctl media refresh

* Fix undefined scope
2 years ago
Brayd fc46fa8f99
Minimal adjustments to the short description (#18001)
Minimal adjustments have been made to the short description so that it logically follows the long description
2 years ago
Eugen Rochko 44b2ee3485
Add customizable user roles (#18641)
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
3 years ago
Claire 02851848e9
Revamp post filtering system (#18058)
* Add model for custom filter keywords

* Use CustomFilterKeyword internally

Does not change the API

* Fix /filters/edit and /filters/new

* Add migration tests

* Remove whole_word column from custom_filters (covered by custom_filter_keywords)

* Redesign /filters

Instead of a list, present a card that displays more information and handles
multiple keywords per filter.

* Redesign /filters/new and /filters/edit to add and remove keywords

This adds a new gem dependency: cocoon, as well as a npm dependency:
cocoon-js-vanilla. Those are used to easily populate and remove form fields
from the user interface when manipulating multiple keyword filters at once.

* Add /api/v2/filters to edit filter with multiple keywords

Entities:
- `Filter`: `id`, `title`, `filter_action` (either `hide` or `warn`), `context`
  `keywords`
- `FilterKeyword`: `id`, `keyword`, `whole_word`

API endpoits:
- `GET /api/v2/filters` to list filters (including keywords)
- `POST /api/v2/filters` to create a new filter
  `keywords_attributes` can also be passed to create keywords in one request
- `GET /api/v2/filters/:id` to read a particular filter
- `PUT /api/v2/filters/:id` to update a new filter
  `keywords_attributes` can also be passed to edit, delete or add keywords in
   one request
- `DELETE /api/v2/filters/:id` to delete a particular filter
- `GET /api/v2/filters/:id/keywords` to list keywords for a filter
- `POST /api/v2/filters/:filter_id/keywords/:id` to add a new keyword to a
   filter
- `GET /api/v2/filter_keywords/:id` to read a particular keyword
- `PUT /api/v2/filter_keywords/:id` to edit a particular keyword
- `DELETE /api/v2/filter_keywords/:id` to delete a particular keyword

* Change from `irreversible` boolean to `action` enum

* Remove irrelevent `irreversible_must_be_within_context` check

* Fix /filters/new and /filters/edit with update for filter_action

* Fix Rubocop/Codeclimate complaining about task names

* Refactor FeedManager#phrase_filtered?

This moves regexp building and filter caching to the `CustomFilter` class.

This does not change the functional behavior yet, but this changes how the
cache is built, doing per-custom_filter regexps so that filters can be matched
independently, while still offering caching.

* Perform server-side filtering and output result in REST API

* Fix numerous filters_changed events being sent when editing multiple keywords at once

* Add some tests

* Use the new API in the WebUI

- use client-side logic for filters we have fetched rules for.
  This is so that filter changes can be retroactively applied without
  reloading the UI.
- use server-side logic for filters we haven't fetched rules for yet
  (e.g. network error, or initial timeline loading)

* Minor optimizations and refactoring

* Perform server-side filtering on the streaming server

* Change the wording of filter action labels

* Fix issues pointed out by linter

* Change design of “Show anyway” link in accordence to review comments

* Drop “irreversible” filtering behavior

* Move /api/v2/filter_keywords to /api/v1/filters/keywords

* Rename `filter_results` attribute to `filtered`

* Rename REST::LegacyFilterSerializer to REST::V1::FilterSerializer

* Fix systemChannelId value in streaming server

* Simplify code by removing client-side filtering code

The simplifcation comes at a cost though: filters aren't retroactively
applied anymore.
3 years ago
Eugen Rochko fe2d6fe105
Fix wrong aspect ratio of logo in icons (#18639) 3 years ago
Eugen Rochko 45aa5781ce
Change brand color and logotypes (#18592)
- Add rake task for generating Apple/Android icons and favicons from SVG
- Add rake task for generating PNG icons and logos for e-mails from SVG
- Remove obsolete Microsoft icons and configuration
- Remove PWA shortcut icons
3 years ago
Claire 9d4861b498
Remove dependency on running Redis server for db:setup (#18560) 3 years ago
Eugen Rochko fbcbf7898f
Bump version to 3.5.3 (#18530) 3 years ago
Eugen Rochko a9b64b24d6
Change algorithm of `tootctl search deploy` to improve performance (#18463) 3 years ago
Eugen Rochko 679b7158e3
Change search indexing to use batches to minimize resource usage (#18451) 3 years ago
Claire f714e24ff1
Fix redis configuration not being changed by mastodon:setup (#18383)
Fixes #18342
3 years ago
Claire 014065913c
Bump version to 3.5.2 (#18295)
* Bump version to 3.5.2

* Change some entries to be more clear

* Add some extra notes

* Fix line wrap

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
3 years ago
Claire bc19c083ce
Add ability to set approval-based registration through tootctl (#18248)
Fixes #18235

Add `tootctl settings registrations approved` with
optional `--require-reason` switch.
3 years ago
Eugen Rochko 7b0fe4aef9
Fix opening and closing Redis connections instead of using a pool (#18171)
* Fix opening and closing Redis connections instead of using a pool

* Fix Redis connections not being returned to the pool in CLI commands
3 years ago
Gaelan Steele 74e20f22cd
Fix light-mode emoji borders. (#18131) 3 years ago
Eugen Rochko 3917353645
Fix single Redis connection being used across all threads (#18135)
* Fix single Redis connection being used across all Sidekiq threads

* Fix tests
3 years ago
Claire 33cd80d69c
Fix instance actor being incorrectly created when running migrations (#18109)
* Add migration test about instance actor key

* Fix old migration

* Work around incorrect database state
3 years ago
Eugen Rochko ed5491e5de
Bump version to 3.5.1 (#18000) 3 years ago
0x2019 012537452a
Fix error resposes for `from` search prefix (#17963)
* Fix error responses in `from` search prefix (addresses mastodon/mastodon#17941)

Using unsupported prefixes now reports a 422; searching for posts from an
account the instance is not aware of reports a 404. TODO: The UI for this
on the front end is abysmal.

Searching `from:username@domain` now succeeds when `domain` is the local
domain; searching `from:@username(@domain)?` now works as expected.

* Remove unused methods on new Error classes as they are not being used

Currently when `raise`d there are error messages being supplied, but
this is not actually being used. The associated `raise`s have been
edited accordingly.

* Remove needless comments

* Satisfy rubocop

* Try fixing tests being unable to find AccountFindingConcern methods

* Satisfy rubocop

* Simplify `from` prefix logic

This incorporates @ClearlyClaire's suggestion (see
https://github.com/mastodon/mastodon/pull/17963#pullrequestreview-933986737).

Accepctable account strings in `from:` clauses are more lenient than
before this commit; for example, `from:@user@example.org@asnteo +cat`
will not error, and return posts by @user@example.org containing the
word "cat". This is more consistent with how Mastodon matches mentions
in statuses. In addition, `from` clauses will not be checked for
syntatically invalid usernames or domain names, simply 404ing when
`Account.find_remote!` raises ActiveRecord::NotFound.

New code for this PR that is no longer used has been removed.
3 years ago
Eugen Rochko 6e418bf346
Fix cookies secure flag being set when served over Tor (#17992) 3 years ago
Claire cb45c04d26
Fix migration error handling (#17991) 3 years ago
Claire 5f0fc639da
Fix error re-running some migrations if they get interrupted at the wrong moment (#17989) 3 years ago
Eugen Rochko 6221b36b27
Remove sign-in token authentication, instead send e-mail about new sign-in (#17970) 3 years ago
Holger 39b489ba4c
fix: `s3_force_single_request` not parsed (#17922) 3 years ago
Eugen Rochko 8c7223f4ea
Bump version to 3.5.0 (#17911) 3 years ago
Eugen Rochko d7d049aab7
Bump version to 3.5.0rc3 (#17876) 3 years ago
Eugen Rochko 07f8b4d1b1
Bump version to 3.5.0rc2 (#17855) 3 years ago
Claire 3afd59df0f
Fix tootctl email_domain_blocks add (#17842)
Fixes #17831
3 years ago
Claire b07906bdb0
Fix wrong language code for Kurdish languages (#17812) 3 years ago
Eugen Rochko 4bdce2c513
Bump version to 3.5.0rc1 (#17618)
* Bump version to 3.5.0rc1

* Various fixes and improvements

* Update AUTHORS.md

* Various fixes and improvements

* Update README.md
3 years ago
Claire 642528f455
Update fix-duplicates maintenance task (#17731)
* Update fix-duplicates task to 2022_02_10_153119

Also add support for Appeal to AccountMerging#merge_with!

* Update fix-duplicates task to 2022_03_07_094650

* Update fix-duplicates task to 2022_03_09_213005

* Update fix-duplicates task to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060626

* Update fix-duplicates script to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060706

* Update fix-duplicates task to 2022_03_10_060959

* Silence CodeClimate
3 years ago
Eugen Rochko 75e33fd08f
Fix null values being included in some indexes (#17711)
* Fix null values being included in some indexes

* Update lib/mastodon/migration_helpers.rb

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Add documentation link to corruption error message

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
3 years ago
Claire 61ae6b3535
Add more migration tests (#17710)
* Add migration tests for hide_network settings migration

* Add tests about suspended/suspended_at

* Add more tests regarding the results of migrations

* Fix migration test regarding stale conflicting remote account

* Add migration tests about AccountConversation
3 years ago
Rens Groothuijsen c439e13e12
Enable importing GIF emojis in CLI (#17706) 3 years ago
Josh Soref b5329e0035
Spelling (#17705)
* spelling: account

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: affiliated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: appearance

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: autosuggest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: cacheable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: component

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: conversations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: domain.example

Clarify what's distinct and use RFC friendly domain space.

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: environment

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exceeds

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: functional

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inefficiency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: notifications

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurring

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: position

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: progress

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: promotable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: reblogging

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repetitive

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resolve

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: saturated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: similar

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strategies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: success

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: targeting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: thumbnails

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unauthorized

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unsensitizes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: validations

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: various

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
3 years ago
Jeong Arm 3e12abc1fe
Calculate max_id without random vector (#17623) 3 years ago
Claire 166f6e4b50
Fix some media attachments being converted with too high framerates (#17619)
Video files with variable framerates are converted to constant framerate videos
and the output framerate picked by ffmpeg is based on the original file's
container framerate (which can be different from the average framerate).

This means that an input video with variable framerate with about 30 frames per
second on average, but a maximum of 120 fps will be converted to a constant 120
fps file, which won't be processed by other Mastodon servers.

This commit changes it so that input files with VFR and a maximum framerate
above the framerate threshold are converted to VFR files with the maximum frame
rate enforced.
3 years ago
Eugen Rochko b6d7726ecb
Remove language detection through cld3 (#17478)
* Remove language detection through cld3

* Update app/helpers/languages_helper.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
3 years ago
Eugen Rochko 3413f1c44b
Forward-port version bump to 3.4.6 (#17434) 3 years ago
Claire 54581d43e7
Bump version to 3.4.5 (#17402) 3 years ago
Claire a0e06c3c3e
Add more advanced migration tests (#17393)
- populate the database with some data when testing migrations
- try both one-step and two-step migrations (`SKIP_POST_DEPLOYMENT_MIGRATIONS`)
3 years ago
Claire c6b291afc3
Change index corruption warning to be a little less scary (#17395) 3 years ago
Claire a99adeaad3
Fix edge case in migration helpers that caused crash because of PostgreSQL quirks (#17398) 3 years ago
Claire 8a07ecd377
Remove leftover database columns from Devise::Models::Rememberable (#17191)
* Remove leftover database columns from Devise::Models::Rememberable

* Update fix-duplication maintenance script

* Improve errors/warnings in the fix-duplicates maintenance script
3 years ago
Claire 1e8c885e5a
Change mastodon:webpush:generate_vapid_key task to not require functional env (#17338)
Fixes #17297
3 years ago
Eugen Rochko fe71548844
Fix warnings on Rails boot (#16946) 3 years ago
Claire 76761d5fc0
Add ability for admins to delete canonical email blocks (#16644)
* Add admin option to remove canonical email blocks from a deleted account

* Add tootctl canonical_email_blocks to inspect and remove canonical email blocks
3 years ago
Takeshi Umeda 6c8c031bcd
Add remove orphans to tootctl statuses remove (#17067)
* Add remove orphans to tootctl statuses remove

* Add REINDEX and change option from vacuum to compression-database

* Changed to extract the deletion target of conversations to a temporary table

* Support progress bar and exceptions when media remove

* Add continue option

* Fix compression to compress

* Remove skip_remove_orphans
3 years ago
Takeshi Umeda 0ac7efdc50
Fix performance of tootctl statuses remove (#17052)
* Fix performance of tootctl statuses remove

* Fix model class
3 years ago
Takeshi Umeda 06631fdc53
Fix ElasticSearch to Elasticsearch (#17050) 3 years ago
OSAMU SATO 53aca8aecf
Add batch_size option to bin/tootctl search deploy (#17049) 3 years ago
Eugen Rochko 6e50134a42
Add trending links (#16917)
* Add trending links

* Add overriding specific links trendability

* Add link type to preview cards and only trend articles

Change trends review notifications from being sent every 5 minutes to being sent every 2 hours

Change threshold from 5 unique accounts to 15 unique accounts

* Fix tests
3 years ago
Takeshi Umeda 3419d3ec84
Bump chewy from 5.2.0 to 7.2.3 (supports Elasticsearch 7.x) (#16915)
* Bump chewy from 5.2.0 to 7.2.2

* fix style (codeclimate)

* fix style

* fix style

* Bump chewy from 7.2.2 to 7.2.3
3 years ago
Claire 48f8658d34
Fix upload of remote media with OpenStack Swift sometimes failing (#16998)
Under certain conditions, files fetched from remotes trigger an error when
being uploaded using OpenStack Swift. This is because in some cases, the
remote server will not return a content-length, so our ResponseWithLimitAdapter
will hold a `nil` value for `#size`, which will lead to an invalid value
for the Content-Length header of the Swift API call.

This commit fixes that by taking the size from the actually-downloaded file
size rather than the upstream-provided Content-Length header value.
3 years ago
Claire 18b885ee3a
Fix "bundle exec rails mastodon:setup" crashing in some circumstances (#16976)
Fix regression from #16896
3 years ago
Eugen Rochko 2251db42ec
Forward port version bumps to 3.4.2 and 3.4.3 (#16945)
* Bump version to 3.4.2

* Bump version to 3.4.3
3 years ago
Jeong Arm 884c60002e
Skip blocked domains media on tootctl media refresh (#16914) 3 years ago
Claire 5ba46952af
Fix mastodon:setup to take dotenv/docker-compose differences into account (#16896)
In order to work around https://github.com/mastodon/mastodon/issues/16895,
add a warning to .env.production.sample, and change the mastodon:setup rake
task to:
- output a warning if a variable will be interpreted differently by dotenv
  and docker-compose
- ensure the printed config is compatible with docker-compose
3 years ago
Claire 6ba8bc45cb
Add S3_FORCE_SINGLE_REQUEST env var to work around S3 compatibility issues (#16866)
Fixes #16822
3 years ago
Jeong Arm 3f5f4273b3
Add optional domain restrict to tootctl accounts cull (#16511)
* Add optional domain restrict to accounts cull

* Use "unless" - codeclimate
3 years ago
Claire a8ef6d24d8
Fix `tootctl accounts cull` not excluding domains on timeouts and certificate issues (#16433)
Fixes #16410
3 years ago
Claire 959f7fc580
Fix tootctl self-destruct not sending Delete activities for recently-suspended accounts (#16688)
* Do not block existing users' emails on self-destruct

That is wasteful and unintuitive

* Do not close registrations when running tootctl self-destruct with --dry-run

* Close registrations on self-destruct regardless of known remote accounts

* Fix tootctl self-destruct not sending Deletes for recently-suspended accounts

* Suspend local users even if no remote account is known

* Do not show scary confirmation text if ran with --dry-run
3 years ago
Claire fc3ae1343d
Switch from unmaintained paperclip to kt-paperclip (#16724)
* Switch from unmaintained paperclip to kt-paperclip

* Drop some compatibility monkey-patches not required by kt-paperclip

* Drop media spoof check monkey-patching

It's broken with kt-paperclip and hopefully it won't be needed anymore

* Fix regression introduced by paperclip 6.1.0

* Do not rely on pathname to call FastImage

* Add test for ogg vorbis file with cover art

* Add audio/vorbis to the accepted content-types

This seems erroneous as this would be the content-type for a vorbis stream
without an ogg container, but that's what the `marcel` gem outputs, so…

* Restore missing for_as_default method

* Refactor Attachmentable concern and delay Paperclip's content-type spoof check

Check for content-type spoofing *after* setting the extension ourselves, this
fixes a regression with kt-paperclip's validations being more strict than
paperclip 6.0.0 and rejecting some Pleroma uploads because of unknown
extensions.

* Please CodeClimate

* Add audio/vorbis to the unreliable set

It doesn't correspond to a file format and thus has no extension associated.
3 years ago
Claire 4ac78e2a06
Add feature to automatically delete old toots (#16529)
* Add account statuses cleanup policy model

* Record last inspected toot to delete to speed up successive calls to statuses_to_delete

* Add service to cleanup a given account's statuses within a budget

* Add worker to go through account policies and delete old toots

* Fix last inspected status id logic

All existing statuses older or equal to last inspected status id must be
kept by the current policy. This is an invariant that must be kept so that
resuming deletion from the last inspected status remains sound.

* Add tests

* Refactor scheduler and add tests

* Add user interface

* Add support for discriminating based on boosts/favs

* Add UI support for min_reblogs and min_favs, rework UI

* Address first round of review comments

* Replace Snowflake#id_at_start with with_random parameter

* Add tests

* Add tests for StatusesCleanupController

* Rework settings page

* Adjust load-avoiding mechanisms

* Please CodeClimate
3 years ago
Takeshi Umeda 818e0b314f
Fix unsupported video error message handling (#16581) 3 years ago
Claire 5a1e072517
Change references to tootsuite/mastodon to mastodon/mastodon (#16491)
* Change references to tootsuite/mastodon to mastodon/mastodon

* Remove obsolete test fixture

* Replace occurrences of tootsuite/mastodon with mastodon/mastodon in CHANGELOG

And a few other places
4 years ago
Eugen Rochko 771c9d4ba8
Add ability to skip sign-in token authentication for specific users (#16427)
Remove "active within last two weeks" exception for sign in token requirement

Change admin reset password to lock access until the password is reset
4 years ago
Claire 2e0eac71dd
Add --by-uri option to `tootctl domains purge` (#16434)
Fixes #16410
4 years ago
Claire f6088922c0
Update emoji codepoint mappings to v13.1 (#16352) 4 years ago
Eugen Rochko d6486c969f
Bump version to 3.4.1 (#16350) 4 years ago
Claire 11d3c065a5
Fix migration script not being able to run if it fails midway (#16312)
* Fix migration script not being able to run if it fails midway

* Fix old migration script

* Fix old migration script

* Refactor CorruptionError
4 years ago
Claire 526332c545
Fix account deletion sometimes failing because of optimistic locks (#16317)
* Fix account deletion sometimes failing because of optimistic locks

In some rare occasions[1], deleting accounts would fail with a
`StaleObjectError` exception.

Indeed, account deletion manually sets the `AccountStat` values without
handling cases where the optimistic locking on `AccountStat` would fail.

To my knowledge, with the rewrite of account counters in #15913, the
`DeleteAccountService` is now the only place that changes the counters in
a way that is not atomic.

Since in this specific case, we do not care about the previous values of the
account counters, it appears we don't need locking at all for this table
anymore.

[1]: https://discourse.joinmastodon.org/t/account-cant-be-deleted/3602

* Bump MAX_SUPPORTED_VERSION in maintenance script
4 years ago
Claire abf4c2ab21
Fix `tootctl search deploy` on Ruby 3 (#16346)
Fixes #16344
4 years ago
Eugen Rochko 4c7efdba40
Bump version to 3.4.0 (#16239) 4 years ago
Eugen Rochko d862728ae1
Add more checks to `repo:check_locales_files` (#16249) 4 years ago
Claire 76064e6608
Update fix-duplicates maintenance script to support latest migrations (#16231)
* Update maintenance script to support latest database migrations

* Update Account#merge_with!
4 years ago
rinsuki 5ed5f62705
Fix animated GIF generates animated thumbnail (#16216) 4 years ago
Eugen Rochko 7bd2b54a46
Bump version to 3.4.0rc2 (#16206) 4 years ago
Takeshi Umeda 9b18914c35
Add a Redis environment variable for sidekiq (#16188) 4 years ago
Eugen Rochko d1442a06c3
Bump version to 3.4.0rc1 (#16053) 4 years ago
Claire a5f91a11d0
Fix older migrations on Ruby 3 (#16174) 4 years ago
Claire 566fc90913
Add Ruby 3.0 support (#16046)
* Fix issues with POSIX::Spawn, Terrapin and Ruby 3.0

Also improve the Terrapin monkey-patch for the stderr/stdout issue.

* Fix keyword argument handling throughout the codebase

* Monkey-patch Paperclip to fix keyword arguments handling in validators

* Change validation_extensions to please CodeClimate

* Bump microformats from 4.2.1 to 4.3.1

* Allow Ruby 3.0

* Add Ruby 3.0 test target to CircleCI

* Add test for admin dashboard warnings

* Fix admin dashboard warnings on Ruby 3.0
4 years ago
Eugen Rochko 6d9ad30bf8
Fix media redownload worker retrying on unexpected response codes (#16111) 4 years ago
Eugen Rochko 036556d350
Fix media processing getting stuck on too much stdin/stderr (#16136)
* Fix media processing getting stuck on too much stdin/stderr

See thoughtbot/terrapin#5

* Remove dependency on paperclip-av-transcoder gem

* Remove dependency on streamio-ffmpeg gem

* Disable stdin on ffmpeg process
4 years ago
Takeshi Umeda 25345c90ff
Fix how to change connection pool for rails 6 (#16158)
* Fix how to change connection pool for rails 6

* Fix to match the code elsewhere
4 years ago
Takeshi Umeda 422df9d670
Fix cache redis not being used (#16131) 4 years ago
Ikko Ashimine 0bc909687a
Fix typo in db.rake (#16126)
occured -> occurred
4 years ago
Claire e78d06eecf
Add border to 🚲 emoji (#16035) 4 years ago
Eugen Rochko ad61265268
Remove dependency on pluck_each gem (#16012) 4 years ago
abcang ddabbbf5a6
Fix DB connection pool settings in CLI (#15983) 4 years ago
Stanislas d33351af3c
tootctl emoji import: case insensitive duplicate check (#15738) 4 years ago
Claire cbd0ee1d07
Update Mastodon to Rails 6.1 (#15910)
* Update devise-two-factor to unreleased fork for Rails 6 support

Update tests to match new `rotp` version.

* Update nsa gem to unreleased fork for Rails 6 support

* Update rails to 6.1.3 and rails-i18n to 6.0

* Update to unreleased fork of pluck_each for Ruby 6 support

* Run "rails app:update"

* Add missing ActiveStorage config file

* Use config.ssl_options instead of removed ApplicationController#force_ssl

Disabled force_ssl-related tests as they do not seem to be easily testable
anymore.

* Fix nonce directives by removing Rails 5 specific monkey-patching

* Fix fixture_file_upload deprecation warning

* Fix yield-based test failing with Rails 6

* Use Rails 6's index_with when possible

* Use ActiveRecord::Cache::Store#delete_multi from Rails 6

This will yield better performances when deleting an account

* Disable Rails 6.1's automatic preload link headers

Since Rails 6.1, ActionView adds preload links for javascript files
in the Links header per default.

In our case, that will bloat headers too much and potentially cause
issues with reverse proxies. Furhermore, we don't need those links,
as we already output them as HTML link tags.

* Switch to Rails 6.0 default config

* Switch to Rails 6.1 default config

* Do not include autoload paths in the load path
4 years ago
Claire 82556834cf
Change mastodon:setup to not call assets:precompile in docker (#13942)
It appears assets are built during image build, and they shouldn't need
to be rebuilt, since we now have reproducible builds.
4 years ago
Claire 741d0952b1
Improve account counters handling (#15913)
* Improve account counters handling

* Use ActiveRecord::Base::sanitize_sql to pass values instead of interpolating them

Keep using string interpolation for `key` as it is safe and using
“ActiveRecord::Base::sanitize_sql_hash_for_assignment” would require stitching
bits of SQL in a way that is not more easily checked for safety.

* Add migration hook to catch PostgreSQL versions earlier than 9.5
4 years ago
Claire c31c95ffe4
Remove MySQL-specific code from Mastodon::MigrationHelpers (#15924)
Mastodon::MigrationHelpers has been forked from Gitlab a long time ago, but
Mastodon has never supported using a MySQL database.

Removing MySQL support from Mastodon::MigrationHelpers makes it a little easier
to maintain. In particular, it removes code that would need updating with
Rails 6.
4 years ago
Claire 82caed594c
Change deduplication order of tootctl maintenance fix-duplicates (#15923)
Hopefully fixes #15922

Also update support up to latest database schema version
4 years ago
Claire b358229834
Further preparation for Rails 6 (#15916)
* Use ActiveRecord::Result#to_ary instead of deprecated to_hash

They do the same thing, and to_hash has been removed from Rails 6.1

* Explicitly name polymorphic indexes to workaround a bug in Rails 6.1

cf. https://github.com/rails/rails/issues/41693

* Fix incorrect usage of “foreign_key” in migration script

* Use `ActiveModel::Errors#delete` instead of deprecated clear method

* Fix link headers tests on Rails 6.1

Rails 6.1 adds values to the Link header by default, thus it is not a
LinkHeader object anymore. Fix the test to parse the Link header instead
of assuming it is a LinkHeader.
4 years ago
Claire 9aaaa96d2f
Use more robust hook for loading timestamp_id function into database (#15919) 4 years ago
Claire a4dcaef53b
Prepare Mastodon for zeitwerk autoloader (#15917)
* Prepare Mastodon for zeitwerk autoloader (Rails 6)

Add inflections and rename/move a few classes.

In particular, app/lib/exceptions.rb and app/lib/sanitize_config.rb
were manually loaded while still in autoload paths.

* Add inflection for Url → URL
4 years ago
Claire 43eff898a0
Prepare Mastodon for Rails 6 (#15911)
* Fix misuse of foreign_type

* Fix use of removed "add_template_helper"

* Use response.media_type instead of response.content_type in tests

* Fix CSV export controller test on Rails 6

Rails 6 sets a "filename*" field in the Content-Disposition header to
explicitly encode the filename as UTF-8.

This changes checks the first part of the Content-Disposition header so
it matches in both Rails 5 and Rails 6.

* Fix emoji formatting with Rails 6

* Make emoji output more idiomatic and robust

* Switch from redis-rails gem to built-in Rails redis cache storage
4 years ago
Claire a8139ab016
Add borders to 📱 and 📲 emojis (#15794) 4 years ago
Justin Tracey c9e8e1739c
replace all instances of "ends_with?" with "end_with?" (#15745)
The "ends_with?" method is just a Rails alias of Ruby's "end_with?" method.
Using the latter makes the code less brittle.
4 years ago
Justin Tracey 3f8523130d
use host instead of headers to make Rack happy (#15741)
"headers" is provided by Rails, Rack can't rely on it
4 years ago
Cecylia Bocovich 3447bd2f80
Monkey patch Rack::Session to send secure cookies to onions (#15725) 4 years ago
Claire 21fb3f3684
Drop dependency on secure_headers, fix response headers (#15712)
* Drop dependency on secure_headers, use always_write_cookie instead

* Fix cookies in Tor Hidden Services by moving configuration to application.rb

* Instead of setting always_write_cookie at boot, monkey-patch ActionDispatch
4 years ago
Claire 6feaad33f2
Fix obsolete digitalocean.rake file breaking rake tasks (#15618) 4 years ago
Shubhendra Singh Chauhan c8d11b8bdb
Fixed code quality issues (#15541)
* Added .deepsource.toml

* Removed bad use of `alias`

* Fixed operand order in the binary expression

* Prefixed unused method arguments with an underscore

* Replaced the old OpenSSL algorithmic constants with the newer strings initializers.

* Removed unnecessary UTF-8 encoding comment
4 years ago
ThibG 13d5b81579
Fix “tootctl accounts unfollow” (#15639)
Fixes #15635

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
4 years ago
luigi eb51e43fb4
Optimize some regex matching (#15528)
* Use Regex#match?

* Replace =~ too

* Avoid to call match? from Nil

* Keep value of Regexp.last_match
4 years ago
ThibG 54d4e5252b
Use Rails' index_by where it makes sense (#15542)
* Use Rails' index_by where it makes sense

* Fix tests

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
4 years ago
luigi 087ed84367
Optimize map { ... }.compact calls (#15513)
* Optimize map { ... }.compact

using Enumerable#filter_map, supported since Ruby 2.7

* Add poyfill for Enumerable#filter_map
4 years ago
ThibG 9395143126
Fix maintenance script not re-indexing some indexes on textual values (#15515)
* Fix maintenance script not re-indexing some indexes on textual values

Fixes #15475

* Refresh instance view at the end of the maintenance script run

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
4 years ago
abcang efffdd3778
Fix rubocop config and warnings (#15503)
* disable NewCops

* update TargetRubyVersion

* Fix Lint/MissingSuper for ActiveModelSerializers::Model

* Fix Lint/MissingSuper for feed

* Fix Lint/FloatComparison

* Do not use instance variables
4 years ago
Sophie Parker c7262d12b2
Improve Emoji import (fix #15429) (#15430)
* Improve Emoji import

Skip macOS '._' shadow files in tar archive to speed up import

* Fix codeclimate format issue with whitespace

* Update lib/mastodon/emoji_cli.rb

suggestions from Gargron to improve comment

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>

* Update emoji_cli.rb

Remove extraneous comment (macOS-specific comment now with correct line)

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
4 years ago
Eugen Rochko 633d175146
Bump version to 3.3.0 (#15433) 4 years ago