disable protocols by default

This commit is contained in:
Eugene Pankov 2022-07-25 15:30:57 +02:00
parent 04078e1fed
commit fe0eea172f
No known key found for this signature in database
GPG key ID: 5896FCBBDD1CF4F4
4 changed files with 10 additions and 6 deletions

View file

@ -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(),

View file

@ -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")
}
}

View file

@ -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,

View file

@ -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()
};