Commit Graph

94 Commits (1a6ac50f319d940e6d3ed69dda4f245f6e958e14)

Author SHA1 Message Date
Claire 5cc4d2ed8b Fix redis configuration not being changed by mastodon:setup ()
Fixes 
2022-05-09 23:19:11 +02:00
Claire efd2f303fe Change mastodon:webpush:generate_vapid_key task to not require functional env ()
Fixes 
2022-01-20 14:51:23 +01:00
Claire 65a727c888 Fix "bundle exec rails mastodon:setup" crashing in some circumstances ()
Fix regression from 
2021-11-11 14:00:30 +01:00
Claire ee098c8342 Fix mastodon:setup to take dotenv/docker-compose differences into account ()
In order to work around https://github.com/mastodon/mastodon/issues/16895,
add a warning to .env.production.sample, and change the mastodon:setup rake
task to:
- output a warning if a variable will be interpreted differently by dotenv
  and docker-compose
- ensure the printed config is compatible with docker-compose
2021-10-25 16:34:15 +02:00
Claire edc41c6e17 Change mastodon:setup to not call assets:precompile in docker ()
It appears assets are built during image build, and they shouldn't need
to be rebuilt, since we now have reproducible builds.
2021-03-24 10:37:24 +01:00
ThibG f894bb9220 Fix external user creation failing when invite request text is required ()
* Fix external user creation failing when invite request text is required

Also fixes tootctl-based user creation.

* Add test about invites when invite request text is otherwise required

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2020-12-22 17:14:32 +01:00
ThibG 8bb1747946 Fix mastodon:setup choking on env variables containing '%' ()
Fix a regression introduced in , caused by TTY::Command building
shell commands by chaining string substitutions.

Ditch TTY::Command and use system instead (both do shell out).
2020-06-03 20:18:52 +02:00
ThibG 96844da338 Fix mastodon:setup not running properly when some environment variables are set ()
When using one of the docker-compose containers, mastodon:setup will use the
existing .env.production rather than the generated one during the setup steps.

This is because dotenv does not overwrite env variables that are alreayd
defined, and the docker-compose.yml file loads the environment variables
from .env.production.
2020-06-02 13:57:21 +02:00
ThibG 6e937a13a8 Fix installation failing when Redis password contains special characters ()
* Add support for special characters in Redis passwords

Fixes 

* Refactor
2020-02-29 03:00:43 +01:00
Yamagishi Kazutoshi 71ff422997 Add config of multipart threshold for S3 () 2019-09-23 15:37:45 +02:00
Eugen Rochko 1a1160ee24 Add tootctl settings registrations open () 2018-10-04 16:05:54 +02:00
Eugen Rochko 26d73847cb Move more tasks to tootctl ()
* Move more tasks to tootctl

- tootctl feeds build
- tootctl feeds clear
- tootctl accounts refresh

Clean up exit codes and help messages

* Move user modifying to tootctl

* Improve user modification through CLI, rename commands

add -> create
mod -> modify
del -> delete

To remove ambiguity

* Fix code style issues

* Fix not being able to unset admin/mod role
2018-09-14 17:42:22 +02:00
Quint Guvernator 476ba6e4f0 Fix low-hanging rubocop gripes ()
* rubocop: quit being so picky

* rubocop: miscellany

* rubocop: prefer present to blank
2018-08-26 19:22:46 +02:00
Eugen Rochko ee4af13f51 Fix NUM_DAYS in rake mastodon:media:remove_remote and print warning ()
Remove old deprecated rake tasks
2018-08-26 17:19:47 +02:00
M Somerville 4b27569841 Rename S3_CLOUDFRONT_HOST to S3_ALIAS_HOST. ()
Still check for S3_CLOUDFRONT_HOST for existing installs.
2018-08-25 13:27:08 +02:00
Eugen Rochko e6e845f74d Add improved CLI interface for removing remote media ()
./bin/tootctl media remove --days 7 --background

Make the old rake task point to it
2018-08-25 13:25:39 +02:00
Eugen Rochko fe88a4f42c Get rid of all batch order warnings () 2018-08-21 12:25:50 +02:00
ThibG 40c7bd7cdd Add some feedback to maintenance rake tasks () 2018-08-11 22:02:55 +02:00
Eugen Rochko 797c72329f Fix missing column in select in mastodon:feeds:build task () 2018-06-04 04:21:15 +02:00
Eugen Rochko 49a0a3a8a2 Speed up some rake tasks by moving execution to Sidekiq ()
* Speed up some rake tasks by moving execution to Sidekiq

mastodon:media:remove_silenced
mastodon:media:remove_remote
mastodon:media:redownload_avatars
mastodon:feeds:build

* Fix code style issue
2018-05-30 21:09:30 +02:00
Eugen Rochko ca1c696dbd Slightly reduce RAM usage ()
* No need to re-require sidekiq plugins, they are required via Gemfile

* Add derailed_benchmarks tool, no need to require TTY gems in Gemfile

* Replace ruby-oembed with FetchOEmbedService

Reduce startup by 45382 allocated objects

* Remove preloaded JSON-LD in favour of caching HTTP responses

Reduce boot RAM by about 6 MiB

* Fix tests

* Fix test suite by stubbing out JSON-LD contexts
2018-05-02 18:58:48 +02:00
Alejandro Martinez Ruiz 20fcb1f5ae tasks/mastodon: fix prompt for Redis password () 2018-04-23 16:03:58 +02:00
David Baucum 259e3aa7bf Ability to specify Redis passwd on mastodon:setup ()
Closes 
2018-04-22 11:49:16 +02:00
Eugen Rochko ec74c3d7da Do not default SMTP verify mode to "peer", default to "none" () 2018-04-02 19:19:51 +02:00
Eugen Rochko ebba6fb7f5 Fix UniqueUsernameValidator comparison ()
Comparison was downcasing only one side, therefore if previously
existing account had a non-lowercase spelling, it would be ignored
when checking for duplicates.

New rake task `mastodon:maintenance:find_duplicate_usernames` will
help find constraint violations that might have occured from the
presence of this bug.

Bump version to 2.3.3
2018-03-27 04:33:57 +02:00
Akihiko Odaki 11c19f6cc9 Close http connection in perform method of Request class ()
HTTP connections must be explicitly closed in many cases, and letting
perform method close connections makes its callers less redundant and
prevent them from forgetting to close connections.
2018-03-24 12:49:54 +01:00
Akihiko Odaki 7b247b15f2 Correct the reference to user's password in mastodon:add_user task () 2018-03-17 13:27:19 +01:00
Ushitora Anqou 44917a10ad Detailed SMTP setup ()
* add detailed SMTP settings setup in mastodon:setup

* add localhost SMTP settings setup in mastodon:setup

* SMTP settings setup should exit after successful delivery of test mail
2018-03-12 21:41:26 +01:00
艮 鮟鱇 aa3b1144d1 set SAFETY_ASSURED=1 of db:setup in mastodon:setup () 2018-03-12 16:21:48 +01:00
Eugen Rochko 512e42fed8 When inside Docker, output saved configuration during mastodon:setup () 2018-03-09 11:52:18 +01:00
Eugen Rochko f92176899e After blocking domain with reject_media, invalidate cache ()
Media attachments are part of the association cache of statuses,
since they are presumed to be immutable. Unless this cache is
cleared manually, the statuses will continue to look like they
have media embedded.
2018-03-08 06:59:42 +01:00
Thomas Leister 225d270134 Fixes () 2018-03-01 23:30:06 +01:00
Paul Woolcock fee184c0fd Some images can cause `convert` to fail, which crashes this whole task ()
* Some images can cause `convert` to fail, which crashes this whole task

* Add more specific exception
2018-02-26 22:01:49 +01:00
Eugen Rochko f35356609b Ensure the app does not even start if OTP_SECRET is not set ()
* Ensure the app does not even start if OTP_SECRET is not set

* Remove PAPERCLIP_SECRET (it's not used by anything, actually)

Imports are for internal consumption and the url option isn't even
used correctly, so we can remove the hash stuff from them
2018-02-26 01:31:44 +01:00
takayamaki 2b3d62a8a5 fix purge_removed_accounts task should suspend account before delete it () 2018-02-21 16:30:46 +01:00
Eugen Rochko e8e6786d6f Interactive `rake mastodon:setup` task ()
* Add better CLI prompt

* Add rake mastodon:setup interactive wizard

* Test db/redis/smtp configurations and add admin user at the end

* Test database connection even when database does not exist yet
2018-02-11 18:40:57 +01:00
Eugen Rochko 92df0bba59 Fix regeneration marker not expiring ()
* Fix regeneration key not getting expired

* Add rake task to remove old regeneration markers
2018-01-18 20:29:56 +01:00
Eugen Rochko 67ee638c28 Move e-mail digest task to sidekiq, reduce workload, improve hint () 2018-01-15 04:34:28 +01:00
Eugen Rochko 50f2d69780 Add rake task to check and purge accounts that are missing in origin ()
* Add rake task to check and purge accounts that are missing in origin

* Add progress bar and --force options to mastodon:maintenance:purge_removed_accounts
2017-12-24 16:14:33 +01:00
Akihiko Odaki ce3989fc6a Add embed_url to preview cards () 2017-12-07 03:37:43 +01:00
Eugen Rochko 97178b6d86 Add moderator role and add pundit policies for admin actions ()
* Add moderator role and add pundit policies for admin actions

* Add rake task for turning user into mod and revoking it again

* Fix handling of unauthorized exception

* Deliver new report e-mails to staff, not just admins

* Add promote/demote to admin UI, hide some actions conditionally

* Fix unused i18n
2017-11-11 20:23:33 +01:00
Naoki Kosaka bc20bea20e In remove_remote, exclude removed media attachments. () 2017-11-08 15:19:22 +01:00
Eugen Rochko 26c797bf0d When accessing uncached media attachment, redownload it ()
* When accessing uncached media attachment, redownload it

* Prevent re-download of rejected media
2017-09-16 03:01:45 +02:00
Eugen Rochko 703fd425ff Fix count numbers from ActivityPub not being saved ()
They are marked as read-only by Rails, but we know what we are doing,
so we are un-marking them as such.

The mastodon:maintenance:update_counter_caches task is not really
supposed to be run anymore (it was a one-time thing during an upgrade)
however, just in case, I have modified it to not touch ActivityPub
accounts.

Also, no point writing to logger from these rake tasks, since they
are not to be run from cron. Better to give stdout feedback.
2017-09-12 00:16:03 +02:00
Joseph Mingrone c69b143264 Use casecmp() instead of casecmp?() for now ()
* Use casecmp() instead of casecmp?() for now

casecmp?() is only available in ruby 2.4.0.  Users running earlier ruby versions
would see errors, e.g., running
RAILS_ENV=production rails mastodon:maintenance:remove_deprecated_preview_cards.

* Correctly check whether casecmp() returns 0
2017-09-07 03:55:06 +02:00
Akihiko Odaki 9304aef321 Use next instead of return in task () 2017-09-03 12:39:39 +02:00
Akihiko Odaki ec7eaa44b0 Explicitly define attached file of DeprecatedPreviewCard ()
The path template of the attached files must explicitly be defined because
it is contradicting to the name of the class.
2017-09-03 07:58:58 +02:00
Eugen Rochko e9e271878e Make PreviewCard records reuseable between statuses ()
* Make PreviewCard records reuseable between statuses

**Warning!** Migration truncates preview_cards tablec

* Allow a wider thumbnail for link preview, display it in horizontal layout ()

* Delete preview cards files before truncating

* Rename old table instead of truncating it

* Add mastodon:maintenance:remove_deprecated_preview_cards

* Ignore deprecated_preview_cards in schema definition

* Fix null behaviour
2017-09-01 16:20:16 +02:00
Eugen Rochko 1a19358b24 ActivityPub migration procedure ()
* ActivityPub migration procedure

Once one account is detected as going from OStatus to ActivityPub,
invalidate WebFinger cache for other accounts from the same domain

* Unsubscribe from PuSH updates once we receive an ActivityPub payload

* Re-subscribe to PuSH unless already unsubscribed, regardless of protocol
2017-08-21 01:14:40 +02:00
Eugen Rochko 97dda48f70 Move clean up of unconfirmed users to sidekiq-scheduler ()
* Move clean up of unconfirmed users to sidekiq-scheduler

* mastodon:daily is now deprecated
2017-07-24 16:17:55 +02:00