mirror of
https://github.com/warp-tech/warpgate.git
synced 2025-02-23 06:55:25 +08:00
disable protocols by default
This commit is contained in:
parent
04078e1fed
commit
fe0eea172f
4 changed files with 10 additions and 6 deletions
|
@ -263,7 +263,7 @@ pub struct SSHConfig {
|
|||
impl Default for SSHConfig {
|
||||
fn default() -> Self {
|
||||
SSHConfig {
|
||||
enable: true,
|
||||
enable: false,
|
||||
listen: _default_ssh_listen(),
|
||||
keys: _default_ssh_keys_path(),
|
||||
client_key: _default_ssh_client_key(),
|
||||
|
@ -274,7 +274,7 @@ impl Default for SSHConfig {
|
|||
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct HTTPConfig {
|
||||
#[serde(default = "_default_true")]
|
||||
#[serde(default = "_default_false")]
|
||||
pub enable: bool,
|
||||
|
||||
#[serde(default = "_default_http_listen")]
|
||||
|
@ -290,7 +290,7 @@ pub struct HTTPConfig {
|
|||
impl Default for HTTPConfig {
|
||||
fn default() -> Self {
|
||||
HTTPConfig {
|
||||
enable: true,
|
||||
enable: false,
|
||||
listen: _default_http_listen(),
|
||||
certificate: "".to_owned(),
|
||||
key: "".to_owned(),
|
||||
|
@ -316,7 +316,7 @@ pub struct MySQLConfig {
|
|||
impl Default for MySQLConfig {
|
||||
fn default() -> Self {
|
||||
MySQLConfig {
|
||||
enable: true,
|
||||
enable: false,
|
||||
listen: _default_http_listen(),
|
||||
certificate: "".to_owned(),
|
||||
key: "".to_owned(),
|
||||
|
|
|
@ -173,6 +173,6 @@ impl ProtocolServer for HTTPProtocolServer {
|
|||
|
||||
impl Debug for HTTPProtocolServer {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "SSHProtocolServer")
|
||||
write!(f, "HTTPProtocolServer")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ pub(crate) async fn command(cli: &crate::Cli) -> Result<()> {
|
|||
result = protocol_futures.next() => {
|
||||
match result {
|
||||
Some(Err(error)) => {
|
||||
error!(?error, "SSH server error");
|
||||
error!(?error, "Server error");
|
||||
std::process::exit(1);
|
||||
},
|
||||
None => break,
|
||||
|
|
|
@ -74,6 +74,10 @@ pub(crate) async fn command(cli: &crate::Cli) -> Result<()> {
|
|||
roles: vec![Role {
|
||||
name: "warpgate:admin".to_owned(),
|
||||
}],
|
||||
http: HTTPConfig {
|
||||
enable: true,
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue