aboutsummaryrefslogtreecommitdiff
path: root/docs/administration/CLI_tasks
diff options
context:
space:
mode:
Diffstat (limited to 'docs/administration/CLI_tasks')
-rw-r--r--docs/administration/CLI_tasks/config.md19
-rw-r--r--docs/administration/CLI_tasks/database.md48
-rw-r--r--docs/administration/CLI_tasks/digest.md13
-rw-r--r--docs/administration/CLI_tasks/emoji.md30
-rw-r--r--docs/administration/CLI_tasks/instance.md30
-rw-r--r--docs/administration/CLI_tasks/relay.md30
-rw-r--r--docs/administration/CLI_tasks/uploads.md12
-rw-r--r--docs/administration/CLI_tasks/user.md94
8 files changed, 276 insertions, 0 deletions
diff --git a/docs/administration/CLI_tasks/config.md b/docs/administration/CLI_tasks/config.md
new file mode 100644
index 000000000..ce19e2402
--- /dev/null
+++ b/docs/administration/CLI_tasks/config.md
@@ -0,0 +1,19 @@
+# Transfering the config to/from the database
+
+!!! danger
+ This is a Work In Progress, not usable just yet.
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl config` and in case of source installs it's
+`mix pleroma.config`.
+
+## Transfer config from file to DB.
+
+```sh
+$PREFIX migrate_to_db
+```
+
+## Transfer config from DB to `config/env.exported_from_db.secret.exs`
+
+```sh
+$PREFIX migrate_from_db <env>
+```
diff --git a/docs/administration/CLI_tasks/database.md b/docs/administration/CLI_tasks/database.md
new file mode 100644
index 000000000..484639231
--- /dev/null
+++ b/docs/administration/CLI_tasks/database.md
@@ -0,0 +1,48 @@
+# Database maintenance tasks
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl database` and in case of source installs it's `mix pleroma.database`.
+
+## Replace embedded objects with their references
+
+Replaces embedded objects with references to them in the `objects` table. Only needs to be ran once if the instance was created before Pleroma 1.0.5. The reason why this is not a migration is because it could significantly increase the database size after being ran, however after this `VACUUM FULL` will be able to reclaim about 20% (really depends on what is in the database, your mileage may vary) of the db size before the migration.
+
+```sh
+$PREFIX remove_embedded_objects [<options>]
+```
+
+### Options
+- `--vacuum` - run `VACUUM FULL` after the embedded objects are replaced with their references
+
+## Prune old remote posts from the database
+
+This will prune remote posts older than 90 days (configurable with [`config :pleroma, :instance, remote_post_retention_days`](../../configuration/cheatsheet.md#instance)) from the database, they will be refetched from source when accessed.
+
+!!! note
+ The disk space will only be reclaimed after `VACUUM FULL`
+
+```sh
+$PREFIX pleroma.database prune_objects [<options>]
+```
+
+### Options
+- `--vacuum` - run `VACUUM FULL` after the objects are pruned
+
+## Create a conversation for all existing DMs
+
+Can be safely re-run
+
+```sh
+$PREFIX bump_all_conversations
+```
+
+## Remove duplicated items from following and update followers count for all users
+
+```sh
+$PREFIX update_users_following_followers_counts
+```
+
+## Fix the pre-existing "likes" collections for all objects
+
+```sh
+$PREFIX fix_likes_collections
+```
diff --git a/docs/administration/CLI_tasks/digest.md b/docs/administration/CLI_tasks/digest.md
new file mode 100644
index 000000000..547702031
--- /dev/null
+++ b/docs/administration/CLI_tasks/digest.md
@@ -0,0 +1,13 @@
+# Managing digest emails
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl digest` and in case of source installs it's `mix pleroma.digest`.
+
+## Send digest email since given date (user registration date by default) ignoring user activity status.
+
+```sh
+$PREFIX test <nickname> [<since_date>]
+```
+
+Example:
+```sh
+$PREFIX test donaldtheduck 2019-05-20
+```
diff --git a/docs/administration/CLI_tasks/emoji.md b/docs/administration/CLI_tasks/emoji.md
new file mode 100644
index 000000000..eee02f2ef
--- /dev/null
+++ b/docs/administration/CLI_tasks/emoji.md
@@ -0,0 +1,30 @@
+# Managing emoji packs
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl emoji` and in case of source installs it's `mix pleroma.emoji`.
+
+## Lists emoji packs and metadata specified in the manifest
+
+```sh
+$PREFIX ls-packs [<options>]
+```
+
+### Options
+- `-m, --manifest PATH/URL` - path to a custom manifest, it can either be an URL starting with `http`, in that case the manifest will be fetched from that address, or a local path
+
+## Fetch, verify and install the specified packs from the manifest into `STATIC-DIR/emoji/PACK-NAME`
+```sh
+$PREFIX get-packs [<options>] <packs>
+```
+
+### Options
+- `-m, --manifest PATH/URL` - same as [`ls-packs`](#ls-packs)
+
+## Create a new manifest entry and a file list from the specified remote pack file
+```sh
+$PREFIX gen-pack PACK-URL
+```
+Currently, only .zip archives are recognized as remote pack files and packs are therefore assumed to be zip archives. This command is intended to run interactively and will first ask you some basic questions about the pack, then download the remote file and generate an SHA256 checksum for it, then generate an emoji file list for you.
+
+ The manifest entry will either be written to a newly created `index.json` file or appended to the existing one, *replacing* the old pack with the same name if it was in the file previously.
+
+ The file list will be written to the file specified previously, *replacing* that file. You _should_ check that the file list doesn't contain anything you don't need in the pack, that is, anything that is not an emoji (the whole pack is downloaded, but only emoji files are extracted).
diff --git a/docs/administration/CLI_tasks/instance.md b/docs/administration/CLI_tasks/instance.md
new file mode 100644
index 000000000..ab0b68ad0
--- /dev/null
+++ b/docs/administration/CLI_tasks/instance.md
@@ -0,0 +1,30 @@
+# Managing instance configuration
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl instance` and in case of source installs it's `mix pleroma.instance`.
+
+## Generate a new configuration file
+```sh
+$PREFIX gen [<options>]
+```
+
+If any of the options are left unspecified, you will be prompted interactively.
+
+### Options
+- `-f`, `--force` - overwrite any output files
+- `-o <path>`, `--output <path>` - the output file for the generated configuration
+- `--output-psql <path>` - the output file for the generated PostgreSQL setup
+- `--domain <domain>` - the domain of your instance
+- `--instance-name <instance_name>` - the name of your instance
+- `--admin-email <email>` - the email address of the instance admin
+- `--notify-email <email>` - email address for notifications
+- `--dbhost <hostname>` - the hostname of the PostgreSQL database to use
+- `--dbname <database_name>` - the name of the database to use
+- `--dbuser <username>` - the user (aka role) to use for the database connection
+- `--dbpass <password>` - the password to use for the database connection
+- `--rum <Y|N>` - Whether to enable RUM indexes
+- `--indexable <Y|N>` - Allow/disallow indexing site by search engines
+- `--db-configurable <Y|N>` - Allow/disallow configuring instance from admin part
+- `--uploads-dir <path>` - the directory uploads go in when using a local uploader
+- `--static-dir <path>` - the directory custom public files should be read from (custom emojis, frontend bundle overrides, robots.txt, etc.)
+- `--listen-ip <ip>` - the ip the app should listen to, defaults to 127.0.0.1
+- `--listen-port <port>` - the port the app should listen to, defaults to 4000
diff --git a/docs/administration/CLI_tasks/relay.md b/docs/administration/CLI_tasks/relay.md
new file mode 100644
index 000000000..aa44617df
--- /dev/null
+++ b/docs/administration/CLI_tasks/relay.md
@@ -0,0 +1,30 @@
+# Managing relays
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl relay` and in case of source installs it's `mix pleroma.relay`.
+
+## Follow a relay
+```sh
+$PREFIX follow <relay_url>
+```
+
+Example:
+```sh
+$PREFIX follow https://example.org/relay
+```
+
+## Unfollow a remote relay
+
+```sh
+$PREFIX unfollow <relay_url>
+```
+
+Example:
+```sh
+$PREFIX unfollow https://example.org/relay
+```
+
+## List relay subscriptions
+
+```sh
+$PREFIX list
+```
diff --git a/docs/administration/CLI_tasks/uploads.md b/docs/administration/CLI_tasks/uploads.md
new file mode 100644
index 000000000..71800e341
--- /dev/null
+++ b/docs/administration/CLI_tasks/uploads.md
@@ -0,0 +1,12 @@
+# Managing uploads
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl uploads` and in case of source installs it's `mix pleroma.uploads`.
+
+## Migrate uploads from local to remote storage
+```sh
+$PREFIX migrate_local <target_uploader> [<options>]
+```
+### Options
+- `--delete` - delete local uploads after migrating them to the target uploader
+
+A list of available uploaders can be seen in [Configuration Cheat Sheet](../../configuration/cheatsheet.md#pleromaupload)
diff --git a/docs/administration/CLI_tasks/user.md b/docs/administration/CLI_tasks/user.md
new file mode 100644
index 000000000..cf120f2c9
--- /dev/null
+++ b/docs/administration/CLI_tasks/user.md
@@ -0,0 +1,94 @@
+# Managing users
+
+Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl user` and in case of source installs it's `mix pleroma.user`.
+
+## Create a user
+```sh
+$PREFIX new <nickname> <email> [<options>]
+```
+
+### Options
+- `--name <name>` - the user's display name
+- `--bio <bio>` - the user's bio
+- `--password <password>` - the user's password
+- `--moderator`/`--no-moderator` - whether the user should be a moderator
+- `--admin`/`--no-admin` - whether the user should be an admin
+- `-y`, `--assume-yes`/`--no-assume-yes` - whether to assume yes to all questions
+
+## Generate an invite link
+```sh
+$PREFIX invite [<options>]
+```
+
+### Options
+- `--expires-at DATE` - last day on which token is active (e.g. "2019-04-05")
+- `--max-use NUMBER` - maximum numbers of token uses
+
+## List generated invites
+```sh
+$PREFIX invites
+```
+
+## Revoke invite
+```sh
+$PREFIX revoke_invite <token_or_id>
+```
+
+## Delete a user
+```sh
+$PREFIX rm <nickname>
+```
+
+## Delete user's posts and interactions
+```sh
+$PREFIX delete_activities <nickname>
+```
+
+## Sign user out from all applications (delete user's OAuth tokens and authorizations)
+```sh
+$PREFIX sign_out <nickname>
+```
+
+## Deactivate or activate a user
+```sh
+$PREFIX toggle_activated <nickname>
+```
+
+## Unsubscribe local users from a user and deactivate the user
+```sh
+$PREFIX unsubscribe NICKNAME
+```
+
+## Unsubscribe local users from an instance and deactivate all accounts on it
+```sh
+$PREFIX unsubscribe_all_from_instance <instance>
+```
+
+## Create a password reset link for user
+```sh
+$PREFIX reset_password <nickname>
+```
+
+## Set the value of the given user's settings
+```sh
+$PREFIX set <nickname> [<options>]
+```
+### Options
+- `--locked`/`--no-locked` - whether the user should be locked
+- `--moderator`/`--no-moderator` - whether the user should be a moderator
+- `--admin`/`--no-admin` - whether the user should be an admin
+
+## Add tags to a user
+```sh
+$PREFIX tag <nickname> <tags>
+```
+
+## Delete tags from a user
+```sh
+$PREFIX untag <nickname> <tags>
+```
+
+## Toggle confirmation status of the user
+```sh
+$PREFIX toggle_confirmed <nickname>
+```