This commit is contained in:
Eugene Pankov 2022-11-20 14:09:27 +01:00
parent d90abcfb50
commit 1842984b60
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
5 changed files with 23 additions and 15 deletions

View file

@ -1,27 +1,25 @@
projects := "warpgate warpgate-admin warpgate-common warpgate-db-entities warpgate-db-migrations warpgate-database-protocols warpgate-protocol-ssh warpgate-protocol-mysql warpgate-protocol-http warpgate-core warpgate-sso"
features := "sqlite,postgres,mysql"
run *ARGS:
RUST_BACKTRACE=1 cargo run --features {{features}} -- --config config.yaml {{ARGS}}
RUST_BACKTRACE=1 cargo run --all-features -- --config config.yaml {{ARGS}}
fmt:
for p in {{projects}}; do cargo fmt --features {{features}} -p $p -v; done
for p in {{projects}}; do cargo fmt -p $p -v; done
fix *ARGS:
for p in {{projects}}; do cargo fix --features {{features}} -p $p {{ARGS}}; done
for p in {{projects}}; do cargo fix --all-features -p $p {{ARGS}}; done
clippy *ARGS:
for p in {{projects}}; do cargo cranky --features {{features}} -p $p {{ARGS}}; done
for p in {{projects}}; do cargo cranky --all-features -p $p {{ARGS}}; done
test:
for p in {{projects}}; do cargo test --features {{features}} -p $p; done
for p in {{projects}}; do cargo test --all-features -p $p; done
yarn *ARGS:
cd warpgate-web && yarn {{ARGS}}
migrate *ARGS:
cargo run --features {{features}} -p warpgate-db-migrations -- {{ARGS}}
cargo run --all-features -p warpgate-db-migrations -- {{ARGS}}
lint:
cd warpgate-web && yarn run lint
@ -38,4 +36,4 @@ openapi:
cleanup: (fix "--allow-dirty") (clippy "--fix" "--allow-dirty") fmt svelte-check lint
udeps:
cargo udeps --features {{features}} --all-targets
cargo udeps --all-features --all-targets

View file

@ -16,7 +16,6 @@ use handler::ClientHandler;
use russh::client::Handle;
use russh::{Preferred, Sig};
use russh_keys::key::{self, PublicKey};
use tokio::sync::mpsc::error::SendError;
use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender};
use tokio::sync::{oneshot, Mutex};
use tokio::task::JoinHandle;

View file

@ -50,9 +50,15 @@ pub fn load_host_keys(config: &WarpgateConfig) -> Result<Vec<KeyPair>, russh_key
let key_path = path.join("host-rsa");
let key = load_secret_key(key_path, None)?;
key.with_signature_hash(SignatureHash::SHA2_512).map(|key| keys.push(key));
key.with_signature_hash(SignatureHash::SHA2_256).map(|key| keys.push(key));
key.with_signature_hash(SignatureHash::SHA1).map(|key| keys.push(key));
if let Some(key) = key.with_signature_hash(SignatureHash::SHA2_512) {
keys.push(key)
}
if let Some(key) = key.with_signature_hash(SignatureHash::SHA2_256) {
keys.push(key)
}
if let Some(key) = key.with_signature_hash(SignatureHash::SHA1) {
keys.push(key)
}
Ok(keys)
}

View file

@ -473,7 +473,12 @@ impl russh::server::Handler for ServerHandler {
.boxed()
}
fn tcpip_forward(self, address: &str, port: &mut u32, mut session: Session) -> Self::FutureBool {
fn tcpip_forward(
self,
address: &str,
port: &mut u32,
mut session: Session,
) -> Self::FutureBool {
let address = address.to_string();
let port = *port;
async move {

View file

@ -248,7 +248,7 @@ impl ServerSession {
self.channel_map
.get_by_left(ch)
.cloned()
.ok_or_else(|| WarpgateError::InconsistentState)
.ok_or(WarpgateError::InconsistentState)
}
fn map_channel_reverse(&self, ch: &Uuid) -> Result<ServerChannelId> {