Commit Graph

2284 Commits

Author SHA1 Message Date
Daniel M Brasil f3feb4c891
Improve test coverage for `/api/v1/admin/email_domain_blocks` () 2023-05-22 13:28:11 +02:00
Emelia Smith 19f9098551
Allow reports with long comments from remote instances, but truncate () 2023-05-22 13:15:21 +02:00
Daniel M Brasil d51464283c
Improve test coverage for `/api/v1/admin/ip_blocks_controller` () 2023-05-22 12:50:44 +02:00
Nick Schonning 99e2e9b81f
Fix minor typos in comments and spec names () 2023-05-19 17:13:29 +02:00
Claire b805b7f021
Add tests for avatar/header in backup service () 2023-05-19 12:04:18 +02:00
Matt Jankowski d34d94d08f
Add spec for migration warning module () 2023-05-19 10:53:50 +02:00
Claire e60414792d
Add polling and automatic redirection to `/start` on email confirmation () 2023-05-16 18:03:52 +02:00
Claire 3ed3d54bf3
Fix reports not being closed when performing batch suspensions () 2023-05-16 14:56:49 +02:00
Matt Jankowski 604e1c2b11
Remove usage of random sample values in specs () 2023-05-15 20:20:13 +02:00
Matt Jankowski b84bc2de5d
Replace i18n view spec with helper spec () 2023-05-15 17:25:04 +02:00
Matt Jankowski 679aca46da
I18n pluralization errors () 2023-05-12 18:53:30 +02:00
Daniel M Brasil 433ab0c9a3
Fix uncaught NoMethodError error in `/api/v1/admin/canonical_email_blocks/test` ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-12 13:46:16 +02:00
Claire 9015c2d646
Change profile updates to be sent to recently-mentioned servers () 2023-05-12 13:13:04 +02:00
Matt Jankowski 2c2d924942
Fix RSpec/RepeatedExampleGroupDescription cop ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-12 12:25:32 +02:00
Matt Jankowski bf3ebeb42f
Fix RSpec/SharedContext cop () 2023-05-12 09:25:43 +02:00
Matt Jankowski a610a02d4f
Fix RSpec/ScatteredSetup cop () 2023-05-11 10:32:09 +02:00
Daniel M Brasil 9cbda99941
Add test coverage for `Mastodon::IpBlocksCLI` () 2023-05-11 10:19:24 +02:00
Claire 6b0942d107
Change AccessTokensVacuum to also delete expired tokens () 2023-05-11 04:40:03 +02:00
Claire 8b31030fe4 Fix rubocop issues in glitch-soc-specific code 2023-05-08 19:28:43 +02:00
Claire d77fbbed73 Merge commit 'f877aa9d70d0d600961989b8e97c0e0ce3ac1db6' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  Upstream made changes, but we had removed it.
  Discarded upstream changes.
- `.rubocop_todo.yml`:
  Upstream regenerated the file, we had some glitch-soc-specific ignores.
- `app/models/account_statuses_filter.rb`:
  Minor upstream code style change where glitch-soc had slightly different code
  due to handling of local-only posts.
  Updated to match upstream's code style.
- `app/models/status.rb`:
  Upstream moved ActiveRecord callback definitions, glitch-soc had an extra one.
  Moved the definitions as upstream did.
- `app/services/backup_service.rb`:
  Upstream rewrote a lot of the backup service, glitch-soc had changes because
  of exporting local-only posts.
  Took upstream changes and added back code to deal with local-only posts.
- `config/routes.rb`:
  Upstream split the file into different files, while glitch-soc had a few
  extra routes.
  Extra routes added to `config/routes/settings.rb`, `config/routes/api.rb`
  and `config/routes/admin.rb`
- `db/schema.rb`:
  Upstream has new migrations, while glitch-soc had an extra migration.
  Updated the expected serial number to match upstream's.
- `lib/mastodon/version.rb`:
  Upstream added support to set version tags from environment variables, while
  glitch-soc has an extra `+glitch` tag.
  Changed the code to support upstream's feature but prepending a `+glitch`.
- `spec/lib/activitypub/activity/create_spec.rb`:
  Minor code style change upstream, while glitch-soc has extra tests due to
  `directMessage` handling.
  Applied upstream's changes while keeping glitch-soc's extra tests.
- `spec/models/concerns/account_interactions_spec.rb`:
  Minor code style change upstream, while glitch-soc has extra tests.
  Applied upstream's changes while keeping glitch-soc's extra tests.
2023-05-08 19:28:21 +02:00
Claire 2d029dedd9 Merge commit '0ad2413b35287958f59073a5b63aecc659a64d98' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/styles/mastodon/forms.scss`:
  Conflict because we ran eslint autofix on upstream files.
- `config/initializers/content_security_policy.rb`:
  Code style changes but we have a different version.
  Kept our version.
- `streaming/index.js`:
  Upstream fixed a typo close to glitch-soc-only code.
  Applied upstream's changes.
2023-05-08 15:28:36 +02:00
Daniel M Brasil c9210af3ee
Add test coverage for `Mastodon::SettingsCLI` () 2023-05-04 20:37:42 +02:00
Claire c3c7d59072
Fix infinite loop in AccountsStatusesCleanupScheduler () 2023-05-04 10:13:00 +02:00
Nick Schonning da3bd913ae
Autofix Rubocop Style/HashSyntax () 2023-05-04 05:54:26 +02:00
Nick Schonning 1fe04f740a
Enable Rubocop Rails/FilePath () 2023-05-04 05:50:40 +02:00
Matt Jankowski c97b611b6b
Fix RSpec/InferredSpecType cop () 2023-05-04 05:49:53 +02:00
Matt Jankowski 710745e16b
Fix RSpec/ContextWording cop () 2023-05-04 05:49:08 +02:00
Matt Jankowski cf18cc2891
Fix RSpec/MultipleSubjects cop () 2023-05-04 05:48:35 +02:00
Matt Jankowski bdcd8a9e88
Misc spec cleanup () 2023-05-04 05:47:52 +02:00
Matt Jankowski 08fb9d300a
Spec coverage for settings/preferences/* controllers () 2023-05-04 05:44:27 +02:00
Claire a2a22bad23
Fix various edge cases with local moves () 2023-05-03 19:19:25 +02:00
Claire 1e75eb690d
Fix own posts not getting delivered to own lists () 2023-05-03 19:17:40 +02:00
Claire c98b012583
Change Move handler to also move list memberships () 2023-05-03 14:03:38 +02:00
Matt Jankowski 3df665fd23
Fix Lint/ConstantDefinitionInBlock cop () 2023-05-03 10:32:30 +02:00
Claire 8b636a29c6
Improve automatic post cleanup worker performances () 2023-05-03 10:31:40 +02:00
Matt Jankowski a0c9f2447e
Fix Performance/MethodObjectAsBlock cop () 2023-05-03 10:30:54 +02:00
Matt Jankowski 97385f27bd
Fix Performance/RedundantEqualityComparisonBlock cop () 2023-05-03 10:30:10 +02:00
Matt Jankowski 05e3abe9d9
Fix Lint/EmptyClass cop () 2023-05-02 21:06:51 +02:00
Matt Jankowski a7df578f97
ApplicationHelper spec coverage, unused removal, tiny refactor () 2023-05-02 18:10:39 +02:00
Matt Jankowski 570079f8ce
Fix Performance/TimesMap cop () 2023-05-02 18:07:16 +02:00
Claire 9189e90ff2
Add fallback redirection when getting a webfinger query `LOCAL_DOMAIN@LOCAL_DOMAIN` ()
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2023-05-02 17:42:42 +02:00
Claire b233da5996
Optimize archive export service and export zip files instead of gzipped tar files () 2023-05-02 15:09:43 +02:00
Claire 6693a4fe7c
Change lists to be able to include accounts with pending follow requests () 2023-05-02 14:40:36 +02:00
Claire 1eb51bd749
Add request specs for caching behavior () 2023-05-02 13:58:29 +02:00
Claire 32a030dd74
Rewrite import feature () 2023-05-02 12:08:48 +02:00
Matt Jankowski d00e45a7d3
Fix Rails/I18nLocaleAssignment cop () 2023-04-30 14:07:03 +02:00
Mark Roszko c23d285b16
Remove the u in Favorite for non-gb english ()
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
2023-04-30 16:33:37 +09:00
João Pedro Marques 8f6e290c7a
Adds new follower/following routes () 2023-04-30 09:01:42 +02:00
Matt Jankowski bdc74086e6
Fix Rails/ContentTag cop () 2023-04-30 06:47:15 +02:00
Matt Jankowski 8dcfb6e0ea
Fix Rails/HttpPositionalArguments cop () 2023-04-30 06:43:28 +02:00
Matt Jankowski 274d561430
Enable local account key generation spec () 2023-04-30 02:28:52 +02:00
Matt Jankowski 4cfe52635c
Add pending spec for User.those_who_can () 2023-04-29 22:03:36 +02:00
Claire 612a1ee697 Fix `body_classes` test for glitch-soc 2023-04-29 11:08:38 +02:00
Claire 12b935fadf Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  Updated upstream, removed in glitch-soc to disable noise.
  Kept removed.
- `CODE_OF_CONDUCT.md`:
  Upstream updated to a new version of the covenant, but I have not read it
  yet, so kept unchanged.
- `Gemfile.lock`:
  Not a real conflict, one upstream dependency updated textually too close to
  the glitch-soc only `hcaptcha` dependency.
  Applied upstream changes.
- `app/controllers/admin/base_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/controllers/application_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/controllers/disputes/base_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/controllers/relationships_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/controllers/statuses_cleanup_controller.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/helpers/application_helper.rb`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `app/javascript/mastodon/features/compose/components/compose_form.jsx`:
  Upstream added a highlight animation for onboarding, while we changed the
  max character limit.
  Applied our local changes on top of upstream's new version.
- `app/views/layouts/application.html.haml`:
  Minor conflict due to glitch-soc's theming system.
  Applied upstream changes.
- `stylelint.config.js`:
  Upstream added ignore paths, glitch-soc had extra ignore paths.
  Added the same paths as upstream.
2023-04-29 10:44:56 +02:00
Nick Schonning 5841f1af8c
Autofix Rubocop RSpec/MatchArray () 2023-04-26 21:29:36 +02:00
Nick Schonning a3393d0d07
Autofix Rubocop RSpec/MatchArray () 2023-04-26 20:21:54 +02:00
Matt Jankowski 91a8cd21d8
React component helper specs () 2023-04-26 18:21:32 +02:00
Nick Schonning 90beba57d8
Autofix Rubocop Rails/ResponseParsedBody () 2023-04-26 17:25:07 +02:00
Claire 276c39361b
Fix anonymous visitors getting a session cookie on first visit () 2023-04-25 16:51:38 +02:00
Claire f45961aa98
Add feature test for OAuth access grant () 2023-04-24 19:06:58 +02:00
Matt Jankowski 0a5f0a8b20
Remove instance variables from helper usage () 2023-04-23 22:35:54 +02:00
Claire 58a1b2e330
Fix caching logic with regards to Accept-Language, Cookie, and Signature () 2023-04-23 22:27:24 +02:00
Claire 5dc3173ef8
Fix AccountsStatusesCleanupScheduler not spreading deletes across accounts correctly () 2023-04-23 22:25:40 +02:00
Claire abfdafef1e Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/auth/setup_controller.rb`:
  Upstream removed a method close to a glitch-soc theming-related method.
  Removed the method like upstream did.
2023-04-22 10:06:11 +02:00
Eugen Rochko e98c86050a
Refactor `Cache-Control` and `Vary` definitions () 2023-04-19 16:07:29 +02:00
Robert R George 4db8230194
Add trend management to admin API () 2023-04-18 11:33:30 +02:00
Heitor de Melo Cardozo bc75e62ca6
Change moderation search an account using the username with @ () 2023-04-17 14:16:36 +02:00
Heitor de Melo Cardozo 4601e0dcbb
Add user handle to notification mail recipient address ()
Co-authored-by: luccamps <luccamps@users.noreply.github.com>
Co-authored-by: Leonardo Negreiros de Oliveira <negreirosleo12@gmail.com>
Co-authored-by: Marcio Flavio <mflaviof1995@gmail.com>
Co-authored-by: Gabriel Quaresma <j.quaresmasantos_98@hotmail.com>
2023-04-17 11:06:06 +02:00
Claire f9a9f9344b Merge branch 'main' into glitch-soc/merge-upstream 2023-04-16 17:52:44 +02:00
Matt Jankowski 10f0de4212
Refactor race condition reblog service spec () 2023-04-14 14:42:10 +02:00
Claire f53d009778
Refactor `Status._insert_record` slightly and tighten the test around reblogs of discarded statuses () 2023-04-12 12:47:05 +02:00
Matt Jankowski 36eeb70d53
Spec coverage on Settings/ controllers specs () 2023-04-11 11:35:39 +02:00
Matt Jankowski a2a66300d9
Clean up the post deployment migration generator () 2023-04-11 11:25:29 +02:00
Claire ce12934f5b Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  Upstream removed a dependency that was textually close to a glitch-soc-only
  dependency.
  Removed the dependency as upstream did, while keeping the glitch-soc-only
  dependency.
2023-04-09 11:45:08 +02:00
Claire ff168ef202
Fix most rubocop issues ()
* Run rubocop --autocorrect on app/, config/ and lib/, also manually fix some remaining style issues

* Run rubocop --autocorrect-all on db/

* Run rubocop --autocorrect-all on `spec/` and fix remaining issues
2023-04-09 11:25:30 +02:00
Matt Jankowski 9d39b111f1
Expand coverage for "system checks" () 2023-04-07 14:39:34 +02:00
Claire 01d6f7529f Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream added a link to the roadmap, but we have a completely different README.
  Kept ours.
- `app/models/media_attachment.rb`:
  Upstream upped media attachment limits.
  Updated the default according to upstream's.
- `db/migrate/20180831171112_create_bookmarks.rb`:
  Upstream changed the migration compatibility level.
  Did so too.
- `config/initializers/content_security_policy.rb`:
  Upstream refactored this file but we have a different version.
  Kept our version.
- `app/controllers/settings/preferences_controller.rb`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  The file does not directly references individual settings anymore.
  Applied upstream changes.
- `app/lib/user_settings_decorator.rb`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  The file got removed entirely.
  Removed it as well.
- `app/models/user.rb`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  References to individual settings have been removed from the file.
  Removed them as well.
- `app/views/settings/preferences/appearance/show.html.haml`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  Applied upstream's changes and ported ours back.
- `app/views/settings/preferences/notifications/show.html.haml`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  Applied upstream's changes and ported ours back.
- `app/views/settings/preferences/other/show.html.haml`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  Applied upstream's changes and ported ours back.
- `config/settings.yml`:
  Upstream completely refactored user settings storage, and glitch-soc has a
  different set of settings.
  In particular, upstream removed user-specific and unused settings.
  Did the same in glitch-soc.
- `spec/controllers/application_controller_spec.rb`:
  Conflicts due to glitch-soc's theming system.
  Mostly kept our version, as upstream messed up the tests.
2023-03-31 21:30:27 +02:00
Christian Schmidt b4f38edf74
Wrong type for user setting when default is defined by lambda () 2023-03-31 07:33:17 +02:00
Eugen Rochko a9b5598c97
Change user settings to be stored in a more optimal way ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-03-30 14:44:00 +02:00
Christian Schmidt eb38e9df31
Requeue expiration notification () 2023-03-29 10:52:40 +02:00
Eugen Rochko 9bda933740
Change media upload limits and remove client-side resizing () 2023-03-25 10:00:03 +01:00
Claire 5ac380c122 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/models/status.rb`:
  Upstream added lines close to a glitch-soc only line, not a real conflict.
  Applied upstream's changes (added hooks) while keeping glitch-soc's changes
  (`local_only` scope).
- `config/environments/production.rb`:
  Upstream removed a header, while we have glitch-soc specific ones.
  Removed the header removed upstream.
2023-03-22 19:50:11 +01:00
Matt Jankowski b179ff84c7
Add specs for Chewy importers () 2023-03-22 14:06:26 +01:00
Claire 193250556c Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream changed their README, we have our own.
  Kept ours.
- `app/helpers/application_helper.rb`:
  Minor code style fix upstream, on a line that is different in glitch-soc
  due to the different theming system.
  Applied the code style fix to our own code.
- `app/views/settings/preferences/appearance/show.html.haml`:
  Code style fix on a line next to lines exclusive to glitch-soc.
  Applied upstream changes.
- `yarn.lock`:
  Upstream updated a dependency textually close to a glitch-soc-only
  dependency.
  Updated the dependency like upstream did.
2023-03-16 23:12:59 +01:00
Christian Schmidt bd047acc35
Replace `Status#translatable?` with language matrix in separate endpoint () 2023-03-16 11:07:24 +01:00
Nick Schonning a38f67c1c3
Autofix Rubocop Style/PreferredHashMethods () 2023-03-16 01:36:37 +01:00
Claire 3ef5f62abf Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Upstream switched to pushing to both DockerHub and GitHub Container
  Repository, while glitch-soc was already pushing to the latter only.
  Updated our configuration to be slightly more consistent with upstream's
  naming and styling, but kept our behavior.
- `Gemfile.lock`:
  Updated dependencies textually too close to glitch-soc only hcaptcha
  dependency.
  Updated dependencies as upstream did.
- `README.md`:
  Upstream updated its README, but we have a completely different one.
  Kept our README, though it probably should be reworked at some point.
- `app/views/auth/sessions/two_factor.html.haml`:
  Minor style fix upstream that's on a line glitch-soc removed because
  of its different theming system.
  Kept our file as is.
- `spec/controllers/health_controller_spec.rb`:
  This file apparently did not exist upstream, upstream created it with
  different contents but it is functionally the same.
  Switched to upstream's version of the file.
- `spec/presenters/instance_presenter_spec.rb`:
  Upstream changed the specs around `GITHUB_REPOSITORY`, while glitch-soc
  had its own code because it's a fork and does not have the same default
  source URL.
  Took upstream's change, but with glitch-soc's repo as the default case.
- `yarn.lock`:
  Upstream dependencies textually too close to a glitch-soc only one.
  Updated dependencies as upstream did.
2023-03-15 09:16:10 +01:00
Claire a232a1feb8
Fix misleading error code when receiving invalid WebAuthn credentials () 2023-03-15 04:15:20 +01:00
Matt Jankowski a471e1c48f
Add spec for the CLI `version` task () 2023-03-15 03:56:09 +01:00
Matt Jankowski 1ed12d5e2f
Add basic search specs for chewy indexes () 2023-03-10 19:31:10 +01:00
Matt Jankowski 688287c59d
Coverage improvement round-out following up previous work () 2023-03-10 13:33:30 +01:00
Matt Jankowski 56bddfbfa3
Serializers spec coverage () 2023-03-10 12:12:51 +01:00
Matt Jankowski 2f7a663b0b
Explicitly set github repo in instance presenter spec () 2023-03-09 14:27:48 +01:00
Christian Schmidt 684a970b3c
Unescape HTML entities () 2023-03-08 19:56:41 +01:00
Claire 7623e18124 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream README has been changed, but we have a completely different one.
  Kept our `README.md`.
- `lib/sanitize_ext/sanitize_config.rb`:
  Upstream added support for more incoming HTML tags (a large subset of what
  glitch-soc accepts).
  Change the code style to match upstream's but otherwise do not change our
  code.
- `spec/lib/sanitize_config_spec.rb`:
  Upstream added support for more incoming HTML tags (a large subset of what
  glitch-soc accepts).
  Kept our version, since the tests are mostly glitch-soc's, except for cases
  which are purposefuly different.
2023-03-05 20:46:56 +01:00
Matt Jankowski c599e289d8
Fix spec for api/v1/statuses/translations () 2023-03-04 23:17:46 +01:00
Matt Jankowski 2d1ccb3d8b
Restore missing fabricators () 2023-03-04 18:31:13 +01:00
Matt Jankowski 506b16cf59
Pending example models minimal coverage () 2023-03-04 17:16:45 +01:00
Matt Jankowski 7f4412eeeb
User mailer spec coverage improvements () 2023-03-04 17:16:11 +01:00
Matt Jankowski 42ddc45133
Admin controllers specs () 2023-03-04 17:13:28 +01:00
Matt Jankowski ad585fb195
Specs api v1 controllers () 2023-03-04 17:12:54 +01:00
Matt Jankowski cd99fa8ceb
Fabricator specs () 2023-03-04 17:12:09 +01:00
Matt Jankowski c40d5e5a8f
Misc coverage improvements for validators () 2023-03-04 17:00:00 +01:00
Matt Jankowski 2f606ba122
Helpers specs coverage improvement () 2023-03-04 16:58:11 +01:00
Matt Jankowski 00eb2269b6
Policies specs () 2023-03-04 16:57:22 +01:00
Matt Jankowski 6a57c42316
Settings controllers specs () 2023-03-04 16:56:43 +01:00
Matt Jankowski 39e7525c96
Add basic coverage for some worker jobs () 2023-03-04 16:56:09 +01:00
Matt Jankowski f9c2213ae5
Models specs coverage () 2023-03-04 16:43:47 +01:00
Christian Schmidt 5a8c651e8f
Only offer translation for supported languages () 2023-03-03 21:06:31 +01:00
Claire 3f52e717fa
Add tests for moderation actions without custom text () 2023-03-03 20:50:46 +01:00
Claire c2a046ded1
Fix “Remove all followers from the selected domains” being more destructive than it claims () 2023-03-03 20:25:15 +01:00
Claire 3a6451c867
Add support for incoming rich text () 2023-03-03 20:19:29 +01:00
Claire 276c1d32d6 Merge branch 'main' into glitch-soc/merge-upstream 2023-03-02 17:32:38 +01:00
Matt Jankowski af578e8ce0
Fix deprecation warning about merging conditions () 2023-03-02 16:21:04 +01:00
Matt Jankowski 9da52ac044
Update rspec-rails to version 6.0.1 () 2023-03-02 15:55:37 +01:00
Matt Jankowski 35dff48edf
Add spec coverage for Admin::Trends::StatusesHelper () 2023-03-02 15:30:40 +01:00
Stanislav Dobrovolschii d9271126ce
Add rspecs for FollowRecommendationsScheduler () 2023-03-02 10:05:05 +01:00
Matt Jankowski b6602f68eb
Spec coverage for HomeHelper () 2023-03-02 10:04:14 +01:00
Matt Jankowski 6185efbc3c
Admin mailer spec coverage improvement () 2023-02-28 22:33:34 +09:00
Matt Jankowski 9ee83a9f3b
Add policies and serializers groups to simplecov output () 2023-02-27 16:35:47 +01:00
Matt Jankowski 4bb39ac3c3
Fix single-record invalid condition on PollVote () 2023-02-27 09:31:15 +01:00
Claire 4ed09276d5 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.prettierignore`:
  Upstream added a line at the end of the file, while glitch-soc had its own
  extra lines.
  Took upstream's change.
- `CONTRIBUTING.md`:
  We have our custom CONTRIBUTING.md quoting upstream. Upstream made changes.
  Ported upstream changes.
- `app/controllers/application_controller.rb`:
  Upstream made code style changes in a method that is entirely replaced
  in glitch-soc.
  Ignored the change.
- `app/models/account.rb`:
  Code style changes textually close to glitch-soc-specific changes.
  Ported upstream changes.
- `lib/sanitize_ext/sanitize_config.rb`:
  Upstream code style changes.
  Ignored them.
2023-02-25 14:00:40 +01:00
Nick Schonning 19614ba247
Rename ActivityPub Serializer Specs () 2023-02-23 23:17:48 +01:00
Claire 20b80c62ff
Change auto-deletion throttling constants to better scale with server size () 2023-02-23 16:52:40 +01:00
Nick Schonning 6bd7003799
Fix mispelled spec filenames () 2023-02-23 11:28:56 +01:00
Claire 3ed1b9ebb6
Fix rack:attack flaky tests and test end of throttle period () 2023-02-22 10:28:52 +01:00
Nick Schonning 8fd3fc404d
Autofix Rubocop Rails/RootPathnameMethods () 2023-02-22 09:57:15 +09:00
Nick Schonning 84cc805cae
Enable Style/FrozenStringLiteralComment for specs () 2023-02-22 09:55:31 +09:00
Nick Schonning 0cfdd1a401
Enable Rubocop Style/StringConcatenation defaults () 2023-02-22 09:54:36 +09:00
Nick Schonning 35d032500b
Autofix Rubocop Security/IoMethods () 2023-02-21 03:21:19 +09:00
Nick Schonning 2c3c734bcc
Autofix Rubocop Style/SymbolProc () 2023-02-20 07:58:46 +01:00
Nick Schonning 717683d1c3
Autofix Rubocop remaining Layout rules () 2023-02-20 06:58:28 +01:00
Nick Schonning 5116347eb7
Autofix Rubocop RSpec/BeEq () 2023-02-20 06:14:50 +01:00
Nick Schonning bf785df9fe
Audofix Rubocop Style/WordArray () 2023-02-20 06:14:10 +01:00
Nick Schonning 4552685f6b
Autofix Rubocop RSpec/LeadingSubject () 2023-02-20 13:24:14 +09:00
Nick Schonning 4ea1e0fceb
Enable Rubocop RSpec/ExpectActual () 2023-02-20 05:00:59 +01:00
Nick Schonning 38a1d8bb85
Autofix Rubocop RSpec/ImplicitSubject () 2023-02-20 05:00:48 +01:00
Nick Schonning 5179c47087
Autofix Rubocops RSpec/ScatteredLet () 2023-02-20 11:17:41 +09:00
Nick Schonning aef0051fd0
Enable Rubocop HTTP status rules () 2023-02-20 11:16:40 +09:00
Nick Schonning bd1d57c230
Autofix Rubocop RSpec/EmptyLineAfterSubject () 2023-02-20 02:46:00 +01:00
Nick Schonning dbc6d7b276
Autofix Rubocop Lint/UnusedBlockArgument () 2023-02-20 02:45:50 +01:00
Nick Schonning 65ba0d92ef
Enable Rubocop RSpec/NotToNot () 2023-02-20 02:33:27 +01:00
Nick Schonning a2fdb388eb
Autofix Rubocop RSpec/ReturnFromStub () 2023-02-20 02:32:10 +01:00
Nick Schonning 21bf326356
Autofix Rubocop Rails/Pluck () 2023-02-20 02:28:40 +01:00
Claire 7452a95998 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  Upstream made changes while we have dropped this file.
  Keep the file deleted.
- `.prettierignore`:
  Upstream made changes at the end of the file, where we
  had our extra lines.
  Just moved our extra lines back at the end.
- `app/serializers/initial_state_serializer.rb`:
  Upstream code style changes.
  Applied them.
- `app/services/backup_service.rb`:
  Upstream code style changes.
  Applied them.
2023-02-19 10:42:55 +01:00
Nick Schonning e0e63b73ee
Autofix Rubocop RSpec/EmptyLineAfterHook () 2023-02-19 14:54:34 +09:00
Nick Schonning 81ad6c2e39
Autofix Rubocop Style/StringLiterals () 2023-02-19 07:38:14 +09:00
Nick Schonning ac3561098e
Autofix Rubocop RSpec/LetBeforeExamples () 2023-02-19 07:17:59 +09:00
Nick Schonning 1a02101100
Autofix Rubocop Style/EmptyLambdaParameter () 2023-02-19 07:12:06 +09:00
Nick Schonning 3680e032b4
Autofix Rubocop RSpec/EmptyLineAfterFinalLet () 2023-02-19 07:10:19 +09:00
Nick Schonning 167709f6b0
Autofix Rubocop Style/BlockDelimiters () 2023-02-19 07:00:17 +09:00
Nick Schonning c0d7c855b3
Autofix Rubocop RSpec/Capybara/FeatureMethods () 2023-02-19 06:59:00 +09:00
Nick Schonning 08289a38fa
Autofix Rubocop Style/TrailingCommaInArrayLiteral () 2023-02-19 06:54:30 +09:00
Nick Schonning 5069769cbe
Autofix Rubocop Style/TrailingCommaInHashLiteral () 2023-02-18 23:33:41 +09:00
Nick Schonning b4cbfff3eb
Autofix Rubocop RSpec/ExcessiveDocstringSpacing () 2023-02-18 12:47:37 +01:00
Nick Schonning c38bd17657
Autofix Rubocop Style/TrailingCommaInArguments () 2023-02-18 12:39:58 +01:00
Nick Schonning e2a3ebb271
Autofix Rubocop Style/IfUnlessModifier () 2023-02-18 12:37:47 +01:00
Nick Schonning d65b2c1924
Apply Rubocop Style/RedundantConstantBase () 2023-02-18 04:30:03 +01:00
Nick Schonning a7db0b41cd
Autofix Rubocop Lint/ParenthesesAsGroupedExpression () 2023-02-18 04:00:05 +01:00
Nick Schonning e5cf23cf3a
Enable Rubocop RSpec/HooksBeforeExamples () 2023-02-18 03:59:57 +01:00
Nick Schonning efd424506a
Autofix Rubocop Style/RedundantPercentQ () 2023-02-18 03:32:57 +01:00
Nick Schonning c0a645f647
Autofix Rubocop RSpec/ExampleWording () 2023-02-18 03:26:20 +01:00
Nick Schonning 7a3d4c3d4b
Enable Rubocop RSpec/MultipleDescribes () 2023-02-18 03:25:47 +01:00
Nick Schonning 54318dcd6d
Autofix Rubocop RSpec/ClassCheck () 2023-02-18 03:24:16 +01:00
Nick Schonning 634368c491
Autofix Rubocop Lint/SymbolConversion () 2023-02-18 03:23:49 +01:00
Nick Schonning 6d42820e5d
Autofix Rubocop Lint/AmbiguousOperator () 2023-02-18 03:22:01 +01:00
Nick Schonning ac59d6f19f
Enable Rubocop Style/NumericLiterals () 2023-02-18 11:05:57 +09:00
Nick Schonning 669f6d2c0a
Run rubocop formatting except line length () 2023-02-18 06:56:20 +09:00
Nick Schonning 6ed6c41724
Autofix Rubocop RSpec/EmptyLineAfterExample () 2023-02-17 21:46:00 +09:00
Nick Schonning 68b1071f86
Autofix Rubocop RSpec/BeNil () 2023-02-17 21:45:27 +09:00
Nick Schonning 936204b9ea
Autofix Rubocop Style/NestedParenthesizedCalls () 2023-02-17 21:43:10 +09:00
Nick Schonning 37914c8757
Autofix Rubocop Style/MethodCallWithoutArgsParentheses () 2023-02-17 21:36:14 +09:00
Claire 66f715550e
Add `memorial` attribute to REST API () 2023-02-14 13:50:55 +01:00
Claire ce84d163cc Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.prettierignore`:
  Upstream added a line at the end, glitch-soc had extra entries at the end.
  Added upstream's new line before glitch-soc's.
- `Gemfile.lock`:
  Upstream updated dependencies while glitch-soc has an extra one (hcaptcha).
  Updated dependencies like upstream did.
- `app/controllers/api/v1/statuses_controller.rb`:
  Not a real conflict, upstream added a parameter (`allowed_mentions`) where
  glitch-soc already had an extra one (`content_type`).
  Added upstream's new parameter.
- `app/javascript/styles/fonts/roboto-mono.scss`:
  A lot of lines were changed upstream due to code style changes, and a lot
  of those lines had path changes to accomodate glitch-soc's theming system.
  Applied upstream's style changes.
- `app/javascript/styles/fonts/roboto.scss`:
  A lot of lines were changed upstream due to code style changes, and a lot
  of those lines had path changes to accomodate glitch-soc's theming system.
  Applied upstream's style changes.
2023-02-13 19:35:35 +01:00
Claire d6930b3847
Add API parameter to safeguard unexpect mentions in new posts () 2023-02-13 16:36:29 +01:00
Varun Sharma 45e2936c89
Add tests to indicate inclusion of self replies in statuses endpoint () 2023-02-13 16:04:26 +01:00
Claire c55568c75a
Add tests for `REST::AccountSerializer` () 2023-02-13 13:23:59 +01:00
Claire 87419f9307 Merge branch 'main' into glitch-soc/merge-upstream 2023-02-10 22:49:59 +01:00
Claire 0c9eac80d8
Fix unbounded recursion in post discovery ()
* Add a limit to how many posts can get fetched as a result of a single request

* Add tests

* Always pass `request_id` when processing `Announce` activities

---------

Co-authored-by: nametoolong <nametoolong@users.noreply.github.com>
2023-02-10 22:16:37 +01:00
Claire 85558a5e18 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Minor upstream change, our README is completely different.
  Kept ours.
- `lib/tasks/assets.rake`:
  glitch-soc has extra code to deal with its theming system,
  upstream changed a line that exists in glitch-soc.
  Applied upstream changes.
2023-02-09 12:46:12 +01:00
Nick Schonning 0592937264
Apply Rubocop Rails/WhereNot ()
* Apply Rubocop Rails/WhereNot

* Update spec for where.not
2023-02-08 10:39:57 +01:00
Nick Schonning 1487fcde93
Apply Rubocop Style/ExpandPathArguments () 2023-02-08 07:06:20 +01:00
Nick Schonning ed570050c6
Autofix Rails/EagerEvaluationLogMessage ()
* Autofix Rails/EagerEvaluationLogMessage

* Update spec for debug block syntax
2023-02-07 03:44:36 +01:00
Claire 9edefc779f
Fix `UserCleanupScheduler` crash when an unconfirmed account has a moderation note ()
* Fix `UserCleanupScheduler` crash when an unconfirmed account has a moderation note

* Add tests
2023-02-07 01:14:44 +01:00
Claire aeacebb3d7 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Upstream updated `docker/build-push-action`, and we a different config
  for `docker/metadata-action` so the lines directly above were different,
  but it's not a real conflict.
  Upgraded `docker/build-push-action` as upstream did.
- `app/javascript/mastodon/features/compose/components/compose_form.js`:
  Upstream changed the codestyle near a line we had modified to accommodate
  configurable character count.
  Kept our change.
2023-02-03 19:23:27 +01:00
Claire 20a479ff7c
Change `POST /settings/applications/:id` to regenerate token on scopes change ()
Fixes 
2023-02-02 12:03:49 +01:00
Claire fad6633156 Merge branch 'main' into glitch-soc/merge-upstream 2023-01-26 19:31:39 +01:00
Claire 13a2abacc8
Add `roles` attribute to Account entities in REST API () 2023-01-25 19:55:40 +01:00
Claire 3074338d79 Merge branch 'main' into glitch-soc/merge-upstream 2023-01-24 20:32:31 +01:00
Claire a5a00d7f7a
Fix email with empty domain name labels passing validation ()
* Fix email with empty domain name labels passing validation

`EmailMxValidator` would allow empty labels because `Resolv::DNS` is
particularly lenient about them, but the email would be invalid and
unusable.

* Add tests
2023-01-24 20:18:41 +01:00
Claire 6883fddb19
Fix account activation being triggered before email confirmation ()
* Add tests

* Fix account activation being triggered before email confirmation

Fixes 
2023-01-24 19:40:21 +01:00
Markus Unterwaditzer f2a6e71bb6
Suppress AddressFamilyError in link verification ()
* Suppress AddressFamilyError

* clarify comment
2023-01-23 13:05:54 +01:00
Claire 448be26b34
Add missing `policy` attribute to `WebPushSubscriptionSerializer` ()
* Add missing `policy` attribute to `WebPushSubscriptionSerializer`

Fixes 

* Add tests
2023-01-23 13:05:30 +01:00
Claire 60abcb3c4c Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `config/i18n-tasks.yml`:
  Upstream added new ignored strings, glitch-soc has extra ignored strings
  because of the theming system.
  Added upstream's changes.
2023-01-18 17:38:11 +01:00
Claire 68dcbcb7bf
Add more specific error messages to HTTP signature verification ()
* Return specific error on failure to parse Date header

* Add error message when preferredUsername is not set

* Change error report to be JSON and include more details

* Change error report to differentiate unknown account and failed refresh

* Add tests
2023-01-18 16:47:56 +01:00
Claire 343e1fe8e9
Add confirmation screen when handling reports ()
* Add confirmation screen on moderation actions

* Add flash notice when a report has been processed

* Refactor tests

* Add tests
2023-01-18 16:40:09 +01:00
Claire 4b92e59f4f
Add support for editing media description and focus point of already-posted statuses ()
* Add backend support for editing media attachments of existing posts

* Allow editing media attachments of already-posted toots

* Add tests
2023-01-18 16:33:55 +01:00
Claire fcc4c9b34a
Change domain block CSV parsing to be more robust and handle more lists ()
* Change domain block CSV parsing to be more robust and handle more lists

* Add some tests

* Improve domain block import validation and reporting
2023-01-18 16:20:52 +01:00
Claire ab59743c13 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/layouts/mailer.html.haml`:
  Upstream removed a line close to one modified by glitch-soc.
  Removed the line as upstream did.
2023-01-14 22:34:09 +01:00
Claire 21a1a8ee88
Fix crash when marking statuses as sensitive while some statuses are deleted ()
* Do not offer to mark statuses as sensitive if there is no undeleted status with media attachments

* Fix crash when marking statuses as sensitive while some statuses are deleted

Fixes 

* Fix multiple strikes being created for a single report when selecting “Mark as sensitive”

* Add tests
2023-01-13 10:46:52 +01:00
Claire 3e63fcd4f0 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/models/status.rb`:
  Minor upstream refactor moved hook definitions around,
  and glitch-soc has an extra `before_create`.
  Moved the `before_create` accordingly.
- `app/services/batched_remove_status_service.rb`:
  Minor upstream refactor changed a block in which glitch-soc
  had one extra call to handle direct timelines.
  Adapted changes to keep glitch-soc's extra call.
2023-01-12 10:15:46 +01:00
Claire 15b88a83ab
Fix sanitizer parsing link text as HTML when stripping unsupported links () 2023-01-11 22:21:10 +01:00
Markus Unterwaditzer 0c689b9d01
fix: allow verification when page size exceeds 1MB (using HTML5 parser) ()
* fix: allow verification when page size exceeds 1MB
Truncates the page after 1MB instead

Closes 

* switch to HTML5 parser, fix rubocop errors

* undo rubocop fixes

Co-authored-by: Chris Zubak-Skees <chriszs@gmail.com>
2023-01-11 21:59:13 +01:00
Claire 6c20dad201 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Upstream updated its README, while we have a completely different one.
  Kept our README.
- `app/controllers/concerns/web_app_controller_concern.rb`:
  Conflict because of glitch-soc's theming system.
  Additionally, glitch-soc has different behavior regarding moved accounts.
  Ported some of the changes, but kept our overall behavior.
- `app/javascript/packs/admin.js`:
  Code changes actually applied to `app/javascript/core/admin.js`
2023-01-05 14:16:25 +01:00
Claire 18fb01ef7c
Fix possible race conditions when suspending/unsuspending accounts ()
* Fix possible race conditions when suspending/unsuspending accounts

* Fix tests

Tests were assuming SuspensionWorker and UnsuspensionWorker would do the
suspending/unsuspending themselves, but this has changed.
2023-01-05 13:47:21 +01:00
Jeong Arm fdd1facba1
Fix home TL could contain post from who blocked me ()
* Fix home tl contains post from who blocked me

* Add test

* Fix feed_manager's build_crutches

blocked_by was not includes status' owner

* Add test for status from I blocked

* Fix typo
2023-01-05 13:30:38 +01:00
Partho Ghosh 115ab2869b
Fix ・ detection in hashtag regex to construct hashtag correctly ()
* Fix ・ detection in hashtag regex to construct hashtag correctly

* Fixed rubocop liniting issues

* More rubocop linting fix
2023-01-04 02:12:48 +01:00
Claire f3a4d57be1 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Discarded upstream changes: we have our own README
- `app/controllers/follower_accounts_controller.rb`:
  Port upstream's minor refactoring
2022-12-15 20:25:25 +01:00
Claire 70415714f1
Add follow request banner on account header ()
* Add requested_by to relationship maps

* Display whether an account has requested to follow you on their profile
2022-12-15 18:50:11 +01:00
Claire 8556a649d5
Fix changing domain block severity not undoing individual account effects ()
* Fix changing domain block severity not undoing individual account effects

Fixes 

* Add tests
2022-12-15 17:45:02 +01:00
Jeong Arm d412147d02
Save avatar or header correctly even if other one fails ()
* Save avatar or header correctly if other one fails

* Fix test
2022-12-15 17:11:14 +01:00
Neil Matatall 1f5740e65c
Use Rails tag API to build RSS feed for spoilers and polls ()
* Use Rails tag API to build RSS feed for spoilers and polls

While the previous method did not contain a bug or a potential issue,
the tag API can be very resilient against future problems and reduces the
amount of manual management of the escape status of the content.

I've added tests to ensure that the formatting is broken and still
escapes control characters correctly.

* this seems cleaner and passes

* Incorporate feedback by moving the br to its own line and using the tag helper over the string constant for the br tag itself

* whoops, tag helper doesn't use a self-closing tag
2022-12-15 16:39:41 +01:00
Ikko Ashimine baecdf2882
Fix typo in application_helper_spec.rb ()
enviroment -> environment
2022-12-15 16:20:55 +01:00
Francis Murillo 5fb1c3e934
Revoke all authorized applications on password reset ()
* Clear sessions on password change

* Rename User::clear_sessions to revoke_access for a clearer meaning

* Add reset paassword controller test

* Use User.find instead of User.find_for_authentication for reset password test

* Use redirect and render for better test meaning in reset password

Co-authored-by: Effy Elden <effy@effy.space>
2022-12-15 15:47:06 +01:00
Meisam 6cdbc345f4
Validate nodeinfo response by schema ()
* add json-schema to :test in Gemfile

* Create node_info_2.0_schema.json

* test match_response_schema

* Create match_response_schema.rb

* Update nodeinfo_controller_spec.rb

* Rename spec/support/node_info_2.0_schema.json to spec/support/schema/node_info_2.0_schema.json

* Update match_response_schema.rb

* cleanup

* additionally validate the json schema itself

disable throwing errors

test the schema matcher

* rename nodeinfo schema to nodeinfo_2.0

* use Rails.root.join to construct the path

* prettify json

* sync Gemfile.lock
2022-12-15 15:43:05 +01:00
Claire 9a3d91f629 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/models/concerns/domain_materializable.rb`:
  Fixed a code style issue upstream in a PR that got merged in glitch-soc
  earlier.
  Changed the code to match upstream's.
2022-12-07 09:03:42 +01:00
Claire b59fb28e90
Fix 500 error when trying to migrate to an invalid address ()
* Fix 500 error when trying to migrate to an invalid address

* Add tests
2022-12-07 02:35:39 +01:00
Francis Murillo f6492a7c4d
Log admin approve and reject account ()
* Log admin approve and reject account

* Add unit tests for approve and reject logging
2022-12-07 00:25:18 +01:00
Claire c8849d6cee
Fix unbounded recursion in account discovery ()
* Fix trying to fetch posts from other users when fetching featured posts

* Rate-limit discovery of new subdomains

* Put a limit on recursively discovering new accounts
2022-12-07 00:15:24 +01:00
Claire 69137f4a90
Fix irreversible and whole_word parameters handling in /api/v1/filters ()
Fixes 
2022-12-07 00:10:53 +01:00
Claire fe523a3045
Fix unbounded recursion in account discovery ()
* Fix trying to fetch posts from other users when fetching featured posts

* Rate-limit discovery of new subdomains

* Put a limit on recursively discovering new accounts
2022-12-04 21:23:19 +01:00
kibigo! 2cabc5d188
Use a tree‐based approach for advanced text formatting ()
* Use a tree‐based approach for adv. text formatting

Sanitizing HTML/Markdown means parsing the content into an HTML tree
under‐the‐hood anyway, and it is more accurate to do mention/hashtag
replacement on the text nodes in that tree than it is to try to hack it
in with regexes et cetera.

This undoes the overrides of `#entities` and `#rewrite` on
`AdvancedTextFormatter` but also stops using them, instead keeping
track of the parsed Nokogiri tree itself and using that in the `#to_s`
method.

Internally, this tree uses `<mastodon-entity>` nodes to keep track of
hashtags, links, and mentions. Sanitization is moved to the beginning,
so it should be known that these do not appear in the input.

* Also disallow entities inside of `<code>`

I think this is generally expected behaviour, and people are annoyed
when their code gets turned into links/hashtags/mentions.

* Minor cleanup to AdvancedTextFormatter

* Change AdvancedTextFormatter to rewrite entities in one pass and sanitize at the end

Also, minor refactoring to better match how other formatters are organized.

* Add some tests

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-12-02 10:29:42 +01:00
Claire a2e7997592 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `README.md`:
  Our README is completely different.
  Discarded upstream changes.
2022-11-28 11:33:34 +01:00
Claire 625216d8e1
Fix attachments of edited statuses not being fetched ()
* Fix attachments of edited statuses not being fetched

* Fix tests
2022-11-27 20:39:05 +01:00
Claire ff42233aae Merge branch 'main' into glitch-soc/merge-upstream 2022-11-22 10:28:43 +01:00
Claire 51a33ce77a
Fix not being able to follow more than one hashtag ()
Fixes regression from 
2022-11-21 10:35:09 +01:00
David Leadbeater 69378eac99
Don't allow URLs that contain non-normalized paths to be verified ()
* Don't allow URLs that contain non-normalized paths to be verified

This stops things like https://example.com/otheruser/../realuser where
"/otheruser" appears to be the verified URL, but the actual URL being
verified is "/realuser" due to the "/../".

Also fix a test to use 'https', so it is testing the right thing, now
that since  https is required.

* missing do
2022-11-20 19:28:13 +01:00
Claire aec61a703f Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `.github/workflows/build-image.yml`:
  Upstream changed how docker images were built, including how
  they were cached.
  I don't know much about it, so applied upstream's changes.
- `app/controllers/admin/domain_blocks_controller.rb`:
  The feature, that was in glitch-soc, got backported upstream.
  It also had a few fixes upstream, so those have been ported!
- `app/javascript/packs/admin.js`:
  Glitch-soc changes have been backported upstream. As a result,
  some code from `app/javascript/core/admin.js` got added upstream.
  Kept our version since our shared Javascript already has that feature.
- `app/models/user.rb`:
  Upstream added something to distinguish unusable and unusable-because-moved
  accounts, while glitch-soc considers moved accounts usable.
  Took upstream's code for `functional_or_moved?` and made `functional?`
  call it.
- `app/views/statuses/_simple_status.html.haml`:
  Upstream cleaned up code style a bit, on a line that we had custom changes
  for.
  Applied upstream's change while keeping our change.
- `config/initializers/content_security_policy.rb`:
  Upstream adopted one CSP directive we already had.
  The conflict is because of our files being structurally different, but the
  change itself was already part of glitch-soc.
  Kept our version.
2022-11-17 12:01:37 +01:00
Rose 4f15fd0ba1
Fix style for hashes ()
* Fix style for hashes

Make the style for hashes consistent.

* New style

More consistency
2022-11-17 11:05:39 +01:00
lenore gilbert c373148b3d
Support for import/export of instance-level domain blocks/allows for 4.x w/ additional fixes ()
* Allow import/export of instance-level domain blocks/allows ()

* Allow import/export of instance-level domain blocks/allows.
Fixes 

* Pacify circleci

* Address simple code review feedback

* Add headers to exported CSV

* Extract common import/export functionality to
AdminExportControllerConcern

* Add additional fields to instance-blocked domain export

* Address review feedback

* Split instance domain block/allow import/export into separate pages/controllers

* Address code review feedback

* Pacify DeepSource

* Work around Paperclip::HasAttachmentFile for Rails 6

* Fix deprecated API warning in export tests

* Remove after_commit workaround

(cherry picked from commit 94e98864e3)

* Add confirmation page when importing blocked domains ()

* Move glitch-soc-specific strings to glitch-soc-specific locale files

* Add confirmation page when importing blocked domains

(cherry picked from commit b91196f4b7)

* Fix authorization check in domain blocks controller

(cherry picked from commit 7527937758)

* Fix error strings for domain blocks and email-domain blocks

Corrected issue with non-error message used for Mastodon:NotPermittedError in Domain Blocks
Corrected issue Domain Blocks using the Email Domain Blocks message on ActionContoller::ParameterMissing
Corrected issue with Email Domain Blocks using the not_permitted string from "custom emojii's"

* Ran i18n-tasks normalize to address test failure

* Removed unused admin.export_domain_blocks.not_permitted string

Removing unused string as indicated by Check i18n

* Fix tests

(cherry picked from commit 9094c2f52c)

* Fix domain block export not exporting blocks with only media rejection

(cherry picked from commit 26ff48ee48)

* Fix various issues with domain block import

- stop using Paperclip for processing domain allow/block imports
- stop leaving temporary files
- better error handling
- assume CSV files are UTF-8-encoded

(cherry picked from commit cad824d8f501b95377e4f0a957e5a00d517a1902)

Co-authored-by: Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2022-11-17 11:05:09 +01:00
Joshua Wood daf6f3453e
Handle links with no href in VerifyLinkService ()
Before this change, the following error would cause VerifyAccountLinksWorker to fail:

NoMethodError: undefined method `downcase' for nil:NilClass
  [PROJECT_ROOT]/app/services/verify_link_service.rb:31 :in `block in link_back_present?`
2022-11-17 10:59:35 +01:00
Claire 767630be24 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `Gemfile`:
  Upstream removed blank lines.
2022-11-14 20:27:31 +01:00
Eugen Rochko 21fd25a269
Fix rate limiting for paths with formats () 2022-11-14 20:26:31 +01:00
Claire 32c70d2f09 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/admin/announcements/edit.html.haml`:
  Upstream change too close to theming-related glitch-soc change.
  Ported upstream changes.
- `app/views/admin/announcements/new.html.haml`
  Upstream change too close to theming-related glitch-soc change.
  Ported upstream changes.
2022-11-14 08:35:55 +01:00
trwnh b59ce0a60f
Move V2 Filter methods under /api/v2 prefix ()
* Move V2 Filter methods under /api/v2 prefix

* move over the tests too
2022-11-14 08:34:07 +01:00
Eugen Rochko 552d69ad96
Fix error when invalid domain name is submitted ()
Fix 
2022-11-14 08:07:14 +01:00
Eugen Rochko b31afc6294
Fix error when passing unknown filter param in REST API ()
Fix 
2022-11-14 08:06:06 +01:00
Hampton Lintorn-Catlin 147d8bd8fc
Support UTF-8 Characters in Domains During CSV Import ()
* Support UTF-8 Characters in Domains During Import

* Update Changelong
2022-11-14 05:52:13 +01:00
Emily Strickland c2231539c7
Test blank account field verifiability ()
* Test blank account field verifiability

This change tests the need for , which ensures that we guard against a situation in which `at_xpath` returns `nil`.

* Test verifiability of blank fields for remote account profiles

This adds a counterpart test for remote account profiles' fields' verifiability when those fields are blank. I previously added the same test for local accounts.
2022-11-13 21:02:09 +01:00
Claire 93912f0498 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/models/account.rb`:
  Conflict because we (glitch-soc) have disabled trending of posts without
  review.
  Discarded that upstream change.
- `app/views/admin/settings/discovery/show.html.haml`:
  Just an extra setting in glitch-soc.
  Kept that extra setting.
2022-11-12 13:28:03 +01:00
F d4f973227c
Test the native_locale_name of a non-standard locale ()
`:en` is English for both `standard_locale_name` and
`native_locale_name`, and so makes for a poor test candidate for
differentiating between them.
2022-11-11 00:06:18 +01:00
Claire c118918520 Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/models/custom_emoji.rb`:
  Not a real conflict, just upstream changing a line too close to
  a glitch-soc-specific validation.
  Applied upstream changes.
- `app/models/public_feed.rb`:
  Not a real conflict, just upstream changing a line too close to
  a glitch-soc-specific parameter documentation.
  Applied upstream changes.
2022-11-10 09:36:47 +01:00
Eugen Rochko 9965a23b04
Change link verification to ignore IDN domains ()
Fix 
2022-11-10 06:27:45 +01:00
Eugen Rochko e98833748e
Fix being able to spoof link verification ()
- Change verification to happen in `default` queue
- Change verification worker to only be queued if there's something to do
- Add `link` tags from metadata fields to page header of profiles
2022-11-09 08:24:21 +01:00
luzpaz 6ba52306f9
Fix typos ()
Found via `codespell -q 3 -S ./yarn.lock,./CHANGELOG.md,./AUTHORS.md,./config/locales,./app/javascript/mastodon/locales -L ba,followings,keypair,medias,pattens,pixelx,rememberable,ro,te`
2022-11-08 17:32:03 +01:00
Roni Laukkarinen 36b0ff57b7
Fix grammar () 2022-11-08 16:35:42 +01:00
Claire a8c854b3ea Merge branch 'main' into glitch-soc/merge-upstream 2022-11-08 15:44:57 +01:00
Claire bbf74498f5
Fix validation error in SynchronizeFeaturedTagsCollectionWorker ()
* Fix followers count not being updated when migrating follows

Fixes 

* Fix validation error in SynchronizeFeaturedTagsCollectionWorker

Also saves remote user's chosen case for hashtags

* Limit remote featured tags before validation
2022-11-07 22:35:53 +01:00
Claire be7032b9cf Merge branch 'main' into glitch-soc/merge-upstream 2022-11-07 19:53:30 +01:00
Claire 3114c826a7
Fix filter handling in status cache hydration () 2022-11-07 19:47:48 +01:00