Compare commits

...

558 Commits

Author SHA1 Message Date
Ariadne Conill e8b0b5d83e Merge pull request 'Incorporate glitch changes as of 2023-07-06' (#62) from test-merge-2023-07-04 into main
ci/woodpecker/push/woodpecker Pipeline was successful Details
Reviewed-on: #62
2023-07-06 20:27:32 +00:00
kouhai dev f26d104e75 th: Merge remote-tracking branch 'glitch/main'
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
fixes: CVE-2023-36459
fixes: CVE-2023-36460
fixes: CVE-2023-36461
fixes: CVE-2023-36462
fixes: GHSA-55j9-c3mp-6fcq
fixes: GHSA-9928-3cp5-93fm
fixes: GHSA-9pxv-6qvf-pjwc
fixes: GHSA-ccm4-vgcc-73hp
2023-07-06 12:12:21 -07:00
Claire c25ba31e95
Merge pull request #2274 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-07-06 15:21:10 +02:00
Claire ff7aae3037 Merge branch 'main' into glitch-soc/merge-upstream 2023-07-06 15:16:34 +02:00
Claire 5e1752ce3f
Bump version to v4.1.3 (#25757) 2023-07-06 15:14:42 +02:00
Claire 610731b03d
Merge pull request from GHSA-55j9-c3mp-6fcq 2023-07-06 15:06:49 +02:00
Claire c5929798bf
Merge pull request from GHSA-9pxv-6qvf-pjwc
* Fix timeout handling of outbound HTTP requests

* Use CLOCK_MONOTONIC instead of Time.now
2023-07-06 15:06:23 +02:00
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
2023-07-06 15:05:05 +02:00
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
2023-07-06 15:03:33 +02:00
Claire fed9cbfd2b
Add hardened headers to user-uploaded files (#25756) 2023-07-06 14:31:37 +02:00
kouhai dev 814c1f7a71 th: reduce ci clone depth
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-07-06 02:47:21 -07:00
kouhai dev 4ff0116cf6 th: quieter yarn please
yarn cache logs make woodpecker webui lag. this is not ideal.
2023-07-06 02:47:21 -07:00
Claire 30ad9d976b
Merge pull request #2272 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-07-05 16:47:23 +02:00
Eugen Rochko c0fa85b8dd [Glitch] Fix regression of icon button colors in web UI
Port 69e124e2ed to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 13:31:26 +02:00
Trevor Wolf 4719d88117 [Glitch] Change button colors to increase hover/focus contrast and consistency
Port 54cb679c19 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 13:30:52 +02:00
Eugen Rochko a117c953d0 [Glitch] Add button to see results for polls in web UI
Port b7910bc751 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 12:42:24 +02:00
Eugen Rochko b3f209370b [Glitch] Add canonical link tags in web UI
Port 000b835803 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 12:41:52 +02:00
mogaminsk c6246807f5 [Glitch] Fix local live feeds does not expand
Port 6268188543 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 12:39:46 +02:00
forsamori ac74374311 [Glitch] Add at-symbol prepended to mention span title
Port d9a5c1acfa to glitch-soc

Co-authored-by: Sam BC <samuel.balbirnie-cumming@xdesign.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 12:38:54 +02:00
Eugen Rochko 0a5271629c [Glitch] Change labels of live feeds tabs in web UI
Port 54a10523e2 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-05 12:37:37 +02:00
Claire 5de49e74d4 Merge branch 'main' into glitch-soc/merge-upstream 2023-07-05 12:01:26 +02:00
Eugen Rochko 000b835803
Add canonical link tags in web UI (#25715) 2023-07-05 11:25:27 +02:00
kouhai dev 361dc97e40 th: run haml-lint on quote haml
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-07-05 01:50:54 -07:00
kouhai dev 4801cfbf78 th: invite limit nonfixited bugs 2023-07-05 01:50:54 -07:00
kouhai dev e5fdf9ab86 th: update haml-lint for autocorrect 2023-07-05 01:49:42 -07:00
kouhai dev ea47ea1479 th: oops, foreman's back 2023-07-05 01:49:42 -07:00
Eugen Rochko b7910bc751
Add button to see results for polls in web UI (#25726) 2023-07-05 10:32:04 +02:00
kouhai dev 961ac9e493 th: merge glitch again (lol)
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-07-05 01:14:10 -07:00
kouhai dev 1857350c10 th: update ruby
ci/woodpecker/push/woodpecker Pipeline was successful Details
2023-07-05 00:27:37 -07:00
kouhai dev 763bcbbc19 th: update node base docker
ci/woodpecker/push/woodpecker Pipeline failed Details
2023-07-05 00:24:27 -07:00
kouhai dev 0c68cb08f5 th: add invite limits behind TH_USE_INVITE_QUOTA
ci/woodpecker/push/woodpecker Pipeline was successful Details
TH_USE_INVITE_QUOTA: feature flag
TH_INVITE_MAX_USES: max uses per invite for non-moderators
TH_ACTIVE_INVITE_SLOT_QUOTA: max slots in active invites, including consumed slots
2023-07-05 00:20:28 -07:00
Cyra W c4f112ff01 th: add slowest dot network to readme 2023-07-05 00:14:12 -07:00
kouhai dev aeaeed71f3 th: 12-factor ~~authentication~~ apps were a mistake 2023-07-05 00:14:12 -07:00
Claire eb2417ce99
Fix OAuth apps page crashing when listing apps with certain admin API scopes (#25713) 2023-07-04 18:58:23 +02:00
Claire 4658263b4a
Fix re-activated accounts being deleted by AccountDeletionWorker (#25711) 2023-07-04 18:36:24 +02:00
Trevor Wolf 182fd93a07
fix read more button overlapping thread line bug (#25706) 2023-07-04 14:57:46 +02:00
Claire 12fa24a885
Fix forgotten unconfirmed_email migration file (#25702) 2023-07-04 11:25:29 +02:00
mogaminsk 6268188543
Fix local live feeds does not expand (#25694) 2023-07-04 00:37:57 +02:00
forsamori d9a5c1acfa
Add at-symbol prepended to mention span title (#25684)
Co-authored-by: Sam BC <samuel.balbirnie-cumming@xdesign.com>
2023-07-03 22:58:10 +02:00
Eugen Rochko 54a10523e2
Change labels of live feeds tabs in web UI (#25683) 2023-07-03 22:57:18 +02:00
Daniel M Brasil 383c00819c
Fix `/api/v2/search` not working with following query param (#25681) 2023-07-03 18:06:57 +02:00
Eugen Rochko 69e124e2ed
Fix regression of icon button colors in web UI (#25679) 2023-07-03 16:51:04 +02:00
Plastikmensch ed15893eed
Add regex filter back to firehose (#2266)
* Add regex filter back to firehose

The regex filter will apply to all tabs and not be automatically applied when pinned.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Keep regex when pinned

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-07-03 15:41:50 +02:00
Trevor Wolf 54cb679c19
Change button colors to increase hover/focus contrast and consistency (#25677) 2023-07-03 11:32:31 +02:00
Plastikmensch b422b5eebd
Fix showing local only toots in "All" (#2265)
* Fix warnings about missing dependency in hooks

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Add `allowLocalOnly` to timelineId

Without this local-only toots will never be loaded.

feedType is checked to be public to not show local-only toots in the "Remote" tab.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-07-03 07:00:38 +02:00
Claire ed567c9de6
Merge pull request #2263 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-07-02 22:14:45 +02:00
Claire 9f3c3f5209 Show local-only posts in “All” by default, and add back option to toggle it 2023-07-02 20:28:02 +02:00
Claire e6a8faae81
Add users index on unconfirmed_email (#25672) 2023-07-02 19:41:35 +02:00
Claire 933ba1a3eb
Add superapp index on `oauth_applications` (#25670) 2023-07-02 16:56:16 +02:00
Claire 180f0e6715
Fix inefficient query when requesting a new confirmation email from a logged-in account (#25669) 2023-07-02 16:08:58 +02:00
mogaminsk 587ddc2c7f [Glitch] Prevent duplicate concurrent calls of `/api/*/instance` in web UI
Port 5b46345459 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 12:00:03 +02:00
Eugen Rochko c49e339c89 [Glitch] Change dropdown icon above compose form from ellipsis to bars in web UI
Port 0512537eb6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 11:59:31 +02:00
Claire 7cc2c1be29 [Glitch] Change local and federated timelines to be in a single firehose column
Port cea9db5a0b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 11:58:51 +02:00
Renaud Chaput eb1cb8224a [Glitch] Use an Immutable Record as the root state
Port 78ba12f0bf to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 11:55:34 +02:00
Claire 2ba4773ebe [Glitch] Fix onboarding prompt being displayed because of disconnection gaps
Port 9934949fc4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 11:55:08 +02:00
Claire b75aa6b819 [Glitch] Remove the search button from UI header when logged out
Port 285a691936 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-07-02 11:54:47 +02:00
Claire 44e98a2740 Merge branch 'main' into glitch-soc/merge-upstream 2023-07-02 11:49:08 +02:00
Eugen Rochko ba06a2f104
Revert "Rails 7 update" (#25667) 2023-07-02 11:14:22 +02:00
mogaminsk 5b46345459
Prevent duplicate concurrent calls of `/api/*/instance` in web UI (#25663) 2023-07-02 11:12:16 +02:00
Eugen Rochko 0512537eb6
Change dropdown icon above compose form from ellipsis to bars in web UI (#25661) 2023-07-02 10:39:55 +02:00
Matt Jankowski 50c2a03695
Rails 7 update (#24241) 2023-07-02 10:38:53 +02:00
Daniel M Brasil 4fe2d7cb59
Fix HTTP 500 in `/api/v1/emails/check_confirmation` (#25595) 2023-07-02 00:05:44 +02:00
Claire cea9db5a0b
Change local and federated timelines to be in a single firehose column (#25641) 2023-07-02 00:05:10 +02:00
Matt Jankowski 0139b1c8e1
Update uri to version 0.12.2 (CVE fix) (#25657) 2023-07-02 00:04:21 +02:00
Vivianne 155fc459e3
Fixing an issue with a missing argument (#2261)
undefined
2023-07-01 22:55:43 +02:00
Matt Jankowski f8bd581126
Remove unused routes (#25578) 2023-07-01 21:48:53 +02:00
Matt Jankowski 683ba5ecb1
Fix rails `rewhere` deprecation warning in directories api controller (#25625) 2023-07-01 21:48:16 +02:00
Matt Jankowski c47cdf6e17
Add index to backups on `user_id` column (#25647) 2023-06-30 19:09:03 +02:00
Renaud Chaput 78ba12f0bf
Use an Immutable Record as the root state (#25584) 2023-06-30 17:03:25 +02:00
Claire 9934949fc4
Fix onboarding prompt being displayed because of disconnection gaps (#25617) 2023-06-30 16:32:12 +02:00
Eugen Rochko 8bfbd19d2b Update Crowdin configuration file 2023-06-30 16:22:40 +02:00
Renaud Chaput c4a8c332b2
Remove `pkg-config` gem dependency (#25615) 2023-06-30 14:59:07 +02:00
Claire a209d1e683
Fix ResolveURLService not resolving local URLs for remote content (#25637) 2023-06-29 14:48:54 +02:00
jsgoldstein 4581a528f7
Change account search to match by text when opted-in (#25599)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
2023-06-29 13:05:21 +02:00
Claire 285a691936
Remove the search button from UI header when logged out (#25631) 2023-06-28 14:57:51 +02:00
Claire 8b4df95dbe
Merge pull request #2258 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-27 14:47:30 +02:00
Renaud Chaput c43cfd2406 [Glitch] Improve dismissable banner buttons when they dont fit on 1 line
Port ae30a60b1f to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-27 13:25:21 +02:00
Eugen Rochko 4faa4eb3c4 [Glitch] Fix onboarding prompt flashing while home feed is loading in web UI
Port 65aa04647a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-27 13:21:55 +02:00
Eugen Rochko 2f996375e5 [Glitch] Fix search not being easily findable on smaller screens in web UI
Port 2b78c07ef1 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-27 13:21:14 +02:00
Claire 80a5c16ae1 Merge branch 'main' into glitch-soc/merge-upstream 2023-06-27 13:15:41 +02:00
Claire c7c6f02ae6
Fix suspending an already-limited domain (#25603) 2023-06-27 12:32:51 +02:00
renovate[bot] ceca93d0d1
Update dependency glob to v10.3.0 (#25608)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 12:16:17 +02:00
renovate[bot] a9ba8263a0
Update mcr.microsoft.com/devcontainers/ruby Docker tag to v1 (#25613)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 11:28:07 +02:00
renovate[bot] dbd37f129d
Update dependency pg to v8.11.1 (#25604)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 10:36:21 +02:00
renovate[bot] b7f6280ef4
Update dependency pg-connection-string to v2.6.1 (#25605)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 10:21:54 +02:00
renovate[bot] a90190f813
Update dependency react-textarea-autosize to v8.5.0 (#25610)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 10:20:46 +02:00
renovate[bot] ccaa676452
Update dependency sass to v1.63.6 (#25607)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 10:20:09 +02:00
renovate[bot] d9b07b6a11
Update dependency rails to v6.1.7.4 (#25606)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-27 10:19:51 +02:00
Claire 0ccf6c0eb7
Fix batch attachment deletion leaving empty directories (#25587) 2023-06-27 09:36:11 +02:00
renovate[bot] 9caa0475f8
Update dependency react-redux to v8.1.1 (#25432)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-26 20:59:58 +02:00
S.H 7a25af64dd
Remove media attachment only when file was exist (#25586) 2023-06-26 16:38:19 +02:00
Eugen Rochko bb4756c823
Change files to be deleted in batches instead of one-by-one (#23302) 2023-06-26 14:17:41 +02:00
Renaud Chaput ae30a60b1f
Improve dismissable banner buttons when they dont fit on 1 line (#25580)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-06-26 12:31:48 +02:00
Claire ed96e28c9e
Fix compose form not being shown when clicking “Make your first post” on mobile (#25581) 2023-06-26 12:30:35 +02:00
Eugen Rochko 7b024baf50
Change header backgrounds to use fewer different colors in web UI (#25577) 2023-06-26 05:27:07 +02:00
Eugen Rochko 65aa04647a
Fix onboarding prompt flashing while home feed is loading in web UI (#25579) 2023-06-26 05:26:54 +02:00
Eugen Rochko 2b78c07ef1
Fix search not being easily findable on smaller screens in web UI (#25576) 2023-06-26 05:26:41 +02:00
Claire b052a7ed95
Merge pull request #2256 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-25 21:01:10 +02:00
Claire 5def74a436 [Glitch] Remove unique accounts condition from Home onboarding prompt
Port 0842a68532 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 17:40:01 +02:00
Eugen Rochko 6fb34258a4 [Glitch] Add onboarding prompt when home feed too slow in web UI
Port 00ec43914a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 17:40:01 +02:00
Claire 7d160d2272 [Glitch] Fix j/k keyboard shortcuts on some status lists
Port a8c1c8bd37 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 17:40:01 +02:00
mogaminsk 222713a768 [Glitch] Fix custom signup URL may not loaded
Port 8d2c26834f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 14:27:46 +02:00
Ian 6fe345c383 [Glitch] Change emoji picker icon
Port 69db507924 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 14:27:46 +02:00
たいち ひ c71fc42f4e [Glitch] Rewrite `<AutosuggestHashtag />` as FC and TS
Port 804488d38e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-25 14:27:46 +02:00
Claire 178e151019 Merge commit '55e7c08a83547424024bac311d5459cb82cf6dae' into glitch-soc/merge-upstream
Conflicts:
- `app/models/user_settings.rb`:
  Upstream added a constraint on a setting textually close
  to glitch-soc-only settings.
  Applied upstream's change.
- `lib/sanitize_ext/sanitize_config.rb`:
  Upstream added support for the `translate` attribute on a few elements,
  where glitch-soc had a different set of allowed elements and attributes.
  Extended glitch-soc's allowed attributes with `translate` as upstream did.
- `spec/validators/status_length_validator_spec.rb`:
  Upstream refactored to use RSpec's `instance_double` instead of `double`,
  but glitch-soc had changes to tests due to configurable max toot chars.
  Applied upstream's changes while keeping tests against configurable max
  toot chars.
2023-06-25 14:27:38 +02:00
Claire 55e7c08a83
Fix verified badge in account lists potentially including rel="me" links (#25561) 2023-06-24 17:24:31 +02:00
Eugen Rochko a985d587e1
Change labels and styles on the onboarding screen in web UI (#25559) 2023-06-23 16:34:27 +02:00
Claire 0842a68532
Remove unique accounts condition from Home onboarding prompt (#25556) 2023-06-23 14:44:54 +02:00
Eugen Rochko 00ec43914a
Add onboarding prompt when home feed too slow in web UI (#25267) 2023-06-22 23:48:40 +02:00
Claire 1d622c8033
Add POST /api/v1/conversations/:id/unread (#25509) 2023-06-22 18:46:43 +02:00
Matt Jankowski c9cd634184
Use default `bootsnap/setup` in boot.rb (#25502) 2023-06-22 18:46:32 +02:00
Claire a8c1c8bd37
Fix j/k keyboard shortcuts on some status lists (#25554) 2023-06-22 17:54:43 +02:00
Claire a5b6f6da80
Change /api/v1/statuses/:id/history to always return at least one item (#25510) 2023-06-22 14:56:14 +02:00
Matt Jankowski 05f9e39b32
Fix `RSpec/VerifiedDoubles` cop (#25469) 2023-06-22 14:55:22 +02:00
Matt Jankowski 38433ccd0b
Reduce `Admin::Reports::Actions` spec db activity (#25465) 2023-06-22 14:53:13 +02:00
Claire 602c458ab6
Add finer permission requirements for managing webhooks (#25463) 2023-06-22 14:52:25 +02:00
Matt Jankowski 63d15d5330
Speed-up on `StatusesController` spec (#25549) 2023-06-22 14:51:53 +02:00
mogaminsk 8d2c26834f
Fix custom signup URL may not loaded (#25531) 2023-06-22 12:10:49 +02:00
Matt Jankowski 0b39b9abee
Speed-up on `BackupService` spec (#25527) 2023-06-22 11:53:28 +02:00
Daniel M Brasil 6ac271c2a0
Migrate to request specs in `/api/v1/suggestions` (#25540) 2023-06-22 11:49:35 +02:00
Ian 69db507924
Change emoji picker icon (#25479) 2023-06-21 17:58:00 +02:00
Claire 37a9c2258a
Add per-test timeouts to AutoStatusesCleanupScheduler tests (#24841) 2023-06-20 18:54:05 +02:00
Claire ebfeaebedb
Fix /api/v1/conversations sometimes returning empty accounts (#25499) 2023-06-20 18:32:26 +02:00
Claire ec91ea4457
Fix missing validation on `default_privacy` setting (#25513) 2023-06-20 18:32:14 +02:00
Daniel M Brasil e53eb38a8d
Migrate to request specs in `/api/v1/admin/account_actions` (#25514) 2023-06-20 18:16:48 +02:00
Claire fd23f50243
Fix wrong view being displayed when a webhook fails validation (#25464) 2023-06-20 18:15:35 +02:00
Claire c78280a8ce
Add translate="no" to outgoing mentions and links (#25524) 2023-06-20 18:10:19 +02:00
Emelia Smith 3a91603b15
Prevent UserCleanupScheduler from overwhelming streaming (#25519) 2023-06-20 18:04:35 +02:00
Plastikmensch eba3411bfa
Re-allow title attribute in <abbr> (#2254)
* Re-allow title attribute in <abbr>

This was accidentally removed in 7623e18124

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

* Add test

Add a new test to check that title attribute on <abbr> is kept.

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>

---------

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-06-19 18:01:35 +02:00
Claire dd07393e75
Fix user settings not getting validated (#25508) 2023-06-19 14:06:06 +01:00
たいち ひ 804488d38e
Rewrite `<AutosuggestHashtag />` as FC and TS (#25481) 2023-06-19 14:11:46 +02:00
Matt Jankowski e1c9d52e91
Reduce `sleep` time in request pool spec (#25470) 2023-06-19 13:48:25 +02:00
renovate[bot] cec4f1d506
Update dependency dotenv to v16.2.0 (#25506)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-19 11:28:59 +02:00
Matt Jankowski 3a65fb044f
Add coverage for `UserMailer` methods (#25484) 2023-06-19 09:50:35 +02:00
Matt Jankowski e835198b26
Combine assertions in api/v1/notifications spec (#25486) 2023-06-19 09:05:42 +02:00
Matt Jankowski 155ec185b2
Remove unused `picture_hint` helper method (#25485) 2023-06-19 09:04:15 +02:00
renovate[bot] a0d7ae257d
Update dependency aws-sdk-s3 to v1.126.0 (#25480)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-19 09:03:50 +02:00
Daniel M Brasil b9bc9d0bda
Fix incorrect pagination headers in `/api/v2/admin/accounts` (#25477) 2023-06-19 08:53:05 +02:00
Daniel M Brasil 0a0a1f1495
Migrate to request specs in `/api/v1/tags` (#25439) 2023-06-19 08:51:40 +02:00
Claire 4ddb736d95
Merge pull request #2252 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-18 16:38:08 +02:00
Claire dc68306b8e Merge branch 'main' into glitch-soc/merge-upstream
Conflicts:
- `app/views/layouts/application.html.haml`:
  Conflicts due to glitch-soc's theming system.
  Added `crossorigin: 'anonymous'` like upstream did, to the glitch-soc-specific code.
- `app/views/layouts/embedded.html.haml`:
  Conflicts due to glitch-soc's theming system.
  Added `crossorigin: 'anonymous'` like upstream did, to the glitch-soc-specific code.
2023-06-18 16:14:29 +02:00
Claire f3c2035fce
Merge pull request #2251 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-18 16:11:49 +02:00
Claire 64f7a11658
Fix cross-origin loading of locales (#25498) 2023-06-18 15:47:04 +02:00
Claire 3b04e39534 [Glitch] Fix non-interactive upload container being given a `button` role and tabIndex
Port c9d06d10d4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 14:10:49 +02:00
Claire e5978184a6 Fix glitch-soc-only test being broken by refactor of the surrounding tests 2023-06-18 13:59:47 +02:00
Claire 6c99479ef4 Merge commit '9e245d147bcb2c72cc552ff8c276a1c34e2f686d' into glitch-soc/merge-upstream
Conflicts:
- `app/views/settings/profiles/show.html.haml`:
  Upstream redesigned the settings page, where glitch-soc had changes because of
  the ability to set some custom limits.
  Went with upstream's design while keeping our custom limits.
- `yarn.lock`:
  Upstream updated dependencies textually close to a glitch-soc-only dependency.
  Updated the dependnencies as well.
2023-06-18 13:41:33 +02:00
Eugen Rochko d795c2c70c [Glitch] Fix CAPTCHA page not following design pattern of sign-up flow
Port 39110d1d0a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 12:11:58 +02:00
たいち ひ b1b95ddd1f [Glitch] Rewrite `emoji_mart_data_light` as TS
Port 3b5e302f7f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 12:11:19 +02:00
alfe 9bf63257fb [Glitch] Rewrite `<LoadingIndicator/>` as FC and TS (#25364)
Port a86886b1fd to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 12:10:37 +02:00
Renaud Chaput 0a212cfa7f [Glitch] Add missing report category translation
Port 1cb4514d0e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 10:43:07 +02:00
alfe cdec45eca9 [Glitch] Rewrite <LoadPending /> as FC and TS
Port dfaf59d99a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 10:42:04 +02:00
Eugen Rochko f815bd5fd9 [Glitch] Change "bot" label to "automated"
Port 432a5d2d4b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-18 10:40:56 +02:00
Claire 65cbcce997 Merge commit '39110d1d0af5e3d9cf452ae47496a52797249fd0' into glitch-soc/merge-upstream 2023-06-18 10:36:14 +02:00
renovate[bot] 9e245d147b
Update dependency aws-sdk-s3 to v1.125.0 (#25458)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-16 14:23:58 +02:00
Claire c9d06d10d4
Fix non-interactive upload container being given a `button` role and tabIndex (#25462) 2023-06-16 12:03:06 +02:00
Matt Jankowski b276b3bb83
Remove Ruby GC config from spec helper (#25455) 2023-06-15 22:14:46 +01:00
renovate[bot] e686a54064
Update dependency better_errors to v2.10.1 (#25445)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-15 10:41:04 +02:00
Daniel M Brasil b10c05e702
Migrate to request specs in `/api/v1/lists` (#25443) 2023-06-15 10:19:51 +02:00
renovate[bot] 8b2048d0c8
Lock file maintenance (#25434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-15 10:13:12 +02:00
renovate[bot] a6d7abb29d
Update dependency intl-messageformat to v10.5.0 (#25431)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-15 09:36:10 +02:00
renovate[bot] 36566e9245
Update dependency core-js to v3.31.0 (#25430)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 18:32:55 +02:00
renovate[bot] 478687fc49
Update libretranslate/libretranslate Docker tag to v1.3.11 (#25428)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 18:15:32 +02:00
renovate[bot] 841e35e291
Update devDependencies (non-major) (#25427)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 18:12:33 +02:00
Matt Jankowski 4c5aa0e470
Update rubocop-rspec to version 2.22.0, fix `RSpec/IndexedLet` cop (#24698) 2023-06-14 16:44:37 +02:00
Daniel M Brasil 24015ef0cc
Migrate to request specs in `/api/v1/domain_blocks` (#25414) 2023-06-14 16:08:53 +02:00
Daniel M Brasil 87aff5aad8
Migrate to request specs in `/api/v1/follow_requests` (#25411) 2023-06-14 15:43:50 +02:00
Daniel M Brasil d9c6f70cc6
Fix `ArgumentError` in `/api/v1/admin/accounts/:id/action` (#25386) 2023-06-14 15:21:36 +02:00
renovate[bot] b9e8d2b352
Update dependency sass to v1.63.3 (#25422)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 11:23:54 +02:00
renovate[bot] 95b84874f3
Update dependency redis-namespace to v1.11.0 (#25421)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 11:18:37 +02:00
renovate[bot] 360759df7b
Update formatjs monorepo (#25418)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 11:16:36 +02:00
renovate[bot] f10f4f2359
Update dependency glob to v10.2.7 (#25417)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 10:56:22 +02:00
Matt Jankowski ae9f5379d1
Reduce factory data created in spec/models/trends/statuses spec (#25410) 2023-06-14 09:57:06 +02:00
Matt Jankowski 31d5bc89d1
Speed improvement for `AccountsStatusesCleanupScheduler` spec (#25406) 2023-06-14 09:56:11 +02:00
Daniel M Brasil a5b62e56d0
Migrate to request specs in `/api/v1/apps/verify_credentials` (#25404) 2023-06-14 09:48:57 +02:00
Daniel M Brasil a6407aa662
Migrate to request specs in `/api/v1/apps` (#25401) 2023-06-14 09:48:48 +02:00
Matt Jankowski 4c5f62de99
Extract shared examples from api specs (#25387) 2023-06-14 09:34:01 +02:00
renovate[bot] ae2790d84f
Update babel monorepo to v7.22.5 (#25405)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
2023-06-14 09:22:54 +02:00
renovate[bot] a99201c735
Update dependency capybara to v3.39.2 (#25407)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 09:21:30 +02:00
renovate[bot] 780d54e5c3
Update dependency aws-sdk-s3 to v1.124.0 (#25297)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-14 09:05:30 +02:00
Eugen Rochko f20698000f
Fix always redirecting to onboarding in web UI (#25396) 2023-06-14 09:05:03 +02:00
Claire ec59166844
Fix ArgumentError when loading newer Private Mentions (#25399) 2023-06-14 08:54:52 +02:00
Eugen Rochko bca649ba79
Change edit profile page (#25413) 2023-06-14 04:38:07 +02:00
Eugen Rochko 39110d1d0a
Fix CAPTCHA page not following design pattern of sign-up flow (#25395) 2023-06-13 22:30:40 +02:00
たいち ひ 3b5e302f7f
Rewrite `emoji_mart_data_light` as TS (#25138) 2023-06-13 19:28:31 +02:00
alfe a86886b1fd
Rewrite `<LoadingIndicator/>` as FC and TS (#25364) 2023-06-13 19:26:25 +02:00
Nick Schonning 72590e601a
Update Rubocop 1.52.1 (#25376) 2023-06-13 18:42:51 +02:00
Renaud Chaput 1cb4514d0e
Add missing report category translation (#25400) 2023-06-13 15:05:40 +02:00
Matt Jankowski 10746af82f
Remove unused shared examples for scoped settings (#25389) 2023-06-13 14:59:04 +02:00
Matt Jankowski 25c66fa640
Enable paperclip for account attachment examples (#25381) 2023-06-12 17:37:43 +02:00
Eugen Rochko 6637ef7852
Add unsubscribe link to e-mails (#25378) 2023-06-12 14:22:46 +02:00
Plastikmensch fefdc3244c
[Glitch] Change "direct message" nomenclature to "private mention" in web UI (#2158)
Port 68a192e718 to glitch-soc

Signed-off-by: Plastikmensch <plastikmensch@users.noreply.github.com>
2023-06-11 13:33:45 +02:00
Claire af97a6ac5a
Merge pull request #2246 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-11 09:58:55 +02:00
alfe dfaf59d99a
Rewrite <LoadPending /> as FC and TS (#25363) 2023-06-11 04:47:18 +02:00
Eugen Rochko 432a5d2d4b
Change "bot" label to "automated" (#25356) 2023-06-11 04:47:07 +02:00
Claire 20718a8b59 Fix some translation strings inconsistencies 2023-06-10 19:21:44 +02:00
Claire 42a0898f16 Merge commit '3a2a15c6ea4d4603469861ed9be09da12a122e45' into glitch-soc/merge-upstream
Conflicts:
- `app/views/settings/preferences/appearance/show.html.haml`:
  Conflict because glitch-soc does not have a theme selector here.
2023-06-10 18:42:29 +02:00
Matt Jankowski 62c996b52d
Reduce `RSpec/MultipleExpectations` cop max to 8 (#25313) 2023-06-10 18:38:22 +02:00
Matt Jankowski b5675e265e
Add coverage for `CLI::Feeds` command (#25319) 2023-06-10 18:37:36 +02:00
Matt Jankowski 07933db788
Add coverage for `CLI::Cache` command (#25238) 2023-06-10 18:36:09 +02:00
Emelia Smith 215081240f
Add logging of websocket send errors (#25280) 2023-06-10 18:35:57 +02:00
fusagiko / takayamaki b19a695608
migrate test for `GET /api/v1/accounts/{account_id}` to request spec (#25322) 2023-06-10 18:33:24 +02:00
Daniel M Brasil 99216e34e5
Migrate to request specs in `/api/v1/admin/canonical_email_blocks` (#25330) 2023-06-10 18:33:02 +02:00
Daniel M Brasil b4e19f9610
Migrate to request specs in `/api/v1/admin/ip_blocks` (#25331) 2023-06-10 18:32:46 +02:00
Daniel M Brasil 4301d8cbb3
Migrate to request specs in `/api/v1/admin/domain_allows` (#25333) 2023-06-10 18:32:26 +02:00
Daniel M Brasil 841c220c40
Migrate to request specs in `/api/v1/admin/domain_blocks` (#25335) 2023-06-10 18:32:07 +02:00
Daniel M Brasil 0e200d4e2f
Migrate to request specs in `/api/v1/admin/reports` (#25355) 2023-06-10 18:30:43 +02:00
Matt Jankowski 3a2a15c6ea
Use `build` where possible in fabricators (#25360) 2023-06-10 18:29:01 +02:00
Matt Jankowski c94bb9ba9a
Disable paperclip processing in specs (#25359) 2023-06-10 18:27:35 +02:00
Emelia Smith c81f59583c
Fix logging of messages that are binary before closing their connection (#25361) 2023-06-10 18:24:37 +02:00
Claire 34efd1a24c Switch to using a `common` runtime chunk rather than `locales` 2023-06-10 17:43:13 +02:00
Claire 8c26d49cbd Merge commit '16dd3f08c1e5396d5f9ff3f13417901bc4e4b8b9' into glitch-soc/merge-upstream
Conflicts:
- `app/views/settings/preferences/appearance/show.html.haml`:
  Upstream fixed a translation bug in the theme selector that is absent from
  glitch-soc due to our different theming system.
  Discarded upstream changes.
- `streaming/index.js`:
  Upstream changed the signature of a function to change its return type.
  This is not a real conflict, the conflict being caused by an extra
  argument in glitch-soc's code.
  Applied upstream's change while keeping our extra argument.
2023-06-10 17:18:36 +02:00
Eugen Rochko fb0d2de8fe [Glitch] Change design of dropdowns in web UI
Port e4fd9503ec to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 17:10:06 +02:00
alfe 83ae40e192 [Glitch] Rewrite `<LoadMore />` as FC and TS
Port fb5bf5cbf8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:59:25 +02:00
Claire c48ec9cb8c Merge commit 'b85c387c5c0527b0ad31c27031a09d361826c5fc' into glitch-soc/merge-upstream
Conflicts:
- `config/initializers/content_security_policy.rb`:
  Kept our version, it was not affected by upstream's bug.
2023-06-10 16:48:01 +02:00
Claire 88c5ad3136 [Glitch] Add data-nosnippet so Google doesn't use trending posts in snippets for /
Port 1483a3ddfe to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:38:03 +02:00
S.H 5a961f84cf [Glitch] Fix not shown announcements in hometimeline.
Port a6c898f501 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:37:20 +02:00
Claire 475185a2ee [Glitch] Fix design issues with recent react-intl upgrade
Port c2c396157f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:36:54 +02:00
Darius Kazemi a8a30f1298 [Glitch] Add exclusive lists
Port bacb674921 to glitch-soc

Co-authored-by: Liam Cooke <liam@liamcooke.com>
Co-authored-by: John Holdun <john@johnholdun.com>
Co-authored-by: Effy Elden <effy@effy.space>
Co-authored-by: Lina Reyne <git@lina.pizza>
Co-authored-by: Lina <20880695+necropolina@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:36:15 +02:00
Claire bf23afa059 [Glitch] Add card with who invited you to join when displaying rules on sign-up
Port SCSS from 0766c9a631 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:30:36 +02:00
Jed Fox 753385d3e0 [Glitch] Fix spacing of middle dots in the detailed status meta section
Port acc419b81b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:29:48 +02:00
Claire d8b0a732aa Merge commit '1483a3ddfe74e4fb81d87447a1781943eab86c60' into glitch-soc/merge-upstream
Conflicts:
- `config/initializers/simple_form.rb`:
  Upstream added a new simple_form component, where we had an extra one.
  Kept both components.
2023-06-10 16:22:14 +02:00
Renaud Chaput 9e66c07be7 [Glitch] Fix `/share` and cleanup and reorganize frontend locale loading
Port b0780cfeed to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 16:18:01 +02:00
Claire 734e186717 Merge commit 'b0780cfeeda641645ea65da257a72ec507e71647' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/mastodon/load_locale.js`:
  The file moved to `app/javascript/mastodon/locales/load_locale.ts`.
  Ported the changes there and deleted `app/javascript/mastodon/load_locale.js`.
- `app/javascript/mastodon/locales/index.js`:
  The file moved to `app/javascript/mastodon/locales/index.ts`.
  Did *not* port the changes as I want to try something a bit different.
2023-06-10 15:32:29 +02:00
S.H a4d7a17089 [Glitch] Fix using Date.now() instead of intl.now()
Port b3f9a0da52 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 15:21:04 +02:00
Claire aa57f7e3e2 Merge commit '5fae2de454806730742b7be7435ae1c4fb97cf3c' into glitch-soc/merge-upstream 2023-06-10 15:17:08 +02:00
Claire 9af04d5a46 [Glitch] Add a confirmation screen when suspending a domain
Port e9385e93e9 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 15:10:24 +02:00
Claire b27a9a5903 Merge commit 'e9385e93e9b4601c87d1f5d6b8ddfd815f7aedcb' into glitch-soc/merge-upstream 2023-06-10 15:09:19 +02:00
Renaud Chaput 8188522bde [Glitch] Fix prev/next buttons color in media viewer
Port 675672feb6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 14:48:41 +02:00
Christian Schmidt 7e25fd9b0c [Glitch] Translate CW, poll options and media descriptions
Port 69057467cb to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 14:48:41 +02:00
Claire 93c714417f Merge commit 'b922ad7a1b4bc8d968d0df2c7f307d4fec53435d' into glitch-soc/merge-upstream
Conflicts:
- `package.json`:
  Upstream changed various script definitions in lines surrounding the one for
  `i18n:extract`, which had glitch-soc-specific changes.
  Updated the scripts as upstream did, while keeping our changes to
  `i18n:extract`.
2023-06-10 14:38:04 +02:00
Renaud Chaput 9e133e2527 [Glitch] Upgrade react-intl
Port 44cd88adc4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-10 14:37:08 +02:00
Claire 85722a918d Merge commit '44cd88adc4e2f4028dcc2b08b98368f0dc90cee4' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  Updated upstream, but we've deleted it.
  Keep it deleted.
- `app/javascript/mastodon/locales/index.js`:
  Reworked upstream, but the code was mostly in
  `app/javascript/locales/index.js` in glitch-soc.
  Updated that file accordingly.
- `app/javascript/packs/public.jsx`:
  Not a real conflict, but different imports in
  glitch-soc and upstream.
- `app/views/layouts/application.html.haml`:
  Conflict due to locales loading and theme system
  discrepancies.
  Updated in our own way.
- `app/views/layouts/embedded.html.haml`:
  Conflict due to locales loading and theme system
  discrepancies.
  Updated in our own way.
- `config/webpack/generateLocalePacks.js`:
  Deleted upstream, as upstream now directly loads the
  JSON at runtime.
  Deleted as well, will switch to runtime loading in
  an upcoming commit.
- `config/webpack/shared.js`:
  Not a real conflict, but different imports in
  glitch-soc and upstream.
- `config/webpack/translationRunner.js`:
  Mostly deleted upstream, to be replaced with `formatjs-formatter.js`
  instead.
  Moved the glitch-soc logic there and deleted the file.
2023-06-10 12:38:33 +02:00
Eugen Rochko 4c9406bdb0
Add time zone preference (#25342) 2023-06-10 03:29:37 +02:00
Emelia Smith 16dd3f08c1
Fix performance of streaming by parsing message JSON once (#25278) 2023-06-09 19:29:16 +02:00
Renaud Chaput e34142782f
Add Ruby & Bundler versions to Gemfile.lock (#25317) 2023-06-09 16:34:36 +02:00
Matt Jankowski 75e299f440
Remove unused `redis_info` method Admin::Dashboard (#25345) 2023-06-09 14:03:35 +02:00
Daniel M Brasil 4aff1d2974
Migrate to request specs in `/api/v1/admin/email_domain_blocks` (#25337) 2023-06-09 14:00:14 +02:00
jsgoldstein 18f092d927
Fix translations for changing theme (#25340) 2023-06-08 17:12:41 +02:00
Matt Jankowski b85c387c5c
Remove reference to deleted statsd config file (#25336) 2023-06-07 22:46:53 +02:00
renovate[bot] db047e323b
Update dependency webpack-bundle-analyzer to v4.9.0 (#25327)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 12:05:05 +02:00
renovate[bot] 5265655549
Update dependency dotenv to v16.1.3 (#25302)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 11:46:40 +02:00
renovate[bot] 7e22287caa
Update dependency sass-loader to v10.4.1 (#25315)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-07 11:44:09 +02:00
Claire f378f10404
Fix compatibility of recent migration with PostgreSQL 10 (#25324) 2023-06-07 01:53:50 +02:00
Eugen Rochko 67d17ce194
Add `legal` as report category (#23941) 2023-06-06 23:41:59 +02:00
Eugen Rochko e4fd9503ec
Change design of dropdowns in web UI (#25107) 2023-06-06 21:49:49 +02:00
Renaud Chaput ed04c277b4
Configure RenovateBot to add proper language labels (#25316)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Co-authored-by: Nick Schonning <nschonni@gmail.com>
2023-06-06 18:53:43 +02:00
Matt Jankowski 6c0e3f490a
Fix RSpec/MissingExampleGroupArgument cop (#25310) 2023-06-06 15:51:42 +02:00
Matt Jankowski b74c3cd708
Fix `RSpec/DescribedClass` cop missed items (#25309) 2023-06-06 14:51:03 +02:00
Nick Schonning c66250abf1
Autofix Rubocop Regex Style rules (#23690)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-06-06 14:50:51 +02:00
renovate[bot] 9a653899e9
Update dependency redis to v4.6.7 (#25300)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-06 14:16:41 +02:00
Matt Jankowski c42591356d
Fix `RSpec/DescribedClass` cop (#25104) 2023-06-06 13:58:33 +02:00
Matt Jankowski 1e243e2df7
Misc spec coverage for `Admin::` area controllers (#25282) 2023-06-06 13:57:00 +02:00
Daniel M Brasil eb6f8181e1
Add test coverage for `Mastodon::CLI::Accounts#reset_relationships` (#25194) 2023-06-06 13:37:09 +02:00
Matt Jankowski b22bfae4f9
Add coverage for `DomainBlock#public_domain` method (#25283) 2023-06-06 13:34:04 +02:00
alfe fb5bf5cbf8
Rewrite `<LoadMore />` as FC and TS (#25259) 2023-06-06 11:28:50 +02:00
renovate[bot] 50a8f5b8a7
Update dependency react-redux to v8.0.7 (#25298)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-06 11:18:56 +02:00
Claire 6833732852
Fix autocomplete suggestions being cut off in compose form (#25275) 2023-06-06 11:05:25 +02:00
Eugen Rochko 4eda233e09
Add webhook templating (#23289)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-06-06 10:42:47 +02:00
renovate[bot] a80efb449e
Configure Renovate (#25255)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
2023-06-06 10:42:23 +02:00
Eugen Rochko 0ddc895282
Change follow button in account row to be more obvious in web UI (#24956) 2023-06-06 04:14:28 +02:00
Claire d907e79140
Merge pull request #2242 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to 00c222377d
2023-06-05 20:49:35 +02:00
Matt Jankowski af135bddd0
Update `Admin::Metrics::Measure` classes for Rails 7 (#25236) 2023-06-05 20:46:04 +02:00
Claire e428670e61
Fix CSP headers when S3_ALIAS_HOST includes a path component (#25273) 2023-06-05 17:35:05 +02:00
Claire 1483a3ddfe
Add data-nosnippet so Google doesn't use trending posts in snippets for / (#25279) 2023-06-05 17:32:24 +02:00
Matt Jankowski 3b21c13dcc
Rails 7 compatibility fix for `Admin::Metrics::Dimension` classes (#25277) 2023-06-05 16:52:33 +02:00
Daniel M Brasil 70cd2d6000
Add test coverage for `Mastodon::CLI::Accounts#cull` (#25250) 2023-06-05 14:51:25 +02:00
S.H a6c898f501
Fix not shown announcements in hometimeline. (#25251) 2023-06-05 14:49:51 +02:00
Nick Schonning a8310b15ed
Update kt-paperclip 7.2 from sha (#25274) 2023-06-05 14:40:35 +02:00
dependabot[bot] 7fc1297c3e [Glitch] Bump eslint-plugin-jsdoc from 44.2.5 to 45.0.0
Port 89d6341c80 to glitch-soc

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-05 13:31:45 +02:00
Claire 5e876c2901 [Glitch] Fix `null` signUp URL in various places
Port 14bb6bb29a to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-05 13:28:22 +02:00
y.takahashi 4993b6e800 [Glitch] Handle Surrogate Pairs in truncate()
Port 64b960b6b3 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-06-05 13:28:02 +02:00
Claire c22fc2fa80 Merge commit '00c222377db0e305ac3f4a15bf1c18eb89c1f45f' into glitch-soc/merge-upstream
Conflicts:
- `.rubocop_todo.yml`:
  Took upstream's changes.
2023-06-05 13:25:22 +02:00
Claire c2c396157f
Fix design issues with recent react-intl upgrade (#25272) 2023-06-05 09:52:36 +02:00
Darius Kazemi bacb674921
Add exclusive lists (#22048)
Co-authored-by: Liam Cooke <liam@liamcooke.com>
Co-authored-by: John Holdun <john@johnholdun.com>
Co-authored-by: Effy Elden <effy@effy.space>
Co-authored-by: Lina Reyne <git@lina.pizza>
Co-authored-by: Lina <20880695+necropolina@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-06-05 09:37:02 +02:00
Matt Jankowski 0daf78f903
Add `allow_other_host: true` to backups controller (#25266) 2023-06-05 08:22:03 +02:00
Matt Jankowski 5c87c66504
Add coverage for CLI::CanonicalEmailBlocks command (#25239) 2023-06-05 08:20:18 +02:00
Daniel M Brasil 03a707f6a6
Add test coverage for `Mastodon::CLI::Accounts#merge` (#25199) 2023-06-05 08:16:12 +02:00
Matt Jankowski e49819142f
Remove unmaintained `nsa` gem (#25265) 2023-06-05 01:57:05 +02:00
Eugen Rochko 4a5464f360
Change "Follow 7 people" to "Find at least 7 people to follow" in web UI (#24954) 2023-06-05 01:42:17 +02:00
Claire ee771f5bad
Fix closeModal invocation (#2239)
Fixes #2238

Some call sites where missed in 382b2a506a
2023-06-04 22:05:45 +02:00
Nick Schonning aea67d448b
Cleanup old translationRunner (#25241) 2023-06-02 20:01:36 +02:00
Jed Fox 768b00c4d0
Consistently use middle dot (·) instead of bullet (•) to separate items (#25248) 2023-06-02 19:58:18 +02:00
Claire 0766c9a631
Add card with who invited you to join when displaying rules on sign-up (#23475) 2023-06-02 18:35:37 +02:00
Claire 94329f28e1
Change wording of “Content cache retention period” setting to highlight destructive implications (#23261) 2023-06-02 18:09:08 +02:00
Jed Fox acc419b81b
Fix spacing of middle dots in the detailed status meta section (#25247) 2023-06-02 15:40:23 +02:00
Renaud Chaput b0780cfeed
Fix `/share` and cleanup and reorganize frontend locale loading (#25240) 2023-06-02 15:00:27 +02:00
Claire 5fae2de454
Fix overflow behavior of account rows (#25131) 2023-06-01 14:47:55 +02:00
Claire 8884d1ece0
Add support for importing lists (#25203) 2023-06-01 14:47:31 +02:00
dependabot[bot] d91607feee
Bump sidekiq-scheduler from 5.0.2 to 5.0.3 (#25228)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 14:39:43 +02:00
Matt Jankowski cd4f0feab8
Extract verify options method in search cli (#25121) 2023-06-01 14:35:05 +02:00
Nick Schonning b489c200a6
Update yarn.lock for audit issues (#25152) 2023-06-01 14:32:34 +02:00
Matt Jankowski 35c1c3e57a
Add CLI area progress bar helper (#25208) 2023-06-01 14:31:24 +02:00
Daniel M Brasil 2a353200ad
Add test coverage for `Mastodon::CLI::Accounts#rotate` (#25212) 2023-06-01 14:29:29 +02:00
dependabot[bot] 3182ecc24c
Bump puma from 6.2.2 to 6.3.0 (#25229)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 14:27:58 +02:00
S.H b3f9a0da52
Fix using Date.now() instead of intl.now() (#25234) 2023-06-01 13:46:19 +02:00
Renaud Chaput 942d850b0a
Allow carets in URL search params (#25216) 2023-06-01 12:14:49 +02:00
Claire dac460f43f
Bump workbox from 6.6.1 to 7.0.0 (#25232) 2023-06-01 10:24:11 +02:00
dependabot[bot] c15c8c7aa8
Bump rspec-rails from 6.0.2 to 6.0.3 (#25223)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 10:01:21 +02:00
Daniel M Brasil f906e21a4f
Add test coverage for `Mastodon::CLI::Accounts#refresh` (#25196) 2023-06-01 10:01:09 +02:00
Claire fe84f7e323
Add missing primary keys to `accounts_tags` and `statuses_tags` (#25210) 2023-06-01 09:49:06 +02:00
Matt Jankowski f84037ae2b
Remove unused #hash_to_object method in SettingsHelper (#25213) 2023-06-01 09:47:05 +02:00
dependabot[bot] e7e1b46ce8
Bump aws-sdk-s3 from 1.122.0 to 1.123.0 (#25230)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 09:45:10 +02:00
dependabot[bot] 5a50983654
Bump eslint-plugin-jsdoc from 45.0.0 to 46.1.0 (#25222)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 09:41:44 +02:00
dependabot[bot] b05bbd91d0
Bump @types/jest from 29.5.1 to 29.5.2 (#25220)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-01 09:41:03 +02:00
Claire e9385e93e9
Add a confirmation screen when suspending a domain (#25144) 2023-06-01 09:37:38 +02:00
Claire fca2dff2e2
Merge pull request #2237 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-06-01 09:25:26 +02:00
Claire b922ad7a1b
Fix crash when S3_ALIAS_HOST or S3_CLOUDFRONT_HOST have a path component (#25018) 2023-06-01 09:23:28 +02:00
Claire 2b45fecde1
Fix multiple N+1s in ConversationsController (#25134) 2023-06-01 02:41:51 +02:00
Renaud Chaput 675672feb6
Fix prev/next buttons color in media viewer (#25231) 2023-06-01 02:25:38 +02:00
Nick Schonning d39bce963f
Add fix/lint helper dev targets (#23561) 2023-06-01 02:25:13 +02:00
Christian Schmidt 69057467cb
Translate CW, poll options and media descriptions (#24175)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-06-01 00:10:21 +02:00
Renaud Chaput 44cd88adc4
Upgrade react-intl (#24906) 2023-05-31 23:43:39 +02:00
Matt Jankowski 00c222377d
Remove unused Settings::Extend module (#25214) 2023-05-31 23:34:48 +02:00
Renaud Chaput b7d995cb00
Disable some metrics cops (#25215) 2023-05-31 23:33:10 +02:00
Matt Jankowski b0104e4c33
Silence output to stdout during cli specs (#25211) 2023-05-31 20:01:11 +02:00
Matt Jankowski dc26140d54
Use thor methods instead of tty prompt in maintenance cli (#25207) 2023-05-31 19:40:16 +02:00
Daniel M Brasil 3c41547f49
Add test coverage for `Mastodon::CLI::Accounts#backup` (#25163) 2023-05-31 15:32:37 +02:00
Matt Jankowski 8b1bfaed3e
Add specs for admin/webhooks CRUD actions (#25133) 2023-05-31 15:23:49 +02:00
Matt Jankowski 665bb237a8
Increase spec coverage for controllers - admin/ip_blocks, admin/relays, admin/rules (#25192) 2023-05-31 10:23:32 +02:00
dependabot[bot] 82f6d4c418
Bump @babel/core and @types/babel__core (#25183)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 09:57:48 +02:00
Claire b6519ab3f5
Fix inconsistent naming of Instance.by_domain_and_subdomain (#25159) 2023-05-31 09:57:24 +02:00
dependabot[bot] b86f3596ba
Bump @babel/plugin-transform-runtime from 7.21.4 to 7.22.4 (#25173)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 09:51:35 +02:00
dependabot[bot] e24adacea1
Bump @babel/preset-react from 7.18.6 to 7.22.3 (#25171)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 09:42:14 +02:00
dependabot[bot] e1d0343354
Bump @babel/runtime from 7.21.5 to 7.22.3 (#25170)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-31 09:39:35 +02:00
dependabot[bot] 0ed8164777
Bump @babel/preset-env from 7.21.5 to 7.22.4 (#25167)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-31 09:36:43 +02:00
Daniel M Brasil bf9a7ce8e8
Add test coverage for `Mastodon::CLI::Accounts#unfollow` (#25162) 2023-05-31 09:33:57 +02:00
Renaud Chaput 98e5e011aa
Upgrade Workbox to 6.6.0 (#25197) 2023-05-31 09:29:16 +02:00
dependabot[bot] 89d6341c80
Bump eslint-plugin-jsdoc from 44.2.5 to 45.0.0 (#25172)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Renaud Chaput <renchap@gmail.com>
2023-05-31 09:27:21 +02:00
Renaud Chaput c2ea0dc65f
Drop support for Node.js 14 (#25198) 2023-05-31 08:42:40 +02:00
Claire 14bb6bb29a
Fix `null` signUp URL in various places (#25190) 2023-05-30 19:01:42 +02:00
Matt Jankowski 1baf40077b
Fix FormatStringToken cop in CLI (#25122) 2023-05-30 16:21:53 +02:00
Daniel M Brasil dbc44be0ca
Add test coverage for `Mastodon::CLI::Accounts#follow` (#25161) 2023-05-30 16:13:29 +02:00
Matt Jankowski 80c7de9984
Fix Rails/WhereExists cop in CLI (#25123) 2023-05-30 16:09:57 +02:00
Matt Jankowski b7b96efd17
Extract helper method for error report in cli/accounts command (#25119) 2023-05-30 16:09:15 +02:00
Matt Jankowski 2cecb2dc9e
Increment index which was previously not used in maintenance CLI loop (#25118) 2023-05-30 16:08:47 +02:00
Matt Jankowski ec9bc7e604
Consistent usage of CLI `dry_run?` method (#25116) 2023-05-30 16:07:44 +02:00
Daniel M Brasil 3d253b9830
Add test coverage for `Mastodon::CLI::Accounts#approve` (#25160) 2023-05-30 15:00:21 +02:00
Daniel M Brasil bbbcdc083f
Add test coverage for `Mastodon::CLI::Accounts#delete` (#25146) 2023-05-30 11:59:17 +02:00
dependabot[bot] 44eaa979d4
Bump @types/react from 18.2.6 to 18.2.7 (#25166)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:58:55 +02:00
dependabot[bot] 4869384fa0
Bump jsdom from 22.0.0 to 22.1.0 (#25178)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:43:20 +02:00
dependabot[bot] 05c2d4dab2
Bump nokogiri from 1.14.3 to 1.15.2 (#25177)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:42:41 +02:00
dependabot[bot] 66c1ad8be9
Bump @types/react-motion from 0.0.33 to 0.0.34 (#25185)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:40:22 +02:00
dependabot[bot] 5f1a03fdba
Bump @typescript-eslint/parser from 5.59.7 to 5.59.8 (#25175)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:38:42 +02:00
dependabot[bot] 6d41cdcc6a
Bump @typescript-eslint/eslint-plugin from 5.59.7 to 5.59.8 (#25182)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:34:59 +02:00
dependabot[bot] 8ff2d61add
Bump @types/lodash from 4.14.194 to 4.14.195 (#25184)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:33:21 +02:00
dependabot[bot] b91aeeb94f
Bump sidekiq from 6.5.8 to 6.5.9 (#25176)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:29:40 +02:00
dependabot[bot] 37dc48c3a1
Bump postcss from 8.4.23 to 8.4.24 (#25169)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 09:28:39 +02:00
S.H 8c183a9831
Align argument type to keyword argument for private process method in FetchResourceService (#25189) 2023-05-30 09:28:01 +02:00
Daniel M Brasil bdc7548652
Add test coverage for `Mastodon::CLI::Accounts#modify` (#25145) 2023-05-29 15:31:59 +02:00
y.takahashi 64b960b6b3
Handle Surrogate Pairs in truncate() (#25148) 2023-05-29 11:55:16 +02:00
Daniel M Brasil 11b8336418
Add test coverage for `Mastodon::CLI::Accounts#create` (#25143) 2023-05-29 11:43:19 +02:00
Claire 5ed48e6878 Fix extraneous newlines 2023-05-28 18:06:09 +02:00
fusagiko / takayamaki 382b2a506a [Glitch] Rewrite actions/modal and reducers/modal with typescript
Port 38c6216082 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 17:49:55 +02:00
たいち ひ 6a592083f1 [Glitch] Fix export style of `<LoadGap />` based on `<Domain />`
Port 4197b5e4c8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 17:15:21 +02:00
Renaud Chaput 0009b4b574 [Glitch] Update inconsistent `defaultMessage`
Port e58c36d308 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 17:14:31 +02:00
Claire 0669783da8 Merge branch 'main' into glitch-soc/merge-upstream 2023-05-28 17:01:25 +02:00
Eugen Rochko e7dc375aab [Glitch] Change share action from being in action bar to being in dropdown in web UI
Port 1caa5ff39e to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 16:59:12 +02:00
Renaud Chaput 7bec63e6e2 [Glitch] Fix `null` signUp URL handling from #25014
Port 40b948a1fb to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 16:52:16 +02:00
たいち ひ 017fbc7a74 [Glitch] Rewrite `<LoadGap />` as FC and TS
Port 7336f3648b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 16:48:17 +02:00
Claire 0e7466717f Merge commit '391c089d0db58d731765dba730a5e1f2fe8570a6' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  We removed it from glitch-soc.
  Keep it deleted.
2023-05-28 16:41:14 +02:00
Claire 7d7db8977b Fix import order with ESLint
Port d27216dc46 to glitch-soc
2023-05-28 16:38:10 +02:00
Claire 1cd7f5ff17 Merge commit 'd27216dc4616d80659c0cc5d2a55394e0e1ae874' into glitch-soc/merge-upstream
Conflicts:
- `.eslintrc.js`:
  Upstream moved a configuration block in which we had added a glitch-only
  path.
  Moved the configuration block as upstream did.
- other files:
  Upstream reordered imports, and those files had different ones.
  Kept our version and reordered imports using the same rules.
2023-05-28 15:54:31 +02:00
Claire 9e5278ea7b [Glitch] Add support for custom sign-up URLs
Port ca66e61b93 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 15:09:28 +02:00
Claire 8f380a33fc [Glitch] Fix video player offering to expand in a lightbox when it's in an iframe
Port 100840c06e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-28 15:06:29 +02:00
Claire 6dbd44faea Merge commit 'b896b16cb3c8626fbee12a7eda7f882114b1a040' into glitch-soc/merge-upstream 2023-05-28 15:01:53 +02:00
Claire a0bc0619ca [Glitch] Use JSX syntax for Fragments
Port 5a16bd7bf4 to glitch-soc
2023-05-28 14:56:24 +02:00
Claire 8278907ff7 Merge commit '5a16bd7bf4591feb852364da9b84407438c9b7d6' into glitch-soc/merge-upstream 2023-05-28 14:32:26 +02:00
Claire 6001f5ff36 [Glitch] Use the new JSX transform everywhere
Port 8f66126b10 to glitch-soc
2023-05-28 14:18:43 +02:00
Claire 9381f78166 Merge commit '8f66126b1010e0aaaa8b5f2a2f4ea8a28824e2b7' into glitch-soc/merge-upstream 2023-05-28 13:55:30 +02:00
Claire 0222df6047
Merge pull request #2236 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to e387175fc9
2023-05-27 11:28:10 +02:00
Claire 1347ca6eb0 fixup! [Glitch] Upgrade to React 18 2023-05-26 18:44:18 +02:00
Matt Jankowski 55785b1603
Extract methods for user de-duping in maintenance CLI (#25117) 2023-05-26 09:42:16 +02:00
Matt Jankowski 0f2c16ac4b
Fix RSpec/NoExpectationExample cop (#25103) 2023-05-26 09:41:12 +02:00
Claire 61f6cd45e3 Fix glitch-soc-only tests being broken because of test refactor 2023-05-26 00:10:57 +02:00
たいち ひ 60c7e559d8 [Glitch] Rewrite `<TimelineHint />` as FC and TS
Port 9a472efe7c to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 23:58:54 +02:00
たいち ひ 6746e5d430 [Glitch] Rewrite `<Skeleton/>` as FC and TS
Port 8066118d1f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 23:55:36 +02:00
Claire 892b3c16f5 [Glitch] Allow scripts in post embed previews
Port 711a037660 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 23:52:04 +02:00
Claire e2ab9d4dad Merge commit 'e387175fc9a3ebfd72ab45ebfe43ecfabef7b0c3' into glitch-soc/merge-upstream 2023-05-25 23:47:28 +02:00
Renaud Chaput 3b375ee395 [Glitch] Upgrade to React 18
Port 8d6aea3326 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 23:45:01 +02:00
Claire 45d7358100 Merge commit '8d6aea33260dedeacb3d22ac1a6d2f9cc3856a5e' into glitch-soc/merge-upstream 2023-05-25 23:18:57 +02:00
Claire 2e02d03524 Merge commit '4a22e72b9b1b8f14792efcc649b0db8bc27f0df2' into glitch-soc/merge-upstream 2023-05-25 22:59:30 +02:00
Claire ad1098970b Merge commit 'bec6a1cad4c509c53deb378c7ba984ba7e2de5a9' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/auth/confirmations_controller.rb`:
  Upstream merged our captcha code, but there are some
  conflicts due to glitch-soc's theming system.
- `app/views/admin/settings/registrations/show.html.haml`:
  Upstream merged our captcha code, but there are some
  conflicts due to glitch-soc's theming system.

Additional changes:
- `Gemfile`:
  Upstream added hcaptcha dependency in another place in the file.
- `config/settings.yml`:
  Upstream added the `captcha_enabled` setting in another place in the file.
2023-05-25 22:49:18 +02:00
Claire ba73f0ea3a [Glitch] Add polling and automatic redirection to `/start` on email confirmation
Port e60414792d to glitch-soc
2023-05-25 22:37:14 +02:00
Claire f959f6cdbb Merge commit 'e60414792d86a99c0f401f3c1bab92ee37835d39' into glitch-soc/merge-upstream 2023-05-25 22:18:55 +02:00
Claire b0ec3bfcf9 [Glitch] Fix being unable to load past a full page of filtered posts in Home timeline
Port 7b54e47d03 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 22:00:07 +02:00
Christian Schmidt 4a1f4cb6a2 [Glitch] Fix UI crash in moderation interface when opening the media modal
Port 5241f7b2fd to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 21:57:19 +02:00
Eugen Rochko d728222121 [Glitch] Change "Sign in" to "Login"
Port 3869e8c210 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 21:52:37 +02:00
Claire 602ae7f2f6 [Glitch] Fix videos being improperly positioned on safari
Port 0eed06073f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 21:47:48 +02:00
Renaud Chaput e6a7cfd12e [Glitch] Add stricter ESLint rules for Typescript files
Port 5eeb40bdbe to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 21:43:19 +02:00
Nick Schonning e8fc445e14 [Glitch] Enable ESLint react/no-deprecated
Port b878e3d8df to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 21:07:38 +02:00
Renaud Chaput 79c43b61a6 [Glitch] Disable RTK safety middlewares
Port 6f8db56a01 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 20:57:42 +02:00
fusagiko / takayamaki 7d9b7f28b8 [Glitch] Add type annotation for DisplayName component
Port 349cae0b57 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 20:57:07 +02:00
fusagiko / takayamaki ea1f9b4223 [Glitch] Rename Image component to ServerHeroImage
Port ab7716cff4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-25 20:44:09 +02:00
Claire b735954971 Merge commit '2ce0b666a139726dc406e6c1887728553b947e59' into glitch-soc/merge-upstream
Conflicts:
- `config/webpack/generateLocalePacks.js`:
  A dependency update changed how functions are imported.
  Also, some linting fixes not applicable to glitch-soc.
2023-05-25 20:43:25 +02:00
Claire 646cde71d1
Change captcha to be presented even for invited users (#2227) 2023-05-25 20:13:18 +02:00
Claire 69903b5830
Fix margins around small avatars (reply indicators, autocompletion suggestion) (#2231)
Fix regression from #2156
2023-05-25 19:40:33 +02:00
Claire cb6f445b90
Greatly simplify history management code (#2230)
Fixes #2220

This drops the ability to shift+click on “Back” to get back to a pinned
column, but that was inconsistent, broken, and undocumented.

This also brings us slightly closer to upstream.
2023-05-25 19:14:51 +02:00
Claire 2f2f74efd8
[Glitch] Update style of captcha confirmation page to match sign-up form (#2226) 2023-05-25 19:14:37 +02:00
fusagiko / takayamaki 38c6216082
Rewrite actions/modal and reducers/modal with typescript (#24833) 2023-05-25 15:42:37 +02:00
たいち ひ 4197b5e4c8
Fix export style of `<LoadGap />` based on `<Domain />` (#25128) 2023-05-25 13:03:37 +02:00
Claire 1d588d58f1
Improve various queries against account domains (#25126) 2023-05-25 09:27:16 +02:00
Renaud Chaput e58c36d308
Update inconsistent `defaultMessage` (#25114) 2023-05-24 12:38:50 +02:00
dependabot[bot] 391c089d0d
Bump eslint from 8.40.0 to 8.41.0 (#25081)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 12:38:08 +02:00
Matt Jankowski 384345b0de
Add CLI Base class for command line code (#25106) 2023-05-24 11:55:40 +02:00
Matt Jankowski d2e5430d4a
Fix RSpec/ExpectChange cop (#25101) 2023-05-24 11:23:40 +02:00
Eugen Rochko 1caa5ff39e
Change share action from being in action bar to being in dropdown in web UI (#25105)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-24 11:04:43 +02:00
dependabot[bot] f7d93f95e1
Bump capistrano from 3.17.2 to 3.17.3 (#25113)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 10:52:10 +02:00
dependabot[bot] 2e3b1ef13e
Bump eslint-plugin-jsdoc from 44.2.4 to 44.2.5 (#25112)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 10:47:50 +02:00
dependabot[bot] ac98e9fdbc
Bump fastimage from 2.2.6 to 2.2.7 (#25111)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-24 10:46:10 +02:00
Renaud Chaput 342daeb389
Update `react-redux` (#25110) 2023-05-24 10:23:17 +02:00
Renaud Chaput 40b948a1fb
Fix `null` signUp URL handling from #25014 (#25108) 2023-05-24 09:49:26 +02:00
たいち ひ 7336f3648b
Rewrite `<LoadGap />` as FC and TS (#25042) 2023-05-24 09:20:39 +02:00
Renaud Chaput d27216dc46
Enforce import order with ESLint (#25096) 2023-05-23 17:15:17 +02:00
Matt Jankowski b896b16cb3
Fix RSpec/PredicateMatcher cop (#25102) 2023-05-23 16:49:11 +02:00
Matt Jankowski 778e4a7bf7
Fix RSpec/ExpectInHook cop (#25100) 2023-05-23 16:40:21 +02:00
Matt Jankowski b6b4ea4ca5
Move the mastodon/*_cli files to mastodon/cli/* (#24139) 2023-05-23 16:08:26 +02:00
Matt Jankowski c9f980b268
Add request spec for backups download (#25099) 2023-05-23 15:44:11 +02:00
Claire ca66e61b93
Add support for custom sign-up URLs (#25014) 2023-05-23 15:17:09 +02:00
Claire dfa5889fc0
Change Identity to not destroy associated User on destroy (#25098) 2023-05-23 15:00:36 +02:00
Claire 100840c06e
Fix video player offering to expand in a lightbox when it's in an iframe (#25067) 2023-05-23 14:28:21 +02:00
Claire 9017df7178
Remove dead code in Api::V1::FeaturedTagsController (#25073) 2023-05-23 14:27:37 +02:00
Claire fea0830614
Remove invalid X-Frame-Options: ALLOWALL (#25070) 2023-05-23 14:27:17 +02:00
Matt Jankowski 541f64b2bb
Fix Rails/Exit cop (#24743) 2023-05-23 13:26:10 +02:00
Renaud Chaput 5a16bd7bf4
Use JSX syntax for Fragments (#25093) 2023-05-23 11:47:36 +02:00
Renaud Chaput 8f66126b10
Use the new JSX transform (#25064) 2023-05-23 10:52:27 +02:00
Matt Jankowski e387175fc9
Fix RSpec/RepeatedExample cop (#24849) 2023-05-23 10:49:23 +02:00
Matt Jankowski 9f5deb310b
Fix Performance/MapCompact cop (#24797)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-23 10:49:12 +02:00
Matt Jankowski 0664704cd9
Fix Performance/StartWith cop (#24818) 2023-05-23 10:16:50 +02:00
たいち ひ 9a472efe7c
Rewrite `<TimelineHint />` as FC and TS (#25091) 2023-05-23 10:04:10 +02:00
Matt Jankowski 2877c80dbc
Add specs for admin/announcements CRUD actions (#25077) 2023-05-23 10:03:51 +02:00
dependabot[bot] 753e6df04a
Bump rubocop from 1.50.2 to 1.51.0 (#24995)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:52:54 +02:00
dependabot[bot] 5b332112fc
Bump stylelint from 15.6.1 to 15.6.2 (#25078)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:47:59 +02:00
dependabot[bot] c37ecbcd10
Bump aws-sdk-s3 from 1.121.0 to 1.122.0 (#24923)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:44:47 +02:00
dependabot[bot] c2cbe90a89
Bump rimraf from 5.0.0 to 5.0.1 (#25082)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:44:14 +02:00
dependabot[bot] 9e59186f78
Bump glob from 10.2.2 to 10.2.6 (#25083)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:34:31 +02:00
dependabot[bot] c7cbded282
Bump webpack-merge from 5.8.0 to 5.9.0 (#25084)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:27:55 +02:00
dependabot[bot] d7fd2c5763
Bump rqrcode from 2.1.2 to 2.2.0 (#25086)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:25:43 +02:00
dependabot[bot] 4ea24537cf
Bump rubocop-performance from 1.17.1 to 1.18.0 (#25089)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:25:32 +02:00
dependabot[bot] 7cfa6424f1
Bump @typescript-eslint/eslint-plugin from 5.59.6 to 5.59.7 (#25085)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:25:20 +02:00
dependabot[bot] 16d3e76a71
Bump @typescript-eslint/parser from 5.59.6 to 5.59.7 (#25080)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:15:43 +02:00
dependabot[bot] 9628d949ef
Bump connection_pool from 2.4.0 to 2.4.1 (#25088)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:07:01 +02:00
dependabot[bot] a5fa30a2d2
Bump rspec-rails from 6.0.1 to 6.0.2 (#25092)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:06:43 +02:00
Daniel M Brasil b473df9a14
Improve test coverage for `/api/v1/featured_tags` (#25076) 2023-05-23 09:01:11 +02:00
Nick Schonning 520e00a3c1
Don't run Rubocop excluded files for lint-staged (#25090) 2023-05-23 08:58:40 +02:00
たいち ひ 8066118d1f
Rewrite `<Skeleton/>` as FC and TS (#25055) 2023-05-23 08:58:08 +02:00
Claire 711a037660
Allow scripts in post embed previews (#25071) 2023-05-22 21:18:21 +02:00
Daniel M Brasil 785e650ab4
Fix uncaught TypeError in POST `/api/v1/featured_tags` (#25072)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-22 19:14:54 +02:00
Daniel M Brasil 45d98959ac
Fix uncaught NoMethodError in POST `/api/v1/featured_tags` (#25063) 2023-05-22 18:11:28 +02:00
Claire 2a61f14753
Fix account confirmation flow not returning to app after captcha validation (#25057) 2023-05-22 17:38:05 +02:00
Renaud Chaput 8d6aea3326
Upgrade to React 18 (#24916) 2023-05-22 15:48:01 +02:00
Daniel M Brasil 4a22e72b9b
Improve test coverage for `/api/v1/admin/canonical_email_blocks` (#24985) 2023-05-22 15:27:35 +02:00
Matt Jankowski 325d5f0183
Regenerate rubocop-todo (#24846) 2023-05-22 14:49:10 +02:00
Claire e13d2edd47
Fix “Authorized applications” inefficiently and incorrectly getting last use date (#25060) 2023-05-22 14:03:38 +02:00
Daniel M Brasil ce8b5899ae
Fix POST `/api/v1/admin/domain_allows` returning 200 when no domain is specified (#24958) 2023-05-22 13:44:49 +02:00
Matt Jankowski e328ab7e5a
Implement pending specs for StatusesController (#23969) 2023-05-22 13:43:05 +02:00
Daniel M Brasil f3feb4c891
Improve test coverage for `/api/v1/admin/email_domain_blocks` (#25017) 2023-05-22 13:28:11 +02:00
Nick Schonning c0b9664a31
Autofix Rubocop spacing in config (#25022) 2023-05-22 13:17:56 +02:00
Emelia Smith 19f9098551
Allow reports with long comments from remote instances, but truncate (#25028) 2023-05-22 13:15:21 +02:00
Daniel M Brasil d51464283c
Improve test coverage for `/api/v1/admin/ip_blocks_controller` (#25031) 2023-05-22 12:50:44 +02:00
Nick Schonning 23a4ecf444
Remove duplicate JPG type (#25054) 2023-05-22 12:46:20 +02:00
Nick Schonning 7d805cfa90
Remove requestAnimationFrame test polyfill (#25056) 2023-05-22 12:45:29 +02:00
Claire 7bb8030cc1
Change OpenGraph-based embeds to allow fullscreen (#25058) 2023-05-22 12:25:56 +02:00
Frankie Roberto 36a77748b4
Order sessions by most-recent to least-recently updated (#25005) 2023-05-22 11:40:00 +02:00
kouhai dev 2408f1046f Merge remote-tracking branch 'glitch/main' 2023-05-22 00:10:53 -07:00
Nick Schonning c1e70a2072
Cleanup and document bundle test/dev deps (#24457)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-19 17:48:15 +02:00
Nick Schonning ed349b14e2
Add Postgres 15 testing for migrations (#23887) 2023-05-19 17:14:15 +02:00
Nick Schonning 99e2e9b81f
Fix minor typos in comments and spec names (#21831) 2023-05-19 17:13:29 +02:00
Claire b805b7f021
Add tests for avatar/header in backup service (#25037) 2023-05-19 12:04:18 +02:00
dependabot[bot] 27ec8f297d
Bump jsdom from 21.1.2 to 22.0.0 (#24828)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-19 11:28:56 +02:00
Essem 5fd8d1e417
Fix oversight in backup service (#25034) 2023-05-19 11:27:10 +02:00
Matt Jankowski d34d94d08f
Add spec for migration warning module (#25033) 2023-05-19 10:53:50 +02:00
Claire 058898802a
Fix AvatarComposite and DisplayName referencing undefined props (#2222) 2023-05-17 23:24:27 +02:00
Claire 45ba9ada34
Fix race condition when reblogging a status (#25016) 2023-05-17 00:09:21 +02:00
Claire 5cd55d8aaf
Fix being able to vote on your own polls (#25015) 2023-05-17 00:08:42 +02:00
Claire bec6a1cad4
Add hCaptcha support (#25019) 2023-05-16 23:27:35 +02:00
Claire e60414792d
Add polling and automatic redirection to `/start` on email confirmation (#25013) 2023-05-16 18:03:52 +02:00
dependabot[bot] 2ce0b666a1
Bump pg-connection-string from 2.5.0 to 2.6.0 (#24999)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 15:39:18 +02:00
Claire 7b54e47d03
Fix being unable to load past a full page of filtered posts in Home timeline (#24930) 2023-05-16 15:36:25 +02:00
Claire aa4c9730f6
Change composer highlight border size to be more noticeable (#25010) 2023-05-16 14:59:44 +02:00
Claire 3ed3d54bf3
Fix reports not being closed when performing batch suspensions (#24988) 2023-05-16 14:56:49 +02:00
dependabot[bot] 6ce4fd1cf2
Bump thor from 1.2.1 to 1.2.2 (#25001)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:58:36 +02:00
dependabot[bot] e95e896f10
Bump capybara from 3.39.0 to 3.39.1 (#25004)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:52:07 +02:00
Nick Schonning cee4369cf5
Autofix Rubocop Lint/AmbiguousOperatorPrecedence (#25002) 2023-05-16 10:51:59 +02:00
dependabot[bot] 520462799f
Bump @typescript-eslint/eslint-plugin from 5.59.5 to 5.59.6 (#24998)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:51:02 +02:00
dependabot[bot] bbe4800b04
Bump @typescript-eslint/parser from 5.59.5 to 5.59.6 (#25000)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:45:53 +02:00
dependabot[bot] 4d6a8ee34a
Bump eslint-plugin-jsdoc from 43.1.1 to 44.2.4 (#24994)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 10:10:02 +02:00
Steven Munn 52d36f0f98
Fix spelling of "Lets" on the onboarding page after clicking the confirmation email (#24959)
Co-authored-by: Steven Munn <stevenjmunn@gmail.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-15 22:42:07 +02:00
Matt Jankowski 604e1c2b11
Remove usage of random sample values in specs (#24869) 2023-05-15 20:20:13 +02:00
Matt Jankowski b84bc2de5d
Replace i18n view spec with helper spec (#24966) 2023-05-15 17:25:04 +02:00
Renaud Chaput 2e1c6e93ad
Bump `mkdirp` major version (#24978) 2023-05-15 09:40:24 +02:00
Claire 054df2d67e
Merge pull request #2216 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
2023-05-14 15:39:47 +02:00
dependabot[bot] 713d217384
Bump eslint from 8.39.0 to 8.40.0 (#24919)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-14 15:09:33 +02:00
Matt Jankowski 679aca46da
I18n pluralization errors (#24963) 2023-05-12 18:53:30 +02:00
Daniel M Brasil 433ab0c9a3
Fix uncaught NoMethodError error in `/api/v1/admin/canonical_email_blocks/test` (#24947)
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 (#24852) 2023-05-12 13:13:04 +02:00
Matt Jankowski 2c2d924942
Fix RSpec/RepeatedExampleGroupDescription cop (#24850)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-05-12 12:25:32 +02:00
Matt Jankowski bf3ebeb42f
Fix RSpec/SharedContext cop (#24847) 2023-05-12 09:25:43 +02:00
Christian Schmidt 5241f7b2fd
Fix UI crash in moderation interface when opening the media modal (#24816) 2023-05-11 12:41:55 +02:00
Matt Jankowski a610a02d4f
Fix RSpec/ScatteredSetup cop (#24848) 2023-05-11 10:32:09 +02:00
Daniel M Brasil 9cbda99941
Add test coverage for `Mastodon::IpBlocksCLI` (#24935) 2023-05-11 10:19:24 +02:00
Emelia Smith b8a2430642
Fix Onboarding Errors (#24883) 2023-05-11 07:55:10 +02:00
Claire 6b0942d107
Change AccessTokensVacuum to also delete expired tokens (#24868) 2023-05-11 04:40:03 +02:00
Eugen Rochko 3869e8c210
Change "Sign in" to "Login" (#24942) 2023-05-10 20:17:55 +02:00
Claire 0eed06073f
Fix videos being improperly positioned on safari (#24943) 2023-05-10 17:22:34 +02:00
Renaud Chaput 5eeb40bdbe
Add stricter ESLint rules for Typescript files (#24926) 2023-05-10 12:59:29 +02:00
Nick Schonning b878e3d8df
Enable ESLint react/no-deprecated (#24471) 2023-05-10 09:05:32 +02:00
たいち ひ 2d5e257938
Rewrite `logo.tsx` as FC (#24909) 2023-05-10 08:58:21 +02:00
Renaud Chaput 6f8db56a01
Disable RTK safety middlewares (#24936) 2023-05-10 08:38:02 +02:00
Claire f371464639 Remove our copy of image.d.ts as tsconfig already uses upstream's 2023-05-10 00:00:28 +02:00
Claire 96e99e2170 Run prettier on Typescript files
Port 51b83ed195 to glitch-soc
2023-05-09 23:41:18 +02:00
Claire facc7ab03c Merge commit '51b83ed19536b06ce3f57b260400ecec2d1dd187' into glitch-soc/merge-upstream 2023-05-09 23:37:38 +02:00
Renaud Chaput 5aa08826cf [Glitch] Type Redux store and middleware
Port 6aeb162927 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 23:28:40 +02:00
Renaud Chaput a56c71faba [Glitch] Remove unused iOS agent sniffing function
Port 224d458f7e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 23:20:57 +02:00
Renaud Chaput 526fe33e2f [Glitch] Rework polyfills loading
Port a3a2414f0e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 23:20:24 +02:00
fusagiko / takayamaki e22a88b512 [Glitch] Add more detailed type annotation for Account
Port 6579e3af7d to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 23:16:23 +02:00
Claire 1a664560cc Merge commit '6aeb162927e6f9bbfd597632a10d82d9656c2385' into glitch-soc/merge-upstream
Conflicts:
- `.github/dependabot.yml`:
  We deleted it.
  Kept it removed.
- `app/javascript/packs/public.jsx`:
  Upstream changed an import, we have slightly different ones.
  Ported upstream changes.
2023-05-09 23:12:48 +02:00
fusagiko / takayamaki 349cae0b57
Add type annotation for DisplayName component (#24752) 2023-05-09 23:08:54 +02:00
fusagiko / takayamaki ab7716cff4
Rename Image component to ServerHeroImage (#24894) 2023-05-09 23:08:28 +02:00
Claire 0fff2b67de Disable broken onboarding code 2023-05-09 23:03:23 +02:00
Renaud Chaput 5f2071d055 [Glitch] Enforce stricter rules for Typescript files
Port c8181eb0a4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 22:56:26 +02:00
Renaud Chaput b509b96504 [Glitch] Enforce React Rules of Hooks with eslint
Port d9b93bd15e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 22:28:53 +02:00
Renaud Chaput 108720d7b0 [Glitch] Dont use CommonJS (`require`, `module.exports`) anywhere
Port 955179fc55 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 22:28:53 +02:00
Claire c81d1b0d38 Merge commit 'c8181eb0a41c4f5c1655d4e400cab071aee4182a' into glitch-soc/merge-upstream
Conflicts:
- `app/javascript/packs/admin.jsx`:
  Upstream reworked imports, but we had many changes.
  Reworked imports as upstream did.
- `app/javascript/packs/public.jsx`:
  Upstream reworked imports, but we had many changes.
  Reworked imports as upstream did.
2023-05-09 22:12:05 +02:00
たいち ひ 887112a065 [Glitch] Add TypeScript support for `mastodon` alias and image imports
Port 7c1305b3a4 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 21:50:48 +02:00
Claire 42bdc2add9 Copy hooks/useHovering.ts to glitch-soc 2023-05-09 21:30:10 +02:00
Claire 8e806b6e88 Fix IconButton prop types in glitch-soc 2023-05-09 21:11:23 +02:00
Renaud Chaput 6415981056 [Glitch] Mark `wheel` events on scrollable list as passive
Port 89269e4b71 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:42:07 +02:00
fusagiko / takayamaki f94eb65cf9 [Glitch] Rewrite Domain component as function component
Port 9818f34273 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:33:58 +02:00
fusagiko / takayamaki 468dfffd26 [Glitch] Use LayoutType from is_mobile in actions/app
Port 5bc8e2d1fd to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:32:30 +02:00
たいち ひ 87a704f70b [Glitch] Rewrite RadioButton component as FC
Port 76264e3fe8 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:25:31 +02:00
たいち ひ bd851d3b58 [Glitch] Rewrite Image component as function component
Port a65d2d1045 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:24:49 +02:00
たいち ひ 1edaf58fb9 [Glitch] Rewrite <NotSignedInIndicator /> as FC
Port 490ccbf40b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2023-05-09 20:24:01 +02:00
Claire 8b568755ad Merge commit '89269e4b713e3291a5c8c29b8d2e7b950b60eb35' into glitch-soc/merge-upstream
Conflicts:
- `tsconfig.json`:
  Upstream changed the config to properly process imports.
  Glitch-soc had previously already done so.
  Changed the config to better match upstream.
2023-05-09 20:12:33 +02:00
Nick Schonning 51b83ed195
Use Prettier for ESLint formatting TypeScript (#23631) 2023-05-09 19:02:12 +02:00
Renaud Chaput 6aeb162927
Type Redux store and middleware (#24843) 2023-05-09 16:56:26 +02:00
Claire e1f466fbbe
Fix javascript on moderation interface (#24933) 2023-05-09 16:42:02 +02:00
Renaud Chaput 224d458f7e
Remove unused iOS agent sniffing function (#24931) 2023-05-09 15:48:53 +02:00
dependabot[bot] 72dcb2ef58
Bump @typescript-eslint/eslint-plugin from 5.59.2 to 5.59.5 (#24922)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 15:42:21 +02:00
dependabot[bot] a5ba98d2df
Bump @typescript-eslint/parser from 5.59.2 to 5.59.5 (#24921)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-09 15:25:49 +02:00
eggplants af7bf59b3e
Fix wrong documentation link (#24924) 2023-05-09 14:56:02 +02:00
Renaud Chaput a3a2414f0e
Rework polyfills loading (#24907) 2023-05-09 14:55:35 +02:00
Daniel M Brasil 536dd046d4
Add ability to block sign-ups from IP using the CLI (#24870) 2023-05-09 14:46:00 +02:00
Daniel M Brasil ffb3fef7db
Fix uncaught `ActiveRecord::StatementInvalid` in Mastodon::IpBlocksCLI (#24861) 2023-05-09 14:45:47 +02:00
Renaud Chaput aec486b4ec
Upgrade `uuid` to 9.0.0 (#24917) 2023-05-09 14:43:07 +02:00
fusagiko / takayamaki 6579e3af7d
Add more detailed type annotation for Account (#24815) 2023-05-09 12:09:32 +02:00
Renaud Chaput c8181eb0a4
Enforce stricter rules for Typescript files (#24910) 2023-05-09 03:11:56 +02:00
Renaud Chaput 64ec41d89c
Make Webpack fail on failed imports (#24908) 2023-05-09 03:10:04 +02:00
Renaud Chaput d9b93bd15e
Enforce React Rules of Hooks with eslint (#24911) 2023-05-09 03:09:11 +02:00
Renaud Chaput 955179fc55
Dont use CommonJS (`require`, `module.exports`) anywhere (#24913) 2023-05-09 03:08:47 +02:00
Renaud Chaput 89269e4b71
Mark `wheel` events on scrollable list as passive (#24914) 2023-05-09 03:07:13 +02:00
fusagiko / takayamaki 9818f34273
Rewrite Domain component as function component (#24896) 2023-05-08 15:12:12 +02:00
fusagiko / takayamaki 5bc8e2d1fd
Use LayoutType from is_mobile in actions/app (#24863) 2023-05-08 15:10:21 +02:00
たいち ひ 7c1305b3a4
Add TypeScript support for `mastodon` alias and image imports (#24895) 2023-05-08 11:28:36 +02:00
たいち ひ 76264e3fe8
Rewrite RadioButton component as FC (#24897) 2023-05-08 11:12:53 +02:00
たいち ひ a65d2d1045
Rewrite Image component as function component (#24893) 2023-05-08 11:12:44 +02:00
たいち ひ 490ccbf40b
Rewrite <NotSignedInIndicator /> as FC (#24903) 2023-05-08 11:12:13 +02:00
たいち ひ 6fdbee240c
Rewrite <Check /> as FC (#24901) 2023-05-08 08:26:02 +02:00
fusagiko / takayamaki 140aa6b054
Rewrite VerifiedBadge component as function component (#24892) 2023-05-07 09:10:58 +02:00
1892 changed files with 41307 additions and 31636 deletions

View File

@ -1,5 +1,5 @@
# For details, see https://github.com/devcontainers/images/tree/main/src/ruby
FROM mcr.microsoft.com/devcontainers/ruby:0-3.2-bullseye
FROM mcr.microsoft.com/devcontainers/ruby:1-3.2-bullseye
# Install Rails
# RUN gem install rails webdrivers

View File

@ -69,7 +69,7 @@ services:
hard: -1
libretranslate:
image: libretranslate/libretranslate:v1.3.10
image: libretranslate/libretranslate:v1.3.11
restart: unless-stopped
volumes:
- lt-data:/home/libretranslate/.local

View File

@ -5,3 +5,5 @@ DB_HOST=$(pwd)/data/postgres
DB_USER=mastodon
DB_NAME=mastodon_dev
REDIS_URL=unix://./data/redis/redis-dev.sock
TH_USE_INVITE_QUOTA=1

View File

@ -4,10 +4,12 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/recommended',
'plugin:promise/recommended',
'plugin:jsdoc/recommended',
'plugin:prettier/recommended',
],
env: {
@ -53,28 +55,14 @@ module.exports = {
'\\.(css|scss|json)$',
],
'import/resolver': {
node: {
paths: ['app/javascript'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
typescript: {},
},
},
rules: {
'brace-style': 'warn',
'comma-dangle': ['error', 'always-multiline'],
'comma-spacing': [
'warn',
{
before: false,
after: true,
},
],
'comma-style': ['warn', 'last'],
'consistent-return': 'error',
'dot-notation': 'error',
eqeqeq: ['error', 'always', { 'null': 'ignore' }],
indent: ['warn', 2],
'jsx-quotes': ['error', 'prefer-single'],
'no-case-declarations': 'off',
'no-catch-shadow': 'error',
@ -93,8 +81,16 @@ module.exports = {
{ property: 'substring', message: 'Use .slice instead of .substring.' },
{ property: 'substr', message: 'Use .slice instead of .substr.' },
],
'no-restricted-syntax': [
'error',
{
// eslint-disable-next-line no-restricted-syntax
selector: 'Literal[value=/•/], JSXText[value=/•/]',
// eslint-disable-next-line no-restricted-syntax
message: "Use '·' (middle dot) instead of '•' (bullet)",
},
],
'no-self-assign': 'off',
'no-trailing-spaces': 'warn',
'no-unused-expressions': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
@ -102,34 +98,26 @@ module.exports = {
{
vars: 'all',
args: 'after-used',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'object-curly-spacing': ['error', 'always'],
'padded-blocks': [
'error',
{
classes: 'always',
},
],
quotes: ['error', 'single'],
semi: 'error',
'valid-typeof': 'error',
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', 'tsx'] }],
'react/jsx-boolean-value': 'error',
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
'react/jsx-curly-spacing': 'error',
'react/display-name': 'off',
'react/jsx-fragments': ['error', 'syntax'],
'react/jsx-equals-spacing': 'error',
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react/jsx-indent': ['error', 2],
'react/jsx-no-bind': 'error',
'react/jsx-no-useless-fragment': 'error',
'react/jsx-no-target-blank': 'off',
'react/jsx-tag-spacing': 'error',
'react/jsx-uses-react': 'off', // not needed with new JSX transform
'react/jsx-wrap-multilines': 'error',
'react/no-deprecated': 'off',
'react/no-unknown-property': 'off',
'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
'react/self-closing-comp': 'error',
// recommended values found in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/src/index.js
@ -192,11 +180,14 @@ module.exports = {
{
js: 'never',
jsx: 'never',
mjs: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-anonymous-default-export': 'error',
'import/no-extraneous-dependencies': [
'error',
{
@ -208,8 +199,63 @@ module.exports = {
],
},
],
'import/no-amd': 'error',
'import/no-commonjs': 'error',
'import/no-import-module-exports': 'error',
'import/no-relative-packages': 'error',
'import/no-self-import': 'error',
'import/no-useless-path-segments': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/order': [
'error',
{
alphabetize: { order: 'asc' },
'newlines-between': 'always',
groups: [
'builtin',
'external',
'internal',
'parent',
['index', 'sibling'],
'object',
],
pathGroups: [
// React core packages
{
pattern: '{react,react-dom,react-dom/client,prop-types}',
group: 'builtin',
position: 'after',
},
// I18n
{
pattern: '{react-intl,intl-messageformat}',
group: 'builtin',
position: 'after',
},
// Common React utilities
{
pattern: '{classnames,react-helmet,react-router-dom}',
group: 'external',
position: 'before',
},
// Immutable / Redux / data store
{
pattern: '{immutable,react-redux,react-immutable-proptypes,react-immutable-pure-component,reselect}',
group: 'external',
position: 'before',
},
// Internal packages
{
pattern: '{mastodon/**,flavours/glitch-soc/**}',
group: 'internal',
position: 'after',
},
],
pathGroupsExcludedImportTypes: [],
},
],
'promise/always-return': 'off',
'promise/catch-or-return': [
'error',
@ -255,6 +301,8 @@ module.exports = {
'*.config.js',
'.*rc.js',
'ide-helper.js',
'config/webpack/**/*',
'config/formatjs-formatter.js',
],
env: {
@ -264,6 +312,10 @@ module.exports = {
parserOptions: {
sourceType: 'script',
},
rules: {
'import/no-commonjs': 'off',
},
},
{
files: [
@ -274,18 +326,39 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:promise/recommended',
'plugin:jsdoc/recommended',
'plugin:jsdoc/recommended-typescript',
'plugin:prettier/recommended',
],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'@typescript-eslint/consistent-type-definitions': ['warn', 'interface'],
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'jsdoc/require-jsdoc': 'off',
// Those rules set stricter rules for TS files
// to enforce better practices when converting from JS
'import/no-default-export': 'warn',
'react/prefer-stateless-function': 'warn',
'react/function-component-definition': ['error', { namedComponents: 'arrow-function' }],
'react/jsx-uses-react': 'off', // not needed with new JSX transform
'react/react-in-jsx-scope': 'off', // not needed with new JSX transform
'react/prop-types': 'off',
},
},
{
@ -298,5 +371,13 @@ module.exports = {
jest: true,
},
},
{
files: [
'streaming/**/*',
],
rules: {
'import/no-commonjs': 'off',
},
},
],
};

114
.github/renovate.json5 vendored Normal file
View File

@ -0,0 +1,114 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:base',
':dependencyDashboard',
':labels(dependencies)',
':maintainLockFilesMonthly', // update non-direct dependencies monthly
':prConcurrentLimit10', // only 10 open PRs at the same time
],
stabilityDays: 3, // Wait 3 days after the package has been published before upgrading it
// packageRules order is important, they are applied from top to bottom and are merged,
// so for example grouping rules needs to be at the bottom
packageRules: [
{
// Ignore major version bumps for these node packages
matchManagers: ['npm'],
matchPackageNames: [
'@rails/ujs', // Needs to match the major Rails version
'tesseract.js', // Requires code changes
'react-hotkeys', // Requires code changes
// Requires Webpacker upgrade or replacement
'@types/webpack',
'babel-loader',
'compression-webpack-plugin',
'css-loader',
'imports-loader',
'mini-css-extract-plugin',
'postcss-loader',
'sass-loader',
'terser-webpack-plugin',
'webpack',
'webpack-assets-manifest',
'webpack-bundle-analyzer',
'webpack-dev-server',
'webpack-cli',
// react-router: Requires manual upgrade
'history',
'react-router-dom',
],
matchUpdateTypes: ['major'],
enabled: false,
},
{
// Ignore major version bumps for these Ruby packages
matchManagers: ['bundler'],
matchPackageNames: [
'sprockets', // Requires manual upgrade https://github.com/rails/sprockets/blob/master/UPGRADING.md#guide-to-upgrading-from-sprockets-3x-to-4x
'strong_migrations', // Requires manual upgrade
'sidekiq', // Requires manual upgrade
'sidekiq-unique-jobs', // Requires manual upgrades and sync with Sidekiq version
'redis', // Requires manual upgrade and sync with Sidekiq version
'fog-openstack', // TODO: was ignored in https://github.com/mastodon/mastodon/pull/13964
// Needs major Rails version bump
'rack',
'rails',
'rails-i18n',
],
matchUpdateTypes: ['major'],
enabled: false,
},
{
// Update Github Actions and Docker images weekly
matchManagers: ['github-actions', 'dockerfile', 'docker-compose'],
extends: ['schedule:weekly'],
},
{
// Ignore major & minor bumps for the ruby image, this needs to be synced with .ruby-version
matchManagers: ['dockerfile'],
matchPackageNames: ['moritzheiber/ruby-jemalloc'],
matchUpdateTypes: ['minor', 'major'],
enabled: false,
},
{
// Ignore major bump for the node image, this needs to be synced with .nvmrc
matchManagers: ['dockerfile'],
matchPackageNames: ['node'],
matchUpdateTypes: ['major'],
enabled: false,
},
{
// Ignore major postgres bumps in the docker-compose file, as those break dev environments
matchManagers: ['docker-compose'],
matchPackageNames: ['postgres'],
matchUpdateTypes: ['major'],
enabled: false,
},
{
// Update devDependencies every week, with one grouped PR
matchDepTypes: 'devDependencies',
matchUpdateTypes: ['patch', 'minor'],
excludePackageNames: [
'typescript', // Typescript has many changes in minor versions, needs to be checked every time
],
groupName: 'devDependencies (non-major)',
extends: ['schedule:weekly'],
},
{
// Update @types/* packages every week, with one grouped PR
matchPackagePrefixes: '@types/',
matchUpdateTypes: ['patch', 'minor'],
groupName: 'DefinitelyTyped types (non-major)',
extends: ['schedule:weekly'],
addLabels: ['typescript'],
},
// Add labels depending on package manager
{ matchManagers: ['npm', 'nvm'], addLabels: ['javascript'] },
{ matchManagers: ['bundler', 'ruby-version'], addLabels: ['ruby'] },
{ matchManagers: ['docker-compose', 'dockerfile'], addLabels: ['docker'] },
{ matchManagers: ['github-actions'], addLabels: ['github_actions'] },
],
}

View File

@ -41,8 +41,7 @@ jobs:
- name: Check for missing strings in English JSON
run: |
yarn build:development
yarn manage:translations en
yarn i18n:extract --throws
git diff --exit-code
- name: Check locale file normalization

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
@ -48,4 +49,4 @@ jobs:
- run: echo "::add-matcher::.github/stylelint-matcher.json"
- name: Stylelint
run: yarn test:lint:sass
run: yarn lint:sass

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- '.github/workflows/haml-lint-problem-matcher.json'
- '.github/workflows/lint-haml.yml'

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
@ -48,7 +49,7 @@ jobs:
run: yarn --frozen-lockfile
- name: ESLint
run: yarn test:lint:js --max-warnings 0
run: yarn lint:js --max-warnings 0
- name: Typecheck
run: yarn test:typecheck
run: yarn typecheck

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
@ -40,4 +41,4 @@ jobs:
run: yarn --frozen-lockfile
- name: Prettier
run: yarn prettier --check "**/*.json"
run: yarn lint:json

View File

@ -3,8 +3,10 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- '.github/workflows/lint-md.yml'
- '.nvmrc'
- '.prettier*'
- '**/*.md'
- '!AUTHORS.md'
@ -14,6 +16,7 @@ on:
pull_request:
paths:
- '.github/workflows/lint-md.yml'
- '.nvmrc'
- '.prettier*'
- '**/*.md'
- '!AUTHORS.md'
@ -32,9 +35,10 @@ jobs:
uses: actions/setup-node@v3
with:
cache: yarn
node-version-file: '.nvmrc'
- name: Install all yarn packages
run: yarn --frozen-lockfile
- name: Prettier
run: yarn prettier --check "**/*.md"
run: yarn lint:md

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'Gemfile*'
- '.rubocop*.yml'

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
@ -42,4 +43,4 @@ jobs:
run: yarn --frozen-lockfile
- name: Prettier
run: yarn prettier --check "**/*.{yml,yaml}"
run: yarn lint:yml

View File

@ -4,10 +4,12 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
- 'l10n_main'
pull_request_target:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
- 'l10n_main'
types: [synchronize]

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
paths:
- 'package.json'
- 'yarn.lock'
@ -44,4 +45,4 @@ jobs:
run: yarn --frozen-lockfile
- name: Jest testing
run: yarn test:jest --reporters github-actions summary
run: yarn jest --reporters github-actions summary

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:
jobs:
@ -23,9 +24,17 @@ jobs:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
strategy:
fail-fast: false
matrix:
postgres:
- 14-alpine
- 15-alpine
services:
postgres:
image: postgres:14-alpine
image: postgres:${{ matrix.postgres}}
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres

View File

@ -3,6 +3,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:
jobs:
@ -23,9 +24,17 @@ jobs:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
strategy:
fail-fast: false
matrix:
postgres:
- 14-alpine
- 15-alpine
services:
postgres:
image: postgres:14-alpine
image: postgres:${{ matrix.postgres}}
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres

View File

@ -4,6 +4,7 @@ on:
push:
branches-ignore:
- 'dependabot/**'
- 'renovate/**'
pull_request:
env:

View File

@ -4,6 +4,11 @@ exclude:
- 'vendor/**/*'
- lib/templates/haml/scaffold/_form.html.haml
require:
- ./lib/linter/haml_middle_dot.rb
linters:
AltText:
enabled: true
MiddleDot:
enabled: true

View File

@ -61,7 +61,7 @@ docker-compose.override.yml
/app/javascript/mastodon/features/emoji/emoji_map.json
# Ignore locale files
/app/javascript/mastodon/locales
/app/javascript/mastodon/locales/*.json
/config/locales
# Ignore vendored CSS reset
@ -70,8 +70,6 @@ app/javascript/styles/mastodon/reset.scss
# Ignore Javascript pending https://github.com/mastodon/mastodon/pull/23631
*.js
*.jsx
*.ts
*.tsx
# Ignore HTML till cleaned and included in CI
*.html

View File

@ -1,3 +1,4 @@
module.exports = {
singleQuote: true
singleQuote: true,
jsxSingleQuote: true
}

View File

@ -11,6 +11,7 @@ require:
- rubocop-rspec
- rubocop-performance
- rubocop-capybara
- ./lib/linter/rubocop_middle_dot
AllCops:
TargetRubyVersion: 3.0 # Set to minimum supported version of CI
@ -43,7 +44,7 @@ Layout/LineLength:
- !ruby/regexp / \# .*$/
- !ruby/regexp /^\# .*$/
Exclude:
- lib/**/*cli*.rb
- 'lib/mastodon/cli/*.rb'
- db/*migrate/**/*
- db/seeds/**/*
@ -53,113 +54,52 @@ Lint/UselessAccessModifier:
ContextCreatingMethods:
- class_methods
## Disable most Metrics/*Length cops
# Reason: those are often triggered and force significant refactors when this happend
# but the team feel they are not really improving the code quality.
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
Metrics/BlockLength:
Enabled: false
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
Metrics/ClassLength:
Enabled: false
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength
Metrics/MethodLength:
Enabled: false
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
Metrics/ModuleLength:
Enabled: false
## End Disable Metrics/*Length cops
# Reason: Currently disabled in .rubocop_todo.yml
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize
Metrics/AbcSize:
Exclude:
- 'lib/**/*cli*.rb'
- 'lib/mastodon/cli/*.rb'
- db/*migrate/**/*
# Reason: Some functions cannot be broken up, but others may be refactor candidates
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
Metrics/BlockLength:
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
Exclude:
- 'config/routes.rb'
- 'lib/mastodon/*_cli.rb'
- 'lib/tasks/*.rake'
- 'app/models/concerns/account_associations.rb'
- 'app/models/concerns/account_interactions.rb'
- 'app/models/concerns/ldap_authenticable.rb'
- 'app/models/concerns/omniauthable.rb'
- 'app/models/concerns/pam_authenticable.rb'
- 'app/models/concerns/remotable.rb'
- 'app/services/suspend_account_service.rb'
- 'app/services/unsuspend_account_service.rb'
- 'app/views/accounts/show.rss.ruby'
- 'app/views/tags/show.rss.ruby'
- 'config/environments/development.rb'
- 'config/environments/production.rb'
- 'config/initializers/devise.rb'
- 'config/initializers/doorkeeper.rb'
- 'config/initializers/omniauth.rb'
- 'config/initializers/simple_form.rb'
- 'config/navigation.rb'
- 'config/routes.rb'
- 'config/routes/*.rb'
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
- 'lib/paperclip/gif_transcoder.rb'
# Reason:
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting
Metrics/BlockNesting:
Exclude:
- 'lib/mastodon/*_cli.rb'
# Reason: Some Excluded files would be candidates for refactoring but not currently addressed
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
Metrics/ClassLength:
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
Exclude:
- 'lib/mastodon/*_cli.rb'
- 'app/controllers/admin/accounts_controller.rb'
- 'app/controllers/api/base_controller.rb'
- 'app/controllers/api/v1/admin/accounts_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/auth/registrations_controller.rb'
- 'app/controllers/auth/sessions_controller.rb'
- 'app/lib/activitypub/activity.rb'
- 'app/lib/activitypub/activity/create.rb'
- 'app/lib/activitypub/tag_manager.rb'
- 'app/lib/feed_manager.rb'
- 'app/lib/link_details_extractor.rb'
- 'app/lib/request.rb'
- 'app/lib/text_formatter.rb'
- 'app/lib/user_settings_decorator.rb'
- 'app/mailers/user_mailer.rb'
- 'app/models/account.rb'
- 'app/models/admin/account_action.rb'
- 'app/models/form/account_batch.rb'
- 'app/models/media_attachment.rb'
- 'app/models/status.rb'
- 'app/models/tag.rb'
- 'app/models/user.rb'
- 'app/serializers/activitypub/actor_serializer.rb'
- 'app/serializers/activitypub/note_serializer.rb'
- 'app/serializers/rest/status_serializer.rb'
- 'app/services/account_search_service.rb'
- 'app/services/activitypub/process_account_service.rb'
- 'app/services/activitypub/process_status_update_service.rb'
- 'app/services/backup_service.rb'
- 'app/services/bulk_import_service.rb'
- 'app/services/delete_account_service.rb'
- 'app/services/fan_out_on_write_service.rb'
- 'app/services/fetch_link_card_service.rb'
- 'app/services/import_service.rb'
- 'app/services/notify_service.rb'
- 'app/services/post_status_service.rb'
- 'app/services/update_status_service.rb'
- 'lib/paperclip/color_extractor.rb'
- 'lib/mastodon/cli/*.rb'
# Reason: Currently disabled in .rubocop_todo.yml
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity
Metrics/CyclomaticComplexity:
Exclude:
- lib/mastodon/*cli*.rb
- lib/mastodon/cli/*.rb
- db/*migrate/**/*
# Reason: Currently disabled in .rubocop_todo.yml
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength
Metrics/MethodLength:
CountAsOne: [array, heredoc]
Exclude:
- 'lib/mastodon/*_cli.rb'
# Reason:
# https://docs.rubocop.org/rubocop/cops_style.html#stylerescuestandarderror
Metrics/ModuleLength:
CountAsOne: [array, heredoc]
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsparameterlists
Metrics/ParameterLists:
CountKeywordArgs: false
# Reason: Prevailing style is argument file paths
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsfilepath
@ -171,13 +111,12 @@ Rails/FilePath:
Rails/HttpStatus:
EnforcedStyle: numeric
# Reason: Allowed only in the `tootctl` CLI application code
# Reason: Allowed in `tootctl` CLI code and in boot ENV checker
# https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsexit
Rails/Exit:
Exclude:
- 'lib/mastodon/*_cli.rb'
- 'lib/mastodon/cli_helper.rb'
- 'lib/cli.rb'
- 'config/boot.rb'
- 'lib/mastodon/cli/*.rb'
# Reason: Some single letter camel case files shouldn't be split
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
@ -267,3 +206,6 @@ Style/TrailingCommaInArrayLiteral:
# https://docs.rubocop.org/rubocop/cops_style.html#styletrailingcommainhashliteral
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: 'comma'
Style/MiddleDot:
Enabled: true

View File

@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.50.2.
# using RuboCop version 1.52.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@ -21,12 +21,6 @@ Layout/ArgumentAlignment:
- 'config/initializers/cors.rb'
- 'config/initializers/session_store.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment.
Layout/ExtraSpacing:
Exclude:
- 'config/initializers/omniauth.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
# SupportedHashRocketStyles: key, separator, table
@ -39,12 +33,6 @@ Layout/HashAlignment:
- 'config/initializers/rack_attack.rb'
- 'config/routes.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Width, AllowedPatterns.
Layout/IndentationWidth:
Exclude:
- 'config/initializers/ffmpeg.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
Layout/LeadingCommentSpace:
@ -52,14 +40,6 @@ Layout/LeadingCommentSpace:
- 'config/application.rb'
- 'config/initializers/omniauth.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
# SupportedStyles: space, no_space
# SupportedStylesForEmptyBraces: space, no_space
Layout/SpaceBeforeBlockBraces:
Exclude:
- 'config/initializers/paperclip.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: require_no_space, require_space
@ -69,35 +49,13 @@ Layout/SpaceInLambdaLiteral:
- 'config/initializers/content_security_policy.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: space, no_space
Layout/SpaceInsideStringInterpolation:
Exclude:
- 'config/initializers/webauthn.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowInHeredoc.
Layout/TrailingWhitespace:
Exclude:
- 'config/initializers/paperclip.rb'
# Configuration parameters: AllowedMethods, AllowedPatterns.
Lint/AmbiguousBlockAssociation:
Exclude:
- 'spec/controllers/admin/account_moderation_notes_controller_spec.rb'
- 'spec/controllers/settings/two_factor_authentication/confirmations_controller_spec.rb'
- 'spec/controllers/settings/two_factor_authentication/otp_authentication_controller_spec.rb'
- 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb'
- 'spec/services/activitypub/process_status_update_service_spec.rb'
- 'spec/services/post_status_service_spec.rb'
- 'spec/services/suspend_account_service_spec.rb'
- 'spec/services/unsuspend_account_service_spec.rb'
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
# This cop supports safe autocorrection (--autocorrect).
Lint/AmbiguousOperatorPrecedence:
Exclude:
- 'config/initializers/rack_attack.rb'
# Configuration parameters: AllowComments, AllowEmptyLambdas.
Lint/EmptyBlock:
@ -162,6 +120,7 @@ Lint/UnusedBlockArgument:
- 'config/initializers/paperclip.rb'
- 'config/initializers/simple_form.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Lint/UselessAssignment:
Exclude:
- 'app/services/activitypub/process_status_update_service.rb'
@ -183,6 +142,7 @@ Lint/UselessAssignment:
- 'spec/services/resolve_url_service_spec.rb'
- 'spec/views/statuses/show.html.haml_spec.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
@ -194,12 +154,6 @@ Metrics/AbcSize:
Exclude:
- 'app/serializers/initial_state_serializer.rb'
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
- 'app/models/concerns/status_safe_reblog_insert.rb'
# Configuration parameters: CountBlocks, Max.
Metrics/BlockNesting:
Exclude:
@ -209,31 +163,9 @@ Metrics/BlockNesting:
Metrics/CyclomaticComplexity:
Max: 25
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
Metrics/MethodLength:
Max: 58
# Configuration parameters: CountComments, Max, CountAsOne.
Metrics/ModuleLength:
Exclude:
- 'app/controllers/concerns/signature_verification.rb'
- 'app/helpers/application_helper.rb'
- 'app/helpers/jsonld_helper.rb'
- 'app/models/concerns/account_interactions.rb'
- 'app/models/concerns/has_user_settings.rb'
- 'lib/sanitize_ext/sanitize_config.rb'
# Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Exclude:
- 'app/models/concerns/account_interactions.rb'
- 'app/services/activitypub/fetch_remote_account_service.rb'
- 'app/services/activitypub/fetch_remote_actor_service.rb'
- 'app/services/activitypub/fetch_remote_status_service.rb'
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 28
Max: 27
Naming/AccessorMethodName:
Exclude:
@ -246,6 +178,7 @@ Naming/FileName:
Exclude:
- 'config/locales/sr-Latn.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
Naming/MemoizedInstanceVariableName:
@ -268,39 +201,9 @@ Naming/VariableNumber:
- 'db/migrate/20190820003045_update_statuses_index.rb'
- 'db/migrate/20190823221802_add_local_index_to_statuses.rb'
- 'db/migrate/20200119112504_add_public_index_to_statuses.rb'
- 'spec/controllers/activitypub/followers_synchronizations_controller_spec.rb'
- 'spec/lib/feed_manager_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/models/concerns/account_interactions_spec.rb'
- 'spec/models/custom_emoji_filter_spec.rb'
- 'spec/models/domain_block_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/services/activitypub/fetch_featured_collection_service_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/MapCompact:
Exclude:
- 'app/lib/admin/metrics/dimension.rb'
- 'app/lib/admin/metrics/measure.rb'
- 'app/lib/feed_manager.rb'
- 'app/models/account.rb'
- 'app/models/account_statuses_cleanup_policy.rb'
- 'app/models/account_suggestions/setting_source.rb'
- 'app/models/account_suggestions/source.rb'
- 'app/models/follow_recommendation_filter.rb'
- 'app/models/notification.rb'
- 'app/models/user_role.rb'
- 'app/models/webhook.rb'
- 'app/services/process_mentions_service.rb'
- 'app/validators/existing_username_validator.rb'
- 'db/migrate/20200407202420_migrate_unavailable_inboxes.rb'
- 'spec/presenters/status_relationships_presenter_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SafeMultiline.
Performance/StartWith:
Exclude:
- 'app/lib/extractor.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/UnfreezeString:
@ -330,79 +233,6 @@ RSpec/AnyInstance:
- 'spec/workers/activitypub/delivery_worker_spec.rb'
- 'spec/workers/web/push_notification_worker_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: SkipBlocks, EnforcedStyle.
# SupportedStyles: described_class, explicit
RSpec/DescribedClass:
Exclude:
- 'spec/controllers/concerns/cache_concern_spec.rb'
- 'spec/controllers/concerns/challengable_concern_spec.rb'
- 'spec/lib/entity_cache_spec.rb'
- 'spec/lib/extractor_spec.rb'
- 'spec/lib/feed_manager_spec.rb'
- 'spec/lib/hash_object_spec.rb'
- 'spec/lib/ostatus/tag_manager_spec.rb'
- 'spec/lib/request_spec.rb'
- 'spec/lib/tag_manager_spec.rb'
- 'spec/lib/webfinger_resource_spec.rb'
- 'spec/mailers/notification_mailer_spec.rb'
- 'spec/mailers/user_mailer_spec.rb'
- 'spec/models/account_conversation_spec.rb'
- 'spec/models/account_domain_block_spec.rb'
- 'spec/models/account_migration_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/models/block_spec.rb'
- 'spec/models/domain_block_spec.rb'
- 'spec/models/email_domain_block_spec.rb'
- 'spec/models/export_spec.rb'
- 'spec/models/favourite_spec.rb'
- 'spec/models/follow_spec.rb'
- 'spec/models/identity_spec.rb'
- 'spec/models/import_spec.rb'
- 'spec/models/media_attachment_spec.rb'
- 'spec/models/notification_spec.rb'
- 'spec/models/relationship_filter_spec.rb'
- 'spec/models/report_filter_spec.rb'
- 'spec/models/session_activation_spec.rb'
- 'spec/models/setting_spec.rb'
- 'spec/models/site_upload_spec.rb'
- 'spec/models/status_pin_spec.rb'
- 'spec/models/status_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/policies/account_moderation_note_policy_spec.rb'
- 'spec/presenters/account_relationships_presenter_spec.rb'
- 'spec/presenters/status_relationships_presenter_spec.rb'
- 'spec/serializers/activitypub/note_serializer_spec.rb'
- 'spec/serializers/activitypub/update_poll_serializer_spec.rb'
- 'spec/serializers/rest/account_serializer_spec.rb'
- 'spec/services/activitypub/fetch_remote_account_service_spec.rb'
- 'spec/services/activitypub/fetch_remote_actor_service_spec.rb'
- 'spec/services/activitypub/fetch_remote_key_service_spec.rb'
- 'spec/services/after_block_domain_from_account_service_spec.rb'
- 'spec/services/authorize_follow_service_spec.rb'
- 'spec/services/batched_remove_status_service_spec.rb'
- 'spec/services/block_domain_service_spec.rb'
- 'spec/services/block_service_spec.rb'
- 'spec/services/bootstrap_timeline_service_spec.rb'
- 'spec/services/clear_domain_media_service_spec.rb'
- 'spec/services/favourite_service_spec.rb'
- 'spec/services/follow_service_spec.rb'
- 'spec/services/import_service_spec.rb'
- 'spec/services/post_status_service_spec.rb'
- 'spec/services/precompute_feed_service_spec.rb'
- 'spec/services/process_mentions_service_spec.rb'
- 'spec/services/purge_domain_service_spec.rb'
- 'spec/services/reblog_service_spec.rb'
- 'spec/services/reject_follow_service_spec.rb'
- 'spec/services/remove_from_followers_service_spec.rb'
- 'spec/services/remove_status_service_spec.rb'
- 'spec/services/unallow_domain_service_spec.rb'
- 'spec/services/unblock_service_spec.rb'
- 'spec/services/unfollow_service_spec.rb'
- 'spec/services/unmute_service_spec.rb'
- 'spec/services/update_account_service_spec.rb'
- 'spec/validators/note_length_validator_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/EmptyExampleGroup:
Exclude:
@ -442,29 +272,6 @@ RSpec/EmptyExampleGroup:
RSpec/ExampleLength:
Max: 22
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: method_call, block
RSpec/ExpectChange:
Exclude:
- 'spec/controllers/admin/account_moderation_notes_controller_spec.rb'
- 'spec/controllers/admin/custom_emojis_controller_spec.rb'
- 'spec/controllers/admin/invites_controller_spec.rb'
- 'spec/controllers/admin/report_notes_controller_spec.rb'
- 'spec/controllers/concerns/accountable_concern_spec.rb'
- 'spec/controllers/invites_controller_spec.rb'
- 'spec/controllers/settings/two_factor_authentication/webauthn_credentials_controller_spec.rb'
- 'spec/models/admin/account_action_spec.rb'
- 'spec/services/suspend_account_service_spec.rb'
- 'spec/services/unsuspend_account_service_spec.rb'
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
RSpec/ExpectInHook:
Exclude:
- 'spec/controllers/api/v1/media_controller_spec.rb'
- 'spec/controllers/settings/applications_controller_spec.rb'
- 'spec/lib/status_filter_spec.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
@ -509,11 +316,8 @@ RSpec/LetSetup:
- 'spec/controllers/admin/statuses_controller_spec.rb'
- 'spec/controllers/api/v1/accounts/statuses_controller_spec.rb'
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb'
- 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb'
- 'spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb'
- 'spec/controllers/api/v1/filters_controller_spec.rb'
- 'spec/controllers/api/v1/followed_tags_controller_spec.rb'
- 'spec/controllers/api/v1/tags_controller_spec.rb'
- 'spec/controllers/api/v2/admin/accounts_controller_spec.rb'
- 'spec/controllers/api/v2/filters/keywords_controller_spec.rb'
- 'spec/controllers/api/v2/filters/statuses_controller_spec.rb'
@ -550,7 +354,6 @@ RSpec/LetSetup:
- 'spec/services/suspend_account_service_spec.rb'
- 'spec/services/unallow_domain_service_spec.rb'
- 'spec/services/unsuspend_account_service_spec.rb'
- 'spec/workers/scheduler/accounts_statuses_cleanup_scheduler_spec.rb'
- 'spec/workers/scheduler/user_cleanup_scheduler_spec.rb'
RSpec/MessageChain:
@ -582,32 +385,8 @@ RSpec/MessageSpies:
- 'spec/spec_helper.rb'
- 'spec/validators/status_length_validator_spec.rb'
RSpec/MissingExampleGroupArgument:
Exclude:
- 'spec/controllers/accounts_controller_spec.rb'
- 'spec/controllers/activitypub/collections_controller_spec.rb'
- 'spec/controllers/admin/statuses_controller_spec.rb'
- 'spec/controllers/admin/users/roles_controller_spec.rb'
- 'spec/controllers/api/v1/accounts_controller_spec.rb'
- 'spec/controllers/api/v1/admin/account_actions_controller_spec.rb'
- 'spec/controllers/api/v1/admin/domain_allows_controller_spec.rb'
- 'spec/controllers/api/v1/statuses_controller_spec.rb'
- 'spec/controllers/auth/registrations_controller_spec.rb'
- 'spec/features/log_in_spec.rb'
- 'spec/lib/activitypub/activity/undo_spec.rb'
- 'spec/lib/status_reach_finder_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/models/email_domain_block_spec.rb'
- 'spec/models/trends/statuses_spec.rb'
- 'spec/models/trends/tags_spec.rb'
- 'spec/models/user_role_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/services/fetch_link_card_service_spec.rb'
- 'spec/services/notify_service_spec.rb'
- 'spec/services/process_mentions_service_spec.rb'
RSpec/MultipleExpectations:
Max: 19
Max: 8
# Configuration parameters: AllowSubject.
RSpec/MultipleMemoizedHelpers:
@ -617,53 +396,10 @@ RSpec/MultipleMemoizedHelpers:
RSpec/NestedGroups:
Max: 6
# Configuration parameters: AllowedPatterns.
# AllowedPatterns: ^expect_, ^assert_
RSpec/NoExpectationExample:
Exclude:
- 'spec/controllers/auth/registrations_controller_spec.rb'
- 'spec/services/precompute_feed_service_spec.rb'
RSpec/PendingWithoutReason:
Exclude:
- 'spec/controllers/statuses_controller_spec.rb'
- 'spec/models/account_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
# SupportedStyles: inflected, explicit
RSpec/PredicateMatcher:
Exclude:
- 'spec/controllers/api/v1/accounts/notes_controller_spec.rb'
- 'spec/models/user_spec.rb'
- 'spec/services/post_status_service_spec.rb'
RSpec/RepeatedExample:
Exclude:
- 'spec/policies/status_policy_spec.rb'
RSpec/RepeatedExampleGroupBody:
Exclude:
- 'spec/controllers/statuses_controller_spec.rb'
RSpec/RepeatedExampleGroupDescription:
Exclude:
- 'spec/controllers/admin/reports/actions_controller_spec.rb'
- 'spec/policies/report_note_policy_spec.rb'
RSpec/ScatteredSetup:
Exclude:
- 'spec/controllers/activitypub/followers_synchronizations_controller_spec.rb'
- 'spec/controllers/activitypub/outboxes_controller_spec.rb'
- 'spec/controllers/admin/disputes/appeals_controller_spec.rb'
- 'spec/controllers/auth/registrations_controller_spec.rb'
- 'spec/services/activitypub/process_account_service_spec.rb'
# This cop supports safe autocorrection (--autocorrect).
RSpec/SharedContext:
Exclude:
- 'spec/services/unsuspend_account_service_spec.rb'
RSpec/StubbedMock:
Exclude:
- 'spec/controllers/api/base_controller_spec.rb'
@ -678,7 +414,6 @@ RSpec/StubbedMock:
RSpec/SubjectDeclaration:
Exclude:
- 'spec/controllers/admin/domain_blocks_controller_spec.rb'
- 'spec/controllers/api/v1/admin/domain_blocks_controller_spec.rb'
- 'spec/models/account_migration_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/models/relationship_filter_spec.rb'
@ -704,45 +439,6 @@ RSpec/SubjectStub:
- 'spec/services/unallow_domain_service_spec.rb'
- 'spec/validators/blacklisted_email_validator_spec.rb'
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
RSpec/VerifiedDoubles:
Exclude:
- 'spec/controllers/admin/change_emails_controller_spec.rb'
- 'spec/controllers/admin/confirmations_controller_spec.rb'
- 'spec/controllers/admin/disputes/appeals_controller_spec.rb'
- 'spec/controllers/admin/domain_allows_controller_spec.rb'
- 'spec/controllers/admin/domain_blocks_controller_spec.rb'
- 'spec/controllers/api/v1/reports_controller_spec.rb'
- 'spec/controllers/api/web/embeds_controller_spec.rb'
- 'spec/controllers/auth/sessions_controller_spec.rb'
- 'spec/controllers/disputes/appeals_controller_spec.rb'
- 'spec/helpers/statuses_helper_spec.rb'
- 'spec/lib/suspicious_sign_in_detector_spec.rb'
- 'spec/models/account/field_spec.rb'
- 'spec/models/session_activation_spec.rb'
- 'spec/models/setting_spec.rb'
- 'spec/services/account_search_service_spec.rb'
- 'spec/services/post_status_service_spec.rb'
- 'spec/services/search_service_spec.rb'
- 'spec/validators/blacklisted_email_validator_spec.rb'
- 'spec/validators/disallowed_hashtags_validator_spec.rb'
- 'spec/validators/email_mx_validator_spec.rb'
- 'spec/validators/follow_limit_validator_spec.rb'
- 'spec/validators/note_length_validator_spec.rb'
- 'spec/validators/poll_validator_spec.rb'
- 'spec/validators/status_length_validator_spec.rb'
- 'spec/validators/status_pin_validator_spec.rb'
- 'spec/validators/unique_username_validator_spec.rb'
- 'spec/validators/unreserved_username_validator_spec.rb'
- 'spec/validators/url_validator_spec.rb'
- 'spec/views/statuses/show.html.haml_spec.rb'
- 'spec/workers/activitypub/processing_worker_spec.rb'
- 'spec/workers/admin/domain_purge_worker_spec.rb'
- 'spec/workers/domain_block_worker_spec.rb'
- 'spec/workers/domain_clear_media_worker_spec.rb'
- 'spec/workers/feed_insert_worker_spec.rb'
- 'spec/workers/regeneration_worker_spec.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationController:
Exclude:
@ -805,12 +501,6 @@ Rails/DuplicateAssociation:
- 'app/serializers/activitypub/collection_serializer.rb'
- 'app/serializers/activitypub/note_serializer.rb'
# Configuration parameters: Include.
# Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb
Rails/Exit:
Exclude:
- 'config/boot.rb'
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/HasAndBelongsToMany:
@ -859,7 +549,6 @@ Rails/NegateInclude:
- 'app/models/concerns/attachmentable.rb'
- 'app/models/concerns/remotable.rb'
- 'app/models/custom_filter.rb'
- 'app/models/webhook.rb'
- 'app/services/activitypub/process_status_update_service.rb'
- 'app/services/fetch_link_card_service.rb'
- 'app/services/search_service.rb'
@ -945,9 +634,9 @@ Rails/SkipsModelValidations:
- 'db/post_migrate/20220617202502_migrate_roles.rb'
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
- 'lib/cli.rb'
- 'lib/mastodon/accounts_cli.rb'
- 'lib/mastodon/maintenance_cli.rb'
- 'lib/mastodon/cli/accounts.rb'
- 'lib/mastodon/cli/main.rb'
- 'lib/mastodon/cli/maintenance.rb'
- 'spec/controllers/api/v1/admin/accounts_controller_spec.rb'
- 'spec/lib/activitypub/activity/follow_spec.rb'
- 'spec/services/follow_service_spec.rb'
@ -1029,13 +718,9 @@ Rails/WhereExists:
- 'app/validators/vote_validator.rb'
- 'app/workers/move_worker.rb'
- 'db/migrate/20190529143559_preserve_old_layout_for_existing_users.rb'
- 'lib/mastodon/email_domain_blocks_cli.rb'
- 'lib/tasks/tests.rake'
- 'spec/controllers/api/v1/accounts/notes_controller_spec.rb'
- 'spec/controllers/api/v1/tags_controller_spec.rb'
- 'spec/models/account_spec.rb'
- 'spec/services/activitypub/process_collection_service_spec.rb'
- 'spec/services/post_status_service_spec.rb'
- 'spec/services/purge_domain_service_spec.rb'
- 'spec/services/unallow_domain_service_spec.rb'
@ -1057,6 +742,7 @@ Style/ClassVars:
Exclude:
- 'config/initializers/devise.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CombinableLoops:
Exclude:
- 'app/models/form/custom_emoji_batch.rb'
@ -1091,7 +777,6 @@ Style/FormatStringToken:
Exclude:
- 'app/models/privacy_policy.rb'
- 'config/initializers/devise.rb'
- 'lib/mastodon/maintenance_cli.rb'
- 'lib/paperclip/color_extractor.rb'
# This cop supports unsafe autocorrection (--autocorrect-all).
@ -1501,11 +1186,6 @@ Style/GlobalStdStream:
- 'config/environments/development.rb'
- 'config/environments/production.rb'
# Configuration parameters: AllowedVariables.
Style/GlobalVars:
Exclude:
- 'config/initializers/statsd.rb'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
Style/GuardClause:
@ -1536,9 +1216,9 @@ Style/GuardClause:
- 'db/post_migrate/20220704024901_migrate_settings_to_user_roles.rb'
- 'lib/devise/two_factor_ldap_authenticatable.rb'
- 'lib/devise/two_factor_pam_authenticatable.rb'
- 'lib/mastodon/accounts_cli.rb'
- 'lib/mastodon/maintenance_cli.rb'
- 'lib/mastodon/media_cli.rb'
- 'lib/mastodon/cli/accounts.rb'
- 'lib/mastodon/cli/maintenance.rb'
- 'lib/mastodon/cli/media.rb'
- 'lib/paperclip/attachment_extensions.rb'
- 'lib/tasks/repo.rake'
@ -1639,7 +1319,6 @@ Style/RedundantConstantBase:
Exclude:
- 'config/environments/production.rb'
- 'config/initializers/sidekiq.rb'
- 'config/initializers/statsd.rb'
- 'config/locales/sr-Latn.rb'
- 'config/locales/sr.rb'
@ -1653,52 +1332,6 @@ Style/RedundantFetchBlock:
- 'config/initializers/paperclip.rb'
- 'config/puma.rb'
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpCharacterClass:
Exclude:
- 'app/lib/link_details_extractor.rb'
- 'app/lib/tag_manager.rb'
- 'app/models/domain_allow.rb'
- 'app/models/domain_block.rb'
- 'app/services/fetch_oembed_service.rb'
- 'config/initializers/rack_attack.rb'
- 'lib/tasks/emojis.rake'
- 'lib/tasks/mastodon.rake'
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantRegexpEscape:
Exclude:
- 'app/lib/webfinger_resource.rb'
- 'app/models/account.rb'
- 'app/models/tag.rb'
- 'app/services/fetch_link_card_service.rb'
- 'config/initializers/twitter_regex.rb'
- 'lib/paperclip/color_extractor.rb'
- 'lib/tasks/mastodon.rake'
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'app/lib/link_details_extractor.rb'
- 'app/lib/plain_text_formatter.rb'
- 'app/lib/tag_manager.rb'
- 'app/lib/text_formatter.rb'
- 'app/models/account.rb'
- 'app/models/domain_allow.rb'
- 'app/models/domain_block.rb'
- 'app/models/site_upload.rb'
- 'app/models/tag.rb'
- 'app/services/backup_service.rb'
- 'app/services/fetch_oembed_service.rb'
- 'app/services/search_service.rb'
- 'config/initializers/rack_attack.rb'
- 'config/initializers/twitter_regex.rb'
- 'config/routes.rb'
- 'lib/mastodon/premailer_webpack_strategy.rb'
- 'lib/tasks/mastodon.rake'
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
# AllowedMethods: present?, blank?, presence, try, try!

View File

@ -14,7 +14,7 @@ clone:
image: woodpeckerci/plugin-git
settings:
partial: false
depth: 10
depth: 5
pipeline:
build-base:

View File

@ -3,3 +3,7 @@ enableGlobalCache: true
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.4.1.cjs
logFilters:
- code: YN0013
level: ${YARN_NOISE_LOG_CODE_LEVEL:-info}

View File

@ -2,6 +2,54 @@
All notable changes to this project will be documented in this file.
## [4.1.3] - 2023-07-06
### Added
- Add fallback redirection when getting a webfinger query `LOCAL_DOMAIN@LOCAL_DOMAIN` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/23600))
### Changed
- Change OpenGraph-based embeds to allow fullscreen ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25058))
- Change AccessTokensVacuum to also delete expired tokens ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24868))
- Change profile updates to be sent to recently-mentioned servers ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24852))
- Change automatic post deletion thresholds and load detection ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24614))
- Change `/api/v1/statuses/:id/history` to always return at least one item ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25510))
- Change auto-linking to allow carets in URL query params ([renchap](https://github.com/mastodon/mastodon/pull/25216))
### Removed
- Remove invalid `X-Frame-Options: ALLOWALL` ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25070))
### Fixed
- Fix wrong view being displayed when a webhook fails validation ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25464))
- Fix soft-deleted post cleanup scheduler overwhelming the streaming server ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/25519))
- Fix incorrect pagination headers in `/api/v2/admin/accounts` ([danielmbrasil](https://github.com/mastodon/mastodon/pull/25477))
- Fix multiple inefficiencies in automatic post cleanup worker ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24607), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/24785), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/24840))
- Fix performance of streaming by parsing message JSON once ([ThisIsMissEm](https://github.com/mastodon/mastodon/pull/25278), [ThisIsMissEm](https://github.com/mastodon/mastodon/pull/25361))
- Fix CSP headers when `S3_ALIAS_HOST` includes a path component ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25273))
- Fix `tootctl accounts approve --number N` not aproving N earliest registrations ([danielmbrasil](https://github.com/mastodon/mastodon/pull/24605))
- Fix reports not being closed when performing batch suspensions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24988))
- Fix being able to vote on your own polls ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25015))
- Fix race condition when reblogging a status ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25016))
- Fix “Authorized applications” inefficiently and incorrectly getting last use date ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25060))
- Fix “Authorized applications” crashing when listing apps with certain admin API scopes ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25713))
- Fix multiple N+1s in ConversationsController ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25134), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25399), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/25499))
- Fix user archive takeouts when using OpenStack Swift ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/24431))
- Fix searching for remote content by URL not working under certain conditions ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25637))
- Fix inefficiencies in indexing content for search ([VyrCossont](https://github.com/mastodon/mastodon/pull/24285), [VyrCossont](https://github.com/mastodon/mastodon/pull/24342))
### Security
- Add finer permission requirements for managing webhooks ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25463))
- Update dependencies
- Add hardening headers for user-uploaded files ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/25756))
- Fix verified links possibly hiding important parts of the URL (CVE-2023-36462)
- Fix timeout handling of outbound HTTP requests (CVE-2023-36461)
- Fix arbitrary file creation through media processing (CVE-2023-36460)
- Fix possible XSS in preview cards (CVE-2023-36459)
## [4.1.2] - 2023-04-04
### Fixed

View File

@ -1,113 +1,143 @@
# syntax=docker/dockerfile:1.4
# This needs to be bullseye-slim because the Ruby image is built on bullseye-slim
ARG NODE_VERSION="18.15-bullseye-slim"
ARG NODE_IMAGE=node:18.16-bullseye-slim
ARG RUBY_IMAGE=ghcr.io/moritzheiber/ruby-jemalloc:3.2.2-slim
FROM ghcr.io/moritzheiber/ruby-jemalloc:3.2.1-slim as ruby
FROM node:${NODE_VERSION} as build-base
FROM ${RUBY_IMAGE} as ruby
# build-base
FROM ${NODE_IMAGE} as build-base
COPY --link --from=ruby /opt/ruby /opt/ruby
ENV DEBIAN_FRONTEND="noninteractive" \
PATH="${PATH}:/opt/ruby/bin" \
NODE_OPTIONS=--openssl-legacy-provider
PATH="${PATH}:/opt/ruby/bin"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /opt/mastodon
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential \
RUN --mount=type=cache,id=apt,target=/var/cache/apt,sharing=private \
set -eux && \
rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
git \
libicu-dev \
libidn11-dev \
libpq-dev \
libjemalloc-dev \
zlib1g-dev \
libgdbm-dev \
libgmp-dev \
libicu-dev \
libidn11-dev \
libjemalloc-dev \
libpq-dev \
libreadline8 \
libssl-dev \
libyaml-0-2 \
ca-certificates \
libreadline8 \
python3 \
shared-mime-info
shared-mime-info \
zlib1g-dev
COPY --link .yarn/releases/ /opt/mastodon/.yarn/releases/
COPY --link Gemfile* package.json yarn.lock .yarnrc.yml /opt/mastodon/
RUN \
ENV NODE_OPTIONS=--openssl-legacy-provider \
YARN_GLOBAL_FOLDER=/opt/yarn \
YARN_ENABLE_GLOBAL_CACHE=1
RUN --mount=type=cache,id=bundle,target=/opt/bundle/cache,sharing=private \
--mount=type=cache,id=yarn,target=/opt/yarn/cache,sharing=private \
set -eux && \
bundle config set cache_path /opt/bundle/cache && \
bundle config set silence_root_warning 'true' && \
bundle cache --no-install && \
bundle config set --local deployment 'true' && \
bundle config set --local without 'development test' && \
bundle config set silence_root_warning true && \
bundle install -j"$(nproc)" && \
yarn install && \
yarn cache clean
bundle install --local -j"$(nproc)" && \
yarn install --immutable
# Precompile assets
# TODO(kouhai): we're currently patching node_modules because of emoji-mart.
# we should integrate our own fork instead.
COPY --link . /opt/mastodon
# build
FROM build-base AS build
ENV RAILS_ENV="production" \
NODE_ENV="production"
ENV NODE_OPTIONS=--openssl-legacy-provider \
YARN_GLOBAL_FOLDER=/opt/yarn \
YARN_ENABLE_GLOBAL_CACHE=1
ENV OTP_SECRET=precompile_placeholder \
SECRET_KEY_BASE=precompile_placeholder \
RAKE_NO_YARN_INSTALL_HACK=1
RUN mv ./emoji_data/all.json ./node_modules/emoji-mart/data/all.json && yarn install && \
ENV BOOTSNAP_CACHE_DIR=/opt/mastodon/bootsnap
RUN --mount=type=cache,id=yarn,target=/opt/yarn/cache,sharing=private \
--mount=type=cache,id=webpacker,target=/opt/webpacker/cache,sharing=private \
set -eux && \
mkdir -p tmp/cache && \
ln -sf /opt/webpacker/cache tmp/cache/webpacker && \
mv ./emoji_data/all.json ./node_modules/emoji-mart/data/all.json && \
yarn install && \
bundle exec rails assets:precompile
FROM node:${NODE_VERSION}
# final image
FROM ${NODE_IMAGE} as output
# Use those args to specify your own version flags & suffixes
ARG SOURCE_TAG=""
ARG MASTODON_VERSION_FLAGS=""
ARG MASTODON_VERSION_SUFFIX=""
ARG UID="991"
ARG GID="991"
COPY --link --from=ruby /opt/ruby /opt/ruby
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND="noninteractive" \
PATH="${PATH}:/opt/ruby/bin:/opt/mastodon/bin"
# Ignoreing these here since we don't want to pin any versions and the Debian image removes apt-get content after use
# Ignoring these here since we don't want to pin any versions and the Debian image removes apt-get content after use
# hadolint ignore=DL3008,DL3009
RUN apt-get update && \
RUN --mount=type=cache,id=apt,target=/var/cache/apt,sharing=private \
set -eux && \
rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache && \
apt-get update && \
echo "Etc/UTC" > /etc/localtime && \
groupadd -g "${GID}" mastodon && \
useradd -l -u "$UID" -g "${GID}" -m -d /opt/mastodon mastodon && \
apt-get -y --no-install-recommends install whois \
wget \
procps \
libssl1.1 \
libpq5 \
imagemagick \
apt-get -y --no-install-recommends install \
ca-certificates \
ffmpeg \
libjemalloc2 \
file \
imagemagick \
libicu67 \
libidn11 \
libyaml-0-2 \
file \
ca-certificates \
tzdata \
libjemalloc2 \
libpq5 \
libreadline8 \
tini && \
ln -s /opt/mastodon /mastodon
libssl1.1 \
libyaml-0-2 \
procps \
tini \
tzdata \
wget \
whois \
&& ln -s /opt/mastodon /mastodon
# Note: no, cleaning here since Debian does this automatically
# See the file /etc/apt/apt.conf.d/docker-clean within the Docker image's filesystem
COPY --link --from=ruby /opt/ruby /opt/ruby
COPY --link --chown=mastodon:mastodon --from=build /opt/mastodon /opt/mastodon
ARG SOURCE_TAG=''
ENV RAILS_ENV="production" \
NODE_ENV="production" \
RAILS_SERVE_STATIC_FILES="true" \
@ -116,6 +146,11 @@ ENV RAILS_ENV="production" \
MASTODON_VERSION_FLAGS="${MASTODON_VERSION_FLAGS}" \
MASTODON_VERSION_SUFFIX="${MASTODON_VERSION_SUFFIX}"
ENV BOOTSNAP_CACHE_DIR=/opt/mastodon/bootsnap
# override this at will
ENV BOOTSNAP_READONLY=1
# Set the run user
USER mastodon
WORKDIR /opt/mastodon

102
Gemfile
View File

@ -3,9 +3,7 @@
source 'https://rubygems.org'
ruby '>= 3.0.0'
gem 'pkg-config', '~> 1.5'
gem 'puma', '~> 6.2'
gem 'puma', '~> 6.3'
gem 'rails', '~> 6.1.7'
gem 'sprockets', '~> 3.7.2'
gem 'thor', '~> 1.2'
@ -17,10 +15,10 @@ gem 'makara', '~> 0.5'
gem 'pghero'
gem 'dotenv-rails', '~> 2.8'
gem 'aws-sdk-s3', '~> 1.120', require: false
gem 'aws-sdk-s3', '~> 1.123', require: false
gem 'fog-core', '<= 2.4.0'
gem 'fog-openstack', '~> 0.3', require: false
gem 'kt-paperclip', '~> 7.1', github: 'kreeti/kt-paperclip', ref: '11abf222dc31bff71160a1d138b445214f434b2b'
gem 'kt-paperclip', '~> 7.2'
gem 'blurhash', '~> 0.1'
gem 'active_model_serializers', '~> 0.10'
@ -59,8 +57,7 @@ gem 'idn-ruby', require: 'idn'
gem 'kaminari', '~> 1.2'
gem 'link_header', '~> 0.0'
gem 'mime-types', '~> 3.4.1', require: 'mime/types/columnar'
gem 'nokogiri', '~> 1.14'
gem 'nsa', '~> 0.2'
gem 'nokogiri', '~> 1.15'
gem 'oj', '~> 3.14'
gem 'ox', '~> 2.14'
gem 'parslet'
@ -75,7 +72,7 @@ gem 'rails-settings-cached', '~> 0.6', git: 'https://github.com/mastodon/rails-s
gem 'redcarpet', '~> 3.6'
gem 'redis', '~> 4.5', require: ['redis', 'redis/connection/hiredis']
gem 'mario-redis-lock', '~> 1.2', require: 'redis_lock'
gem 'rqrcode', '~> 2.1'
gem 'rqrcode', '~> 2.2'
gem 'ruby-progressbar', '~> 1.13'
gem 'sanitize', '~> 6.0'
gem 'scenic', '~> 1.7'
@ -99,55 +96,89 @@ gem 'json-ld'
gem 'json-ld-preloaded', '~> 3.2'
gem 'rdf-normalize', '~> 0.5'
group :development, :test do
gem 'fabrication', '~> 2.30'
gem 'fuubar', '~> 2.5'
gem 'i18n-tasks', '~> 1.0', require: false
gem 'rspec-rails', '~> 6.0'
gem 'rspec_chunked', '~> 0.6'
gem 'rubocop-capybara', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'rubocop', require: false
end
group :production, :test do
gem 'private_address_check', '~> 0.5'
end
gem 'private_address_check', '~> 0.5'
group :test do
gem 'capybara', '~> 3.39'
gem 'climate_control'
gem 'faker', '~> 3.2'
gem 'json-schema', '~> 4.0'
gem 'rack-test', '~> 2.1'
gem 'rails-controller-testing', '~> 1.0'
gem 'rspec_junit_formatter', '~> 0.6'
# RSpec runner for rails
gem 'rspec-rails', '~> 6.0'
# Used to split testing into chunks in CI
gem 'rspec_chunked', '~> 0.6'
# RSpec progress bar formatter
gem 'fuubar', '~> 2.5'
# Extra RSpec extenion methods and helpers for sidekiq
gem 'rspec-sidekiq', '~> 3.1'
# Browser integration testing
gem 'capybara', '~> 3.39'
# Used to mock environment variables
gem 'climate_control', '~> 0.2'
# Generating fake data for specs
gem 'faker', '~> 3.2'
# Generate test objects for specs
gem 'fabrication', '~> 2.30'
# Add back helpers functions removed in Rails 5.1
gem 'rails-controller-testing', '~> 1.0'
# Validate schemas in specs
gem 'json-schema', '~> 4.0'
# Test harness fo rack components
gem 'rack-test', '~> 2.1'
# Coverage formatter for RSpec test if DISABLE_SIMPLECOV is false
gem 'simplecov', '~> 0.22', require: false
# Stub web requests for specs
gem 'webmock', '~> 3.18'
end
group :development do
# Code linting CLI and plugins
gem 'rubocop', require: false
gem 'rubocop-capybara', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
# Annotates modules with schema
gem 'annotate', '~> 3.2'
# Enhanced error message pages for development
gem 'better_errors', '~> 2.9'
gem 'binding_of_caller', '~> 1.0'
# Preview mail in the browser
gem 'letter_opener', '~> 1.8'
gem 'letter_opener_web', '~> 2.0'
gem 'memory_profiler'
# Security analysis CLI tools
gem 'brakeman', '~> 5.4', require: false
gem 'bundler-audit', '~> 0.9', require: false
# Linter CLI for HAML files
gem 'haml_lint', require: false
# Deployment automation
gem 'capistrano', '~> 3.17'
gem 'capistrano-rails', '~> 1.6'
gem 'capistrano-rbenv', '~> 2.2'
gem 'capistrano-yarn', '~> 2.0'
gem 'stackprof'
# Validate missing i18n keys
gem 'i18n-tasks', '~> 1.0', require: false
# Profiling tools
gem 'memory_profiler', require: false
gem 'stackprof', require: false
# foreman
gem 'foreman'
end
@ -159,8 +190,9 @@ gem 'concurrent-ruby', require: false
gem 'connection_pool', require: false
gem 'xorcist', '~> 1.1'
gem 'hcaptcha', '~> 7.1'
gem 'cocoon', '~> 1.2'
gem 'net-http', '~> 0.3.2'
gem 'rubyzip', '~> 2.3'
gem 'hcaptcha', '~> 7.1'

View File

@ -7,18 +7,6 @@ GIT
hkdf (~> 0.2)
jwt (~> 2.0)
GIT
remote: https://github.com/kreeti/kt-paperclip.git
revision: 11abf222dc31bff71160a1d138b445214f434b2b
ref: 11abf222dc31bff71160a1d138b445214f434b2b
specs:
kt-paperclip (7.1.1)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
marcel (~> 1.0.1)
mime-types
terrapin (~> 0.6.0)
GIT
remote: https://github.com/mastodon/rails-settings-cached.git
revision: 86328ef0bd04ce21cc0504ff5e334591e8c2ccab
@ -30,40 +18,40 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.7.3)
actionpack (= 6.1.7.3)
activesupport (= 6.1.7.3)
actioncable (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.7.3)
actionpack (= 6.1.7.3)
activejob (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionmailbox (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
mail (>= 2.7.1)
actionmailer (6.1.7.3)
actionpack (= 6.1.7.3)
actionview (= 6.1.7.3)
activejob (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionmailer (6.1.7.4)
actionpack (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activesupport (= 6.1.7.4)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.7.3)
actionview (= 6.1.7.3)
activesupport (= 6.1.7.3)
actionpack (6.1.7.4)
actionview (= 6.1.7.4)
activesupport (= 6.1.7.4)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.7.3)
actionpack (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
actiontext (6.1.7.4)
actionpack (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
nokogiri (>= 1.8.5)
actionview (6.1.7.3)
activesupport (= 6.1.7.3)
actionview (6.1.7.4)
activesupport (= 6.1.7.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
@ -73,22 +61,22 @@ GEM
activemodel (>= 4.1, < 7.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (6.1.7.3)
activesupport (= 6.1.7.3)
activejob (6.1.7.4)
activesupport (= 6.1.7.4)
globalid (>= 0.3.6)
activemodel (6.1.7.3)
activesupport (= 6.1.7.3)
activerecord (6.1.7.3)
activemodel (= 6.1.7.3)
activesupport (= 6.1.7.3)
activestorage (6.1.7.3)
actionpack (= 6.1.7.3)
activejob (= 6.1.7.3)
activerecord (= 6.1.7.3)
activesupport (= 6.1.7.3)
activemodel (6.1.7.4)
activesupport (= 6.1.7.4)
activerecord (6.1.7.4)
activemodel (= 6.1.7.4)
activesupport (= 6.1.7.4)
activestorage (6.1.7.4)
actionpack (= 6.1.7.4)
activejob (= 6.1.7.4)
activerecord (= 6.1.7.4)
activesupport (= 6.1.7.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.7.3)
activesupport (6.1.7.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
@ -109,26 +97,26 @@ GEM
attr_required (1.0.1)
awrence (1.2.1)
aws-eventstream (1.2.0)
aws-partitions (1.752.0)
aws-sdk-core (3.171.0)
aws-partitions (1.780.0)
aws-sdk-core (3.175.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.63.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (1.67.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.121.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-s3 (1.126.0)
aws-sdk-core (~> 3, >= 3.174.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2)
bcrypt (3.1.18)
better_errors (2.9.1)
coderay (>= 1.0.0)
better_errors (2.10.1)
erubi (>= 1.0.0)
rack (>= 0.9.0)
rouge (>= 1.0.0)
better_html (2.0.1)
actionview (>= 6.0)
activesupport (>= 6.0)
@ -151,7 +139,7 @@ GEM
bundler-audit (0.9.1)
bundler (>= 1.2.0, < 3)
thor (~> 1.0)
capistrano (3.17.2)
capistrano (3.17.3)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
@ -166,7 +154,7 @@ GEM
sshkit (~> 1.3)
capistrano-yarn (2.0.2)
capistrano (~> 3.0)
capybara (3.39.0)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
@ -186,10 +174,9 @@ GEM
chunky_png (1.4.0)
climate_control (0.2.0)
cocoon (1.2.15)
coderay (1.1.3)
color_diff (0.1)
concurrent-ruby (1.2.2)
connection_pool (2.4.0)
connection_pool (2.4.1)
cose (1.3.0)
cbor (~> 0.5.9)
openssl-signature_algorithm (~> 1.0)
@ -241,7 +228,7 @@ GEM
erubi (1.12.0)
et-orbi (1.2.7)
tzinfo
excon (0.99.0)
excon (0.100.0)
fabrication (2.30.0)
faker (3.2.0)
i18n (>= 1.8.11, < 2)
@ -269,7 +256,7 @@ GEM
faraday-rack (1.0.0)
faraday-retry (1.0.3)
fast_blank (1.0.1)
fastimage (2.2.6)
fastimage (2.2.7)
ffi (1.15.5)
ffi-compiler (1.0.1)
ffi (>= 1.0.0)
@ -305,11 +292,11 @@ GEM
activesupport (>= 5.1)
haml (>= 4.0.6)
railties (>= 5.1)
haml_lint (0.45.0)
haml_lint (0.46.0)
haml (>= 4.0, < 6.2)
parallel (~> 1.10)
rainbow
rubocop (>= 0.50.0)
rubocop (>= 1.0)
sysexits (~> 1.1)
hashdiff (1.0.1)
hashie (5.0.0)
@ -332,7 +319,7 @@ GEM
httplog (1.6.2)
rack (>= 2.0)
rainbow (>= 2.0.0)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
i18n-tasks (1.0.12)
activesupport (>= 4.0.2)
@ -368,7 +355,7 @@ GEM
json-schema (4.0.0)
addressable (>= 2.8)
jsonapi-renderer (0.2.2)
jwt (2.7.0)
jwt (2.7.1)
kaminari (1.2.2)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.2.2)
@ -381,6 +368,13 @@ GEM
activerecord
kaminari-core (= 1.2.2)
kaminari-core (1.2.2)
kt-paperclip (7.2.0)
activemodel (>= 4.2.0)
activesupport (>= 4.2.0)
marcel (~> 1.0.1)
mime-types
terrapin (~> 0.6.0)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
letter_opener (1.8.1)
@ -399,9 +393,9 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.20.0)
loofah (2.21.3)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
@ -419,14 +413,14 @@ GEM
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
mini_portile2 (2.8.1)
minitest (5.18.0)
msgpack (1.7.0)
mini_portile2 (2.8.2)
minitest (5.18.1)
msgpack (1.7.1)
multi_json (1.15.0)
multipart-post (2.3.0)
net-http (0.3.2)
uri
net-imap (0.3.4)
net-imap (0.3.6)
date
net-protocol
net-ldap (0.18.0)
@ -440,15 +434,10 @@ GEM
net-protocol
net-ssh (7.1.0)
nio4r (2.5.9)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
nokogiri (1.15.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nsa (0.2.8)
activesupport (>= 4.2, < 7)
concurrent-ruby (~> 1.0, >= 1.0.2)
sidekiq (>= 3.5)
statsd-ruby (~> 1.4, >= 1.4.0)
oj (3.14.3)
oj (3.15.0)
omniauth (1.9.2)
hashie (>= 3.4.6)
rack (>= 1.6.2, < 3)
@ -482,15 +471,15 @@ GEM
orm_adapter (0.5.0)
ox (2.14.16)
parallel (1.23.0)
parser (3.2.2.1)
parser (3.2.2.3)
ast (~> 2.4.1)
racc
parslet (2.0.0)
pastel (0.8.0)
tty-color (~> 0.5)
pg (1.5.3)
pghero (3.3.3)
activerecord (>= 6)
pkg-config (1.5.1)
posix-spawn (0.3.15)
premailer (1.21.0)
addressable
@ -502,12 +491,12 @@ GEM
premailer (~> 1.7, >= 1.7.9)
private_address_check (0.5.0)
public_suffix (5.0.1)
puma (6.2.2)
puma (6.3.0)
nio4r (~> 2.0)
pundit (2.3.0)
activesupport (>= 3.0.0)
raabro (1.4.0)
racc (1.6.2)
racc (1.7.1)
rack (2.2.7)
rack-attack (6.6.1)
rack (>= 1.0, < 3)
@ -523,20 +512,20 @@ GEM
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.3)
actioncable (= 6.1.7.3)
actionmailbox (= 6.1.7.3)
actionmailer (= 6.1.7.3)
actionpack (= 6.1.7.3)
actiontext (= 6.1.7.3)
actionview (= 6.1.7.3)
activejob (= 6.1.7.3)
activemodel (= 6.1.7.3)
activerecord (= 6.1.7.3)
activestorage (= 6.1.7.3)
activesupport (= 6.1.7.3)
rails (6.1.7.4)
actioncable (= 6.1.7.4)
actionmailbox (= 6.1.7.4)
actionmailer (= 6.1.7.4)
actionpack (= 6.1.7.4)
actiontext (= 6.1.7.4)
actionview (= 6.1.7.4)
activejob (= 6.1.7.4)
activemodel (= 6.1.7.4)
activerecord (= 6.1.7.4)
activestorage (= 6.1.7.4)
activesupport (= 6.1.7.4)
bundler (>= 1.15.0)
railties (= 6.1.7.3)
railties (= 6.1.7.4)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@ -545,30 +534,31 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 7)
railties (6.1.7.3)
actionpack (= 6.1.7.3)
activesupport (= 6.1.7.3)
railties (6.1.7.4)
actionpack (= 6.1.7.4)
activesupport (= 6.1.7.4)
method_source
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.0.6)
rdf (3.2.10)
rdf (3.2.11)
link_header (~> 0.0, >= 0.0.8)
rdf-normalize (0.5.1)
rdf-normalize (0.6.0)
rdf (~> 3.2)
redcarpet (3.6.0)
redis (4.8.1)
redis-namespace (1.10.0)
redis-namespace (1.11.0)
redis (>= 4)
redlock (1.3.2)
redis (>= 3.0.0, < 6.0)
regexp_parser (2.8.0)
regexp_parser (2.8.1)
request_store (1.5.1)
rack (>= 1.4)
responders (3.1.0)
@ -576,8 +566,9 @@ GEM
railties (>= 5.2)
rexml (3.2.5)
rotp (6.2.2)
rouge (4.1.2)
rpam2 (4.0.2)
rqrcode (2.1.2)
rqrcode (2.2.0)
chunky_png (~> 1.0)
rqrcode_core (~> 1.0)
rqrcode_core (1.2.0)
@ -589,52 +580,54 @@ GEM
rspec-mocks (3.12.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
rspec-rails (6.0.3)
actionpack (>= 6.1)
activesupport (>= 6.1)
railties (>= 6.1)
rspec-core (~> 3.11)
rspec-expectations (~> 3.11)
rspec-mocks (~> 3.11)
rspec-support (~> 3.11)
rspec-core (~> 3.12)
rspec-expectations (~> 3.12)
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-sidekiq (3.1.0)
rspec-core (~> 3.0, >= 3.0.0)
sidekiq (>= 2.4.0)
rspec-support (3.12.0)
rspec_chunked (0.6)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.50.2)
rubocop (1.54.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.0.0)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.28.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.18.0)
rubocop (~> 1.41)
rubocop-performance (1.17.1)
rubocop-factory_bot (2.23.1)
rubocop (~> 1.33)
rubocop-performance (1.18.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.19.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-rspec (2.19.0)
rubocop-rspec (2.22.0)
rubocop (~> 1.33)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
ruby-saml (1.13.0)
nokogiri (>= 1.10.5)
ruby-saml (1.15.0)
nokogiri (>= 1.13.10)
rexml
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
rufus-scheduler (3.8.2)
rufus-scheduler (3.9.1)
fugit (~> 1.1, >= 1.1.6)
safety_net_attestation (0.4.0)
jwt (~> 2.0)
@ -645,13 +638,13 @@ GEM
activerecord (>= 4.0.0)
railties (>= 4.0.0)
semantic_range (3.0.0)
sidekiq (6.5.8)
sidekiq (6.5.9)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq-bulk (0.2.0)
sidekiq
sidekiq-scheduler (5.0.2)
sidekiq-scheduler (5.0.3)
rufus-scheduler (~> 3.2)
sidekiq (>= 6, < 8)
tilt (>= 1.4.0)
@ -684,7 +677,6 @@ GEM
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stackprof (0.2.25)
statsd-ruby (1.5.0)
stoplight (3.0.1)
redlock (~> 1.0)
strong_migrations (0.8.0)
@ -694,13 +686,13 @@ GEM
attr_required (>= 0.0.5)
httpclient (>= 2.4)
sysexits (1.2.0)
temple (0.10.0)
temple (0.10.2)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
terrapin (0.6.0)
climate_control (>= 0.0.3, < 1.0)
thor (1.2.1)
tilt (2.1.0)
thor (1.2.2)
tilt (2.2.0)
timeout (0.3.2)
tpm-key_attestation (0.12.0)
bindata (~> 2.4)
@ -727,7 +719,7 @@ GEM
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
uri (0.12.1)
uri (0.12.2)
validate_email (0.1.6)
activemodel (>= 3.0)
mail (>= 2.2.5)
@ -764,7 +756,7 @@ GEM
xorcist (1.1.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.7)
zeitwerk (2.6.8)
PLATFORMS
ruby
@ -773,7 +765,7 @@ DEPENDENCIES
active_model_serializers (~> 0.10)
addressable (~> 2.8)
annotate (~> 3.2)
aws-sdk-s3 (~> 1.120)
aws-sdk-s3 (~> 1.123)
better_errors (~> 2.9)
binding_of_caller (~> 1.0)
blurhash (~> 0.1)
@ -788,7 +780,7 @@ DEPENDENCIES
capybara (~> 3.39)
charlock_holmes (~> 0.7.7)
chewy (~> 7.3)
climate_control
climate_control (~> 0.2)
cocoon (~> 1.2)
color_diff (~> 0.1)
concurrent-ruby
@ -822,7 +814,7 @@ DEPENDENCIES
json-ld-preloaded (~> 3.2)
json-schema (~> 4.0)
kaminari (~> 1.2)
kt-paperclip (~> 7.1)!
kt-paperclip (~> 7.2)
letter_opener (~> 1.8)
letter_opener_web (~> 2.0)
link_header (~> 0.0)
@ -833,8 +825,7 @@ DEPENDENCIES
mime-types (~> 3.4.1)
net-http (~> 0.3.2)
net-ldap (~> 0.18)
nokogiri (~> 1.14)
nsa (~> 0.2)
nokogiri (~> 1.15)
oj (~> 3.14)
omniauth (~> 1.9)
omniauth-cas (~> 2.0)
@ -845,12 +836,11 @@ DEPENDENCIES
parslet
pg (~> 1.5)
pghero
pkg-config (~> 1.5)
posix-spawn
premailer-rails
private_address_check (~> 0.5)
public_suffix (~> 5.0)
puma (~> 6.2)
puma (~> 6.3)
pundit (~> 2.3)
rack (~> 2.2.7)
rack-attack (~> 6.6)
@ -864,11 +854,10 @@ DEPENDENCIES
redcarpet (~> 3.6)
redis (~> 4.5)
redis-namespace (~> 1.10)
rqrcode (~> 2.1)
rqrcode (~> 2.2)
rspec-rails (~> 6.0)
rspec-sidekiq (~> 3.1)
rspec_chunked (~> 0.6)
rspec_junit_formatter (~> 0.6)
rubocop
rubocop-capybara
rubocop-performance
@ -901,7 +890,7 @@ DEPENDENCIES
xorcist (~> 1.1)
RUBY VERSION
ruby 3.0.5p211
ruby 3.2.2p53
BUNDLED WITH
2.4.6
2.4.13

View File

@ -2,8 +2,37 @@
class AccountsIndex < Chewy::Index
settings index: { refresh_interval: '30s' }, analysis: {
filter: {
english_stop: {
type: 'stop',
stopwords: '_english_',
},
english_stemmer: {
type: 'stemmer',
language: 'english',
},
english_possessive_stemmer: {
type: 'stemmer',
language: 'possessive_english',
},
},
analyzer: {
content: {
natural: {
tokenizer: 'uax_url_email',
filter: %w(
english_possessive_stemmer
lowercase
asciifolding
cjk_width
english_stop
english_stemmer
),
},
verbatim: {
tokenizer: 'whitespace',
filter: %w(lowercase asciifolding cjk_width),
},
@ -26,18 +55,13 @@ class AccountsIndex < Chewy::Index
index_scope ::Account.searchable.includes(:account_stat)
root date_detection: false do
field :id, type: 'long'
field :display_name, type: 'text', analyzer: 'content' do
field :edge_ngram, type: 'text', analyzer: 'edge_ngram', search_analyzer: 'content'
end
field :acct, type: 'text', analyzer: 'content', value: ->(account) { [account.username, account.domain].compact.join('@') } do
field :edge_ngram, type: 'text', analyzer: 'edge_ngram', search_analyzer: 'content'
end
field :following_count, type: 'long', value: ->(account) { account.following_count }
field :followers_count, type: 'long', value: ->(account) { account.followers_count }
field :last_status_at, type: 'date', value: ->(account) { account.last_status_at || account.created_at }
field(:id, type: 'long')
field(:following_count, type: 'long')
field(:followers_count, type: 'long')
field(:properties, type: 'keyword', value: ->(account) { account.searchable_properties })
field(:last_status_at, type: 'date', value: ->(account) { account.last_status_at || account.created_at })
field(:display_name, type: 'text', analyzer: 'verbatim') { field :edge_ngram, type: 'text', analyzer: 'edge_ngram', search_analyzer: 'verbatim' }
field(:username, type: 'text', analyzer: 'verbatim', value: ->(account) { [account.username, account.domain].compact.join('@') }) { field :edge_ngram, type: 'text', analyzer: 'edge_ngram', search_analyzer: 'verbatim' }
field(:text, type: 'text', value: ->(account) { account.searchable_text }) { field :stemmed, type: 'text', analyzer: 'natural' }
end
end

View File

@ -14,15 +14,5 @@ module Admin
@pending_tags_count = Tag.pending_review.count
@pending_appeals_count = Appeal.pending.count
end
private
def redis_info
@redis_info ||= if redis.is_a?(Redis::Namespace)
redis.redis.info
else
redis.info
end
end
end
end

View File

@ -31,31 +31,41 @@ module Admin
@domain_block = DomainBlock.new(resource_params)
existing_domain_block = resource_params[:domain].present? ? DomainBlock.rule_for(resource_params[:domain]) : nil
# Disallow accidentally downgrading a domain block
if existing_domain_block.present? && !@domain_block.stricter_than?(existing_domain_block)
@domain_block.save
flash.now[:alert] = I18n.t('admin.domain_blocks.existing_domain_block_html', name: existing_domain_block.domain, unblock_url: admin_domain_block_path(existing_domain_block)).html_safe
@domain_block.errors.delete(:domain)
render :new
else
if existing_domain_block.present?
@domain_block = existing_domain_block
@domain_block.update(resource_params)
end
return render :new
end
if @domain_block.save
DomainBlockWorker.perform_async(@domain_block.id)
log_action :create, @domain_block
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
else
render :new
end
# Allow transparently upgrading a domain block
if existing_domain_block.present?
@domain_block = existing_domain_block
@domain_block.assign_attributes(resource_params)
end
# Require explicit confirmation when suspending
return render :confirm_suspension if requires_confirmation?
if @domain_block.save
DomainBlockWorker.perform_async(@domain_block.id)
log_action :create, @domain_block
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
else
render :new
end
end
def update
authorize :domain_block, :update?
if @domain_block.update(update_params)
@domain_block.assign_attributes(update_params)
# Require explicit confirmation when suspending
return render :confirm_suspension if requires_confirmation?
if @domain_block.save
DomainBlockWorker.perform_async(@domain_block.id, @domain_block.severity_previously_changed?)
log_action :update, @domain_block
redirect_to admin_instances_path(limited: '1'), notice: I18n.t('admin.domain_blocks.created_msg')
@ -92,5 +102,9 @@ module Admin
def action_from_button
'save' if params[:save]
end
def requires_confirmation?
@domain_block.valid? && (@domain_block.new_record? || @domain_block.severity_changed?) && @domain_block.severity.to_s == 'suspend' && !params[:confirm]
end
end
end

View File

@ -28,6 +28,7 @@ module Admin
authorize :webhook, :create?
@webhook = Webhook.new(resource_params)
@webhook.current_account = current_account
if @webhook.save
redirect_to admin_webhook_path(@webhook)
@ -39,10 +40,12 @@ module Admin
def update
authorize @webhook, :update?
@webhook.current_account = current_account
if @webhook.update(resource_params)
redirect_to admin_webhook_path(@webhook)
else
render :show
render :edit
end
end
@ -71,7 +74,7 @@ module Admin
end
def resource_params
params.require(:webhook).permit(:url, events: [])
params.require(:webhook).permit(:url, :template, events: [])
end
end
end

View File

@ -90,7 +90,7 @@ class Api::V1::AccountsController < Api::BaseController
end
def account_params
params.permit(:username, :email, :password, :agreement, :locale, :reason)
params.permit(:username, :email, :password, :agreement, :locale, :reason, :time_zone)
end
def check_enabled_registrations

View File

@ -58,7 +58,7 @@ class Api::V1::Admin::CanonicalEmailBlocksController < Api::BaseController
end
def set_canonical_email_blocks_from_test
@canonical_email_blocks = CanonicalEmailBlock.matching_email(params[:email])
@canonical_email_blocks = CanonicalEmailBlock.matching_email(params.require(:email))
end
def set_canonical_email_block

View File

@ -29,7 +29,7 @@ class Api::V1::Admin::DomainAllowsController < Api::BaseController
def create
authorize :domain_allow, :create?
@domain_allow = DomainAllow.find_by(resource_params)
@domain_allow = DomainAllow.find_by(domain: resource_params[:domain])
if @domain_allow.nil?
@domain_allow = DomainAllow.create!(resource_params)

View File

@ -11,7 +11,7 @@ class Api::V1::ConversationsController < Api::BaseController
def index
@conversations = paginated_conversations
render json: @conversations, each_serializer: REST::ConversationSerializer
render json: @conversations, each_serializer: REST::ConversationSerializer, relationships: StatusRelationshipsPresenter.new(@conversations.map(&:last_status), current_user&.account_id)
end
def read
@ -19,6 +19,11 @@ class Api::V1::ConversationsController < Api::BaseController
render json: @conversation, serializer: REST::ConversationSerializer
end
def unread
@conversation.update!(unread: true)
render json: @conversation, serializer: REST::ConversationSerializer
end
def destroy
@conversation.destroy!
render_empty
@ -32,6 +37,19 @@ class Api::V1::ConversationsController < Api::BaseController
def paginated_conversations
AccountConversation.where(account: current_account)
.includes(
account: :account_stat,
last_status: [
:media_attachments,
:preview_cards,
:status_stat,
:tags,
{
active_mentions: [account: :account_stat],
account: :account_stat,
},
]
)
.to_a_paginated_by_id(limit_param(LIMIT), params_slice(:max_id, :since_id, :min_id))
end

View File

@ -21,11 +21,35 @@ class Api::V1::DirectoriesController < Api::BaseController
def accounts_scope
Account.discoverable.tap do |scope|
scope.merge!(Account.local) if truthy_param?(:local)
scope.merge!(Account.by_recent_status) if params[:order].blank? || params[:order] == 'active'
scope.merge!(Account.order(id: :desc)) if params[:order] == 'new'
scope.merge!(Account.not_excluded_by_account(current_account)) if current_account
scope.merge!(Account.not_domain_blocked_by_account(current_account)) if current_account && !truthy_param?(:local)
scope.merge!(account_order_scope)
scope.merge!(local_account_scope) if local_accounts?
scope.merge!(account_exclusion_scope) if current_account
scope.merge!(account_domain_block_scope) if current_account && !local_accounts?
end
end
def local_accounts?
truthy_param?(:local)
end
def account_order_scope
case params[:order]
when 'new'
Account.order(id: :desc)
when 'active', nil
Account.by_recent_status
end
end
def local_account_scope
Account.local
end
def account_exclusion_scope
Account.not_excluded_by_account(current_account)
end
def account_domain_block_scope
Account.not_domain_blocked_by_account(current_account)
end
end

View File

@ -1,9 +1,11 @@
# frozen_string_literal: true
class Api::V1::Emails::ConfirmationsController < Api::BaseController
before_action -> { doorkeeper_authorize! :write, :'write:accounts' }
before_action :require_user_owned_by_application!
before_action :require_user_not_confirmed!
before_action -> { authorize_if_got_token! :read, :'read:accounts' }, only: :check
before_action -> { doorkeeper_authorize! :write, :'write:accounts' }, except: :check
before_action :require_user_owned_by_application!, except: :check
before_action :require_user_not_confirmed!, except: :check
before_action :require_authenticated_user!, only: :check
def create
current_user.update!(email: params[:email]) if params.key?(:email)
@ -12,6 +14,10 @@ class Api::V1::Emails::ConfirmationsController < Api::BaseController
render_empty
end
def check
render json: current_user.confirmed?
end
private
def require_user_owned_by_application!

View File

@ -13,7 +13,7 @@ class Api::V1::FeaturedTagsController < Api::BaseController
end
def create
featured_tag = CreateFeaturedTagService.new.call(current_account, featured_tag_params[:name])
featured_tag = CreateFeaturedTagService.new.call(current_account, params.require(:name))
render json: featured_tag, serializer: REST::FeaturedTagSerializer
end
@ -31,8 +31,4 @@ class Api::V1::FeaturedTagsController < Api::BaseController
def set_featured_tags
@featured_tags = current_account.featured_tags.order(statuses_count: :desc)
end
def featured_tag_params
params.permit(:name)
end
end

View File

@ -42,6 +42,6 @@ class Api::V1::ListsController < Api::BaseController
end
def list_params
params.permit(:title, :replies_policy)
params.permit(:title, :replies_policy, :exclusive)
end
end

View File

@ -8,11 +8,15 @@ class Api::V1::Statuses::HistoriesController < Api::BaseController
def show
cache_if_unauthenticated!
render json: @status.edits.includes(:account, status: [:account]), each_serializer: REST::StatusEditSerializer
render json: status_edits, each_serializer: REST::StatusEditSerializer
end
private
def status_edits
@status.edits.includes(:account, status: [:account]).to_a.presence || [@status.build_snapshot(at_time: @status.edited_at || @status.created_at)]
end
def set_status
@status = Status.find(params[:status_id])
authorize @status, :show?

View File

@ -2,6 +2,8 @@
class Api::V1::Statuses::ReblogsController < Api::BaseController
include Authorization
include Redisable
include Lockable
before_action -> { doorkeeper_authorize! :write, :'write:statuses' }
before_action :require_user!
@ -10,7 +12,9 @@ class Api::V1::Statuses::ReblogsController < Api::BaseController
override_rate_limit_headers :create, family: :statuses
def create
@status = ReblogService.new.call(current_account, @reblog, reblog_params)
with_redis_lock("reblog:#{current_account.id}:#{@reblog.id}") do
@status = ReblogService.new.call(current_account, @reblog, reblog_params)
end
render json: @status, serializer: REST::StatusSerializer
end

View File

@ -18,6 +18,14 @@ class Api::V2::Admin::AccountsController < Api::V1::Admin::AccountsController
private
def next_path
api_v2_admin_accounts_url(pagination_params(max_id: pagination_max_id)) if records_continue?
end
def prev_path
api_v2_admin_accounts_url(pagination_params(min_id: pagination_since_id)) unless @accounts.empty?
end
def filtered_accounts
AccountFilter.new(translated_filter_params).results
end

View File

@ -34,11 +34,11 @@ class Api::V2::SearchController < Api::BaseController
params[:q],
current_account,
limit_param(RESULTS_LIMIT),
search_params.merge(resolve: truthy_param?(:resolve), exclude_unreviewed: truthy_param?(:exclude_unreviewed))
search_params.merge(resolve: truthy_param?(:resolve), exclude_unreviewed: truthy_param?(:exclude_unreviewed), following: truthy_param?(:following))
)
end
def search_params
params.permit(:type, :offset, :min_id, :max_id, :account_id)
params.permit(:type, :offset, :min_id, :max_id, :account_id, :following)
end
end

View File

@ -57,9 +57,6 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
def captcha_user_bypass?
return true if @confirmation_user.nil? || @confirmation_user.confirmed?
invite = Invite.find(@confirmation_user.invite_id) if @confirmation_user.invite_id.present?
invite.present? && !invite.max_uses.nil?
end
def set_pack
@ -91,8 +88,10 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController
def after_confirmation_path_for(_resource_name, user)
if user.created_by_application && truthy_param?(:redirect_to_app)
user.created_by_application.confirmation_redirect_uri
elsif user_signed_in?
web_url('start')
else
super
new_user_session_path
end
end
end

View File

@ -132,7 +132,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
end
def set_sessions
@sessions = current_user.session_activations
@sessions = current_user.session_activations.order(updated_at: :desc)
end
def set_strikes

View File

@ -45,6 +45,6 @@ class Auth::SetupController < ApplicationController
end
def set_pack
use_pack 'auth'
use_pack 'sign_up'
end
end

View File

@ -11,15 +11,15 @@ class BackupsController < ApplicationController
def download
case Paperclip::Attachment.default_options[:storage]
when :s3
redirect_to @backup.dump.expiring_url(10)
redirect_to @backup.dump.expiring_url(10), allow_other_host: true
when :fog
if Paperclip::Attachment.default_options.dig(:fog_credentials, :openstack_temp_url_key).present?
redirect_to @backup.dump.expiring_url(Time.now.utc + 10)
redirect_to @backup.dump.expiring_url(Time.now.utc + 10), allow_other_host: true
else
redirect_to full_asset_url(@backup.dump.url)
redirect_to full_asset_url(@backup.dump.url), allow_other_host: true
end
when :filesystem
redirect_to full_asset_url(@backup.dump.url)
redirect_to full_asset_url(@backup.dump.url), allow_other_host: true
end
end

View File

@ -2,6 +2,7 @@
module CaptchaConcern
extend ActiveSupport::Concern
include Hcaptcha::Adapters::ViewMethods
included do
@ -35,18 +36,22 @@ module CaptchaConcern
flash.delete(:hcaptcha_error)
yield message
end
false
end
end
def extend_csp_for_captcha!
policy = request.content_security_policy
return unless captcha_required? && policy.present?
%w(script_src frame_src style_src connect_src).each do |directive|
values = policy.send(directive)
values << 'https://hcaptcha.com' unless values.include?('https://hcaptcha.com') || values.include?('https:')
values << 'https://*.hcaptcha.com' unless values.include?('https://*.hcaptcha.com') || values.include?('https:')
policy.send(directive, *values)
end
end

View File

@ -75,7 +75,7 @@ module ThemingConcern
end
fallbacks.each do |fallback|
return resolve_pack(Themes.instance.flavour(fallback), pack_name) if Themes.instance.flavour(fallback)
return resolve_pack(Themes.instance.flavour(fallback), pack_name, skin) if Themes.instance.flavour(fallback)
end
nil

View File

@ -15,6 +15,8 @@ class InvitesController < ApplicationController
@invites = invites
@invite = Invite.new
@invite.max_uses ||= 1
@invite.expires_in ||= 1.day.in_seconds
end
def create

View File

@ -0,0 +1,41 @@
# frozen_string_literal: true
class MailSubscriptionsController < ApplicationController
layout 'auth'
skip_before_action :require_functional!
before_action :set_body_classes
before_action :set_user
before_action :set_type
def show; end
def create
@user.settings[email_type_from_param] = false
@user.save!
end
private
def set_user
@user = GlobalID::Locator.locate_signed(params[:token], for: 'unsubscribe')
end
def set_body_classes
@body_classes = 'lighter'
end
def set_type
@type = email_type_from_param
end
def email_type_from_param
case params[:type]
when 'follow', 'reblog', 'favourite', 'mention', 'follow_request'
"notification_emails.#{params[:type]}"
else
raise ArgumentError
end
end
end

View File

@ -46,7 +46,7 @@ class MediaController < ApplicationController
end
def allow_iframing
response.headers['X-Frame-Options'] = 'ALLOWALL'
response.headers.delete('X-Frame-Options')
end
def set_pack

View File

@ -10,6 +10,8 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
before_action :set_body_classes
before_action :set_cache_headers
before_action :set_last_used_at_by_app, only: :index, unless: -> { request.format == :json }
skip_before_action :require_functional!
include Localized
@ -40,4 +42,14 @@ class Oauth::AuthorizedApplicationsController < Doorkeeper::AuthorizedApplicatio
def set_cache_headers
response.cache_control.replace(private: true, no_store: true)
end
def set_last_used_at_by_app
@last_used_at_by_app = Doorkeeper::AccessToken
.select('DISTINCT ON (application_id) application_id, last_used_at')
.where(resource_owner_id: current_resource_owner.id)
.where.not(last_used_at: nil)
.order(application_id: :desc, last_used_at: :desc)
.pluck(:application_id, :last_used_at)
.to_h
end
end

View File

@ -12,6 +12,7 @@ class Settings::ImportsController < Settings::BaseController
muting: 'muted_accounts_failures.csv',
domain_blocking: 'blocked_domains_failures.csv',
bookmarks: 'bookmarks_failures.csv',
lists: 'lists_failures.csv',
}.freeze
TYPE_TO_HEADERS_MAP = {
@ -20,6 +21,7 @@ class Settings::ImportsController < Settings::BaseController
muting: ['Account address', 'Hide notifications'],
domain_blocking: false,
bookmarks: false,
lists: false,
}.freeze
def index
@ -49,6 +51,8 @@ class Settings::ImportsController < Settings::BaseController
csv << [row.data['domain']]
when :bookmarks
csv << [row.data['uri']]
when :lists
csv << [row.data['list_name'], row.data['acct']]
end
end
end

View File

@ -19,6 +19,6 @@ class Settings::Preferences::BaseController < Settings::BaseController
end
def user_params
params.require(:user).permit(:locale, chosen_languages: [], settings_attributes: UserSettings.keys)
params.require(:user).permit(:locale, :time_zone, chosen_languages: [], settings_attributes: UserSettings.keys)
end
end

View File

@ -0,0 +1,15 @@
# frozen_string_literal: true
class Settings::VerificationsController < Settings::BaseController
before_action :set_account
def show
@verified_links = @account.fields.select(&:verified?)
end
private
def set_account
@account = current_account
end
end

View File

@ -46,7 +46,7 @@ class StatusesController < ApplicationController
return not_found if @status.hidden? || @status.reblog?
expires_in 180, public: true
response.headers['X-Frame-Options'] = 'ALLOWALL'
response.headers.delete('X-Frame-Options')
render layout: 'embedded'
end

View File

@ -52,7 +52,7 @@ module ApplicationHelper
if closed_registrations? || omniauth_only?
'https://joinmastodon.org/#getting-started'
else
new_user_registration_path
ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_path)
end
end
@ -170,11 +170,11 @@ module ApplicationHelper
end
def storage_host
URI::HTTPS.build(host: storage_host_name).to_s
"https://#{storage_host_var}"
end
def storage_host?
storage_host_name.present?
storage_host_var.present?
end
def quote_wrap(text, line_width: 80, break_sequence: "\n")
@ -235,7 +235,7 @@ module ApplicationHelper
private
def storage_host_name
def storage_host_var
ENV.fetch('S3_ALIAS_HOST', nil) || ENV.fetch('S3_CLOUDFRONT_HOST', nil)
end
end

View File

@ -64,6 +64,10 @@ module FormattingHelper
end
def account_field_value_format(field, with_rel_me: true)
html_aware_format(field.value, field.account.local?, with_rel_me: with_rel_me, with_domains: true, multiline: false)
if field.verified? && !field.account.local?
TextFormatter.shortened_link(field.value_for_verification)
else
html_aware_format(field.value, field.account.local?, with_rel_me: with_rel_me, with_domains: true, multiline: false)
end
end
end

View File

@ -1,7 +1,5 @@
# frozen_string_literal: true
# rubocop:disable Metrics/ModuleLength
module LanguagesHelper
ISO_639_1 = {
aa: ['Afar', 'Afaraf'].freeze,

View File

@ -11,7 +11,7 @@ module ReactComponentHelper
end
def react_admin_component(name, props = {})
data = { 'admin-component': name.to_s.camelcase, props: Oj.dump({ locale: I18n.locale }.merge(props)) }
data = { 'admin-component': name.to_s.camelcase, props: Oj.dump(props) }
div_tag_with_data(data)
end

View File

@ -5,10 +5,6 @@ module SettingsHelper
LanguagesHelper::SUPPORTED_LOCALES.keys
end
def hash_to_object(hash)
HashObject.new(hash)
end
def session_device_icon(session)
device = session.detection.device
@ -28,13 +24,4 @@ module SettingsHelper
safe_join([image_tag(account.avatar.url, width: 15, height: 15, alt: display_name(account), class: 'avatar'), content_tag(:span, account.acct, class: 'username')], ' ')
end
end
def picture_hint(hint, picture)
if picture.original_filename.nil?
hint
else
link = link_to t('generic.delete'), settings_profile_picture_path(picture.name.to_s), data: { method: :delete }
safe_join([hint, link], '<br/>'.html_safe)
end
end
end

View File

@ -2,6 +2,7 @@
import 'packs/public-path';
import { delegate } from '@rails/ujs';
import ready from '../mastodon/ready';
const setAnnouncementEndsAttributes = (target) => {

View File

@ -1,3 +1,3 @@
require('../styles/mailer.scss');
import '../styles/mailer.scss';
require.context('../icons');

View File

@ -2,7 +2,7 @@
import 'packs/public-path';
const { delegate } = require('@rails/ujs');
import { delegate } from '@rails/ujs';
const getProfileAvatarAnimationHandler = (swapTo) => {
//animate avatar gifs on the profile page when moused over

View File

@ -1,9 +1,9 @@
// This file will be loaded on settings pages, regardless of theme.
import 'packs/public-path';
import { delegate } from '@rails/ujs';
import escapeTextContentForBrowser from 'escape-html';
const { delegate } = require('@rails/ujs');
import emojify from '../mastodon/features/emoji/emoji';

View File

@ -16,4 +16,5 @@ pack:
modal: public.js
public: public.js
settings: settings.js
sign_up:
share:

View File

@ -1,6 +1,8 @@
import 'packs/public-path';
import axios from 'axios';
import * as WebAuthnJSON from '@github/webauthn-json';
import axios from 'axios';
import ready from '../mastodon/ready';
import 'regenerator-runtime/runtime';

View File

@ -1,4 +1,5 @@
import api, { getLinks } from '../api';
import { importFetchedAccount, importFetchedAccounts } from './importer';
export const ACCOUNT_FETCH_REQUEST = 'ACCOUNT_FETCH_REQUEST';

View File

@ -1,4 +1,5 @@
import api from '../api';
import { normalizeAnnouncement } from './importer/normalizer';
export const ANNOUNCEMENTS_FETCH_REQUEST = 'ANNOUNCEMENTS_FETCH_REQUEST';

View File

@ -1,7 +1,9 @@
import { createAction } from '@reduxjs/toolkit';
type ChangeLayoutPayload = {
layout: 'mobile' | 'single-column' | 'multi-column';
};
import type { LayoutType } from '../is_mobile';
interface ChangeLayoutPayload {
layout: LayoutType;
}
export const changeLayout =
createAction<ChangeLayoutPayload>('APP_LAYOUT_CHANGE');

View File

@ -1,4 +1,5 @@
import api, { getLinks } from '../api';
import { fetchRelationships } from './accounts';
import { importFetchedAccounts } from './importer';
import { openModal } from './modal';
@ -94,6 +95,6 @@ export function initBlockModal(account) {
account,
});
dispatch(openModal('BLOCK'));
dispatch(openModal({ modalType: 'BLOCK' }));
};
}

View File

@ -1,4 +1,5 @@
import api, { getLinks } from '../api';
import { importFetchedStatuses } from './importer';
export const BOOKMARKED_STATUSES_FETCH_REQUEST = 'BOOKMARKED_STATUSES_FETCH_REQUEST';

View File

@ -14,7 +14,10 @@ export function initBoostModal(props) {
privacy,
});
dispatch(openModal('BOOST', props));
dispatch(openModal({
modalType: 'BOOST',
modalProps: props,
}));
};
}

View File

@ -1,11 +1,14 @@
import { defineMessages } from 'react-intl';
import axios from 'axios';
import { throttle } from 'lodash';
import { defineMessages } from 'react-intl';
import api from 'flavours/glitch/api';
import { search as emojiSearch } from 'flavours/glitch/features/emoji/emoji_mart_search_light';
import { tagHistory } from 'flavours/glitch/settings';
import { recoverHashtags } from 'flavours/glitch/utils/hashtag';
import resizeImage from 'flavours/glitch/utils/resize_image';
import { showAlert, showAlertForError } from './alerts';
import { useEmoji } from './emojis';
import { importFetchedAccounts, importFetchedStatus } from './importer';
@ -436,7 +439,10 @@ export function initMediaEditModal(id) {
id,
});
dispatch(openModal('FOCAL_POINT', { id }));
dispatch(openModal({
modalType: 'FOCAL_POINT',
modalProps: { id },
}));
};
}

View File

@ -1,4 +1,5 @@
import api, { getLinks } from '../api';
import {
importFetchedAccounts,
importFetchedStatuses,

View File

@ -1,6 +1,7 @@
import api from '../api';
import { importFetchedAccounts } from './importer';
import { fetchRelationships } from './accounts';
import { importFetchedAccounts } from './importer';
export const DIRECTORY_FETCH_REQUEST = 'DIRECTORY_FETCH_REQUEST';
export const DIRECTORY_FETCH_SUCCESS = 'DIRECTORY_FETCH_SUCCESS';

View File

@ -1,4 +1,5 @@
import api, { getLinks } from '../api';
import { importFetchedStatuses } from './importer';
export const FAVOURITED_STATUSES_FETCH_REQUEST = 'FAVOURITED_STATUSES_FETCH_REQUEST';

View File

@ -1,4 +1,5 @@
import api from '../api';
import { openModal } from './modal';
export const FILTERS_FETCH_REQUEST = 'FILTERS_FETCH_REQUEST';
@ -14,9 +15,12 @@ export const FILTERS_CREATE_SUCCESS = 'FILTERS_CREATE_SUCCESS';
export const FILTERS_CREATE_FAIL = 'FILTERS_CREATE_FAIL';
export const initAddFilter = (status, { contextType }) => dispatch =>
dispatch(openModal('FILTER', {
statusId: status?.get('id'),
contextType: contextType,
dispatch(openModal({
modalType: 'FILTER',
modalProps: {
statusId: status?.get('id'),
contextType: contextType,
},
}));
export const fetchFilters = () => (dispatch, getState) => {

View File

@ -1,4 +1,5 @@
import api from '../api';
import { importFetchedAccounts } from './importer';
export const HISTORY_FETCH_REQUEST = 'HISTORY_FETCH_REQUEST';

View File

@ -1,11 +1,12 @@
import escapeTextContentForBrowser from 'escape-html';
import emojify from 'flavours/glitch/features/emoji/emoji';
import { unescapeHTML } from 'flavours/glitch/utils/html';
import { autoHideCW } from 'flavours/glitch/utils/content_warning';
import { unescapeHTML } from 'flavours/glitch/utils/html';
const domParser = new DOMParser();
const makeEmojiMap = record => record.emojis.reduce((obj, emoji) => {
const makeEmojiMap = emojis => emojis.reduce((obj, emoji) => {
obj[`:${emoji.shortcode}:`] = emoji;
return obj;
}, {});
@ -19,7 +20,7 @@ export function searchTextFromRawStatus (status) {
export function normalizeAccount(account) {
account = { ...account };
const emojiMap = makeEmojiMap(account);
const emojiMap = makeEmojiMap(account.emojis);
const displayName = account.display_name.trim().length === 0 ? account.username : account.display_name;
account.display_name_html = emojify(escapeTextContentForBrowser(displayName), emojiMap);
@ -79,7 +80,7 @@ export function normalizeStatus(status, normalOldStatus, settings) {
} else {
const spoilerText = normalStatus.spoiler_text || '';
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
const emojiMap = makeEmojiMap(normalStatus);
const emojiMap = makeEmojiMap(normalStatus.emojis);
normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);
@ -119,22 +120,48 @@ export function normalizeStatus(status, normalOldStatus, settings) {
return normalStatus;
}
export function normalizeStatusTranslation(translation, status) {
const emojiMap = makeEmojiMap(status.get('emojis').toJS());
const normalTranslation = {
detected_source_language: translation.detected_source_language,
language: translation.language,
provider: translation.provider,
contentHtml: emojify(translation.content, emojiMap),
spoilerHtml: emojify(escapeTextContentForBrowser(translation.spoiler_text), emojiMap),
spoiler_text: translation.spoiler_text,
};
return normalTranslation;
}
export function normalizePoll(poll) {
const normalPoll = { ...poll };
const emojiMap = makeEmojiMap(normalPoll);
const emojiMap = makeEmojiMap(poll.emojis);
normalPoll.options = poll.options.map((option, index) => ({
...option,
voted: poll.own_votes && poll.own_votes.includes(index),
title_emojified: emojify(escapeTextContentForBrowser(option.title), emojiMap),
titleHtml: emojify(escapeTextContentForBrowser(option.title), emojiMap),
}));
return normalPoll;
}
export function normalizePollOptionTranslation(translation, poll) {
const emojiMap = makeEmojiMap(poll.get('emojis').toJS());
const normalTranslation = {
...translation,
titleHtml: emojify(escapeTextContentForBrowser(translation.title), emojiMap),
};
return normalTranslation;
}
export function normalizeAnnouncement(announcement) {
const normalAnnouncement = { ...announcement };
const emojiMap = makeEmojiMap(normalAnnouncement);
const emojiMap = makeEmojiMap(normalAnnouncement.emojis);
normalAnnouncement.contentHtml = emojify(normalAnnouncement.content, emojiMap);

View File

@ -1,4 +1,5 @@
import api from '../api';
import { importFetchedAccounts, importFetchedStatus } from './importer';
export const REBLOG_REQUEST = 'REBLOG_REQUEST';

View File

@ -1,6 +1,7 @@
import api from '../api';
import { importFetchedAccounts } from './importer';
import { showAlertForError } from './alerts';
import { importFetchedAccounts } from './importer';
export const LIST_FETCH_REQUEST = 'LIST_FETCH_REQUEST';
export const LIST_FETCH_SUCCESS = 'LIST_FETCH_SUCCESS';
@ -150,10 +151,10 @@ export const createListFail = error => ({
error,
});
export const updateList = (id, title, shouldReset, replies_policy) => (dispatch, getState) => {
export const updateList = (id, title, shouldReset, isExclusive, replies_policy) => (dispatch, getState) => {
dispatch(updateListRequest(id));
api(getState).put(`/api/v1/lists/${id}`, { title, replies_policy }).then(({ data }) => {
api(getState).put(`/api/v1/lists/${id}`, { title, replies_policy, exclusive: typeof isExclusive === 'undefined' ? undefined : !!isExclusive }).then(({ data }) => {
dispatch(updateListSuccess(data));
if (shouldReset) {

View File

@ -1,4 +1,5 @@
import { expandSpoilers, disableSwiping } from 'flavours/glitch/initial_state';
import { openModal } from './modal';
export const LOCAL_SETTING_CHANGE = 'LOCAL_SETTING_CHANGE';
@ -27,9 +28,12 @@ export function checkDeprecatedLocalSettings() {
}
if (changed_settings.length > 0) {
dispatch(openModal('DEPRECATED_SETTINGS', {
settings: changed_settings,
onConfirm: () => dispatch(clearDeprecatedLocalSettings()),
dispatch(openModal({
modalType: 'DEPRECATED_SETTINGS',
modalProps: {
settings: changed_settings,
onConfirm: () => dispatch(clearDeprecatedLocalSettings()),
},
}));
}
};

View File

@ -1,8 +1,10 @@
import api from '../api';
import { debounce } from 'lodash';
import compareId from '../compare_id';
import { List as ImmutableList } from 'immutable';
import { debounce } from 'lodash';
import api from '../api';
import { compareId } from '../compare_id';
export const MARKERS_FETCH_REQUEST = 'MARKERS_FETCH_REQUEST';
export const MARKERS_FETCH_SUCCESS = 'MARKERS_FETCH_SUCCESS';
export const MARKERS_FETCH_FAIL = 'MARKERS_FETCH_FAIL';

View File

@ -1,18 +0,0 @@
export const MODAL_OPEN = 'MODAL_OPEN';
export const MODAL_CLOSE = 'MODAL_CLOSE';
export function openModal(type, props) {
return {
type: MODAL_OPEN,
modalType: type,
modalProps: props,
};
}
export function closeModal(type, options = { ignoreFocus: false }) {
return {
type: MODAL_CLOSE,
modalType: type,
ignoreFocus: options.ignoreFocus,
};
}

View File

@ -0,0 +1,17 @@
import { createAction } from '@reduxjs/toolkit';
import type { MODAL_COMPONENTS } from '../features/ui/components/modal_root';
export type ModalType = keyof typeof MODAL_COMPONENTS;
interface OpenModalPayload {
modalType: ModalType;
modalProps: unknown;
}
export const openModal = createAction<OpenModalPayload>('MODAL_OPEN');
interface CloseModalPayload {
modalType: ModalType | undefined;
ignoreFocus: boolean;
}
export const closeModal = createAction<CloseModalPayload>('MODAL_CLOSE');

View File

@ -1,7 +1,9 @@
import { openModal } from 'flavours/glitch/actions/modal';
import api, { getLinks } from '../api';
import { fetchRelationships } from './accounts';
import { importFetchedAccounts } from './importer';
import { openModal } from 'flavours/glitch/actions/modal';
export const MUTES_FETCH_REQUEST = 'MUTES_FETCH_REQUEST';
export const MUTES_FETCH_SUCCESS = 'MUTES_FETCH_SUCCESS';
@ -96,7 +98,7 @@ export function initMuteModal(account) {
account,
});
dispatch(openModal('MUTE'));
dispatch(openModal({ modalType: 'MUTE' }));
};
}

View File

@ -1,5 +1,15 @@
import { IntlMessageFormat } from 'intl-messageformat';
import { defineMessages } from 'react-intl';
import { List as ImmutableList } from 'immutable';
import { compareId } from 'flavours/glitch/compare_id';
import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
import { unescapeHTML } from 'flavours/glitch/utils/html';
import { requestNotificationPermission } from 'flavours/glitch/utils/notifications';
import api, { getLinks } from '../api';
import IntlMessageFormat from 'intl-messageformat';
import { fetchFollowRequests, fetchRelationships } from './accounts';
import {
importFetchedAccount,
@ -9,12 +19,9 @@ import {
} from './importer';
import { submitMarkers } from './markers';
import { saveSettings } from './settings';
import { defineMessages } from 'react-intl';
import { List as ImmutableList } from 'immutable';
import { unescapeHTML } from 'flavours/glitch/utils/html';
import { usePendingItems as preferPendingItems } from 'flavours/glitch/initial_state';
import compareId from 'flavours/glitch/compare_id';
import { requestNotificationPermission } from 'flavours/glitch/utils/notifications';
export const NOTIFICATIONS_UPDATE = 'NOTIFICATIONS_UPDATE';
export const NOTIFICATIONS_UPDATE_NOOP = 'NOTIFICATIONS_UPDATE_NOOP';

View File

@ -6,7 +6,9 @@ export function showOnboardingOnce() {
const alreadySeen = getState().getIn(['settings', 'onboarded']);
if (!alreadySeen) {
dispatch(openModal('ONBOARDING'));
dispatch(openModal({
modalType: 'ONBOARDING',
}));
dispatch(changeSetting(['onboarded'], true));
dispatch(saveSettings());
}

View File

@ -1,12 +1,14 @@
import { me } from 'flavours/glitch/initial_state';
import api from '../api';
import { importFetchedStatuses } from './importer';
export const PINNED_STATUSES_FETCH_REQUEST = 'PINNED_STATUSES_FETCH_REQUEST';
export const PINNED_STATUSES_FETCH_SUCCESS = 'PINNED_STATUSES_FETCH_SUCCESS';
export const PINNED_STATUSES_FETCH_FAIL = 'PINNED_STATUSES_FETCH_FAIL';
import { me } from 'flavours/glitch/initial_state';
export function fetchPinnedStatuses() {
return (dispatch, getState) => {
dispatch(fetchPinnedStatusesRequest());

View File

@ -1,4 +1,5 @@
import api from '../api';
import { importFetchedPoll } from './importer';
export const POLL_VOTE_REQUEST = 'POLL_VOTE_REQUEST';

View File

@ -1,5 +1,5 @@
import { setAlerts } from './setter';
import { saveSettings } from './registerer';
import { setAlerts } from './setter';
export function changeAlerts(path, value) {
return dispatch => {

View File

@ -1,5 +1,6 @@
import api from '../../api';
import { pushNotificationsSetting } from '../../settings';
import { setBrowserSupport, setSubscription, clearSubscription } from './setter';
// Taken from https://www.npmjs.com/package/web-push

View File

@ -1,4 +1,5 @@
import api from '../api';
import { openModal } from './modal';
export const REPORT_SUBMIT_REQUEST = 'REPORT_SUBMIT_REQUEST';
@ -6,9 +7,12 @@ export const REPORT_SUBMIT_SUCCESS = 'REPORT_SUBMIT_SUCCESS';
export const REPORT_SUBMIT_FAIL = 'REPORT_SUBMIT_FAIL';
export const initReport = (account, status) => dispatch =>
dispatch(openModal('REPORT', {
accountId: account.get('id'),
statusId: status?.get('id'),
dispatch(openModal({
modalType: 'REPORT',
modalProps: {
accountId: account.get('id'),
statusId: status?.get('id'),
},
}));
export const submitReport = (params, onSuccess, onFail) => (dispatch, getState) => {

View File

@ -1,4 +1,5 @@
import api from '../api';
import { fetchRelationships } from './accounts';
import { importFetchedAccounts, importFetchedStatuses } from './importer';

View File

@ -1,4 +1,5 @@
import api from '../api';
import { importFetchedAccount } from './importer';
export const SERVER_FETCH_REQUEST = 'Server_FETCH_REQUEST';
@ -18,6 +19,10 @@ export const SERVER_DOMAIN_BLOCKS_FETCH_SUCCESS = 'SERVER_DOMAIN_BLOCKS_FETCH_SU
export const SERVER_DOMAIN_BLOCKS_FETCH_FAIL = 'SERVER_DOMAIN_BLOCKS_FETCH_FAIL';
export const fetchServer = () => (dispatch, getState) => {
if (getState().getIn(['server', 'server', 'isLoading'])) {
return;
}
dispatch(fetchServerRequest());
api(getState)
@ -65,6 +70,10 @@ const fetchServerTranslationLanguagesFail = error => ({
});
export const fetchExtendedDescription = () => (dispatch, getState) => {
if (getState().getIn(['server', 'extendedDescription', 'isLoading'])) {
return;
}
dispatch(fetchExtendedDescriptionRequest());
api(getState)
@ -88,6 +97,10 @@ const fetchExtendedDescriptionFail = error => ({
});
export const fetchDomainBlocks = () => (dispatch, getState) => {
if (getState().getIn(['server', 'domainBlocks', 'isLoading'])) {
return;
}
dispatch(fetchDomainBlocksRequest());
api(getState)

View File

@ -1,5 +1,7 @@
import api from '../api';
import { debounce } from 'lodash';
import api from '../api';
import { showAlertForError } from './alerts';
export const SETTING_CHANGE = 'SETTING_CHANGE';

Some files were not shown because too many files have changed in this diff Show More