pict-rs/releases/0.5.0.md

216 lines
5.9 KiB
Markdown
Raw Normal View History

2023-12-09 03:57:35 +00:00
# pict-rs 0.5.0
## Overview
### Headline Features
- [Postgres Repo](#postgres-repo)
- [Media Proxy](#media-proxy)
### Changes
- [Improved Animation Support](#improved-animation-support)
2023-12-09 04:21:20 +00:00
- [Media Configuration](#media-configuration)
2023-12-09 03:57:35 +00:00
- [Improved Collision Resistance](#improved-collision-resistance)
- [Optional Video Transcoding](#optional-video-transcoding)
- [Library API Changes](#library-api-changes)
- [Reject Malformed Deadliens](#reject-malformed-deadlines)
- [Logging Verbosity](#logging-verbosity)
### Other Features
- [Quality Configuration](#quality-configuration)
- [Read-Only Mode](#read-only-mode)
- [Danger-Dummy Mode](#danger-dummy-mode)
- [Media Variant Retention](#media-variant-retention)
- [Configurable Temporary Directory](#configurable-temporary-directory)
- [Serve From Object Storage](#serve-from-object-storage)
- [Prometheus Metrics](#prometheus-metrics)
- [Internal Hashes Endpoint](#internal-hashes-endpoint)
- [Internal Delete Endpoint](#internal-delete-endpoint)
- [Error Codes](#error-codes)
### Fixes
- [Clean Stray Magick Files](#clean-stray-magick-files)
- [Always Drain Payloads](#always-drain-payloads)
2023-12-09 03:59:51 +00:00
- [Constant-Time Equality for Deletion](#constant-time-equality-for-deletion)
2023-12-09 03:57:35 +00:00
### Removals
- [ini and json5](#ini-and-json5)
- [Client Pool Size](#client-pool-size)
- [0.3 Migration Path](#03-migration-path)
2023-12-09 03:57:35 +00:00
- [Prepare Upgrade Endpoint](#prepare-upgrade-endpoint)
## Upgrade Notes
2023-12-09 04:21:20 +00:00
The upgrade from pict-rs 0.4 to 0.5 might take some time. Any uploads that have not had their
metadata extracted will be processed during this migration. In order to reduce the time required the
migration, pict-rs version 0.4.6 can be run first, and the `/internal/prepare_upgrade` endpoint can
be hit. This will tell pict-rs to extract the required metadata for the 0.5 upgrade in the
background while 0.4 is still running, enabling the upgrade to 0.5 to proceed much faster after it
completes. More information about this endpoint can be found in the
[0.4.6 release document](./0.4.6.md)
If you're running the provided docker container with default configuration values, the 0.5 container
can be pulled and launched with no changes. There is a migration from the 0.4 database format to the
0.5 database format that will occur automatically on first launch. This is also the process that
will extract metadata for any uploads that have not had their metadata extracted yet.
If you have any custom configuration, note that some media-related configuration values have been
moved. See [Media Configuration](#media-configuration) below.
pict-rs 0.5 now supports postgres for metadata storage. It is possible to upgrade directly from 0.4
to 0.5 with postgres, rather than upgrading to 0.5 with sled and then making the migration later.
This process is documented in the
[pict-rs readme](https://git.asonix.dog/asonix/pict-rs#upgrading-directly-to-postgres).
2023-12-09 04:21:20 +00:00
More information can be found in the
[pict-rs 0.4 to 0.5 migration guide](https://git.asonix.dog/asonix/pict-rs#04-to-05-migration-guide).
2023-12-09 04:21:20 +00:00
2023-12-09 03:57:35 +00:00
## Descriptions
### Postgres Repo
One of the most anticipated features of pict-rs 0.5 is the support for postgres for metadata
storage. This makes pict-rs (mostly) stateless, enabling it to be scaled horizontally across
multiple physical or virtual hosts. It also simplifies administration and backup processes for folks
who are already running a postgres server for other reasons.
Configuring postgres is simple. The `repo` section of the pict-rs configuration now supports more
than just `sled`.
In the configuration file
```toml
[repo]
type = 'postgres'
url = 'postgres://user:password@host:5432/db'
```
With environment variables
```bash
PICTRS__REPO__TYPE=postgres
PICTRS__REPO__URL=postgres://user:password@host:5432/db
```
On the commandline
```bash
pict-rs run filesystem -p ./data postgres -u 'postgres://user:password@host:5432/db'
```
It is possible to update from 0.4 directly to 0.5 with postgres, this process is documented in the
[pict-rs readme](https://git.asonix.dog/asonix/pict-rs#upgrading-directly-to-postgres).
It is possible to migrate to postgres after first upgrading to 0.5. This is also ducmented in the
[pict-rs readme](https://git.asonix.dog/asonix/pict-rs#sled-to-postgres-migration).
2023-12-09 03:57:35 +00:00
### Media Proxy
2023-12-09 04:47:56 +00:00
pict-rs 0.5 supports caching media, and purging cached media after it is no longer necessary to
keep. This behavior is accessed with pict-rs' new `proxy` query parameter at the `/image/original`
endpoint, and the `/image/process.{ext}` endpoint. By passing the URL to an image to the `proxy`
parameter, you can instruct pict-rs to download the media from that URL and cache it locally before
serving it, or a processed version of it. The proxied media is stored for a configurable time limit,
which resets on each access to the proxied media.
This value can be configured as follows
In the configuration file
```toml
[media.retention]
proxy = "7d" # units available are "m" for minutes, "h" for hours, "d" for days, and "y" for years
```
With environment variables
```bash
PICTRS__MEDIA__RETENTION__PROXY=7d
```
On the commandline
```bash
pict-rs run --media-retention-proxy 7d
```
More documentation can be found in the [pict-rs readme](https://git.asonix.dog/asonix/pict-rs#api)
and in the example [pict-rs.toml](https://git.asonix.dog/asonix/pict-rs/src/branch/main/pict-rs.toml).
2023-12-09 03:57:35 +00:00
### Improved Animation Support
2023-12-09 04:21:20 +00:00
### Media Configuration
2023-12-09 03:57:35 +00:00
### Improved Collision Resistance
### Optional Video Transcoding
### Library API Changes
### Reject Malformed Deadlines
### Logging Verbosity
### Quality Configuration
### Read-Only Mode
### Danger-Dummy Mode
### Media Variant Retention
### Configurable Temporary Directory
### Serve From Object Storage
### Prometheus Metrics
### Internal Hashes Endpoint
### Internal Delete Endpoint
### Error Codes
### Clean Stray Magick Files
### Always Drain Payloads
### Constant-Time Equality for Deletions
### ini and json5
### Client Pool Size
### 0.3 Migration Path
### Prepare Upgrade Endpoint