openethereum/parity-ethereum

Local dapps are not accessed from external ip

Closed this issue · 14 comments

Parity 1.5.2. Ropsten chain.

Test local dapp is added to /.parity/dapps.

Parity started with:
parity --testnet --jsonrpc-interface all --jsonrpc-hosts all --dapps-hosts all --dapps-interface 0.0.0.0 --ui-interface 0.0.0.0 --ui-port 8180 --dapps-port 8080 --dapps-path /.parity/dapps --keys-path /.parity/keys --db-path /.parity/db --ui-no-validation ui

Local dapp is in the list from the link http://0.0.0.0:8180/#/apps.
But it is not visible from the link: http://[external_ip]:8180/#/apps and cannot be accessed from external link. Only builtin dapps are visible from external link.

I'm facing the same problem

@tomusdrw any ETA on this issue?

As a workaround you can use a specific interface address instead of 0.0.0.0. I will prepare a fix tomorrow.

Upgraded to Parity 1.5.4.

This workaround works for direct running of parity on the host.
But it doesn't work with docker deploying, when I set docker container's ip for --dapps-interface and --ui-interface. Local dapp is invisible for docker deploying.
Full command is used inside docker container:

parity --testnet --jsonrpc-interface all --jsonrpc-hosts all --dapps-hosts all \
--dapps-interface $DAPPS_INTERFACE \
--ui-interface $UI_INTERFACE \
--ui-port 8180 \
--dapps-port 8080 \
--dapps-path /.parity/dapps \
--keys-path /.parity/keys \ 
--db-path /.parity/db \
--ui-no-validation ui

where $DAPPS_INTERFACE = $UI_INTERFACE = docker container's ip.

Any ideas?

@tomusdrw I cloned current master branch of Parity and try to compile cargo build --release --verbose Parity 1.5.4 with changes from pull request 4710.
But compilation fails with error:

error[E0463]: can't find crate for `base32`
  --> dapps/src/lib.rs:22:1
   |
22 | extern crate base32;
   | ^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

Parity successfully compiled without these changes.
What am I doing wrong?

Could you try cargo clean -p ethcore-dapps && cargo build --release --verbose?

Yes, the same error with this command.

@vbaranov it seems a bit wierd. Can you post your rustc --version, cargo --version and also try cargo clean && cargo build --release --verbose?

android-53647968be3bc0ef:~ viktor$ rustc --version
rustc 1.15.1 (021bd294c 2017-02-08)
android-53647968be3bc0ef:~ viktor$ cargo --version
cargo 0.16.0-nightly (6e0c18c 2017-01-27)

cargo clean && cargo build --release --verbose fails with the same error.

Are you trying to build branch dapps-api or did you manually merge those changes to 1.5.x? Probably the merge didn't go that well I suppose. You may try branch dapps-api-1.5

Thanks, probably, it was mistake with my manual merging.
I've successfully compiled from dapps-api-1.5 branch.
But when I start parity in docker container with flag --dapps-cors all, I still don't see any local dapp from external ip of host.
Full command inside docker container:

parity --testnet --jsonrpc-interface all --jsonrpc-hosts all --dapps-hosts all \
--dapps-interface $DAPPS_INTERFACE \
--ui-interface $UI_INTERFACE \
--ui-port 8180 \
--dapps-port 8080 \
--dapps-path /.parity/dapps \
--dapps-cors all \
--keys-path /.parity/keys \ 
--db-path /.parity/db \
--ui-no-validation ui

where
a) $DAPPS_INTERFACE = $UI_INTERFACE = docker container's ip
or b) $DAPPS_INTERFACE = $UI_INTERFACE = 0.0.0.0

@tomusdrw any ideas why?

@vbaranov just tested again both latest master and dapps-api-1.5. branch and it works good for me in such configuration.

Could you post any errors from Chrome Dev Tools (open using F12/cmd+opt+i) while switching to Applications tab?

Yes, It works with b) configuration.
The problem existed for me, because I've mapped --dapps-port 8080 port to another port outside docker container in last tests.
It works perfect with
docker run -ti -p 8545:8545 -p 30303:30303 -p 8180:8180 -p 8080:8080 --name dockerContainerName dockerImageName.
@tomusdrw thanks for help!