Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

darwin64 install issues #43

Closed
gmOjjFj9Ezm2 opened this issue Apr 9, 2019 · 82 comments
Closed

darwin64 install issues #43

gmOjjFj9Ezm2 opened this issue Apr 9, 2019 · 82 comments

Comments

@gmOjjFj9Ezm2
Copy link

I have downloaded from github the pre-compiled darwin64 files and try to follow your install directions for macos as follows but I get errors on first line.

xxxx:browserpass-darwin64-3.0.4 XXXX$ ls -la
total 8360
drwxr-xr-x@ 8 xxxx staff 256 Apr 9 12:26 .
drwx------+ 30 xxxx staff 960 Apr 9 12:21 ..
-rw-r--r--@ 1 xxxx staff 8196 Apr 9 12:26 .DS_Store
-rw-r--r--@ 1 xxxx staff 757 Mar 12 17:39 LICENSE
-rw-r--r--@ 1 xxxx staff 20669 Apr 9 11:32 Makefile
-rw-r--r--@ 1 xxxx staff 13398 Apr 8 18:24 README.md
drwxr-xr-x@ 5 xxxx staff 160 Apr 4 04:43 browser-files
-rwxr-xr-x@ 1 xxxx staff 4219128 Apr 9 11:58 browserpass-darwin64

xxxxx:browserpass-darwin64-3.0.4 XXXX$ make BIN=browserpass-darwin64 configure
sed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
sed: 1: "browser-files/chromium- ...": undefined label 'rowser-files/chromium-host.json'
make: *** [configure] Error 1

xxxx:browserpass-darwin64-3.0.4 XXXX$ sudo make BIN=browserpass-darwin64 install
install -Dm755 -t "/usr/bin/" browserpass-darwin64
install: illegal option -- D
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 file2
install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
[-o owner] file1 ... fileN directory
install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install] Error 64

With both these errors running the commands as you request, I cannot proceed, if an error on my end, please do tell and I will correct, otherwise, please advise on next steps to resolve and get browserpass installed correctly.

@gmOjjFj9Ezm2
Copy link
Author

downloaded source and built myself and reran commands as noted on here and get the same errors for both, just FYI. I have latest 1.12.3 GO installed on latest macOS.

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Hey, thanks for testing! I don't own a mac, so you are the first person to try 😄

Could you please try something for me?

First, run this command: brew install coreutils

Then remove the unarchived browserpass-darwin folder, unarchive it again and repeat installation steps.

If this works, I'll add this to README.

@gmOjjFj9Ezm2
Copy link
Author

Nope, ran, brew install coreutils, it said there was no changes and completed. I then delete the unpack folder and extracted from archive fresh, then ran this command in the folder, make BIN=browserpass-darwin64 configure, received the same error as before and noted below. See the bold below, is that correct or a typo in the code somewhere?

xxxx:browserpass-darwin64-3.0.4 xxxx$ make BIN=browserpass-darwin64 configure
sed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
sed: 1: "browser-files/chromium- ...": undefined label 'rowser-files/chromium-host.json'
make: *** [configure] Error 1

@gmOjjFj9Ezm2
Copy link
Author

Also, from before on the second command and the error,

install -Dm755 -t "/usr/bin/" browserpass-darwin64

the -D says not valid, only -d and should m755 be together or separated from each other and from the - d argument?

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

cc @erayd, do you have experience with Mac?

I was reading up on coreutils package, does it really have all binaries prefixed with g, like gsed and ginstall?

Could you manually edit Makefile in sections configure and install and replace sed with gsed, install with ginstall?

I'm just guessing here, but if this works, we might actually be able to do something like this in Makefile:

SED := $(shell which gsed 2>/dev/null || which sed 2>/dev/null)

These are not typos in Makefile, it's just a difference in commands, both Linux and Mac apparently have the commands that are named identically, but they are not compatible, i.e. install on Linux has -D, but not on Mac.

And coreutils is a package that brings Linux versions of these tools to Mac.

@gmOjjFj9Ezm2
Copy link
Author

did that, error below, no gsed

xxxx:browserpass-darwin64-3.0.4 xxxxx$ make BIN=browserpass-darwin64 configure
gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
/bin/sh: gsed: command not found
make: *** [configure] Error 127

@gmOjjFj9Ezm2
Copy link
Author

I have coreutils 8.31 installed too

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Hmmmmmmmmm.... we need to find how to execute sed from coreutils package.

I found this command to list files in a package, please paste the output:

brew ls -v coreutils

If sed is not in that list, it might be in another package, I've seen some blog recommends this, try:

brew install gnu-sed
brew ls -v gnu-sed

@gmOjjFj9Ezm2
Copy link
Author

nothing in coreutils for sed or gsed, installed gnu-sed, sed and gsed there, but still errors on the configure and install commands.

Listing for gnu-sed

lmba:browserpass-darwin64-3.0.4 larrybeck$ brew ls -v gnu-sed
find /usr/local/Cellar/gnu-sed/4.7 -not -type d -print
/usr/local/Cellar/gnu-sed/4.7/INSTALL_RECEIPT.json
/usr/local/Cellar/gnu-sed/4.7/bin/gsed
/usr/local/Cellar/gnu-sed/4.7/.brew/gnu-sed.rb
/usr/local/Cellar/gnu-sed/4.7/ChangeLog
/usr/local/Cellar/gnu-sed/4.7/AUTHORS
/usr/local/Cellar/gnu-sed/4.7/libexec/man
/usr/local/Cellar/gnu-sed/4.7/libexec/gnubin/sed
/usr/local/Cellar/gnu-sed/4.7/libexec/gnuman/man1/sed.1
/usr/local/Cellar/gnu-sed/4.7/README
/usr/local/Cellar/gnu-sed/4.7/COPYING
/usr/local/Cellar/gnu-sed/4.7/NEWS
/usr/local/Cellar/gnu-sed/4.7/share/man/man1/gsed.1
/usr/local/Cellar/gnu-sed/4.7/share/info/sed.info

When using gsed and ginstall in makefile

configure command:
lmba:browserpass-darwin64-3.0.4 larrybeck$ make BIN=browserpass-darwin64 configure
gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/firefox-host.json

install command:
lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make BIN=browserpass-darwin64 install
ginstall -Dm755 -t "/usr/bin/" browserpass-darwin64
ginstall: cannot create regular file '/usr/bin/browserpass-darwin64': Operation not permitted
make: *** [install] Error 1

when changing makefile back to sed and install, the following error on configure command:
lmba:browserpass-darwin64-3.0.4 larrybeck$ make BIN=browserpass-darwin64 configure
sed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
sed: 1: "browser-files/chromium- ...": undefined label 'rowser-files/chromium-host.json'
make: *** [configure] Error 1

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

So gsed from gnu-sed seemed to help, right, there are no errors? To verify, open browser-files/chromium-host.json and it should contain /usr/bin/browserpass-darwin64, does it?

Cool, now we need to find where to get the proper install from 😄 Is it not being listed in the output of brew ls -v coreutils? I wonder if there's some package like gnu-install 🙂

@gmOjjFj9Ezm2
Copy link
Author

no, ginstall is listed in coreutils, but not gnu-sed

/usr/local/Cellar/coreutils/8.31/bin/ginstall
/usr/local/Cellar/coreutils/8.31/libexec/gnubin/install
/usr/local/Cellar/coreutils/8.31/libexec/gnuman/man1/install.1
/usr/local/Cellar/coreutils/8.31/share/man/man1/ginstall.1

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Oh, nevermind, I saw that ginstall exists, it complains with "Operation not permitted"! This can be fixed by using sudo, because the script is attempting to save the binary in /usr/bin/, which is owned by root.

Or do you want to install browserpass in some other folder, not in /usr/bin?

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Could you please try the attached Makefile to make sure it works properly, before I push it in the repo?

makefile.zip

@gmOjjFj9Ezm2
Copy link
Author

Copied the new makefile, tried running both configure and install with sudo and no sudo, below are the results, neither work correctly for install, one appears to work and one not for configure commands.

Non-sudo:

lmba:browserpass-darwin64-3.0.4 larrybeck$ make BIN=browserpass-darwin64 configure
/usr/local/bin/gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
/usr/local/bin/gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/firefox-host.json

lmba:browserpass-darwin64-3.0.4 larrybeck$ make BIN=browserpass-darwin64 install
/usr/local/bin/ginstall -Dm755 -t "/usr/bin/" browserpass-darwin64
ginstall: cannot create regular file '/usr/bin/browserpass-darwin64': Operation not permitted
make: *** [install] Error 1

sudo:

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make BIN=browserpass-darwin64 configure
/usr/local/bin/gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/chromium-host.json
/usr/local/bin/gsed -i "s|%%replace%%|/usr/bin/browserpass-darwin64|" browser-files/firefox-host.json

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make BIN=browserpass-darwin64 install
/usr/local/bin/ginstall -Dm755 -t "/usr/bin/" browserpass-darwin64
ginstall: cannot create regular file '/usr/bin/browserpass-darwin64': Operation not permitted
make: *** [install] Error 1

@gmOjjFj9Ezm2
Copy link
Author

So gsed from gnu-sed seemed to help, right, there are no errors? To verify, open browser-files/chromium-host.json and it should contain /usr/bin/browserpass-darwin64, does it?

Yes, this had that line added to json file

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

You need to run make configure without sudo and make install with sudo, but interestingly enough sudo doesn't give you permissions to install stuff in /usr/bin/ either!

Let's try to install in /usr/local/bin, since this is where coreutils installed their binaries.

You will need to remove the browserpass-darwin64 folder and unpack it again, because make configure only works once, second time it's not doing anything (I'll try to fix that as well). Once unpacked, put Makefile I attached above in there.

Finally run these commands:

make BIN=browserpass-darwin64 PREFIX=/usr/local configure
sudo make BIN=browserpass-darwin64 PREFIX=/usr/local install

@gmOjjFj9Ezm2
Copy link
Author

I think it worked, is this what we need to see:

lmba:browserpass-darwin64-3.0.4 larrybeck$ make BIN=browserpass-darwin64 PREFIX=/usr/local configure
/usr/local/bin/gsed -i "s|%%replace%%|/usr/local/bin/browserpass-darwin64|" browser-files/chromium-host.json
/usr/local/bin/gsed -i "s|%%replace%%|/usr/local/bin/browserpass-darwin64|" browser-files/firefox-host.json

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make BIN=browserpass-darwin64 PREFIX=/usr/local install
/usr/local/bin/ginstall -Dm755 -t "/usr/local/bin/" browserpass-darwin64
/usr/local/bin/ginstall -Dm644 -t "/usr/local/lib/browserpass/" Makefile
/usr/local/bin/ginstall -Dm644 -t "/usr/local/share/licenses/browserpass/" LICENSE
/usr/local/bin/ginstall -Dm644 -t "/usr/local/share/doc/browserpass/" README.md
/usr/local/bin/ginstall -Dm644 browser-files/chromium-host.json "/usr/local/lib/browserpass/hosts/chromium/com.github.browserpass.native.json"
/usr/local/bin/ginstall -Dm644 browser-files/chromium-policy.json "/usr/local/lib/browserpass/policies/chromium/com.github.browserpass.native.json"
/usr/local/bin/ginstall -Dm644 browser-files/firefox-host.json "/usr/local/lib/browserpass/hosts/firefox/com.github.browserpass.native.json"

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Think so! Try to install the latest browser extension now from browserpass-extension repo, and let me know if everything works!

Don't close this issue yet, I'll use it to improve Makefile and README.

@gmOjjFj9Ezm2
Copy link
Author

when i run this, sudo make hosts-chromium, i get the following:

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make hosts-chromium
make: getcwd: No such file or directory
make: *** No rule to make target `hosts-chromium'. Stop.

@gmOjjFj9Ezm2
Copy link
Author

i have manually installed extension for Chromium from that repo, restarted Chromium, it shows but gives me the following error in the toolbar.

Error: Error: Specified native messaging host not found.

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Try this: sudo make hosts-chromium -f /usr/local/lib/browserpass/Makefile

@gmOjjFj9Ezm2
Copy link
Author

sudo make hosts-chromium -f /usr/local/lib/browserpass/Makefile

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make hosts-chromium -f /usr/local/lib/browserpass/Makefile
make: getcwd: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json -> /usr/lib/browserpass/hosts/chromium/com.github.browserpass.native.json
Error: the symlink points to a non-existent location

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Oops, my bad, let's try again:

sudo make PREFIX=/usr/local hosts-chromium -f /usr/local/lib/browserpass/Makefile

The other errors are weird, but they don't seem to really affect the behavior. Let's see if this works.

@gmOjjFj9Ezm2
Copy link
Author

sudo make PREFIX=/usr/local hosts-chromium -f /usr/local/lib/browserpass/Makefile

Is this what we need:

lmba:browserpass-darwin64-3.0.4 larrybeck$ sudo make PREFIX=/usr/local hosts-chromium -f /usr/local/lib/browserpass/Makefile
Password:
make: getcwd: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
/Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json -> /usr/local/lib/browserpass/hosts/chromium/com.github.browserpass.native.json

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Yep! The file

/Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json

Must be a correct symlink, open this file and you should see /usr/local/bin/browserpass in there.

And extension must be working now, is it?

@gmOjjFj9Ezm2
Copy link
Author

Extension still shows this error after I installed it and restarted browser.

Error: Error: Specified native messaging host not found.

@gmOjjFj9Ezm2
Copy link
Author

/Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json

json file is not in that directory at all

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

To confirm, do you mean that com.github.browserpass.native.json is not present in /Library/Application Support/Chromium/NativeMessagingHosts/?

@gmOjjFj9Ezm2
Copy link
Author

To confirm, do you mean that com.github.browserpass.native.json is not present in /Library/Application Support/Chromium/NativeMessagingHosts/?

correct, that symlink error above must be saying it was not created as it is not in the usr/lib folder either

@maximbaz
Copy link
Member

maximbaz commented Apr 9, 2019

Could you please try this? Just some wild idea, want to make sure we are not impacted by another issue.

cd /usr/local/lib/browserpass
sudo make PREFIX=/usr/local hosts-chromium

@gmOjjFj9Ezm2
Copy link
Author

Thanks for the help @larry-beck, it is very nice that we are able to test macOS experience before the Saturday release, I highly appreciate.

To remove:

sudo rm -rf /usr/local/lib/browserpass
sudo rm -rf /usr/local/bin/browserpass
sudo rm -rf /Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json
sudo rm -rf /Users/larrybeck/Library/Application Support/Chromium/NativeMessagingHosts/com.github.browserpass.native.json

Here's a patched release archive for you: browserpass-darwin64-3.0.4.tar.gz

I have updated the README in #44. I think the best way would be to ask you to go through the new README steps and try to install by yourself, but please paste afterwards every single command that you executed and its output, for diagnostics.

I suspect we will stumble upon an issue during make hosts-chromium again, but let's see.

I have another Mac to test this on if you think that all the fixes are in that need to be there. This other Mac only has v2 installed, so it will be sort of fresh without having to manually remove things that could taint the final touches for verifying the install works correctly for a normal user.

Please confirm that you feel the native install is complete and I will attempt the install for v3 on that laptop.

@gmOjjFj9Ezm2
Copy link
Author

Where is the old v2 json file stored for Brave Browser as I have it working correctly in my present install but I cannot find the json file as I see for Chromium or Firefox in the same folder as the v3 one for each of them? I have checked the following which only contains the v3 json that I am trying to get working now.

/Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts

@gmOjjFj9Ezm2
Copy link
Author

gmOjjFj9Ezm2 commented Apr 10, 2019

There must be something not right with the extension for Chromium working with Brave Browser, my reasoning is this:

  1. If I install manually the extension via the zip file browserpass-chromium-3.0.6.zip, it installs but I cannot get it to work in browser, error says "Error: Error: Specified native messaging host not found."
  2. Remove manual Load Unpacked install from Add temporary bash host #1 and drag and drop browserpass-github-3.0.6.crx, it installs but is greyed out and says the extension is not from Chrome or Brave and cannot be used. Plus I had v2 installed, and when I install the extension this way, it uninstalls/removes the v2 which I can install again from Chrome Store and it works fine as usual.

Anyone else have any thoughts, I have done everything we did to get Chromium version working, verified all items as before and nothing works, so I think something might not be right with the Chromium extension working with Brave, or something along those lines?

@Amar1729
Copy link

Amar1729 commented Apr 10, 2019

@larry-beck i'm not sure, but I seem to remember the installation for v2 browserpass going under ~/.browserpass or ~/.config/browserpass.

@maximbaz do you have a way of creating a request.hex.txt file like you had at the older linked issue? Could make debugging/testing a little easier.

update: The extension works for me using Brave browser.

  • i used the unpacked extension (3.0.6)
  • unzipped it and "load unpacked" in developer mode in brave://extensions

i tried both the -github and -webstore releases, but those stayed grayed out. It seems that Brave's security policy is too strict to allow a .crx that's not on the webstore being enabled, so you have to load it unpacked as developer.

btw rough formula added to my tap. I'll add instructions for it to the PR.
https://github.com/Amar1729/homebrew-formulae/blob/master/browserpass.rb

@gmOjjFj9Ezm2
Copy link
Author

@larry-beck i'm not sure, but I seem to remember the installation for v2 browserpass going under ~/.browserpass or ~/.config/browserpass.

I do not see anything in either place mentioned, I know it is somewhere as I have v2 still running in Brave and I cannot find the json file it is using.

@maximbaz
Copy link
Member

maximbaz commented Apr 10, 2019

@Amar1729 I have something better: native.pl and PROTOCOL.md.

The simplest request is:

❯ /tmp/native.pl ./browserpass-linux64 '{"action": "configure"}'        
Request: |  {"action": "configure"}
Result:  |  {"status":"ok","version":3000004,"data":{"defaultStore":{"path":"/home/maximbaz/.password-store","settings":"{}"},"storeSettings":{}}}
Errors:  |  -

UPDATE: ah, you need to for an automated test in your tap, I'll prepare a request.hex file for you.

UPDATE 2: request.hex.txt

❯ ./browserpass-linux64 < /tmp/request.hex.txt
{"status":"ok","version":3000004,"data":{"defaultStore":{"path":"/home/maximbaz/.password-store","settings":"{}"},"storeSettings":{}}}

@larry-beck the old json is named com.dannyvankooten.browserpass.json, try locate maybe to find it, if that exists on macOS?

@Amar1729 do you confirm that you used make hosts-brave to configure Brave, and it did create the correct symlink and everything works as expected? Could you please assist @larry-beck? Do you guys use the same Brave browser, installed in the same way? And by the way, do you think I can merge #44 now, were instructions clear to you?

@larry-beck yes you can try from this release archive and README from #44 (rendered: README).

@Amar1729
Copy link

Amar1729 commented Apr 10, 2019

@maximbaz thanks for the request i'll update the test for the brewfile.

@larry-beck for brave I tested the extension two ways:

  • installed brave-browser-dev via its homebrew cask
  • navigated to brave://extensions and loaded the unpacked extension

And to install the native:

# 1: verify homebrew install
brew install amar1729/formulae/browserpass
cd /usr/local/opt/browserpass/lib
DESTDIR='' PREFIX='/usr/local/opt/browserpass' make hosts-brave-user
# went to github.com and verified the extension worked (it did)

# 2: verify local install
cd /opt/src/browserpass-native
PREFIX='/opt' DESTDIR='' make BIN=browserpass-darwin64 configure
PREFIX='/opt' DESTDIR='' make BIN=browserpass-darwin64 make
PREFIX='/opt' DESTDIR='' make BIN=browserpass-darwin64 hosts-brave-user
# went to github.com and verified the extension worked (it did)

# both of these steps were done with #44 

p.s. locate does exist on macOS by default, although you may have to run updatedb or sudo updatedb first

@gmOjjFj9Ezm2
Copy link
Author

I have Brave release version installed, json file is in NativeMessagingHosts folder, /Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts, file links to json file, /usr/local/lib/browserpass/hosts/chromium/com.github.browserpass.native.json, and that json file reads the following contents:

{
"name": "com.github.browserpass.native",
"description": "Browserpass native component for the Chromium extension",
"path": "/usr/local/bin/browserpass-darwin64",
"type": "stdio",
"allowed_origins": [
"chrome-extension://naepdomgkenhinolocfifgehidddafch/",
"chrome-extension://pjmbgaakjkbhpopmakjoedenlfdmcdgm/",
"chrome-extension://klfoddkbhleoaabpmiigbmpbjfljimgb/"
]
}

The extension is installed, but gives the following error as in the beginning with the Chromium issue we dealt with yesterday, Error: Error: Specified native messaging host not found.

image

Let me know what else to look at, should work as Chromium started yesterday when we made changes, but it does not, Firefox and Chromium are working fine, no issues.

@Amar1729
Copy link

If you're getting Error: Error: specified native messaging host not found it seems like Brave can't find the executable for some reason.

Can you do

ls -lh /usr/local/bin/browserpass-darwin64

to make sure the file is there and executable?

also: you can use backtics for code formatting (single ` surrounding a line, or triple ``` surrounding a code block)

@gmOjjFj9Ezm2
Copy link
Author

If you're getting Error: Error: specified native messaging host not found it seems like Brave can't find the executable for some reason.

Can you do

ls -lh /usr/local/bin/browserpass-darwin64

to make sure the file is there and executable?

lmba:browserpass larrybeck$ ls -lh /usr/local/bin/browserpass-darwin64
-rwxr-xr-x 1 root admin 4.0M Apr 9 15:20 /usr/local/bin/browserpass-darwin64

@maximbaz
Copy link
Member

Well, because it's a symlink, and because @larry-beck has it working in Chromium, the contents of the json file as well as the binary itself is definitely correct.

The only thing I can think of is that for some reason your @larry-beck version of Brave browser does not respect a json file located in the following location:

/Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.github.browserpass.native.json

Are you running exactly the same version of Brave browser as @Amar1729 described, "installed brave-browser-dev via its homebrew cask"?

@Amar1729
Copy link

Amar1729 commented Apr 10, 2019

That is very strange. The native host works for me both in brave stable and dev. Can you try

sudo chown larrybeck /usr/local/bin/browserpass-darwin64 ?

I've got no idea why it's not working for you though.

edit: yeah this is the full path of the json file for me (for both dev and stable):

/Users/amar/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.github.browserpass.native.json

@maximbaz
Copy link
Member

maximbaz commented Apr 10, 2019

@Amar1729 can you confirm that both locations are correct on macOS?

/Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.github.browserpass.native.json

/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.github.browserpass.native.json

To test, remove both files, check that you get an error, add one of them, check that Browserpass is working again.

@Amar1729
Copy link

Oh this is weird -
I guess my installation of Chrome was shadowing Brave somehow?

# extension in Brave browser (stable and dev) works properly, even though this file is under chrome application support
/Users/amar/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.github.browserpass.native.json

# extension does NOT work (native messaging host not found)
/Users/amar/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.github.browserpass.native.json

# if both exist, the extension works fine

@gmOjjFj9Ezm2
Copy link
Author

Gents, here is what I don't understand about Brave, there is no com.dannyvankooten.browserpass.json file to be found in any BraveSoftware and/or Brave-Browser folder for v2 as there is being created for v3, see attached photos showing my Chromium folder with both v2 and v3 json files for browserpass and the Brave folder with only the v3 json file. Also see the screenshot showing that in Brave v2 and v3 extensions are installed, v2 is working, but v3 is not. Something is missing here from v2 to v3.

Screen Shot 2019-04-10 at 1 45 16 PM
Screen Shot 2019-04-10 at 1 45 26 PM
Screen Shot 2019-04-10 at 1 45 49 PM
Screen Shot 2019-04-10 at 1 46 50 PM
Screen Shot 2019-04-10 at 1 47 43 PM

@gmOjjFj9Ezm2
Copy link
Author

though this file is under chrome application support
/Users/amar/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.github.browserpass.native.json

Bingo, when I copy the /usr/local/lib/browserpass/hosts/chromium/com.github.browserpass.native.json file to /Users/larrybeck/Library/Application Support/Google/Chrome/NativeMessagingHosts, Brave works correctly now with v3. See attached to confirm. What do we need to do to fix this as I don't even have Google Chrome installed any longer, that was a previous installed before I stopped using Google Chrome, I only use the Chromium browser now and others will have the same type issue is not using Google Chrome too.

Screen Shot 2019-04-10 at 1 54 14 PM

@Amar1729
Copy link

Amar1729 commented Apr 10, 2019

Linking the chrome docs:

OS X (user-specific, default path)
Google Chrome: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.my_company.my_application.json
Chromium: ~/Library/Application Support/Chromium/NativeMessagingHosts/com.my_company.my_application.json

I tried the Chromium directory, but Brave doesn't read that - it only seems to find the json if it's under the Google/Chrome application support dir. Not sure if it's because Brave made the decision to read that dir instead of the Chromium dir, or if chromium engine browsers on MacOS are still supposed to read the Chrome directory instead.

Either way, I guess the makefile for hosts-brave-user and hosts-brave should be changed to mirror hosts-chrome-user and hosts-chrome, respectively.

Edit @maximbaz - regarding system-wide install, Brave browser does NOT read the json file under chrome, it needs the Chromium directory for a system-wide. It does not work at all in the BraveSoftware dir structure.

# this doesnt work for brave
/Library/Google/Chrome/NativeMessagingHosts/

# this does
/Library/Application Support/Chromium/NativeMessagingHosts/

@larry-beck if you're worried about a fix, I don't think there's a need to be concerned - the file will live under Library/Application Support/Google/Chrome/ but you won't actually have Chrome installed, you'll just have that folder with the json in it.

@gmOjjFj9Ezm2
Copy link
Author

I can confirm too that Brave release, beta and developer all work as long as the v3 json file is in the /Users/larrybeck/Library/Application Support/Google/Chrome/NativeMessagingHosts folder, but not without it being in there, the /Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser does not matter if the v3 json file is there, right now anyway. Also, if you have more than release of Brave installed on macOS, you will have three folders where the json file will need to be located as they create three different folder structures for each version of browser installed on macOS, see below what I mean.

  1. /Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser
  2. /Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser-Beta
  3. /Users/larrybeck/Library/Application Support/BraveSoftware/Brave-Browser-Dev

There will need to be a NativeMessagingHosts folder created in the Beta and Dev folders structures with the json file for each of those to work when the final fix is in and Brave is not looking in the Chrome folders.

@gmOjjFj9Ezm2
Copy link
Author

Linking the chrome docs:

OS X (user-specific, default path)
Google Chrome: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.my_company.my_application.json
Chromium: ~/Library/Application Support/Chromium/NativeMessagingHosts/com.my_company.my_application.json

I tried the Chromium directory, but Brave doesn't read that - it only seems to find the json if it's under the Google/Chrome application support dir. Not sure if it's because Brave made the decision to read that dir instead of the Chromium dir, or if chromium engine browsers on MacOS are still supposed to read the Chrome directory instead.

Either way, I guess the makefile for hosts-brave-user and hosts-brave should be changed to mirror hosts-chrome-user and hosts-chrome, respectively.

@larry-beck if you're worried about a fix, I don't think there's a need to be concerned - the file will live under Library/Application Support/Google/Chrome/ but you won't actually have Chrome installed, you'll just have that folder with the json in it.

Sounds fine to me as long as the install creates those Google Chrome directories and files if someone does not even have Google Chrome installed, else they will have issues with v3 working for them in Brave.

@gmOjjFj9Ezm2
Copy link
Author

Let me know when complete updated install files and directions are done for macOS and I will test fresh on my other Mac laptop that has Firefox and Brave on it to make sure everything "just works" for the normal user per se.

@Amar1729
Copy link

@maximbaz this is the patch I have for the Makefile (since I can't edit #44 ):

diff --git a/Makefile b/Makefile
index c5ae0a6..e7222a4 100644
--- a/Makefile
+++ b/Makefile
@@ -191,9 +191,9 @@ hosts-brave:
 	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "/etc/opt/brave/native-messaging-hosts/$(APP_ID).json"; \
 	            [ -e "/etc/opt/brave/native-messaging-hosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
 	            ;; \
-	Darwin)     mkdir -p "/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/"; \
-	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json"; \
-	            [ -e "/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
+	Darwin)     mkdir -p "/Library/Application Support/Chromium/NativeMessagingHosts/"; \
+	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "/Library/Application Support/Chromium/NativeMessagingHosts/$(APP_ID).json"; \
+	            [ -e "/Library/Application Support/Chromium/NativeMessagingHosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
 	            ;; \
 	*)          echo "The operating system $(OS) is not supported"; exit 1 ;; \
 	esac
@@ -205,9 +205,9 @@ hosts-brave-user:
 	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json"; \
 	            [ -e "${HOME}/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
 	            ;; \
-	Darwin)     mkdir -p "${HOME}/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/"; \
-	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "${HOME}/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json"; \
-	            [ -e "${HOME}/Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
+	Darwin)     mkdir -p "${HOME}/Library/Application Support/Google/Chrome/NativeMessagingHosts/"; \
+	            ln -sfv "$(LIB_DIR)/browserpass/hosts/chromium/$(APP_ID).json" "${HOME}/Library/Application Support/Google/Chrome/NativeMessagingHosts/$(APP_ID).json"; \
+	            [ -e "${HOME}/Library/Application Support/Google/Chrome/NativeMessagingHosts/$(APP_ID).json" ] || echo "Error: the symlink points to a non-existent location" >&2; \
 	            ;; \
 	*)          echo "The operating system $(OS) is not supported"; exit 1 ;; \
 	esac

Tested the user and system-wide target after deleting all other hosts files, they both work for Brave.

@maximbaz
Copy link
Member

Wow, thanks guys! What a mess.

So, to summarize, here's a situation for Brave:

@maximbaz
Copy link
Member

I've just pushed to #44, could you please have a final look if everything looks alright?

@Amar1729
Copy link

Tested user and systemwide for Google Chrome and Brave, both work!

@maximbaz
Copy link
Member

@larry-beck 3.0.5 is ready for your testing 😉 If you experience more issues, just post here, I'll reopen the ticket if there are more changes I can/need to do on my side.

@gmOjjFj9Ezm2
Copy link
Author

@larry-beck 3.0.5 is ready for your testing 😉 If you experience more issues, just post here, I'll reopen the ticket if there are more changes I can/need to do on my side.

Been slammed, will try to test install on other Mac late tonight and report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants