Skip to content

Commit

Permalink
Merge branch 'release/v0.13.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
ja573 committed Jan 28, 2025
2 parents 9d36a16 + 497d2eb commit 29f193f
Show file tree
Hide file tree
Showing 19 changed files with 686 additions and 517 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/run_migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ on:
- '**up.sql'
- '**down.sql'
- '**db.rs'
- 'src/bin/**'
pull_request:
paths:
- '**up.sql'
- '**down.sql'
- '**db.rs'
- 'src/bin/**'
workflow_dispatch:

env:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [[0.13.6]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.6) - 2025-01-28
### Changed
- [667](https://github.com/thoth-pub/thoth/pull/667) - Refactor binary using new submodules `commands` and `arguments`
- [667](https://github.com/thoth-pub/thoth/pull/667) - Trigger `run\_migrations` github action when binary source changes

### Added
- [667](https://github.com/thoth-pub/thoth/pull/667) - CLI subcommand `thoth account publishers` to modify which publisher(s) an account has access to

## [[0.13.5]](https://github.com/thoth-pub/thoth/releases/tag/v0.13.5) - 2025-01-17
### Changed
- [665](https://github.com/thoth-pub/thoth/pull/665) - Removed unnecessary `map_or()` to comply with [`rustc 1.84.0`](https://github.com/rust-lang/rust/releases/tag/1.84.0)
Expand Down
17 changes: 9 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "thoth"
version = "0.13.5"
version = "0.13.6"
authors = ["Javier Arias <[email protected]>", "Ross Higman <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand All @@ -15,12 +15,13 @@ maintenance = { status = "actively-developed" }
members = ["thoth-api", "thoth-api-server", "thoth-app", "thoth-app-server", "thoth-client", "thoth-errors", "thoth-export-server"]

[dependencies]
thoth-api = { version = "=0.13.5", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.13.5", path = "thoth-api-server" }
thoth-app-server = { version = "=0.13.5", path = "thoth-app-server" }
thoth-errors = { version = "=0.13.5", path = "thoth-errors" }
thoth-export-server = { version = "=0.13.5", path = "thoth-export-server" }
thoth-api = { version = "=0.13.6", path = "thoth-api", features = ["backend"] }
thoth-api-server = { version = "=0.13.6", path = "thoth-api-server" }
thoth-app-server = { version = "=0.13.6", path = "thoth-app-server" }
thoth-errors = { version = "=0.13.6", path = "thoth-errors" }
thoth-export-server = { version = "=0.13.6", path = "thoth-export-server" }
clap = { version = "4.5.21", features = ["cargo", "env"] }
dialoguer = { version = "0.11.0", features = ["password"] }
dotenv = "0.15.0"
lazy_static = "1.5.0"
tokio = { version = "1.43.0", features = ["rt", "rt-multi-thread", "macros"] }
140 changes: 140 additions & 0 deletions src/bin/arguments/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
use clap::{value_parser, Arg, ArgAction};

pub fn database() -> Arg {
Arg::new("db")
.short('D')
.long("database-url")
.value_name("DATABASE_URL")
.env("DATABASE_URL")
.help("Full postgres database url, e.g. postgres://thoth:thoth@localhost/thoth")
.num_args(1)
}

pub fn redis() -> Arg {
Arg::new("redis")
.short('R')
.long("redis-url")
.value_name("REDIS_URL")
.env("REDIS_URL")
.help("Full redis url, e.g. redis://localhost:6379")
.num_args(1)
}

pub fn host(env_value: &'static str) -> Arg {
Arg::new("host")
.short('H')
.long("host")
.value_name("HOST")
.env(env_value)
.default_value("0.0.0.0")
.help("host to bind")
.num_args(1)
}

pub fn port(default_value: &'static str, env_value: &'static str) -> Arg {
Arg::new("port")
.short('p')
.long("port")
.value_name("PORT")
.env(env_value)
.default_value(default_value)
.help("Port to bind")
.num_args(1)
}

pub fn domain() -> Arg {
Arg::new("domain")
.short('d')
.long("domain")
.value_name("THOTH_DOMAIN")
.env("THOTH_DOMAIN")
.default_value("localhost")
.help("Authentication cookie domain")
.num_args(1)
}

pub fn key() -> Arg {
Arg::new("key")
.short('k')
.long("secret-key")
.value_name("SECRET")
.env("SECRET_KEY")
.help("Authentication cookie secret key")
.num_args(1)
}

pub fn session() -> Arg {
Arg::new("duration")
.short('s')
.long("session-length")
.value_name("DURATION")
.env("SESSION_DURATION_SECONDS")
.default_value("3600")
.help("Authentication cookie session duration (seconds)")
.num_args(1)
.value_parser(value_parser!(i64))
}

pub fn gql_url() -> Arg {
Arg::new("gql-url")
.short('u')
.long("gql-url")
.value_name("THOTH_GRAPHQL_API")
.env("THOTH_GRAPHQL_API")
.default_value("http://localhost:8000")
.help("Thoth GraphQL's, public facing, root URL.")
.num_args(1)
}

pub fn gql_endpoint() -> Arg {
Arg::new("gql-endpoint")
.short('g')
.long("gql-endpoint")
.value_name("THOTH_GRAPHQL_ENDPOINT")
.env("THOTH_GRAPHQL_ENDPOINT")
.default_value("http://localhost:8000/graphql")
.help("Thoth GraphQL's endpoint")
.num_args(1)
}

pub fn export_url() -> Arg {
Arg::new("export-url")
.short('u')
.long("export-url")
.value_name("THOTH_EXPORT_API")
.env("THOTH_EXPORT_API")
.default_value("http://localhost:8181")
.help("Thoth Export API's, public facing, root URL.")
.num_args(1)
}

pub fn threads(env_value: &'static str) -> Arg {
Arg::new("threads")
.short('t')
.long("threads")
.value_name("THREADS")
.env(env_value)
.default_value("5")
.help("Number of HTTP workers to start")
.num_args(1)
.value_parser(value_parser!(usize))
}

pub fn keep_alive(env_value: &'static str) -> Arg {
Arg::new("keep-alive")
.short('K')
.long("keep-alive")
.value_name("THREADS")
.env(env_value)
.default_value("5")
.help("Number of seconds to wait for subsequent requests")
.num_args(1)
.value_parser(value_parser!(u64))
}

pub fn revert() -> Arg {
Arg::new("revert")
.long("revert")
.help("Revert all database migrations")
.action(ArgAction::SetTrue)
}
Loading

0 comments on commit 29f193f

Please sign in to comment.