remove unneeded cmdline args, cert & key
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
those are not needed to be in supplied from the command line, moved to env.sh
This commit is contained in:
parent
4a7bded35f
commit
2470a7ccf8
|
@ -1,3 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
. ./scripts/env.sh && cargo run --no-default-features --features "server" -- ${1:-0.0.0.0:4000} --cert certs/certificate.crt --key certs/private.key
|
||||
. ./scripts/env.sh && cargo run --no-default-features --features "server" -- ${1:-0.0.0.0:4000}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
export CONFIG_CERT_FILE="./certs/certificate.crt"
|
||||
export CONFIG_KEY_FILE="./certs/private.key"
|
||||
|
||||
export DB_HOST="database"
|
||||
[ -z "$CI_DEPLOY" ] && export DB_HOST="localhost"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use std::io;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::path::PathBuf;
|
||||
use std::path::Path;
|
||||
use std::sync::Arc;
|
||||
|
||||
use argh::FromArgs;
|
||||
|
@ -21,14 +21,6 @@ struct Options {
|
|||
/// bind addr
|
||||
#[argh(positional)]
|
||||
addr: String,
|
||||
|
||||
/// cert file
|
||||
#[argh(option, short = 'c')]
|
||||
cert: PathBuf,
|
||||
|
||||
/// key file
|
||||
#[argh(option, short = 'k')]
|
||||
key: PathBuf,
|
||||
}
|
||||
|
||||
tokio::task_local! {
|
||||
|
@ -159,7 +151,8 @@ pub async fn libtrader_init_server() -> std::io::Result<()> {
|
|||
.next()
|
||||
.ok_or_else(|| std::io::Error::from(std::io::ErrorKind::AddrNotAvailable))?;
|
||||
|
||||
let config = gen_tls_server_config(&options.cert, &options.key)?;
|
||||
let config = gen_tls_server_config(&Path::new(&std::env::var("CONFIG_CERT_FILE").unwrap()),
|
||||
&Path::new(&std::env::var("CONFIG_KEY_FILE").unwrap()))?;
|
||||
let acceptor = TlsAcceptor::from(config);
|
||||
|
||||
let listener = TcpListener::bind(&addr).await?;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
## To do
|
||||
|
||||
- use env.sh or arguments
|
||||
- server move network code to somewhere plausable.
|
||||
- create correct modules
|
||||
- data implmentation stuff
|
||||
|
@ -19,7 +18,7 @@
|
|||
|
||||
## In progress
|
||||
|
||||
- configure drone ci
|
||||
- use env.sh or arguments
|
||||
|
||||
## Done
|
||||
|
||||
|
@ -141,3 +140,4 @@
|
|||
* [x] Saving/Loading stock values
|
||||
* [x] Saving/Loading profiles/portfolios
|
||||
* [x] Saving/Loading company values
|
||||
- configure drone ci
|
||||
|
|
Loading…
Reference in New Issue