Update readme, cleanup migration key on completion

This commit is contained in:
Aode (lion) 2021-11-01 10:44:49 -05:00
parent 93c268fc58
commit ad7c323985
3 changed files with 29 additions and 9 deletions

View File

@ -9,7 +9,7 @@ _a simple image hosting service_
## Usage ## Usage
### Running ### Running
``` ```
pict-rs 0.3.0-alpha.42 pict-rs 0.3.0-alpha.43
USAGE: USAGE:
pict-rs [FLAGS] [OPTIONS] [SUBCOMMAND] pict-rs [FLAGS] [OPTIONS] [SUBCOMMAND]
@ -33,6 +33,7 @@ OPTIONS:
--max-image-area <max-image-area> Specify the maximum area in pixels allowed in an image --max-image-area <max-image-area> Specify the maximum area in pixels allowed in an image
--max-image-height <max-image-height> Specify the maximum width in pixels allowed on an image --max-image-height <max-image-height> Specify the maximum width in pixels allowed on an image
--max-image-width <max-image-width> Specify the maximum width in pixels allowed on an image --max-image-width <max-image-width> Specify the maximum width in pixels allowed on an image
--migrate-file <migrate-file> Path to a file defining a store migration
-o, --opentelemetry-url <opentelemetry-url> -o, --opentelemetry-url <opentelemetry-url>
Enable OpenTelemetry Tracing exports to the given OpenTelemetry collector Enable OpenTelemetry Tracing exports to the given OpenTelemetry collector
@ -45,7 +46,7 @@ SUBCOMMANDS:
``` ```
``` ```
pict-rs-file-store 0.3.0-alpha.42 pict-rs-file-store 0.3.0-alpha.43
USAGE: USAGE:
pict-rs file-store [OPTIONS] pict-rs file-store [OPTIONS]
@ -55,11 +56,11 @@ FLAGS:
-V, --version Prints version information -V, --version Prints version information
OPTIONS: OPTIONS:
--path <path> --path <path> Path in which pict-rs will create it's 'files' directory
``` ```
``` ```
pict-rs-s3-store 0.3.0-alpha.42 pict-rs-s3-store 0.3.0-alpha.43
USAGE: USAGE:
pict-rs s3-store [OPTIONS] --bucket-name <bucket-name> --region <region> pict-rs s3-store [OPTIONS] --bucket-name <bucket-name> --region <region>
@ -70,14 +71,16 @@ FLAGS:
OPTIONS: OPTIONS:
--access-key <access-key> --access-key <access-key>
--bucket-name <bucket-name> --bucket-name <bucket-name> Name of the bucket in which pict-rs will store images
--region <region> --region <region> Region in which the bucket exists, can be an http endpoint
--secret-key <secret-key> --secret-key <secret-key>
--security-token <security-token> --security-token <security-token>
--session-token <session-token> --session-token <session-token>
``` ```
See [`pict-rs.toml`](https://git.asonix.dog/asonix/pict-rs/src/branch/main/pict-rs.toml) for more configuration See [`pict-rs.toml`](https://git.asonix.dog/asonix/pict-rs/src/branch/main/pict-rs.toml) and
[`migrate.toml`](https://git.asonix.dog/asonix/pict-rs/src/branch/main/migrate.toml) for more
configuration
#### Example: #### Example:
Running on all interfaces, port 8080, storing data in /opt/data Running on all interfaces, port 8080, storing data in /opt/data

13
migrate.toml Normal file
View File

@ -0,0 +1,13 @@
## Store config where files currently exist
# see [store] documentation in pict-rs.toml for more info
[from]
type = "file_store"
## Store config where files will be moved to
# see [store] documentation in pict-rs.toml for more info
[to]
type = 's3_store'
bucket_name = 'pict-rs'
region = 'http://minio:9000'
access_key = '09ODZ3BGBISV4U92JLIM'
secret_key = 'j35YE9RrxhBP0dpiD5mmdXRXvPkEJR4k6zK12q3o'

View File

@ -150,6 +150,10 @@ impl UploadManager {
settings?; settings?;
} }
// clean up the migration key to avoid interfering with future migrations
self.inner.settings_tree.remove(STORE_MIGRATION_PROGRESS)?;
self.inner.settings_tree.flush_async().await?;
Ok(()) Ok(())
} }