changed readme

This commit is contained in:
Paul Wilde 2022-11-11 20:34:47 +00:00
parent 5e2e529b28
commit f2dd9eec89

172
README.md
View file

@ -1,163 +1,57 @@
# Pleroma
# Rebased
[Pleroma](https://pleroma.social/) is a federated social networking platform, compatible with GNU social and other OStatus implementations. It is free software licensed under the AGPLv3.
[Rebased](https://soapbox.pub/2022/08/19/soapbox-be-is-now-rebased/) is a federated social networking
platform, compatible with Mastodon, Pleroma, GNU Social, and other ActivityPub implementations. It is free software licensed uner the AGPLv3
It actually consists of two components: a backend, named simply Pleroma, and a user-facing frontend, named Pleroma-FE.
It actually consists of two components: a backend, named Rebased, and a user-facing frontend, named Soapbox.
Its main advantages are its lightness and speed.
![Pleroma](https://i.imgur.com/VftiTlR.png)
_Pleromians trying to understand the memes_
![Rebased](https://media.soapbox.pub/uploads/2022/08/signal-2022-08-18-153539_002.png)
## Features
This Podman set up is adapted from [angristan's docker-pleroma](https://github.com/angristan/docker-pleroma). I muddled my way through the set up to get a final working set up. There may be some missed steps in the below, but ultimately this is what lead me to getting things running nicely.
A quick further note. I have included the `config :pleroma, configurable_from_database: true` configuration and the `pleroma_ctl config migrate_to_db` procedure. This means a lot of the actual config.exs parts can be eliminated completely, but I've left them in for clarity.
- adapted from [angristan/docker-pleroma](https://github.com/angristan/docker-pleroma)
- Based on the elixir:alpine image
- Ran as an unprivileged user
- It works great
As with Angristan's Docker-Pleroma: this is not a reusable (e.g. It can't be uploaded to the Docker Hub), because for now Pleroma needs to compile the configuration. 😢
Thus you will need to build the image yourself, but I explain how to do it below.
This podman set up is configured using the official Dockerfile at [Rebased GitLab](https://gitlab.com/soapbox-pub/rebased)
and working through each script will allow you to set up your own Rebased server.
## Build-time variables
- **`PLEROMA_VER`** : Pleroma version (latest commit of the [`develop` branch](https://git.pleroma.social/pleroma/pleroma) by default)
- **`GID`**: group id (default: `911`)
- **`UID`**: user id (default: `911`)
## Usage
Variables are entered into `script_config.sh` - (copy `script_config_sample.sh`),
the key variables being `PG_USER`, `PG_PASS`, `PG_HOST`, `PG_NAME` if you have a database running elsewhere
### Installation
Create a folder for your Pleroma instance. Inside, you should have `Dockerfile` and `podman-run.sh` from this repo.
Each script is numbered which give the order in which they need to be run - scripts with `5` in the name should only need to be run once.
- `00-create-pod.sh` - this creates a simple pod, in which the other containers will exist. It will also open port 5000 for incoming web access and map the folders in which persistent data will reside.
- `10-build-rebased.sh` - this will clone the current develop git repo and build an image from it. Re-running this script will effectively update the version of Rebased. This may take 10 minutes or so to run as it compiles the software.
- `20-create-db.sh` - this will create a postgres container in which the database will exist
- `30-run-rebased.sh` - this creates the main Rebased container and starts the web server on port 5000 (you'll need a reverse proxy (HAProxy, httpd, nginx, etc.) to publish it). At start up, this will check the database and create the appropriate tables and extensions so things will work.
- `35-gen-config.sh` - YOU SHOULD ONLY NEED TO RUN THIS ONCE. Will generate a `generated_config.exs` file. Make sure you set the port number correctly (5000, not 4000). Once generated, it should be renamed to `prod.secret.exs` to make it available at run-time
- at this point you should re-run `30-run-rebased.sh`
- Now, you're instance should be running on your device at port 5000 - test it and find out.
- `40-install-soapbox.sh` - this installs the [Soapbox](https://soapbox.pub/) front end - which is where you will log in and ultimately use the system.
You should change the `POSTGRES_PASSWORD` variable in the `podman-run.sh` file.
Once the above steps are complete, you're nearly ready to go! The final steps are to
1. Create your admin user
2. Configure your reverse proxy
Create the upload and config folder and give write permissions for the uploads:
The `podman-run.sh` script does this automatically.
### Create your admin user
You'll need to create an admin user so you can log in and configure more users and settings.
Simply run
```sh
mkdir uploads config
chown -R 911:911 uploads
podman exec rebased-web /opt/pleroma/bin/pleroma_ctl user new <username> <email@address.com> --admin
```
This will generate the user, set it up as admin, and provide a password reset link. Go to this password reset link to set the new password and you're done!
Pleroma needs the `citext` PostgreSQL extension, here is how to add it:
The `podman-run.sh` script does this automatically when run with the `db-setup` argument.
```sh
./podman-run.sh db-setup
```
This creates a pod and the postgresql container then runs the below
```sh
"You don't need to do this bit"
podman exec -i pleroma-db psql -U pleroma -c "CREATE EXTENSION IF NOT EXISTS citext;"
"You don't need to do that bit"
```
Configure Pleroma. Copy the following to `config/secret.exs`:
```exs
use Mix.Config
config :pleroma, Pleroma.Web.Endpoint,
http: [ ip: {0, 0, 0, 0}, ],
url: [host: "pleroma.domain.tld", scheme: "https", port: 443],
secret_key_base: "<use 'openssl rand -base64 48' to generate a key>"
config :pleroma, :instance,
name: "Pleroma",
email: "admin@email.tld",
limit: 5000,
registrations_open: true
config :pleroma, :media_proxy,
enabled: false,
redirect_on_failure: true,
base_url: "https://cache.domain.tld"
# Configure your database
config :pleroma, Pleroma.Repo,
adapter: Ecto.Adapters.Postgres,
username: "pleroma",
password: "pleroma",
database: "pleroma",
hostname: "postgres",
pool_size: 10
```
You need to change at least:
- `host`
- `secret_key_base`
- `email`
Make sure your PostgreSQL parameters are ok.
You can now build the image. 2 way of doing it:
Again, the `podman-run.sh` script has runtime parameters to do this.
```sh
./podman-run.sh build-setup
```
This builds the container image and does the following:
Sets up the database:
```sh
"You don't need to do this"
podman exec pleroma-web mix ecto.migrate
```
and also... migrates config to the DB
```sh
podman exec pleroma-web /pleroma/bin/pleroma_ctl config migrate_to_db
"You don't need to do that"
```
Get your web push keys and copy them to `secret.exs`:
Again, the `podman-run.sh` script has runtime parameters to do this.
```sh
./podman-run.sh gen-keypair
```
Which sets up the containers again and runs the following:
```sh
"You don't need to do this"
podman exec pleroma-web mix web_push.gen.keypair
"You don't need to do that"
```
Put the output in your secret.exs (may not be necessary due to DB migration of config, but I've left it here for clarity again)
You will need to build the image again, to pick up your updated `secret.exs` file:
Once again, `podman-run.sh` has a parameter for it:
```sh
./podman-run.sh final-build
```
You can now launch your instance:
```sh
podman pod start pleroma-pod
```
Check if everything went well with:
```sh
podman logs -f pleroma-web
```
You can now setup a HAProxy or Nginx reverse proxy in a container or on your host by using the [example Nginx config](https://git.pleroma.social/pleroma/pleroma/blob/develop/installation/pleroma.nginx).
#### Configure your reverse proxy
This will differ from device to device - but check some of the configs in the [Rebased GitLab Repo](https://gitlab.com/soapbox-pub/rebased/-/tree/develop/installation) for further information.
### Congratulations!
If all has gone well, you should be done. Well done. Now get out there and talk to some people!
## Final Notes
As with anything, I've only tested this on my systems, and the process of going through getting things working may have meant some steps are missing from this guide. At some point I will test this process again to ensure the script works well, but if anyone has any queries about it then let me know.
As with anything, I've only tested this on my systems, I have tried my best to re-run these scripts to ensure all events are covered, but I may have missed some.
If you do have troubles, either create an issue here, or contact me on the Fediverse at
[@paul@notnull.click](https://notnull.click/@paul) and I'll try to help.
## Other Container images
Here are other Pleroma Container images that helped me build mine:
- [angristan/docker-pleroma](https://github.com/angristan/docker-pleroma) - which this repo is adapted from
- [potproject/docker-pleroma](https://github.com/potproject/docker-pleroma)
- [rysiek/docker-pleroma](https://git.pleroma.social/rysiek/docker-pleroma)
- [RX14/iscute.moe](https://github.com/RX14/kurisu.rx14.co.uk/blob/master/services/iscute.moe/pleroma/Dockerfile)