From 4c516e1f6fdf9717fc8c05feef3e024107c5476d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Fri, 9 Jun 2017 12:26:57 +0200 Subject: [PATCH] Disable UI if it's not compiled in. (#5773) * Disable UI if it's not compiled in. * Properly enabled/disable ui server depending on features. --- Cargo.toml | 5 +++-- parity/configuration.rs | 2 +- parity/rpc.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 597766a49..497078c62 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,13 +72,14 @@ daemonize = "0.2" [features] default = ["ui-precompiled"] ui = [ - "dapps", + "ui-enabled", "parity-dapps/ui", ] ui-precompiled = [ - "dapps", + "ui-enabled", "parity-dapps/ui-precompiled", ] +ui-enabled = ["dapps"] dapps = ["parity-dapps"] ipc = ["ethcore/ipc", "ethsync/ipc"] jit = ["ethcore/jit"] diff --git a/parity/configuration.rs b/parity/configuration.rs index c211b29d5..b6e0fe5d1 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -1036,7 +1036,7 @@ impl Configuration { self.args.flag_geth || self.args.flag_no_ui; - !ui_disabled + !ui_disabled && cfg!(feature = "ui-enabled") } fn verifier_settings(&self) -> VerifierSettings { diff --git a/parity/rpc.rs b/parity/rpc.rs index 66dcbcaf7..7583e15ff 100644 --- a/parity/rpc.rs +++ b/parity/rpc.rs @@ -102,7 +102,7 @@ impl From for HttpConfiguration { impl Default for UiConfiguration { fn default() -> Self { UiConfiguration { - enabled: true, + enabled: true && cfg!(feature = "ui-enabled"), port: 8180, interface: "127.0.0.1".into(), hosts: Some(vec![]),