-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #288 from umccr/feat/simple-locations
feat: path-based locations
- Loading branch information
Showing
12 changed files
with
1,020 additions
and
534 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
# An example of running htsget-rs. | ||
# Run with `cargo run --all-features -- --config htsget-config/examples/config-files/basic.toml` | ||
# Run with `cargo run -p htsget-axum --all-features -- --config htsget-config/examples/config-files/basic.toml` | ||
|
||
ticket_server_addr = "127.0.0.1:8080" | ||
data_server_addr = "127.0.0.1:8081" | ||
|
||
# Serve data locally from the `data` directory. | ||
[[resolvers]] | ||
regex = '.*' | ||
substitution_string = '$0' | ||
storage.backend = 'Local' | ||
|
||
# Serve data from S3 if the id is prefixed with `example_bucket`. | ||
[[resolvers]] | ||
regex = '^(example_bucket)/(?P<key>.*)$' | ||
substitution_string = '$key' | ||
storage.backend = 'S3' | ||
# Uses the first capture group in the regex as the bucket. | ||
# Serve data locally from the `data` directory or from an S3 bucket called `bucket` depending on the prefix. | ||
locations = [ "file://data/file_prefix", "s3://bucket/s3_prefix" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
# An example of running htsget-rs with Crypt4GH enabled. | ||
# Run with `cargo run -p htsget-axum --features experimental -- --config htsget-config/examples/config-files/c4gh.toml` | ||
# Run with `cargo run -p htsget-axum --features experimental,s3-storage -- --config htsget-config/examples/config-files/c4gh.toml` | ||
|
||
ticket_server_addr = "127.0.0.1:8080" | ||
data_server_addr = "127.0.0.1:8081" | ||
ticket_server.addr = "127.0.0.1:8080" | ||
data_server.addr = "127.0.0.1:8081" | ||
|
||
[[resolvers]] | ||
[[locations]] | ||
regex = ".*" | ||
substitution_string = "$0" | ||
backend.kind = "File" | ||
|
||
[resolvers.storage] | ||
backend = 'Local' | ||
backend.keys.kind = "File" | ||
backend.keys.private = "data/c4gh/keys/bob.sec" # pragma: allowlist secret | ||
backend.keys.public = "data/c4gh/keys/alice.pub" | ||
|
||
[resolvers.storage.keys] | ||
location = "Local" | ||
private_key = "data/c4gh/keys/bob.sec" # pragma: allowlist secret | ||
recipient_public_key = "data/c4gh/keys/alice.pub" | ||
|
||
# Or, use AWS secrets manager to store keys. | ||
#[resolvers.storage.keys] | ||
#location = "SecretsManager" | ||
#private_key = "htsget/test_c4gh_private_key" # pragma: allowlist secret | ||
#recipient_public_key = "htsget/test_c4gh_public_key" | ||
## Or, use AWS secrets manager to store keys. | ||
#backend.keys.kind = "SecretsManager" | ||
#backend.keys.private = "htsget/test_c4gh_private_key" # pragma: allowlist secret | ||
#backend.keys.public = "htsget/test_c4gh_public_key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
# Config generated by running `cargo run -p htsget-axum -- -p` | ||
|
||
formatting_style = "Full" | ||
ticket_server_addr = "127.0.0.1:8080" | ||
ticket_server_cors_allow_credentials = false | ||
ticket_server_cors_allow_origins = ["http://localhost:8080"] | ||
ticket_server_cors_allow_headers = "All" | ||
ticket_server_cors_allow_methods = "All" | ||
ticket_server_cors_max_age = 86400 | ||
ticket_server_cors_expose_headers = [] | ||
data_server_enabled = true | ||
data_server_addr = "127.0.0.1:8081" | ||
data_server_local_path = "./" | ||
data_server_serve_at = "" | ||
data_server_cors_allow_credentials = false | ||
data_server_cors_allow_origins = ["http://localhost:8080"] | ||
data_server_cors_allow_headers = "All" | ||
data_server_cors_allow_methods = "All" | ||
data_server_cors_max_age = 86400 | ||
data_server_cors_expose_headers = [] | ||
|
||
[[resolvers]] | ||
regex = ".*" | ||
substitution_string = "$0" | ||
storage = "Local" | ||
|
||
[resolvers.allow_guard] | ||
allow_reference_names = "All" | ||
allow_fields = "All" | ||
allow_tags = "All" | ||
allow_formats = [ | ||
"BAM", | ||
"CRAM", | ||
"VCF", | ||
"BCF", | ||
] | ||
allow_classes = [ | ||
"body", | ||
"header", | ||
] | ||
|
||
[ticket_server] | ||
addr = "127.0.0.1:8080" | ||
|
||
[ticket_server.cors] | ||
allow_credentials = false | ||
allow_origins = "Mirror" | ||
allow_headers = "Mirror" | ||
allow_methods = "Mirror" | ||
max_age = 2592000 | ||
expose_headers = "All" | ||
|
||
[data_server] | ||
addr = "127.0.0.1:8081" | ||
local_path = "./" | ||
|
||
[data_server.cors] | ||
allow_credentials = false | ||
allow_origins = "Mirror" | ||
allow_headers = "Mirror" | ||
allow_methods = "Mirror" | ||
max_age = 2592000 | ||
expose_headers = "All" | ||
|
||
[service_info] | ||
|
||
[[locations]] | ||
prefix = "" | ||
|
||
[locations.backend] | ||
kind = "File" | ||
scheme = "HTTP" | ||
authority = "127.0.0.1:8081" | ||
local_path = "./" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
# An example for a server which uses s3 storage with data located in "bucket". | ||
# Run with `cargo run -p htsget-axum --features s3-storage -- --config htsget-config/examples/config-files/s3_storage.toml` | ||
|
||
ticket_server_cors_allow_headers = "All" | ||
ticket_server_cors_allow_methods = "All" | ||
ticket_server_cors_allow_credentials = true | ||
ticket_server_cors_max_age = 300 | ||
ticket_server.cors.allow_headers = "All" | ||
ticket_server.cors.allow_methods = "All" | ||
ticket_server.cors.allow_credentials = false | ||
ticket_server.cors.max_age = 300 | ||
|
||
data_server_enabled = false | ||
data_server = "None" | ||
|
||
[[resolvers]] | ||
regex = '^(bucket)/(?P<key>.*)$' | ||
substitution_string = '$key' | ||
storage.backend = 'S3' | ||
locations = "s3://bucket" | ||
|
||
# Or, set the bucket manually | ||
#[resolvers.storage] | ||
#backend = 'S3' | ||
#bucket = 'bucket' | ||
## Or, set using regex locations | ||
#[[locations]] | ||
#regex = "^(bucket)/(?P<key>.*)$" | ||
#substitution_string = "$key" | ||
#backend.kind = "S3" | ||
#backend.bucket = "bucket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
# An example config file for a TLS data server that uses a local storage backend. | ||
# Run with `cargo run -p htsget-axum -- --config htsget-config/examples/config-files/tls_data_server.toml` | ||
|
||
ticket_server_addr = "0.0.0.0:8080" | ||
data_server_addr = "0.0.0.0:8081" | ||
data_server_cors_allow_origins = "All" | ||
data_server_tls.cert = "cert.pem" | ||
data_server_tls.key = "key.pem" | ||
ticket_server.addr = "0.0.0.0:8080" | ||
data_server.addr = "0.0.0.0:8081" | ||
data_server.cors.allow_origins = "All" | ||
data_server.tls.cert = "cert.pem" | ||
data_server.tls.key = "key.pem" | ||
|
||
[[resolvers]] | ||
regex = ".*" | ||
substitution_string = "$0" | ||
locations = "file://data" | ||
|
||
[resolvers.storage] | ||
backend = 'Local' | ||
use_data_server_config = true | ||
## Or, set using regex locations | ||
#[[locations]] | ||
#regex = ".*" | ||
#substitution_string = "$0" | ||
#backend.kind = "File" | ||
#backend.local_path = "data" |
23 changes: 12 additions & 11 deletions
23
htsget-config/examples/config-files/tls_ticket_server.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
# An example config file for a TLS ticket server that uses S3 as a storage backend. | ||
# Run with `cargo run -p htsget-axum --features s3-storage -- --config htsget-config/examples/config-files/tls_ticket_server.toml` | ||
|
||
ticket_server_addr = "0.0.0.0:8080" | ||
ticket_server_cors_allow_origins = "All" | ||
ticket_server_tls.cert = "cert.pem" | ||
ticket_server_tls.key = "key.pem" | ||
data_server_addr = "0.0.0.0:8081" | ||
ticket_server.addr = "0.0.0.0:8080" | ||
ticket_server.cors_allow_origins = "All" | ||
ticket_server.tls.cert = "cert.pem" | ||
ticket_server.tls.key = "key.pem" | ||
data_server.addr = "0.0.0.0:8081" | ||
|
||
[[resolvers]] | ||
regex = ".*" | ||
substitution_string = "$0" | ||
locations = "s3://bucket" | ||
|
||
[resolvers.storage] | ||
backend = 'S3' | ||
bucket = "bucket" | ||
## Or, set using regex locations | ||
#[[locations]] | ||
#regex = ".*" | ||
#substitution_string = "$0" | ||
#backend.kind = "S3" | ||
#backend.bucket = "bucket" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.