Commit graph

416 commits

Author SHA1 Message Date
Eugen Rochko
da4c730c47 Add IP-based rules (#14963) 2020-10-12 16:33:49 +02:00
ThibG
ab58e4a090 Fix downloading remote media files when server returns empty filename (#14867)
Fixes #14817
2020-09-27 22:00:43 +02:00
Eugen Rochko
e514304a76 Change account suspensions to be reversible by default (#14726) 2020-09-15 14:37:58 +02:00
Eugen Rochko
7fa0da9e98 Change REST API to return empty data for suspended accounts (#14765) 2020-09-11 15:16:29 +02:00
ThibG
6c612562f0 Add border around 🕺 emoji (#14769)
Fixes #14768
2020-09-10 19:08:03 +02:00
Y.Yamashiro
78feafaa85 Change S3 ACL in "tootctl media remove-orphans --fix-permissions" from fixed value to environment file's value. (#14715) 2020-09-02 00:17:58 +02:00
Eugen Rochko
dc2ea5223b Add --fix-permissions option to tootctl media remove-orphans (#14383) 2020-09-01 03:33:21 +02:00
dependabot[bot]
61b768572e Bump rubocop from 0.86.0 to 0.88.0 (#14412)
* Bump rubocop from 0.86.0 to 0.88.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.86.0 to 0.88.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.86.0...v0.88.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix for latest RuboCop

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
2020-09-01 03:04:00 +02:00
ThibG
a3c9062153 Add border around 🐞 emoji (#14712) 2020-08-31 23:30:27 +02:00
Takeshi Umeda
e0b8201f67 Fix an error when file_file_size is nil in tootctl media remove (#14657) 2020-08-24 18:09:46 +02:00
ThibG
8baad22f68 Improve email address validation (#14565)
* Increase DNS timeout from 1 second to 5 seconds for MX check

1 seconds is rather short when using a recursive DNS resolver which
hasn't got a cached result already available. Use 5 seconds instead,
which is the timeout value we use for outgoing HTTP queries.

* Add more precise error messages for invalid e-mail addresses
2020-08-12 12:40:25 +02:00
ThibG
ccb975df83 Fix tootctl media commands not handling snowflake ids for media_attachments (#14536) 2020-08-10 01:51:06 +02:00
ThibG
20d6fb7f1b Fix thumbnail color extraction (#14464)
* Fix contrast calculation for thumbnail color extraction

Luminance calculation was using 0-255 RGB values instead of 0-1 sRGB values,
leading to incorrectly-computed contrast values.

Since we use ColorDiff already, just use its XYZ colorspace conversion code
to get the value.

* Require at least 3:1 contrast for both accent and foreground colors

* Lower required contrast for the accent color
2020-08-02 18:47:44 +02:00
ThibG
0dd641dcea Change content-type to be always computed from file data (#14452)
* Change content-type to be always computed from file data

Restore previous behavior, detecting the content-type isn't very
expensive, and some instances may serve files as application/octet-stream
regardless of their true type, making fetching media from them fail, while
it used to work pre-3.2.0.

* Add test
2020-08-02 11:21:10 +02:00
Eugen Rochko
f089dd55ef Bump version to 3.2.0 (#14395) 2020-07-27 00:07:26 +02:00
Eugen Rochko
1959db3fd1 Bump version to 3.2.0rc2 (#14382) 2020-07-24 18:47:25 +02:00
Takeshi Umeda
9e16f0f1f6 Fix mimetype returning nil (#14356) 2020-07-19 13:09:47 +02:00
Eugen Rochko
6391e1e302 Bump version to 3.2.0rc1 (#14312) 2020-07-15 21:07:27 +02:00
Eugen Rochko
09caf7e22e Change tootctl search deploy algorithm (#14300) 2020-07-14 18:10:35 +02:00
Eugen Rochko
c3ef166b61 Bump version to 3.1.5 (#14284) 2020-07-10 21:07:30 +02:00
ThibG
5adec9f3b6 Fix ogg vorbis files with a cover art not being correctly processed (#14255) 2020-07-07 16:32:14 +02:00
Eugen Rochko
8517a5fdb4 Add color extraction for audio thumbnails (#14209) 2020-07-05 18:28:25 +02:00
Eugen Rochko
ae28f94a7a Fix audio uploads without embedded image (#14203) 2020-07-03 03:05:32 +02:00
Eugen Rochko
ca238c879d Change Redis#exists calls to Redis#exists? to avoid deprecation warning (#14191) 2020-07-01 19:05:21 +02:00
Eugen Rochko
36e5fd547b Fix remote files not using Content-Type header, streaming (#14184) 2020-06-30 23:58:02 +02:00
Eugen Rochko
a3ce01a102 Add customizable thumbnails for audio and video attachments (#14145)
- Change audio files to not be stripped of metadata
- Automatically extract cover art from audio if it exists
- Add `thumbnail` parameter to `POST /api/v1/media`, `POST /api/v2/media` and `PUT /api/v1/media/:id`
- Add `icon` to represent it in attachments in ActivityPub
- Fix `preview_url` containing URL of missing missing image when there is no thumbnail instead of null
- Fix duration of audio not being displayed on public pages until the file is loaded
2020-06-29 13:56:55 +02:00
Eugen Rochko
42d2f45db1 Remove the terms blacklist and whitelist from UX (#14149)
Localization strings:

- "Whitelist mode" -> "Limited federation mode"
- "Blacklist e-mail domain" -> "Block e-mail domain"
- "Whitelist domain" -> "Allow domain for federation"

...And so on

Environment variables (backwards-compatible):

- `WHITELIST_MODE` -> `LIMITED_FEDERATION_MODE`
- `EMAIL_DOMAIN_BLACKLIST` -> `EMAIL_DOMAIN_DENYLIST`
- `EMAIL_DOMAIN_WHITELIST` -> `EMAIL_DOMAIN_ALLOWLIST`

tootctl:

- `tootctl domains purge --whitelist-mode` -> `tootctl domains purge --limited-federation-mode`

Removed badly maintained and no longer relevant .env.production.sample file
2020-06-27 20:20:11 +02:00
Eugen Rochko
85ecbd5527 Fix help text around tootctl email_domain_blocks (#14147) 2020-06-26 21:28:40 +02:00
tateisu
29ddd0cdf7 Add tootctl email-domain-blocks (#13589)
* Add tootctl email_domains (block|unblock)

* fix codeclimate issues.

* fix codeclimate issues.

* fix codeclimate issues.

* add list subcommand, remove log_action.

* fix codeclimate issues.

* filter duplicate hostnames,ips before block

* rebase from currnet master branch.
rename email_domains_cli.rb to email_domain_blocks_cli.rb .
rename Mastodon::EmailDomainsCLI to Mastodon::EmailDomainBlocksCLI .
rename command email_domains to email-domain-blocks . (Thor recognizes both of - and _ )
rename subcommand block to add .
rename subcommand unblock to remove .
change the color in list subcommand to while for domain or cyan for childlen.
don't use include() in list subcommand.
suppress console output about succeeded entry.
add console output about count of processed/skipped.
remove capitalization in subcommand description.
remove long_desc in subcommand 'remove'.
remove duplicate where in subcommand 'remove'.

* fix codeclimate issue.
2020-06-25 12:17:10 +02:00
leo60228
230a3b36b6 Add emojis:generate_borders Rake task (#13773)
* Add emojis:generate_borders Rake task

* Address review

* Border all dark emoji

* Combine stroke with filter to reduce artifacting

* Cleanup Camera with Flash

* Add stroke-linejoin="round"

The previous filter and tweaks were effectively a poor imitation of it.
There are no artifacts for any dark emoji now!

* Set stroke-width using property

This fixes old versions of Firefox.

* Store emoji in string instead of array

* Use separate arguments for each path segment

* Remove "background: black;"
2020-06-09 00:12:20 +02:00
ThibG
36f31b5cad Add blurhash to preview cards (#13984)
Fixes #13001
2020-06-05 23:10:41 +02:00
ThibG
8bb1747946 Fix mastodon:setup choking on env variables containing '%' (#13940)
Fix a regression introduced in #13928, 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 (#13928)
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
Stanislas
acb71734fb Fix tootctl upgrade storage-schema S3 ACL (#13768) 2020-05-17 17:27:36 +02:00
Eugen Rochko
7e7613ec9c Fix tootctl media remove-orphans choking on unknown files in storage (#13765)
Fix #13762

Catch tootctl interrupt to prevent confusing stacktrace
2020-05-15 18:41:27 +02:00
Eugen Rochko
b2488c3d77 Fix tootctl upgrade storage-schema misbehaving (#13761)
- Fix not moving original files of custom emojis
- Fix command failing to move any files with S3 storage
- Fix command marking records as upgraded when move failed

Fix #13594
2020-05-15 17:15:24 +02:00
ThibG
74de5ade7d Fix GifReader exceptions (#13760) 2020-05-15 11:38:12 +02:00
Eugen Rochko
5525f6efb7 Bump version to 3.1.4 (#13750) 2020-05-14 07:46:11 +02:00
Takeshi Umeda
27a938101c Fix tootctl media refresh (#13751) 2020-05-14 07:45:52 +02:00
ThibG
b7f47014a7 Fix "tootctl media remove-orphans" crashing on “Import” files (#13685)
* Fix "tootctl media remove-orphans" crashing on “Import” files

* Also remove empty directories when removing orphaned media
2020-05-09 21:06:55 +02:00
Hanage999
190768a28d Fix tootctl upgrade storage-schema failing to delete empty directories (#13593) 2020-05-04 13:51:34 +02:00
Lerk
0dd63eae8e Add tootctl emoji export (#13534)
* add emoji export command to cli

* fix codeclimate issues

* add error when no matching category was found

* add other suggestions

* exit 1 when no matching category is found

* changes according to suggestions

* 👀

* RubyNein

Y u always autoformat :c
2020-04-27 22:17:49 +02:00
Eugen Rochko
adfb22a9dd Add separate cache directory for non-local uploads (#12821) 2020-04-26 23:29:08 +02:00
D Anzorge
945c8e207e Update Twemoji to 12.1.5 (#13021)
* Update Twemoji to 12.1.5

SVGs from Twemoji repo https://github.com/twitter/twemoji

* Update emoji_map.json to Unicode 12
2020-04-19 23:38:31 +02:00
Eugen Rochko
ccee0578a4 Fix regression in tootctl media remove-orphans (#13405)
Fix #13401
2020-04-06 14:11:47 +02:00
Eugen Rochko
331bc98f25 Fix trying to delete already deleted file when post-processing (#13406)
Fix #13403
2020-04-06 14:11:22 +02:00
Eugen Rochko
c7c2a46967 Bump version to 3.1.3 (#13389) 2020-04-05 06:23:46 +02:00
Eugen Rochko
7045cb5d5c Fix tootctl media remove-orphans ignoring PAPERCLIP_ROOT_PATH (#13375)
Fix #13371
2020-04-02 05:28:51 +02:00
ThibG
5e544da8a4 Fix Paperclip using deprecated URI.escape function (#13320)
Monkey-patch Paperclip to perform URL escaping in a slightly more
appropriate way, and get rid of runtime deprecation warnings.
2020-03-26 15:09:16 +01:00
Eugen Rochko
1cb4645638 Change tootctl media remove-orphans to work for all classes (#13316)
Change `tootctl media lookup` to not use an interactive prompt
2020-03-26 01:56:41 +01:00