brave / vault

Brave personal data store vault.
https://brave.com
Mozilla Public License 2.0
19 stars 18 forks source link

Replacements are not working for vault* environments on heroku #15

Closed KevinGrandon closed 8 years ago

KevinGrandon commented 8 years ago

When running the browser with: VAULT_HOST=https://vault-staging.brave.com gulp

It seems no HTTP requests are being made to the vault.

bridiver commented 8 years ago

I think this is a browser issue, not a vault issue. It looks like process.env.VAULT_HOST is not making it to config.js.

The env definitely gets passed through to the executable in the gulpfile.js run task. I tried manually adding it in the shell options with no change and ps -p <PID> -wwwE shows VAULT_HOST for both PIDs. export VAULT_HOST=https://vault-staging.brave.com doesn't work either so it seems like something must be explicitly setting process.env or at least filtering it.

Changing the default value for vaultHost in config.js does work, so the variable is being used correctly.

KevinGrandon commented 8 years ago

Thanks for chiming in! There definitely was a problem with the browser code, but we fixed a problem with VAULT_HOST yesterday. I'm actually seeing the iframe get populated with the correct SRC, but for some reason it's not making the request. Will post some screenshots soon.

(Are you actually getting ad replacements when overriding vaultHost manually? I'll give that a shot as well)

KevinGrandon commented 8 years ago

Here's what I'm seeing when passing VAULT_HOST. I also see the same thing when I hard-code the vaultHost value int he browser config.js. The iframe is in the page, but no HTTP requests are made. Wonder if we're catching the request in ad blocking or tracking protection. screen shot 2015-10-28 at 1 10 52 pm

bridiver commented 8 years ago

I also only see empty boxes, but there was no error message so I assumed it was calling out to the vault and just had nothing to serve. How do you open the dev tools window?

KevinGrandon commented 8 years ago

I also only see empty boxes, but there was no error message so I assumed it was calling out to the vault and just had nothing to serve. How do you open the dev tools window?

We're going to try to get them embedded inside of brave, but for now you need to have a Firefox instance running and use Tools -> Web Developer -> WebIDE. From there you can connect to "remote desktop". Oh, and you also need to have remote debugging enabled in about:preferences inside of Brave. It's quite a chore currently - we're going to make it better.

KevinGrandon commented 8 years ago

sigh.. this was happening because the easlist has a rule like:

{"isException":false,"options":{},"isRegex":false,"data":".com/ad?"},

Removing that line causes everything to load just fine. The likely fix here is to just rename that route :)

KevinGrandon commented 8 years ago

We have a temporary workaround for now, handled by: https://github.com/brave/vault/pull/16 and https://github.com/brave/browser/commit/57c7bd5ddac107bf0c9d3be506aa4a141bbe6ac9

In the future we'll need to make sure that requests to the vault don't get caught up in the ad blocking or tracking protection rules, possibly by having some list of whitelisted hosts.