* add blurhash to card entity

* update tootctl

* env vars

* local/web domain

* revert http_proxy
This commit is contained in:
trwnh 2020-07-25 09:35:41 -05:00 committed by GitHub
parent 35b4d2d280
commit 00277c3e36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 192 additions and 129 deletions

View File

@ -19,8 +19,8 @@ For convenience, it can read them from a flat file called `.env.production` in t
### Federation {#federation}
* `LOCAL_DOMAIN`
* `WEB_DOMAIN`
* `LOCAL_DOMAIN` = the domain for which your Mastodon instance has authority. Used to generate `acct:` URIs for Webfinger, which is used to resolve user addresses.
* `WEB_DOMAIN` = the domain used for URLs generated by your Mastodon instance. Includes actor and object URIs for ActivityPub. Do not set this variable unless you know what you are doing.
* `ALTERNATE_DOMAINS`
#### `AUTHORIZED_FETCH` {#authorized_fetch}
@ -31,17 +31,21 @@ For convenience, it can read them from a flat file called `.env.production` in t
Note that this mode cannot guarantee that bad actors do not access your public and unlisted toots, it merely makes it a bit more difficult.
#### `LIMITED_FEDERATION_MODE` {#limited_federation_mode}
When set to `true`, Mastodon will restrict federation to specific servers only, as well as disable public pages and some client APIs. Limited federation mode mode implies authorized fetch mode.
When switching an existing instance to limited federation mode, the following command should be used to remove any already existent data on non-allowed domains:
```
tootctl domain purge --limited-federation-mode
```
#### `WHITELIST_MODE` {#whitelist_mode}
When set to `true`, Mastodon will restrict federation to whitelisted servers only, as well as disable public pages and some client APIs.
Whitelist mode implies authorized fetch mode.
When switching an existing instance to whitelist mode, the following command should be used to remove any already existent data on non-whitelisted domains:
```
tootctl domain purge --whitelist-mode
```
Note that, while introduced in Mastodon 3.0, `WHITELIST_MODE` is broken on Mastodon 3.0 and 3.0.1.
Equivalent to `LIMITED_FEDERATION_MODE`, which it was renamed into after 3.1.4.
Note that, while introduced in Mastodon 3.0, `WHITELIST_MODE` is broken on Mastodon 3.0 and 3.0.1.
### Secrets {#secrets}
@ -106,7 +110,8 @@ For convenience, it can read them from a flat file called `.env.production` in t
## Limits {#limits}
* `SINGLE_USER_MODE`
* `EMAIL_DOMAIN_WHITELIST`
* `EMAIL_DOMAIN_ALLOWLIST`
* `EMAIL_DOMAIN_DENYLIST`
* `DEFAULT_LOCALE`
* `MAX_SESSION_ACTIVATIONS`
* `USER_ACTIVE_DAYS`
@ -125,6 +130,7 @@ For convenience, it can read them from a flat file called `.env.production` in t
* `SMTP_OPENSSL_VERIFY_MODE`
* `SMTP_ENABLE_STARTTLS_AUTO`
* `SMTP_TLS`
* `SMTP_SSL`
## File storage {#cdn}

View File

@ -6,7 +6,6 @@ menu:
weight: 60
parent: admin
---
---
The command-line interface of Mastodon is an executable file called `tootctl` residing in the `bin` directory within the Mastodon root directory. You must specify which environment you intend to use whenever you execute it by specifying the `RAILS_ENV` environment variable. Unless you are a developer working on a local machine, you need to use `RAILS_ENV=production`. If you are sure that you will never need another environment \(for development, testing, or staging\), you can add it to your `.bashrc` file for convenience, e.g.:
@ -35,19 +34,19 @@ No local data is actually deleted, because emptying the database or deleting the
**Make sure you know exactly what you are doing before running this command.** This operation is NOT reversible, and it can take a long time. The server will be in a BROKEN STATE after this command finishes. A running Sidekiq process is required, so do not shut down the server until the queues are fully cleared.
{{< /hint >}}
**Version history:**
* 2.8.0 - added
**Version history:**\
2.8.0 - added
| Option | Description |
| :--- | :--- |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl --version` {#version}
Show the version of the currently running Mastodon instance.
**Version history:**
* 2.7.0 - added
**Version history:**\
2.7.0 - added
## Accounts CLI {#accounts}
@ -57,8 +56,8 @@ Show the version of the currently running Mastodon instance.
Generate and broadcast new RSA keys, as part of security maintenance.
**Version history:**
* 2.5.0 - added
**Version history:**\
2.5.0 - added
| Option | Description |
| :--- | :--- |
@ -69,8 +68,8 @@ Generate and broadcast new RSA keys, as part of security maintenance.
Create a new user account with given USERNAME and provided --email.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
| Option | Description |
| :--- | :--- |
@ -85,9 +84,9 @@ Create a new user account with given USERNAME and provided --email.
Modify a user account's role, email, active status, approval mode, or 2FA requirement.
**Version history:**
* 2.6.0 - added
* 3.1.2 - added `--reset-password`
**Version history:**\
2.6.0 - added\
3.1.2 - added `--reset-password`
| Option | Description |
| :--- | :--- |
@ -105,8 +104,8 @@ Modify a user account's role, email, active status, approval mode, or 2FA requir
Delete a user account with given USERNAME.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
| Option | Description |
| :--- | :--- |
@ -116,8 +115,8 @@ Delete a user account with given USERNAME.
Request a backup for a user account with given USERNAME. The backup will be created in Sidekiq asynchronously, and the user will receive an email with a link to it once it's done.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
| Option | Description |
| :--- | :--- |
@ -127,21 +126,21 @@ Request a backup for a user account with given USERNAME. The backup will be crea
Remove remote accounts that no longer exist. Queries every single remote account in the database to determine if it still exists on the origin server, and if it doesn't, then remove it from the database. Accounts that have had confirmed activity within the last week are excluded from the checks, in case the server is just down.
**Version history:**
* 2.6.0 - added
* 2.8.0 - add `--dry_run`
**Version history:**\
2.6.0 - added\
2.8.0 - add `--dry-run`
| Option | Description |
| :--- | :--- |
| `--concurrency N` | The number of workers to use for this task. Defaults to N=5. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl accounts refresh` {#accounts-refresh}
Refetch remote user data and files for one or multiple accounts.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
| Option | Description |
| :--- | :--- |
@ -150,15 +149,15 @@ Refetch remote user data and files for one or multiple accounts.
| `--domain DOMAIN` | Can be provided instead of USERNAME. Operate only on remote accounts from this DOMAIN. |
| `--concurrency N` | The number of workers to use for this task. Defaults to N=5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl accounts follow` {#accounts-follow}
Force all local accounts to follow a local account specified by username.
**Version history:**
* 2.7.0 - added
* 3.0.0 - now uses USERNAME instead of ACCT
**Version history:**\
2.7.0 - added\
3.0.0 - now uses USERNAME instead of ACCT
| Option | Description |
| :--- | :--- |
@ -170,8 +169,8 @@ Force all local accounts to follow a local account specified by username.
Force all local accounts to unfollow an account specified by their address.
**Version history:**
* 2.7.0 - added
**Version history:**\
2.7.0 - added
| Option | Description |
| :--- | :--- |
@ -183,8 +182,8 @@ Force all local accounts to unfollow an account specified by their address.
Reset all follow and/or follower relationships for a local account.
**Version history:**
* 2.8.0 - added
**Version history:**\
2.8.0 - added
| Option | Description |
| :--- | :--- |
@ -196,8 +195,8 @@ Reset all follow and/or follower relationships for a local account.
Approve new registrations when instance is in approval mode.
**Version history:**
* 2.8.0 - added
**Version history:**\
2.8.0 - added
| Option | Description |
| :--- | :--- |
@ -213,15 +212,15 @@ Approve new registrations when instance is in approval mode.
Clear out the cache storage.
**Version history:**
* 2.8.1 - added
**Version history:**\
2.8.1 - added
### `tootctl cache recount` {#cache-recount}
Update hard-cached counters of TYPE by counting referenced records from scratch. It may take a very long time to finish, depending on the size of the database. Accounts will have their follower, following, and status counts refreshed. Statuses will have their reply, boost, and favourite counts refreshed.
**Version history:**
* 3.0.0 - added
**Version history:**\
3.0.0 - added
| Option | Description |
| :--- | :--- |
@ -237,34 +236,69 @@ Update hard-cached counters of TYPE by counting referenced records from scratch.
Remove all accounts from a given DOMAIN without leaving behind any records. Unlike a suspension, if the DOMAIN still exists in the wild, it means the accounts could return if they are resolved again.
**Version history:**
* 2.6.0 - added
* 2.8.0 - add `--whitelist_mode`
* 2.9.0 - remove custom emoji as well
* 3.0.0 - accept multiple domains
**Version history:**\
2.6.0 - added\
2.8.0 - add `--whitelist-mode`\
2.9.0 - remove custom emoji as well\
3.0.0 - accept multiple domains\
3.2.0 - rename `--whitelist-mode` to `--limited-federation-mode`
| Option | Description |
| :--- | :--- |
| `DOMAIN[...]` | Domains to purge, separated by space. |
| `--whitelist_mode` | Can be provided instead of DOMAIN. Instead of purging from a single domain, all accounts from domains that are not whitelisted will be removed from the database. Use this after enabling whitelist mode and defining your whitelist. |
| `--limited-federation-mode` | Can be provided instead of DOMAIN. Instead of purging from a single domain, all accounts from domains that are not allow-listed will be removed from the database. Use this after enabling limited federation mode and defining your allow-list. |
| `--concurrency N` | The number of workers to use for this task. Defaults to 5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl domains crawl` {#domains-crawl}
Crawl the known fediverse by using Mastodon REST API endpoints that expose all known peers, and collect statistics from those peers, as long as those peers support those API endpoints. When no START is given, the command uses the server's own database of known peers to seed the crawl. Returns total servers, total registered users, total active users in the last week, and total users joined in the last week.
**Version history:**
* 2.7.0 - added
* 3.0.0 - add `--exclude_suspended`
**Version history:**\
2.7.0 - added\
3.0.0 - add `--exclude-suspended`
| Option | Description |
| :--- | :--- |
| START | Optionally start from a different domain name. |
| `--concurrency N` | The number of workers to use for this task. Defaults to 50. |
| `--format FORMAT` | Control how results are returned. `summary` will print a summary. `domains` will return a newline-delimited list of all discovered peers. `json` will dump aggregated raw data. Defaults to `summary`. |
| `--exclude_suspended` | Do not include instances that you have suspended in the output. Also includes any subdomains. |
| `--exclude-suspended` | Do not include instances that you have suspended in the output. Also includes any subdomains. |
## Email domain blocks CLI {#email-domain-blocks}
{{< caption-link url="https://github.com/tootsuite/mastodon/blob/master/lib/mastodon/email_domain_blocks_cli.rb" caption="lib/mastodon/email\_domain\_blocks\_cli.rb" >}}
### `tootctl email-domain-blocks list` {#email-domain-blocks-list}
List all currently blocked email domains.
**Version history:**\
3.2.0 - added
### `tootctl email-domain-blocks add` {#email-domain-blocks-add}
Add entries to the e-mail domain blocklist.
**Version history:**\
3.2.0 - added
| Option | Description |
| :--- | :--- |
| `DOMAIN[...]` | E-mail domains to block, separated by space. |
| `--with-dns-records` | If provided, will also lookup A, AAAA, and MX records and block them as well. |
### `tootctl email-domain-blocks remove` {#email-domain-blocks-remove}
Remove entries from the e-mail domain blocklist.
**Version history:**\
3.2.0 - added
| Option | Description |
| :--- | :--- |
| `DOMAIN[...]` | E-mail domains to unblock, separated by space. |
## Emoji CLI {#emoji}
@ -274,8 +308,8 @@ Crawl the known fediverse by using Mastodon REST API endpoints that expose all k
Exports custom emoji to `export.tar.gz` at PATH.
**Version history:**
* 3.1.4 - added
**Version history:**\
3.1.4 - added
| Option | Description |
| :--- | :--- |
@ -287,8 +321,8 @@ Exports custom emoji to `export.tar.gz` at PATH.
Imports custom emoji from a .tar.gz archive at a given path. The archive should contain PNG or GIF files no larger than 50KB, and the shortcode will be set equal to the filename minus the extension, with optional prefixes and/or suffixes.
**Version history:**
* 2.5.0 - added
**Version history:**\
2.5.0 - added
| Option | Description |
| :--- | :--- |
@ -303,13 +337,13 @@ Imports custom emoji from a .tar.gz archive at a given path. The archive should
Remove all custom emoji.
**Version history:**
* 2.8.0 - added
* 3.1.0 - add `--remote_only`
**Version history:**\
2.8.0 - added\
3.1.0 - add `--remote-only`
| Option | Description |
| :--- | :--- |
| `--remote_only` | If provided, remove only from remote domains. |
| `--remote-only` | If provided, remove only from remote domains. |
## Feeds CLI {#feeds}
@ -319,8 +353,8 @@ Remove all custom emoji.
Build home and list feeds for one or all users. Feeds will be built from the database and cached in-memory with Redis. Mastodon manages home feeds for active users automatically.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
| Option | Description |
| :--- | :--- |
@ -328,14 +362,14 @@ Build home and list feeds for one or all users. Feeds will be built from the dat
| `--all` | Can be provided instead of USERNAME to refresh all local accounts' feeds. |
| `--concurrency N` | The number of workers to use for this task. Defaults to N=5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl feeds clear` {#feeds-clear}
Remove all home and list feeds from Redis.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
## Media CLI {#media}
@ -345,38 +379,38 @@ Remove all home and list feeds from Redis.
Remove locally cached copies of media attachments from other servers.
**Version history:**
* 2.5.0 - added
* 2.6.2 - show freed disk space
**Version history:**\
2.5.0 - added\
2.6.2 - show freed disk space
| Option | Description |
| :--- | :--- |
| `--days` | How old media attachments have to be before they are removed. Defaults to 7. |
| `--concurrency N` | The number of workers to use for this task. Defaults to 5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
### `tootctl media remove-orphans` {#media-remove-orphans}
Scans for files that do not belong to existing media attachments, and remove them. Please mind that some storage providers charge for the necessary API requests to list objects. Also, this operation requires iterating over every single file individually, so it will be slow.
**Version history:**
* 3.1.0 - added
* 3.1.3 - added `--prefix`
**Version history:**\
3.1.0 - added\
3.1.3 - added `--prefix`
| Option | Description |
| :--- | :--- |
| `--start_after` | The Paperclip attachment key where the loop will start. Use this option if the command was interrupted before. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--start-after` | The Paperclip attachment key where the loop will start. Use this option if the command was interrupted before. |
| `--dry-run` | Print expected results only, without performing any actions. |
| `--prefix` | Traverse only a specific prefix of files in the system. |
### `tootctl media refresh` {#media-refresh}
Refetch remote media attachments from other servers. You must specify the source of media attachments with either --status, --account, or --domain. If an attachment already exists in the database, it will not be overwritten unless you use --force.
**Version history:**
* 3.0.0 - added
* 3.0.1 - add `--force` and skip already downloaded attachments by default
**Version history:**\
3.0.0 - added\
3.0.1 - add `--force` and skip already downloaded attachments by default
| Option | Description |
| :--- | :--- |
@ -385,7 +419,7 @@ Refetch remote media attachments from other servers. You must specify the source
| `--status ID` | Local numeric ID of the status in the database. |
| `--concurrency N` | The number of workers to use for this task. Defaults to 5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
| `--force` | Force redownload the remote resource and overwrite the local attachment. |
### `tootctl media usage` {#media-usage}
@ -393,14 +427,14 @@ Refetch remote media attachments from other servers. You must specify the source
Calculate disk space consumed by Mastodon.
**Version history:**
* 3.0.1 - added
3.0.1 - added
### `tootctl media lookup` {#media-lookup}
Prompts for a media URL, then looks up where the media is displayed.
**Version history:**
* 3.1.0 - added
**Version history:**\
3.1.0 - added
## Preview Cards CLI {#preview_cards}
@ -410,15 +444,15 @@ Prompts for a media URL, then looks up where the media is displayed.
Remove local thumbnails for preview cards.
**Version history:**
* 3.0.0 - added
**Version history:**\
3.0.0 - added
| Option | Description |
| :--- | :--- |
| `--days` | How old media attachments have to be before they are removed. Defaults to 180. \(NOTE: it is not recommended to delete preview cards within the last 14 days, because preview cards will not be refetched unless the link is reposted after 2 weeks from last time.\) |
| `--concurrency N` | The number of workers to use for this task. Defaults to 5. |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |
| `--link` | Only delete link-type preview cards; leave video and photo cards untouched. |
## Search CLI {#search}
@ -430,8 +464,8 @@ Remove local thumbnails for preview cards.
Create or update an ElasticSearch index and populate it. If ElasticSearch is empty, this command will create the necessary indices and then import data from the database into those indices. This command will also upgrade indices if the underlying schema has been changed since the last run.
**Version history:**
* 2.8.0 - added
* 3.0.0 - add `--processes` for parallelization
2.8.0 - added\
3.0.0 - add `--processes` for parallelization
| Option | Description |
| :--- | :--- |
@ -445,15 +479,15 @@ Create or update an ElasticSearch index and populate it. If ElasticSearch is emp
Opens registrations.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
### `tootctl settings registrations close` {#settings-registrations-close}
Closes registrations.
**Version history:**
* 2.6.0 - added
**Version history:**\
2.6.0 - added
## Statuses CLI {#statuses}
@ -465,9 +499,9 @@ Remove unreferenced statuses from the database, such as statuses that came from
This is a computationally heavy procedure that creates extra database indices before commencing, and removes them afterward.
**Version history:**
* 2.8.0 - added
* 3.1.3 - added `--skip-media-remove`
**Version history:**\
2.8.0 - added\
3.1.3 - added `--skip-media-remove`
| Option | Description |
| :--- | :--- |
@ -482,12 +516,12 @@ This is a computationally heavy procedure that creates extra database indices be
Upgrade the storage schema to store all non-local media resources in a top-level cache directory. WARNING: This is optional, and only for deployments made before v3.1.4. This command can incur massive object storage costs due to moving potentially terabytes of data.
**Version history:**
* 3.1.4 - added
**Version history:**\
3.1.4 - added
| Option | Description |
| :--- | :--- |
| `--verbose` | Print additional information while task is processing. |
| `--dry_run` | Print expected results only, without performing any actions. |
| `--dry-run` | Print expected results only, without performing any actions. |

View File

@ -22,7 +22,8 @@ menu:
"width": 480,
"height": 270,
"image": "https://files.mastodon.social/preview_cards/images/014/179/145/original/9cf4b7cf5567b569.jpeg",
"embed_url": ""
"embed_url": "",
"blurhash": "UvK0HNkV,:s9xBR%njog0fo2W=WBS5ozofV@"
}
```
{{< endtab >}}
@ -42,7 +43,8 @@ menu:
"width": 1024,
"height": 427,
"image": "https://files.mastodon.social/preview_cards/images/014/287/139/original/651b1c6976817824.jpeg",
"embed_url": "https://live.staticflickr.com/65535/49088768431_6a4322b3bb_b.jpg"
"embed_url": "https://live.staticflickr.com/65535/49088768431_6a4322b3bb_b.jpg",
"blurhash": "UnE{@jt6M_oIAhjYs+ayT2WBf9ayRkkDXAj["
}
```
{{< endtab >}}
@ -62,33 +64,37 @@ menu:
"width": 0,
"height": 0,
"image": null,
"embed_url": ""
"embed_url": "",
"blurhash": null
}
```
{{< endtab >}}
{{< endtabs >}}
## Required attributes
## Base attributes
### `url` {#url}
### `url`
**Description:** Location of linked resource.\
**Type:** String \(URL\)\
**Version history:** Added in 1.0.0
**Version history:**\
1.0.0 - added
### `title` {#title}
### `title`
**Description:** Title of linked resource.\
**Type:** String\
**Version history:** Added in 1.0.0
**Version history:**\
1.0.0 - added
### `description` {#description}
### `description`
**Description:** Description of preview.\
**Type:** String\
**Version history:** Added in 1.0.0
**Version history:**\
1.0.0 - added
### `type` {#type}
### `type`
**Description:** The type of the preview card.\
**Type:** String \(Enumerable, oneOf\)\
@ -96,7 +102,8 @@ menu:
`photo` = Photo OEmbed\
`video` = Video OEmbed\
`rich` = iframe OEmbed. Not currently accepted, so won't show up in practice.\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
## Optional attributes
@ -104,55 +111,71 @@ menu:
**Description:** The author of the original resource.\
**Type:** String\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `author_url` {#author_url}
**Description:** A link to the author of the original resource.\
**Type:** String \(URL\)\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `provider_name` {#provider_name}
**Description:** The provider of the original resource.\
**Type:** String\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `provider_url` {#provider_url}
**Description:** A link to the provider of the original resource.\
**Type:** String \(URL\)\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `html` {#html}
### `html`
**Description:** HTML to be used for generating the preview card.\
**Type:** String \(HTML\)\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `width` {#width}
### `width`
**Description:** Width of preview, in pixels.\
**Type:** Number\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `height` {#height}
### `height`
**Description:** Height of preview, in pixels.\
**Type:** Number\
**Version history:** Added in 1.3.0
**Version history:**\
1.3.0 - added
### `image` {#image}
### `image`
**Description:** Preview thumbnail.\
**Type:** String \(URL\)\
**Version history:** Added in 1.0.0
**Version history:**\
1.0.0 - added
### `embed_url` {#embed_url}
**Description:** Used for photo embeds, instead of custom `html`.\
**Type:** String \(URL\)\
**Version history:** Added in 2.1.0
**Version history:**\
2.1.0 - added
### `blurhash`
**Description:** A hash computed by [the BlurHash algorithm](https://github.com/woltapp/blurhash), for generating colorful preview thumbnails when media has not been downloaded yet.\
**Type:** String\
**Version history:**\
3.2.0 - added
## See also