diff --git a/Cargo.toml b/Cargo.toml index fe035c348..667335e39 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,6 +49,7 @@ default-features = false [features] default = ["dapps"] +no-ui = ["ethcore-signer/no-ui"] dapps = ["ethcore-dapps"] dev = ["clippy", "ethcore/dev", "ethcore-util/dev", "ethsync/dev", "ethcore-rpc/dev", "ethcore-dapps/dev", "ethcore-signer/dev"] diff --git a/parity/configuration.rs b/parity/configuration.rs index dc00cb237..6644e3437 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -561,7 +561,7 @@ impl Configuration { } pub fn dapps_enabled(&self) -> bool { - !self.args.flag_dapps_off && !self.args.flag_no_dapps + !self.args.flag_dapps_off && !self.args.flag_no_dapps && cfg!(not(feature = "no-ui")) } pub fn signer_enabled(&self) -> bool { diff --git a/parity/dapps.rs b/parity/dapps.rs index 917c59fc6..67b6ce280 100644 --- a/parity/dapps.rs +++ b/parity/dapps.rs @@ -21,9 +21,9 @@ use util::panics::PanicHandler; use die::*; use rpc_apis; -#[cfg(feature = "dapps")] +#[cfg(all(feature = "dapps", not(feature = "no-ui")))] pub use ethcore_dapps::Server as WebappServer; -#[cfg(not(feature = "dapps"))] +#[cfg(any(not(feature = "dapps"), feature = "no-ui"))] pub struct WebappServer; pub struct Configuration { @@ -62,7 +62,7 @@ pub fn new(configuration: Configuration, deps: Dependencies) -> Option Option { + signer::handle(req) + } +} +#[cfg(feature = "no-ui")] +mod signer { + pub struct File { + pub content: String, + pub mime: String, + } + + pub fn handle(_req: &str) -> Option { + None + } +} + fn origin_is_allowed(self_origin: &str, header: Option<&[u8]>) -> bool { match header { None => false,