Compare commits
2 commits
dfb38c7144
...
cef9a68307
Author | SHA1 | Date | |
---|---|---|---|
asonix | cef9a68307 | ||
asonix | 5f9efb2e1a |
70
Cargo.lock
generated
70
Cargo.lock
generated
|
@ -340,7 +340,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -351,7 +351,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -579,7 +579,7 @@ dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -769,9 +769,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "der"
|
name = "der"
|
||||||
version = "0.7.8"
|
version = "0.7.9"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c"
|
checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const-oid",
|
"const-oid",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
|
@ -839,7 +839,7 @@ dependencies = [
|
||||||
"heck 0.4.1",
|
"heck 0.4.1",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -851,7 +851,7 @@ dependencies = [
|
||||||
"diesel_table_macro_syntax",
|
"diesel_table_macro_syntax",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -860,7 +860,7 @@ version = "0.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
|
checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1019,7 +1019,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -1819,7 +1819,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pict-rs"
|
name = "pict-rs"
|
||||||
version = "0.5.10"
|
version = "0.5.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-form-data",
|
"actix-form-data",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
@ -1900,14 +1900,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.13"
|
version = "0.2.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-utils"
|
name = "pin-utils"
|
||||||
|
@ -2009,7 +2009,7 @@ dependencies = [
|
||||||
"itertools",
|
"itertools",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2023,9 +2023,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quanta"
|
name = "quanta"
|
||||||
version = "0.12.2"
|
version = "0.12.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c"
|
checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossbeam-utils",
|
"crossbeam-utils",
|
||||||
"libc",
|
"libc",
|
||||||
|
@ -2114,9 +2114,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "refinery"
|
name = "refinery"
|
||||||
version = "0.8.12"
|
version = "0.8.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2783724569d96af53464d0711dff635cab7a4934df5e22e9fbc9e181523b83e"
|
checksum = "425d0fb45561a45e274d318bfbd1bdfbb7a88045860c7b51a2b812ded1a5efc7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"refinery-core",
|
"refinery-core",
|
||||||
"refinery-macros",
|
"refinery-macros",
|
||||||
|
@ -2124,9 +2124,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "refinery-core"
|
name = "refinery-core"
|
||||||
version = "0.8.12"
|
version = "0.8.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "08d6c80329c0455510a8d42fce286ecb4b6bcd8c57e1816d9f2d6bd7379c2cc8"
|
checksum = "3d0f5d1af6a2e8d5972ca187b2acf7ecb8d6a1a6ece52bceeae8f57880eaf62f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -2146,15 +2146,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "refinery-macros"
|
name = "refinery-macros"
|
||||||
version = "0.8.12"
|
version = "0.8.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6ab6e31e166a49d55cb09b62639e5ab9ba2e73f2f124336b06f6c321dc602779"
|
checksum = "7ba59636ac45d953f2225dc4ca3a55cfda1b015d0e6ff51ea16329918b436d51"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"refinery-core",
|
"refinery-core",
|
||||||
"regex",
|
"regex",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2513,7 +2513,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2741,9 +2741,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.55"
|
version = "2.0.57"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0"
|
checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
@ -2803,7 +2803,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2864,9 +2864,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.36.0"
|
version = "1.37.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
|
checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
@ -2900,7 +2900,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3160,7 +3160,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3390,7 +3390,7 @@ dependencies = [
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -3424,7 +3424,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
@ -3730,7 +3730,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -3750,5 +3750,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.55",
|
"syn 2.0.57",
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "pict-rs"
|
name = "pict-rs"
|
||||||
description = "A simple image hosting service"
|
description = "A simple image hosting service"
|
||||||
version = "0.5.10"
|
version = "0.5.11"
|
||||||
authors = ["asonix <asonix@asonix.dog>"]
|
authors = ["asonix <asonix@asonix.dog>"]
|
||||||
license = "AGPL-3.0"
|
license = "AGPL-3.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
rustPlatform.buildRustPackage {
|
rustPlatform.buildRustPackage {
|
||||||
pname = "pict-rs";
|
pname = "pict-rs";
|
||||||
version = "0.5.10";
|
version = "0.5.11";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
|
|
82
releases/0.5.11.md
Normal file
82
releases/0.5.11.md
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# pict-rs 0.5.11
|
||||||
|
|
||||||
|
pict-rs is a simple image hosting microservice, designed to handle storing and retrieving images,
|
||||||
|
animations, and videos, as well as providing basic image processing functionality.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
pict-rs 0.5.11 introduces new per-upload media validations, and new per-upload media processing.
|
||||||
|
These features will enable applications to be more precise about their media requirements, such as
|
||||||
|
allowing different media types and sizes for different endpoints, or pre-processing certain media to
|
||||||
|
optimize for size.
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
- [Upload Validations](#upload-validations)
|
||||||
|
- [Upload Processing](#upload-processing)
|
||||||
|
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
- [Backgrounded Variants](#backgrounded-variants)
|
||||||
|
|
||||||
|
|
||||||
|
## Upgrade Notes
|
||||||
|
|
||||||
|
For postgres-based installations, a small migration will be run when pict-rs 0.5.11 first launches
|
||||||
|
to create a new notifications table. No manual intervention is required. Upgrading should be as
|
||||||
|
simple as pulling a new version of pict-rs.
|
||||||
|
|
||||||
|
|
||||||
|
## Descriptions
|
||||||
|
|
||||||
|
### Upload Validations
|
||||||
|
|
||||||
|
When ingesting media using `POST /image`, `POST /image/backgrounded`, `POST /internal/import`, or
|
||||||
|
`GET /image/download`, validations can now be applied per-upload. These can be provided in the
|
||||||
|
request query. The following query parameters are supported:
|
||||||
|
|
||||||
|
- max_width: maximum width, in pixels, allowed for the uploaded media
|
||||||
|
- max_height: maximum height, in pixels, allowed for the uploaded media
|
||||||
|
- max_area: maximum area, in pixels, allowed for the uploaded media
|
||||||
|
- max_frame_count: maximum number of frames permitted for animations and videos
|
||||||
|
- max_file_size: maximum size, in megabytes, allowed
|
||||||
|
- allow_image: whether to permit still images in the upload
|
||||||
|
- allow_animation: whether to permit animations in the upload
|
||||||
|
- allow_video: whether to permit video in the upload
|
||||||
|
|
||||||
|
An example request could look like this: `POST /image/backgrounded?max_area=3200&allow_video=false`
|
||||||
|
|
||||||
|
Validations are performed in addition to the validations specified in the pict-rs configuration, so
|
||||||
|
if uploaded media violates any of the validations, it will fail to ingest.
|
||||||
|
|
||||||
|
|
||||||
|
### Upload Processing
|
||||||
|
|
||||||
|
In a similar vein to the upload validations, preprocessing steps can now be applied on a per-upload
|
||||||
|
basis. These are also provided as query parameters, and will be applied _instead of_ the configured
|
||||||
|
preprocess steps. The preprocess query parameters are provided and processed the same way as in the
|
||||||
|
`GET image/process.{ext}` endpoint.
|
||||||
|
|
||||||
|
An example request could be `POST /image/backgrounded?blur=2.5&resize=300`, which would blur the
|
||||||
|
uploaded image and fit it inside a 300x300 box before saving it.
|
||||||
|
|
||||||
|
|
||||||
|
### Backgrounded Variants
|
||||||
|
|
||||||
|
When serving images from the /process.{ext} endpoint, pict-rs will now queue the processing to
|
||||||
|
happen via the job queue, rather than processing media inline. It will still wait up to 30 seconds
|
||||||
|
for the processing to be complete, and return the processed image the same way it always has.
|
||||||
|
|
||||||
|
If processing exceeds 30 seconds, pict-rs will return a timeout error, but the processing will
|
||||||
|
continue in the background. The same variant can be requested again, and it will wait for the same
|
||||||
|
background process to complete, rather than trying to process the variant a second time.
|
||||||
|
|
||||||
|
pict-rs has historically had a method of reducing variant processing to prevent two requests for the
|
||||||
|
same variant from doing the same work, but this was only effective in environments that only ran 1
|
||||||
|
copy of pict-rs. In environments that had multiple replicas, each one could end up processing the
|
||||||
|
same variant if it was requested more than once at a time. This has been solved by using postgres as
|
||||||
|
a notification system to enable globally unique processing for a given variant.
|
||||||
|
|
||||||
|
In sled-based configurations there shouldn't be a noticible difference, aside from the 30 second
|
||||||
|
timeout on variant endpoints.
|
Loading…
Reference in a new issue