From dfae0050af385786c5799ee886de315f69d36a78 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 19:46:30 +0300 Subject: Move out of Gitlab Wiki I understand that this change is quite unreadable and hard to review, sorry for forgetting to do atomic commits. This patch does not change too much content wise, it just * Gets everything from gitlab wiki * Removes some specific gitlab hacks * Formats all documentation file names to be in snake case so they look the same way as our code does --- docs/admin/admin_tasks.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ docs/admin/backup.md | 15 +++++++++++++++ docs/admin/updating.md | 9 +++++++++ 3 files changed, 68 insertions(+) create mode 100644 docs/admin/admin_tasks.md create mode 100644 docs/admin/backup.md create mode 100644 docs/admin/updating.md (limited to 'docs/admin') diff --git a/docs/admin/admin_tasks.md b/docs/admin/admin_tasks.md new file mode 100644 index 000000000..883095cdb --- /dev/null +++ b/docs/admin/admin_tasks.md @@ -0,0 +1,44 @@ +# Admin tasks +## Important + +If your instance is running in prod mode (most likely it is) make sure to prefix every command with `MIX_ENV=prod`. + +## User management + +It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.user` + +### Adding users + +Use `mix pleroma.user invite` to generate an invite link for a new user. + +Also, `mix pleroma.user new NICKNAME EMAIL [OPTION...]` can be used to register an account. + +### Making a user a moderator/admin/locked + +Run `mix pleroma.user set username --[no-]moderator` to make user a moderator or remove the moderator status. + +To make the user admin or locked use `mix pleroma.user set NICKNAME --[no-]admin` and `mix pleroma.user set NICKNAME --[no-]locked` respectively + +### Resetting a password + +Run `mix pleroma.user reset_password NICKNAME` to generate a password reset link that you can then send to the user. + +### Banning users + +Run `mix pleroma.user rm NICKNAME` to remove a local account. + +To deactivate(block from the server completely)/reactivate local and remote user accounts run: + +`mix pleroma.user toggle_activated NICKNAME@instancename` + +## Relay managment + +It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.relay` + +### Following a relay + +Run `mix pleroma.relay follow RELAY_URL` + +### Unfollowing a relay + +Run `mix pleroma.relay unfollow RELAY_URL` diff --git a/docs/admin/backup.md b/docs/admin/backup.md new file mode 100644 index 000000000..b373996f5 --- /dev/null +++ b/docs/admin/backup.md @@ -0,0 +1,15 @@ +# Backup your instance + +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Run `sudo -Hu postgres pg_dump -d --format=custom -f ` +4. Copy `pleroma.pgdump`, `config/prod.secret.exs` and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too. +5. Restart the Pleroma service. + +## Restore your instance + +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Copy the above mentioned files back to their original position. +4. Run `sudo -Hu postgres pg_restore -d -v -1 ` +5. Restart the Pleroma service. diff --git a/docs/admin/updating.md b/docs/admin/updating.md new file mode 100644 index 000000000..33ce1ab4f --- /dev/null +++ b/docs/admin/updating.md @@ -0,0 +1,9 @@ +# Updating your instance +1. Stop the Pleroma service. +2. Go to the working directory of Pleroma (default is `/opt/pleroma`) +3. Run `git pull`. This pulls the latest changes from upstream. +4. Run `mix deps.get`. This pulls in any new dependencies. +5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. +6. Restart the Pleroma service. + +[^1]: Prefix with `MIX_ENV=prod` to run it using the production config file. -- cgit v1.2.3 From e4601b2c1d5f7c2d5d8acf947b9f8dc8beee1747 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 28 Mar 2019 20:16:14 +0300 Subject: remove admin tasks as they have their page in mix tasks category already --- docs/admin/admin_tasks.md | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 docs/admin/admin_tasks.md (limited to 'docs/admin') diff --git a/docs/admin/admin_tasks.md b/docs/admin/admin_tasks.md deleted file mode 100644 index 883095cdb..000000000 --- a/docs/admin/admin_tasks.md +++ /dev/null @@ -1,44 +0,0 @@ -# Admin tasks -## Important - -If your instance is running in prod mode (most likely it is) make sure to prefix every command with `MIX_ENV=prod`. - -## User management - -It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.user` - -### Adding users - -Use `mix pleroma.user invite` to generate an invite link for a new user. - -Also, `mix pleroma.user new NICKNAME EMAIL [OPTION...]` can be used to register an account. - -### Making a user a moderator/admin/locked - -Run `mix pleroma.user set username --[no-]moderator` to make user a moderator or remove the moderator status. - -To make the user admin or locked use `mix pleroma.user set NICKNAME --[no-]admin` and `mix pleroma.user set NICKNAME --[no-]locked` respectively - -### Resetting a password - -Run `mix pleroma.user reset_password NICKNAME` to generate a password reset link that you can then send to the user. - -### Banning users - -Run `mix pleroma.user rm NICKNAME` to remove a local account. - -To deactivate(block from the server completely)/reactivate local and remote user accounts run: - -`mix pleroma.user toggle_activated NICKNAME@instancename` - -## Relay managment - -It is possible to obtain a list of all available tasks with their options by executing `mix help pleroma.relay` - -### Following a relay - -Run `mix pleroma.relay follow RELAY_URL` - -### Unfollowing a relay - -Run `mix pleroma.relay unfollow RELAY_URL` -- cgit v1.2.3 From b46e6f0949eb88be064515a4d3713759155945e9 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:10:47 +0300 Subject: Fix backup/restore page to have proper headings --- docs/admin/backup.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'docs/admin') diff --git a/docs/admin/backup.md b/docs/admin/backup.md index b373996f5..2c70e7bf8 100644 --- a/docs/admin/backup.md +++ b/docs/admin/backup.md @@ -1,4 +1,6 @@ -# Backup your instance +# Backup/Restore your instance + +## Backup 1. Stop the Pleroma service. 2. Go to the working directory of Pleroma (default is `/opt/pleroma`) @@ -6,7 +8,7 @@ 4. Copy `pleroma.pgdump`, `config/prod.secret.exs` and the `uploads` folder to your backup destination. If you have other modifications, copy those changes too. 5. Restart the Pleroma service. -## Restore your instance +## Restore 1. Stop the Pleroma service. 2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -- cgit v1.2.3 From bff8cde0cf01e8b474ad3f5915c3716e885f52b3 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:23:32 +0300 Subject: Instruct to stop the service only after git pulling and getting deps to minimize downtimes --- docs/admin/updating.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/admin') diff --git a/docs/admin/updating.md b/docs/admin/updating.md index 33ce1ab4f..34166fb8d 100644 --- a/docs/admin/updating.md +++ b/docs/admin/updating.md @@ -1,8 +1,8 @@ # Updating your instance -1. Stop the Pleroma service. -2. Go to the working directory of Pleroma (default is `/opt/pleroma`) -3. Run `git pull`. This pulls the latest changes from upstream. -4. Run `mix deps.get`. This pulls in any new dependencies. +1. Go to the working directory of Pleroma (default is `/opt/pleroma`) +2. Run `git pull`. This pulls the latest changes from upstream. +3. Run `mix deps.get`. This pulls in any new dependencies. +4. Stop the Pleroma service. 5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. 6. Restart the Pleroma service. -- cgit v1.2.3 From 949cfde065dbfc4d8ba1824f4cd3675d603e137e Mon Sep 17 00:00:00 2001 From: rinpatch Date: Mon, 1 Apr 2019 16:26:46 +0300 Subject: restart makes no sense here as we instructed to stop the service before --- docs/admin/updating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/admin') diff --git a/docs/admin/updating.md b/docs/admin/updating.md index 34166fb8d..84e6ef18d 100644 --- a/docs/admin/updating.md +++ b/docs/admin/updating.md @@ -4,6 +4,6 @@ 3. Run `mix deps.get`. This pulls in any new dependencies. 4. Stop the Pleroma service. 5. Run `mix ecto.migrate`[^1]. This task performs database migrations, if there were any. -6. Restart the Pleroma service. +6. Start the Pleroma service. [^1]: Prefix with `MIX_ENV=prod` to run it using the production config file. -- cgit v1.2.3