Skip to content

Commit

Permalink
Improve Windows/Powershell compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
elonen committed Jul 29, 2024
1 parent e860517 commit 513eff5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ Work-in-progress, but usable and useful.

## Installation and upgrade

LINUX:

Assuming you have a `~/bin/` directory in path, this will install(/upgrade) the
tool in a `_venv` and link it into your bin directory:

Expand All @@ -94,6 +96,24 @@ make
rm -f ~/bin/hsm-secrets; ln -s $(pwd)/_venv/bin/hsm-secrets ~/bin/
```

WINDOWS:

```
git pull
python3 -m venv _venv
_venv\Scripts\activate
pip install -r requirements.txt
python setup.py install -e .
```

Then add to PowerShell profile something like this:

```
$env:HSM_SECRETS_CONFIG = "~\hsm-secrets\hsm-conf.yml"
Set-Alias -Name hsm-secrets -Value "~\hsm-secrets\_venv\Scripts\hsm-secrets"
```
...and restart PowerShell.

## Authentication

Default HSM authentication method depends on the subcommand:
Expand Down
2 changes: 1 addition & 1 deletion hsm_secrets/main.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def cli(ctx: click.Context, config: str|None, quiet: bool, yklabel: str|None, hs
raise click.UsageError(f"No configuration file found in env or {str(default_paths)}. Please specify a config file with -c/--config or set the {env_var} environment variable.")

cli_info("Using config file: " + click.style(config, fg='cyan'), err=True)
conf = load_hsm_config(config)
conf = load_hsm_config(os.path.expanduser(config))

assert conf.general.master_device, "No master YubiHSM serial specified in config file."

Expand Down

0 comments on commit 513eff5

Please sign in to comment.