opexxx
5/12/2017 - 3:16 PM

GoPass #security #build

GoPass #security #build

Build

# requires chocolatey
# iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
cinst golang git

$go_path = "c:\projects\go"
$env:GOPATH += ";$go_path"
go get -u github.com/justwatchcom/gopass

$exe_path = "$go_path\bin\gopass.exe"
if (!(Test-Path $exe_path)) {throw "gopass.exe build failed"}

# To make it available on the PATH quickly:
#import-module $env:chocolateyInstall\helpers\chocolateyInstaller.psm1
#Install-BinFile gopass $exe_path

Use

#cinst gopass     # once on chocolatey repository, will automatically install gpg-vanilla & git if needed.
cinst gpg-vanilla git 
Update-SessionEnvironment  #refresh PATH in current shell

Gpg non-interactive gen-key

To be used for automatic tests.

@"
%echo Generating a default key
Key-Type: default
Subkey-Type: default
Name-Real: John Doe
Name-Comment: with stupid passphrase
Name-Email: john.doe@foo.bar
Expire-Date: 0
Passphrase: test

# Do a commit here, so that we can later print "done" :-)
%commit
%echo done
"@ | Out-File johndoe -Encoding ascii
gpg --batch --gen-key johndoe
rm johndoe