From a9f25074251e0d1fa48532d5d70210625e29b821 Mon Sep 17 00:00:00 2001 From: Tim Coombs Date: Thu, 1 Feb 2024 09:21:57 +1100 Subject: [PATCH] feat: pict-rs v0.5.4 & Lemmy 0.19.3 (#213) * feat: pict-rs v0.5.0 * feat: pictrs 0.5.4 & lemmy 0.19.3 * fix: linting * fix: spellilng * chore: add optional reference to prepare_upgrade --- README.md | 15 ++++++++++++++- examples/vars.yml | 18 ++++++++++++------ templates/docker-compose.yml | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index dd5595b..1d74a3b 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,19 @@ If you wish to see another distribution on the list, please test on the latest c Since version `1.1.0` we no longer default to using `main` but use tags to make sure deployments are versioned. With every new release all migration steps shall be written below so make sure you check out the [Lemmy Releases Changelog](https://github.com/LemmyNet/lemmy/blob/main/RELEASES.md) to see if there are any config changes with the releases since your last read. +### Upgrading to 1.4.0 (Lemmy 0.19.3 & Pict-rs 0.5.4) + +This is a semi-major release which upgrades pict-rs to 0.5 which has support for postgres as a backend. This configuration is **not supported** by lemmy-ansible for the moment. + +#### Steps + +- `git pull && git checkout 1.4.0` +- Read [Pictrs' Configuration Changes](https://git.asonix.dog/asonix/pict-rs/#configuration-updates) +- Amend your `vars.yml` file to respect the new changes + - Optional: Add: `PICTRS__UPGRADE__CONCURRENCY` with a value between 32 and 512 depending on how much RAM/CPU you want to dedicate to the upgrade process. A value of 32 used about 2.5GB of RAM for the migration. + - Optional: Curl `/internal/prepare_upgrade` to minimise downtime while upgrading. See [the instructions below](https://github.com/LemmyNet/lemmy-ansible#update-your-pict-rs-sled-database-optional) or the official documentation [here](https://git.asonix.dog/asonix/pict-rs/releases#user-content-upgrade-preparation-endpoint) +- Run your regular deployment. Example: `ansible-playbook -i inventory/hosts lemmy.yml --become` + ### Upgrading to 1.3.1 (Lemmy 0.19.1) This is a very minor release but fixes issues relating to federation as part of the Lemmy update. @@ -101,7 +114,7 @@ This is a very minor release but fixes issues relating to federation as part of - `git pull && git checkout 1.3.1` - Run your regular deployment. Example: `ansible-playbook -i inventory/hosts lemmy.yml --become` -### Upgrading to 1.3.0 (Lemmy 0.19.0 & pictrs-0.4.7) +### Upgrading to 1.3.0 (Lemmy 0.19.0 & Pict-rs 0.4.7) This is a major change and has required reading! tl;dr diff --git a/examples/vars.yml b/examples/vars.yml index 1bfd0ac..ca20ad1 100644 --- a/examples/vars.yml +++ b/examples/vars.yml @@ -8,14 +8,16 @@ pictrs_safety_secret: "{{ lookup('password', 'inventory/host_vars/{{ domain }}/p # https://git.asonix.dog/asonix/pict-rs pictrs_env_vars: - PICTRS__SERVER__API_KEY: "{{ postgres_password }}" - - PICTRS__MEDIA__VIDEO_CODEC: vp9 - - PICTRS__MEDIA__GIF__MAX_WIDTH: 256 - - PICTRS__MEDIA__GIF__MAX_HEIGHT: 256 - - PICTRS__MEDIA__GIF__MAX_AREA: 65536 - - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT: 400 + - PICTRS__MEDIA__ANIMATION__MAX_WIDTH: 256 + - PICTRS__MEDIA__ANIMATION__MAX_HEIGHT: 256 + - PICTRS__MEDIA__ANIMATION__MAX_AREA: 65536 + - PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT: 400 + - PICTRS__MEDIA__VIDEO__ENABLE: "True" + - PICTRS__MEDIA__VIDEO__MAX_FILE_SIZE: 20 - PICTRS_OPENTELEMETRY_URL: http://otel:4137 - - RUST_LOG: debug + - RUST_LOG: info - RUST_BACKTRACE: full +# Edit these for Object Storage # - PICTRS__STORE__TYPE: object_storage # - PICTRS__STORE__ENDPOINT: '' # - PICTRS__STORE__BUCKET_NAME: '' @@ -23,6 +25,10 @@ pictrs_env_vars: # - PICTRS__STORE__USE_PATH_STYLE: false # - PICTRS__STORE__ACCESS_KEY: '' # - PICTRS__STORE__SECRET_KEY: '' +# Edit these if you use postgres for your pictrs backend +# - PICTRS__OLD_REPO__PATH=/mnt/sled-repo +# - PICTRS__REPO__TYPE=postgres +# - PICTRS__REPO__URL=postgres://user:password@host:5432/db postgres_env_vars: - POSTGRES_USER: lemmy diff --git a/templates/docker-compose.yml b/templates/docker-compose.yml index 85d0ab5..c4e421f 100644 --- a/templates/docker-compose.yml +++ b/templates/docker-compose.yml @@ -60,7 +60,7 @@ services: logging: *default-logging pictrs: - image: docker.io/asonix/pictrs:0.4.7 + image: docker.io/asonix/pictrs:0.5.4 # this needs to match the pictrs url in lemmy.hjson hostname: pictrs # we can set options to pictrs like this, here we set max. image size and forced format for conversion