Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More flexible config #126

Merged
merged 46 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c5d7295
config: swap out envy for config dependency
mmalenic Nov 14, 2022
d9f2ad7
config: add config file from command line or env option
mmalenic Nov 15, 2022
225eb73
config: add separate config for local server and s3 storage
mmalenic Nov 15, 2022
2bbfed9
config: move fields, tags, no tags, query, and interval to config
mmalenic Nov 16, 2022
8c2b3fb
search: add safe cast for conversion between i64 and u64
mmalenic Nov 18, 2022
a4b03f1
config: implement query matcher logic
mmalenic Nov 21, 2022
4a1a777
test: add tests for checking for contained value in interval
mmalenic Nov 22, 2022
8f1043c
refactor: move config into separate module
mmalenic Nov 23, 2022
505f19e
config: use figment instead of config because it is simpler to set de…
mmalenic Nov 23, 2022
69ee97a
refactor: fix errors relating to new config
mmalenic Nov 23, 2022
52b7df1
config: add UrlResolver, separate data server config from resolver
mmalenic Dec 5, 2022
bb3875e
config: add CorsConfig shared struct
mmalenic Dec 6, 2022
4f3243c
config: add cors allow header types for cors config
mmalenic Dec 6, 2022
6a2c177
config: add cors max age option
mmalenic Dec 6, 2022
2a8927d
config: add generic allow type configuration option for allow headers…
mmalenic Dec 6, 2022
8c17cf8
config: add allow origins, and separate out tagged and untagged enum …
mmalenic Dec 8, 2022
94fc0e4
config: add case insensitive aliases to enum variants
mmalenic Dec 8, 2022
3baab72
config: move cors config to separate file
mmalenic Dec 9, 2022
b450848
config: add expose headers cors option
mmalenic Dec 9, 2022
5c7ad2c
config: allow configuring multiple data servers
mmalenic Dec 11, 2022
bc50c7d
config: remove public fields, add public getters
mmalenic Dec 12, 2022
f4b4aa4
config: add cors tests and environment variable tests
mmalenic Dec 12, 2022
85f522b
config: deserialize empty string as None value
mmalenic Dec 16, 2022
2e2256d
config: update getter return types
mmalenic Dec 18, 2022
945cc57
refactor: apply changes to other crates from reworked config
mmalenic Dec 19, 2022
7a28706
config: fix logic involving allowed attributes
mmalenic Dec 19, 2022
c0a6e0f
config: remove custom deserializer for None option and instead use cu…
mmalenic Dec 19, 2022
fe3283b
test: fix tests affected by config, change some default values and mo…
mmalenic Dec 20, 2022
bbb33c0
refactor: reduce some options for cors, remove repeated code when con…
mmalenic Dec 20, 2022
77a6caa
config: remove setters, add constructors, add documentation.
mmalenic Dec 20, 2022
4819bd3
config: allow specifying tags, reference names, fields with an 'All' …
mmalenic Dec 21, 2022
6b5e60b
config: update config file with default values, add option to print a…
mmalenic Dec 21, 2022
b1c0ec4
style: clippy and fmt
mmalenic Dec 21, 2022
4293a84
config: flatten data server config
mmalenic Dec 21, 2022
cc87548
docs: add documentation for reworked config
mmalenic Dec 21, 2022
c4cc4d1
bug: fix broken data server optional by introducing boolean flag to e…
mmalenic Dec 22, 2022
508763e
test: add test for long resolvers from environment variable config
mmalenic Dec 22, 2022
5ab9f96
build: fix feature flag compile errors
mmalenic Dec 22, 2022
c23195b
Merge branch 'main' of https://github.com/umccr/htsget-rs into more-f…
mmalenic Dec 23, 2022
963f6e8
bug: remove duplicate config module
mmalenic Dec 23, 2022
fde1f86
docs: reword usage string
mmalenic Dec 23, 2022
10d86bf
docs: clarify how the resolvers work
mmalenic Dec 23, 2022
93be5a2
refactor: remove some unnecessary unwraps
mmalenic Dec 23, 2022
512c1f0
docs: reword resolvers description
mmalenic Dec 23, 2022
95ed615
docs: remove unnecessary default column for environment variables, su…
mmalenic Dec 23, 2022
ad096c8
docs: add missing environment variable options
mmalenic Dec 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions htsget-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ s3-storage = []
default = ["s3-storage"]

[dependencies]
noodles = { version = "0.29", features = ["core"] }
serde = { version = "1.0", features = ["derive"] }
serde_with = "2.1"
serde_regex = "1.1"
regex = "1.6"
envy = "0.4"
figment = { version = "0.10", features = ["env", "toml"] }
clap = { version = "4.0", features = ["derive", "env"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] }
tracing-subscriber = { version = "0.3", features = ["registry", "env-filter"] }
toml = "0.5"
http = "0.2"
http-serde = "1.1"

[dev-dependencies]
figment = { version = "0.10", features = ["test"] }
337 changes: 293 additions & 44 deletions htsget-config/README.md

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions htsget-config/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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 = "None"
#data_server_disabled = true
data_server_addr = '127.0.0.1:8082'
data_server_local_path = 'data'
data_server_serve_at = '/data'
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'

[resolvers.storage_type]
type = 'Local'
scheme = 'Http'
authority = '127.0.0.1:8081'
local_path = 'data'
path_prefix = '/data'

[resolvers.guard]
allow_reference_names = 'All'
allow_fields = 'All'
allow_tags = 'All'
allow_formats = [
'BAM',
'CRAM',
'VCF',
'BCF',
]
allow_classes = [
'body',
'header',
]
286 changes: 0 additions & 286 deletions htsget-config/src/config.rs

This file was deleted.

Loading