diff --git a/README.md b/README.md index 9b0cef5..e330613 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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: diff --git a/hsm_secrets/main.py b/hsm_secrets/main.py old mode 100644 new mode 100755 index d6e1efe..2b85cd8 --- a/hsm_secrets/main.py +++ b/hsm_secrets/main.py @@ -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."