-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow manually specifying the number of threads
- Loading branch information
Showing
6 changed files
with
51 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ description = "A very simple secrets vault." | |
authors = ["Dennis Schubert <[email protected]>"] | ||
repository = "https://github.com/denschub/vssv" | ||
license = "MIT" | ||
version = "1.1.3" | ||
version = "1.2.0" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
|
@@ -16,7 +16,6 @@ axum = { version = "0.8", features = ["macros"] } | |
axum-extra = { version = "0.10", features = ["typed-header"] } | ||
chrono = "0.4" | ||
clap = { version = "4", features = ["derive", "env"] } | ||
num_cpus = "1" | ||
serde = { version = "1", features = ["derive"] } | ||
sqlx = { version = "0.8", features = [ | ||
"chrono", | ||
|
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
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,9 @@ | ||
use std::net::SocketAddr; | ||
|
||
use sqlx::{postgres::PgConnectOptions, PgPool}; | ||
use sqlx::PgPool; | ||
|
||
pub mod errors; | ||
pub mod models; | ||
pub mod routes; | ||
|
||
#[derive(Debug, clap::Parser)] | ||
#[clap(about, version, propagate_version = true)] | ||
pub struct Cli { | ||
/// The database URL to connect to. Needs to be a valid PostgreSQL | ||
/// connection URL, like `postgres://[email protected]/vssv` | ||
#[clap(long, short, env = "DATABASE_URL")] | ||
pub database_url: PgConnectOptions, | ||
|
||
/// The Socket Address the server should listen on | ||
#[clap(long, short, env = "LISTEN_ADDR", default_value = "[::1]:3000")] | ||
pub listen_addr: SocketAddr, | ||
} | ||
pub mod settings; | ||
|
||
/// Holds the web server's state. | ||
#[derive(Clone)] | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::net::SocketAddr; | ||
|
||
use sqlx::postgres::PgConnectOptions; | ||
|
||
#[derive(Debug, clap::Parser)] | ||
#[clap(about, version, propagate_version = true)] | ||
pub struct Settings { | ||
/// The database URL to connect to. Needs to be a valid PostgreSQL | ||
/// connection URL, like `postgres://[email protected]/vssv` | ||
#[clap(long, short, env = "DATABASE_URL")] | ||
pub database_url: PgConnectOptions, | ||
|
||
/// The Socket Address the server should listen on | ||
#[clap(long, short, env = "LISTEN_ADDR", default_value = "[::1]:3000")] | ||
pub listen_addr: SocketAddr, | ||
|
||
/// Limits the number of threads used - defaults to the number of CPU cores | ||
#[clap(long, env = "THREADS")] | ||
pub threads: Option<usize>, | ||
} |