Skip to content

Commit

Permalink
Update install instructions and troubleshooting (#126)
Browse files Browse the repository at this point in the history
Fix #124
  • Loading branch information
Mikescops committed Jul 31, 2023
1 parent a54ab2e commit 1fd393a
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 60 deletions.
58 changes: 7 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,15 @@ yarn run pkg

It outputs in `bundle` directory. Be aware you must use the same Node version as the target.

## How to use

In order to get help:

```sh
dcli help
```
## How to use (read more in our documentation website)

In order to sync your vault (this is also the recommended first step):

```sh
dcli sync
```

In order to **get a password**:
In order to **get a password, secure note or otp**:

```sh
dcli p mywebsite
Expand All @@ -69,33 +63,20 @@ dcli p url=someurl title=mytitle

dcli p url,title=mywebsite
# will return any entry for which either the url or the title matches mywebsite
```

Note: You can select a different output for passwords among `clipboard, password, json`. The JSON option outputs all the matching credentials.

In order to **generate an OTP**:
dcli note [titleFilter]
# will return any secure note for which the title matches titleFilter

```sh
dcli otp [filters]
# will return any otp for which the title matches titleFilter
```

In order to **get a secure note**:

```sh
dcli note [titleFilter]
```
Note: You can select a different output for passwords among `clipboard, password, json`. The JSON option outputs all the matching credentials.

### Options
### Debug mode

You can use `--debug` to see all the debug logs of the CLI.

In order to disable automatic synchronization of your vault that is done every hour you can use
`dcli configure disable-auto-sync true`.

If you don't want to use the OS keychain or if you don't want the CLI to save your master password encrypted you can use
`dcli configure save-master-password false`. If you previously had saved your master password encrypted it will delete
it and also delete the local key from the OS keychain.

## How private data is stored on the computer

See [src/crypto/README.md](src/crypto/README.md).
Expand All @@ -106,28 +87,3 @@ Feel free to contribute to this project, fork and pull request your ideas.
Don't include work that is not open source or not from you.

**Warranty note**: Dashlane CLI project is provided “as is,” without warranty of any kind, either express or implied. Neither Dashlane, Inc. nor its affiliates, employees or contractors warrant that Dashlane CLI will meet your requirements, operate as required without error or provide future updates. Dashlane, Inc. does not provide customer support on this project. The community is invited to submit bugs and improvements in the issues and pull requests sections of this repository.

## Troubleshooting

### Mismatching signatures

If you are using the CLI in multiple environments, and particularly in an IDE like WebStorm, they may use different
OS keychain environments so the local keys may not match: the reason why signatures are invalid.

To detect this problem you can, on Linux, install secret-tool: `sudo apt install libsecret-tools`, execute
`secret-tool search service dashlane-cli` on every environment and check if the secrets match.

If they don't, you can fix the error by manually editing what is stored in the OS keychain using this command:
`secret-tool store --label "dashlane-cli@<dashlaneId>" service dashlane-cli account <dashlaneId>` in the
failing environment with the secret from the healthy environment.

### RequestError: unable to verify the first certificate

In NodeJS the list of certificate authorities is hardcoded, read more here: [nodejs/node#4175](https://github.com/nodejs/node/issues/4175).
You can use an environment variable to add custom certs ([see documentation](https://nodejs.org/docs/latest-v16.x/api/cli.html#node_extra_ca_certsfile)):

```sh
NODE_EXTRA_CA_CERTS=/<...>/.ssl/extra_certs.pem
```

See the issue [#46](https://github.com/Dashlane/dashlane-cli/issues/46).
3 changes: 2 additions & 1 deletion documentation/pages/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"install": "Install",
"personal": "Personal",
"business": "Business",
"logout": "Logout"
"logout": "Logout",
"troubleshooting": "Troubleshooting"
}
51 changes: 43 additions & 8 deletions documentation/pages/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import { Tab, Tabs } from 'nextra-theme-docs'

# Install

<Tabs items={['Homebrew', 'Manually with Yarn', 'Packaged Executables']}>
The Dashlane CLI can be installed in multiple ways. You can either install it using [Homebrew](https://brew.sh/) on **macOS** and **Linux**, manually with [Yarn](https://yarnpkg.com/) or download the packaged executables for **Windows**, **macOS** and **Linux** on x64 architectures.

<Tabs items={['Homebrew', 'Manually with Yarn', 'Packaged Executables (x64 only)']}>
<Tab>
You can install the Dashlane CLI using [Homebrew](https://brew.sh/), a package manager for macOS. To install Homebrew, run the following command in your terminal:
You can install the Dashlane CLI using [Homebrew](https://brew.sh/), a package manager for __macOS__ and __Linux__.

To install Homebrew, run the following command in your terminal:

```sh copy
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Expand All @@ -15,9 +19,13 @@ import { Tab, Tabs } from 'nextra-theme-docs'
```sh copy
brew install dashlane/tap/dashlane-cli
```

The CLI is now installed on your machine, it will be updated automatically when a new version is released.
</Tab>
<Tab>
First you need to download or git clone this repository and run the following commands in the root directory of the repository.
This method is available on every environment that supports [Node.js](https://nodejs.org/en/) and Yarn.

First you need to download or `git clone` this repository and run the following commands in the root directory of the repository.

Install the dependencies:

Expand All @@ -36,19 +44,46 @@ import { Tab, Tabs } from 'nextra-theme-docs'
```sh copy
yarn link
```

Make sure to pull the latest changes and rebuild the project to get the latest version of the CLI.
</Tab>
<Tab>
Head to the [releases page](https://github.com/Dashlane/dashlane-cli/releases) and download the latest version of the CLI for your platform.
Head to the [releases page](https://github.com/Dashlane/dashlane-cli/releases) and download the latest version of the CLI for your platform (Windows, macOS or Linux).

Move the executable binary to the bin folder of your choice and add it to your PATH.
You may need to mark the binary as executable (on macOS and Linux):

You may need to mark the binary as executable:
```sh copy
chmod +x dcli-macos-x64
```

You can now try to run the CLI from the current directory in a terminal (Shell, PowerShell, etc.):

```sh copy
chmod +x dcli-macos
./dcli-macos-x64
```

On macos, you may also need to allow the binary to run in your security settings. To do so, go to System Preferences > Security & Privacy > General and click on "Allow Anyway" next to the message "dcli-macos was blocked from use because it is not from an identified developer".
Move the executable binary to the bin folder of your choice, for instance:

```sh
# On macOS:
mv dcli-macos-x64 /usr/local/bin/dcli
# On Linux:
mv dcli-linux-x64 /usr/local/bin/dcli
# On Windows:
move dcli-win-x64.exe C:\Windows\System32\dcli.exe
```

On macOS, you may also need to allow the binary to run in your security settings.
To do so, go to `System Preferences > Security & Privacy > General` and click on "Allow Anyway" next to the message "dcli-macos was blocked from use because it is not from an identified developer".

You will need to get the latest version of the CLI manually by downloading the latest release and replacing the binary in your bin folder.
</Tab>

</Tabs>

## What's next?

- [Authenticate to your personal account](/personal)
- [Getting Started with Business Commands](/business)
1 change: 1 addition & 0 deletions documentation/pages/personal/authentication.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ You will be then asked to validate a second factor to register the CLI to your a

- Email code validation (default)
- TOTP code validation (via an authenticator app)
- Dashlane Authenticator push notification
- DUO push notification

By completing the device registration process, you'll be now asked to enter your Master Password.
Expand Down
49 changes: 49 additions & 0 deletions documentation/pages/troubleshooting.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Tab, Tabs } from 'nextra-theme-docs';

# Troubleshooting

Here are a few common issues and how to fix them.

### Mismatching signatures

If you are using the CLI in multiple environments, and particularly in an IDE like WebStorm, they may use different
OS keychain environments so the local keys may not match: the reason why signatures are invalid.

To detect this problem you can, on Linux, install secret-tool: `sudo apt install libsecret-tools`, execute
`secret-tool search service dashlane-cli` on every environment and check if the secrets match.

If they don't, you can fix the error by manually editing what is stored in the OS keychain using this command:
`secret-tool store --label "dashlane-cli@<dashlaneId>" service dashlane-cli account <dashlaneId>` in the
failing environment with the secret from the healthy environment.

### RequestError: unable to verify the first certificate

In NodeJS the list of certificate authorities is hardcoded, read more here: [nodejs/node#4175](https://github.com/nodejs/node/issues/4175).
You can use an environment variable to add custom certs ([see documentation](https://nodejs.org/docs/latest-v16.x/api/cli.html#node_extra_ca_certsfile)):

<Tabs items={['Bash', 'Powershell', 'Batch']}>
<Tab>

```sh copy
export NODE_EXTRA_CA_CERTS="/path/to/cert.pem"
```

</Tab>
<Tab>

```powershell copy
$Env:NODE_EXTRA_CA_CERTS="C:\certs\root.crt"
```

</Tab>
<Tab>

```batch copy
set NODE_EXTRA_CA_CERTS="C:\certs\root.crt"
```

</Tab>

</Tabs>

See the issue [#46](https://github.com/Dashlane/dashlane-cli/issues/46).

0 comments on commit 1fd393a

Please sign in to comment.