From 86cc1927e5a34e583f9203e47dc91b51c17277e7 Mon Sep 17 00:00:00 2001 From: Jeder Date: Sun, 13 Aug 2023 16:52:57 +0200 Subject: [PATCH] add "Adding another admin section" to post-install.md, and cosmetics --- docs/install.md | 19 +++++++++++++++++++ docs/post-install.md | 26 +++++++++++++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index ddd4513d3..77f3f8922 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,15 +1,18 @@ # Installing Iceshrimp + This document will guide you through manual installation of Iceshrimp on dev branch, for main branch, use Firefish's installation guide. ## Dependencies ### Build + - **Rust** 1.68+ - C/C++ compiler like **GCC** or **Clang** - Build tools like **make** - **Python 3** ### Required + - [**Node.js**](https://nodejs.org) v18.16.0+ (v20 recommended) - [**PostgreSQL**](https://www.postgresql.org/) 12+ - [**Redis**](https://redis.io/) 6+ @@ -19,6 +22,7 @@ This document will guide you through manual installation of Iceshrimp on dev bra - Caddy ### Optional + - [**FFmpeg**](https://ffmpeg.org/) for video transcoding - Full text search (Choose one) Iceshrimp has full text search powered by Postgres by default, however it's very slow, and these are alternatives for that @@ -33,21 +37,25 @@ This document will guide you through manual installation of Iceshrimp on dev bra ## Preparations ### Download repository + ```sh git clone https://iceshrimp.dev/iceshrimp/iceshrimp ``` ### Creating a new user + In case you want to run Iceshrimp as a different user, run `adduser --disabled-password --disabled-login iceshrimp` Following steps will require you to run them as the user you have made, so use `su - iceshrimp`, or `sudo -iu iceshrimp`, or whatever else method in order to temporarily log in as that user. ### Configuration + - Copy `.config/example.yml` to `.config/default.yml` - Edit `.config/default.yml` with text editor - Make sure to set PostgreSQL and Redis section correctly - Make sure to set/uncomment caching server and/or text search sections if you have chosen to set up these ## Installing project dependencies + ```sh corepack enable corepack prepare yarn@stable --activate @@ -56,11 +64,14 @@ yarn ## Building Iceshrimp + ```sh yarn build ``` ## Database + ### Creating database + This will create a postgres user with your password and database, while also granting that user all privileges on database. Using `psql` prompt: ```sh @@ -74,19 +85,23 @@ grant all privileges on database iceshrimp to iceshrimp; ``` ### First migration + In order for Iceshrimp to work properly, you need to initialise the database using ```bash yarn run init ``` ## Setting up Webproxy + ### Nginx + - Run `sudo cp docs/examples/iceshrimp.nginx.conf /etc/nginx/sites-available/ && cd /etc/nginx/sites-available/` - Edit `iceshrimp.nginx.conf` to reflect your server properly - Run `sudo ln -s ./iceshrimp.nginx.conf ../sites-enabled/iceshrimp.nginx.conf` - Run `sudo nginx -t` to check that the config is valid, then restart the nginx service. ### Caddy + - Add the following to your Caddyfile, and replace `example.com` with your domain ``` example.com { @@ -97,11 +112,13 @@ example.com { ## Running Iceshrimp ### Running manually + - Start Iceshrimp by running `NODE_ENV=production yarn run start`. If this is your first run, after Iceshrimp has started successfully, you'll be able to go to the URL you have specified in `.config/default.yml` and create first user. - To stop the server, use `Ctrl-C`. ### Running using systemd + - Run `sudo cp docs/examples/iceshrimp.service /etc/systemd/system/` - Edit `/etc/systemd/system/iceshrimp.service` with text editor, and change `User`, `WorkingDir`, `ExecStart` if necessary. - Run `sudo systemctl daemon-reload` @@ -109,6 +126,7 @@ If this is your first run, after Iceshrimp has started successfully, you'll be a - (Optional) Check if instance is running using `sudo systemctl status iceshrimp` ### Updating Iceshrimp + Shut down Iceshrimp and then run these commands ```sh @@ -123,4 +141,5 @@ yarn build && yarn migrate Start Iceshrimp back up ## Post-install + See [post-install](post-install.md). diff --git a/docs/post-install.md b/docs/post-install.md index e7e2dfca2..e9a97a2fa 100644 --- a/docs/post-install.md +++ b/docs/post-install.md @@ -1,30 +1,54 @@ # Post-install + This document describes things you can do after successfully installing Iceshrimp. ## Automatic translation + ### DeepL + - Create a Free or Pro API account on [DeepL's website](https://www.deepl.com/pro#developer) - Copy the API key to Control Panel > General > DeepL Translation - Check the "Pro account" switch if you registered for paid account ### LibreTranslate + - Install [LibreTranslate](https://libretranslate.com/) - Get an API URL and API key, copy and paste them into Control Panel > General > Libre Translate ## Enabling push notifications + - Run `npx web-push generate-vapid-keys` - - `docker compose exec web npx web-push generate-vapid-keys` if using Docker Compose + - Docker Compose users: `docker compose exec web npx web-push generate-vapid-keys` - Put public and private keys into Control Panel > General > Service Worker ## Object Storage (S3) + Recommended if using Docker - Set up a bucket on provider's website (for example: AWS, Backblaze B2, Wasabi, minio or Google Cloud) - Go to Control Panel > Object Storage and follow instructions ## Customising assets, locale + - To add custom CSS for all users, edit `custom/assets/instance.css`. - To add static assets (such as images for the splash screen), place them in the `custom/assets/` directory. They'll then be available on https://example.com/static-assets/filename.ext. - To add custom locales, place them in the `custom/locales/` directory. If you name your custom locale the same as an existing locale, it will overwrite it. If you give it a unique name, it will be added to the list. Also make sure that the first part of the filename matches the locale you're basing it on. (Example: en-FOO.yml) - To add custom error images, place them in the `custom/assets/badges` directory, replacing the files already there. - To add custom sounds, place only mp3 files in the `custom/assets/sounds` directory. - To update custom assets without rebuilding, just run `yarn run gulp`. + +## Another admin account + +- Go to desired user's page, click 3 dots in upper right corner > About > Moderation, turn on "Moderator" +- Go back to Overview and copy their ID +- Run `psql -d iceshrimp`, replace `iceshrimp` with a name of your database if needed + - If instance is ran by a different system user: Prepend that command with `sudo -U iceshrimp`, replace `iceshrimp` with a name of that user if needed + - Docker Compose users: `docker compose exec db psql -d iceshrimp -U iceshrimp`, replace both `iceshrimp` with name of your db, and username owning that db respectively, if needed +- Run `UPDATE "user" SET "isAdmin" = true WHERE id='999999';`, where `999999` is the copied ID of that user +- Restart your Iceshrimp server + +### Removing admin privileges +- Get ID of the user +- Run `psql` the same way when adding admin +- Run `UPDATE "user" SET "isAdmin" = false WHERE id='999999';`, where `999999` is the copied ID of that user +- Restart your Iceshrimp server +- Remove moderator privileges of the user