Compare commits

..

No commits in common. "3859c4bbcf462a442c5b26be03079a9f65329b02" and "2edf5c9a16905bfcffd403d60e5d58c614c9833f" have entirely different histories.

2 changed files with 5 additions and 85 deletions

View file

@ -8,12 +8,10 @@ The main differences between this and the upstream repository are
- Automatically builds the Akkoma backend when building the Docker image, instead of requiring complex commands after pulling/building images
- Files/directories to mount are minified and completely separated from the repository files, allowing better control over file permissions
- Has an actual Docker entry point, rather than a command that pretends to be an entry point
- Includes out-of-the-box support for [PGroonga](https://pgroonga.github.io/), the fast and accurate full-text search extension for PostgreSQL
- Has out-of-the-box support for PGroonga, the fast and accurate full-text search extension for PostgreSQL
- Supports Podman quite well
## How to setup (Podman Rootless)
_You don't need to replicate backslashes followed by line breaks. They mean "Ignore the next line break" and are only used for better readability. `a \<line break> b \<line break> c` is the same as `a b c`._
## How to Setup (Podman Rootless)
### 0. Requirements
@ -63,20 +61,6 @@ podman run -d \
postgres:14-alpine
```
If you want to use PGroonga, run the command below instead.
```sh
podman run -d \
--pod akkoma \
--restart unless-stopped \
--name akkoma-db \
-e POSTGRES_DB=YOUR_DB_NAME \
-e POSTGRES_USER=YOUR_DB_USER \
-e POSTGRES_PASSWORD=YOUR_DB_PASS \
-v ${PWD}/docker-db/:/var/lib/postgresql/data/:Z \
groonga/pgroonga:3.1.1-alpine-14
```
### 4. Setting up the backend
```sh
@ -98,26 +82,7 @@ podman exec -it akkoma-web \
--output /etc/akkoma/config.exs
```
A few notes on setup
- Make sure your database hostname is set correctly (e.g. localhost)
- Make sure your database password is also set correctly (don't leave it auto-generated)
- You should set the IP to listen on to 0.0.0.0
### 4.1. Apply the optional PGroonga migration
Make sure you apply the migration **before** the first restart of the container, otherwise you will be stuck in a loop of restarts.
_To apply the migration after the first restart, please refer to [the guide down below](#switch-to-pgroonga)._
```sh
podman exec -it akkoma-web \
pleroma_ctl \
migrate \
--migrations-path priv/repo/optional_migrations/pgroonga
```
You can revert the applied changes anytime by replacing `migrate` with `rollback`.
You will be asked a few questions. Make sure the database password is not `[autogenerated]`.
### 5. Test your setup
@ -155,52 +120,7 @@ podman exec -it akkoma-web \
--admin
```
Follow the printed link to set your password.
### 8. Optional steps
#### Switch to PGroonga
Before moving forward, make sure you have stopped the backend for safety.
```sh
podman stop akkoma-web
```
After stopping the backend, change `config :pleroma, :database, pgroonga_enabled` to `true`.
```ex
config :pleroma, :database,
rum_enabled: false,
pgroonga_enabled: true # set this option to true
```
If you have command history enabled in your shell, all you need to do is remove the `--name NAME` option and add `pleroma_ctl migrate --migrations-path priv/repo/optional_migrations/pgroonga` to the end of the command.
```sh
podman run -d \
--pod akkoma-pod \
--restart unless-stopped \ # this option is optional (bruh)
# --name akkoma-web \ # make sure to remove this option to avoid name conflict
-e DB_NAME=YOUR_DB_NAME \
-e DB_USER=YOUR_DB_USER \
-e DB_PASS=YOUR_DB_PASS \
-v ${PWD}/static/:/var/lib/akkoma/static/:Z \
-v ${PWD}/uploads/:/var/lib/akkoma/uploads/:Z \
-v ${PWD}/etc/:/etc/akkoma/:Z \
akkoma \
pleroma_ctl \
migrate \
--migrations-path priv/repo/optional_migrations/pgroonga
```
You can revert the applied changes anytime by replacing `migrate` with `rollback`.
Don't forget to start the container you stopped at the beginning of this guide.
```sh
podman start akkoma-web
```
Open the printed link to set your password.
---

View file

@ -8,7 +8,7 @@ if [ "$1" = 'pleroma' ] || [ "$1" = 'pleroma_ctl' ]; then
done
fi
if [ "$1" = 'pleroma' ] && [ "$2" = 'start' ]; then
if [ "$1" = 'pleroma' ]; then
echo "-- Running migrations..."
pleroma_ctl migrate