Compare commits

...

2 commits

Author SHA1 Message Date
asonix 0123d93458 Bump version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2022-09-28 18:36:42 -05:00
asonix 40246ba7fa Update deps 2022-09-28 18:34:07 -05:00
5 changed files with 366 additions and 408 deletions

694
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
[package]
name = "pict-rs-proxy"
description = "A simple web frontend for pict-rs"
version = "0.4.0-alpha.4"
version = "0.4.0-beta.1"
authors = ["asonix <asonix@asonix.dog>"]
license = "AGPL-3.0"
readme = "README.md"
@ -16,26 +16,26 @@ default = []
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-rt = "2.6.0"
actix-rt = "2.7.0"
actix-web = { version = "4.0.0", default-features = false }
anyhow = "1.0"
awc = { version = "3.0.0", default-features = false }
clap = { version = "3.1.15", features = ["derive", "env"] }
clap = { version = "4.0.2", features = ["derive", "env"] }
console-subscriber = "0.1"
dotenv = "0.15.0"
mime = "0.3"
minify-html = "0.9.0"
minify-html = "0.10.0"
once_cell = "1.4"
opentelemetry = { version = "0.17", features = ["rt-tokio"] }
opentelemetry-otlp = "0.10"
opentelemetry = { version = "0.18", features = ["rt-tokio"] }
opentelemetry-otlp = "0.11"
serde = { version = "1.0", features = ["derive"] }
serde_qs = { version = "0.9", features = ["actix4"] }
serde_qs = { version = "0.10", features = ["actix4"] }
thiserror = "1.0"
tracing = "0.1"
tracing-error = "0.2"
tracing-futures = "0.2"
tracing-log = "0.1"
tracing-opentelemetry = "0.17"
tracing-opentelemetry = "0.18"
tracing-subscriber = { version = "0.3", features = [
"ansi",
"env-filter",
@ -44,16 +44,16 @@ tracing-subscriber = { version = "0.3", features = [
url = "2.1"
[dependencies.tracing-actix-web]
version = "0.6.0"
version = "0.6.1"
default-features = false
features = ["emit_event_on_error", "opentelemetry_0_17"]
features = ["emit_event_on_error", "opentelemetry_0_18"]
[dependencies.tracing-awc]
version = "0.1.0"
version = "0.1.6"
default-features = false
features = ["emit_event_on_error", "opentelemetry_0_17"]
features = ["emit_event_on_error", "opentelemetry_0_18"]
[build-dependencies]
anyhow = "1.0"
dotenv = "0.15.0"
ructe = { version = "0.14.0", features = ["sass", "mime03"] }
ructe = { version = "0.15.0", features = ["sass", "mime03"] }

View file

@ -7,30 +7,26 @@ _a demo frontend for pict-rs supporting noscript_
## Usage
### Running
```
pict-rs-proxy 0.3.0-rc.3
$ pict-rs-proxy -h
A simple web frontend for pict-rs
USAGE:
pict-rs-proxy [OPTIONS]
Usage: pict-rs-proxy [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-a, --addr <addr>
The address and port the server binds to [env: PICTRS_PROXY_ADDR=] [default: 0.0.0.0:8081]
--console-event-buffer-size <console-event-buffer-size>
Number of events to buffer for the console subscriber. When unset, console will be disabled [env:
PICTRS_PROXY_CONSOLE_BUFFER_SIZE=]
-d, --domain <domain>
The scheme, domain, and optional port of the pict-rs proxy server [env: PICTRS_PROXY_DOMAIN=] [default:
http://localhost:8081]
-o, --opentelemetry-url <opentelemetry-url>
URL of OpenTelemetry Collector [env: PICTRS_PROXY_OPENTELEMETRY_URL=]
-u, --upstream <upstream>
The url of the upstream pict-rs server [env: PICTRS_PROXY_UPSTREAM=] [default: http://localhost:8080]
Options:
-a, --addr <ADDR>
The address and port the server binds to [env: PICTRS_PROXY_ADDR=] [default: 0.0.0.0:8081]
-u, --upstream <UPSTREAM>
The url of the upstream pict-rs server [env: PICTRS_PROXY_UPSTREAM=] [default: http://localhost:8080]
-d, --domain <DOMAIN>
The scheme, domain, and optional port of the pict-rs proxy server [env: PICTRS_PROXY_DOMAIN=] [default: http://localhost:8081]
--console-event-buffer-size <CONSOLE_EVENT_BUFFER_SIZE>
Number of events to buffer for the console subscriber. When unset, console will be disabled [env: PICTRS_PROXY_CONSOLE_BUFFER_SIZE=]
-o, --opentelemetry-url <OPENTELEMETRY_URL>
URL of OpenTelemetry Collector [env: PICTRS_PROXY_OPENTELEMETRY_URL=]
-h, --help
Print help information
-V, --version
Print version information
```
#### Examples

View file

@ -8,7 +8,7 @@ services:
- ./volumes/pictrs:/mnt
pictrs-proxy:
image: asonix/pictrs-proxy:v0.3.0-alpha.14
image: asonix/pictrs-proxy:v0.3.0-beta.1
ports:
- "8081:8081"
restart: always

View file

@ -39,9 +39,11 @@ include!(concat!(env!("OUT_DIR"), "/templates.rs"));
const HOURS: u32 = 60 * 60;
const DAYS: u32 = 24 * HOURS;
/// Simple proxy service to demonstrate pict-rs's functionality
#[derive(Clone, Debug, Parser)]
#[command(author, version, about, long_about = None)]
struct Config {
#[clap(
#[arg(
short,
long,
env = "PICTRS_PROXY_ADDR",
@ -50,7 +52,7 @@ struct Config {
)]
addr: SocketAddr,
#[clap(
#[arg(
short,
long,
env = "PICTRS_PROXY_UPSTREAM",
@ -59,7 +61,7 @@ struct Config {
)]
upstream: Url,
#[clap(
#[arg(
short,
long,
env = "PICTRS_PROXY_DOMAIN",
@ -68,14 +70,14 @@ struct Config {
)]
domain: Url,
#[clap(
#[arg(
long,
env = "PICTRS_PROXY_CONSOLE_BUFFER_SIZE",
help = "Number of events to buffer for the console subscriber. When unset, console will be disabled"
)]
console_event_buffer_size: Option<usize>,
#[clap(
#[arg(
short,
long,
env = "PICTRS_PROXY_OPENTELEMETRY_URL",