Skip to content
This repository has been archived by the owner on Nov 9, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release-0.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
bndw committed Aug 18, 2017
2 parents 50fd627 + 84dfcb4 commit 7d4e2c0
Show file tree
Hide file tree
Showing 3,180 changed files with 1,777,695 additions and 107 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bin/
vendor/
vendor/src
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
language: go
go:
- 1.6
- 1.7
- 1.8
- tip
install:
- make
script:
- make fmt
- make govet
- make build
- make test
87 changes: 87 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 58 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"


[[constraint]]
name = "github.com/BurntSushi/toml"
version = "0.3.0"

[[constraint]]
branch = "master"
name = "github.com/atotto/clipboard"

[[constraint]]
name = "github.com/aws/aws-sdk-go"
version = "1.10.22"

[[constraint]]
name = "github.com/leonklingele/randomstring"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "github.com/mitchellh/go-homedir"

[[constraint]]
branch = "master"
name = "github.com/pkg/term"

[[constraint]]
branch = "master"
name = "github.com/spf13/cobra"

[[constraint]]
name = "github.com/spf13/pflag"
version = "1.0.0"

[[constraint]]
branch = "master"
name = "golang.org/x/crypto"
33 changes: 20 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
PWD := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

GOPKG = github.com/bndw/pick
GOPATH = "$(CURDIR)/vendor:$(CURDIR)"
GOVENDOR = vendor
GOPATH = "$(CURDIR)/$(GOVENDOR)"

PICK_DIR = $(HOME)/.pick
BIN_DIR = /usr/local/bin
INSTALL = install

FOLDERS = $(shell find . -mindepth 1 -type d -not -path "*.git*" -not -path "./githooks*" -not -path "./vendor*" -not -path "*bin*")
FOLDERS = $(shell find . -mindepth 1 -type d -not -path "*.git*" -not -path "./githooks*" -not -path "./$(GOVENDOR)*" -not -path "./Godeps*" -not -path "*bin*")

VERSION = $(shell cat VERSION)
LDFLAGS = -ldflags "-X main.version=$(VERSION)"
Expand All @@ -27,17 +28,24 @@ install_hooks:
done \
fi

goget:
GOPATH=$(GOPATH) go get github.com/rogpeppe/godeps
GOPATH=$(GOPATH) $(CURDIR)/vendor/bin/godeps -u dependencies.tsv
mkdir -p $(shell dirname "$(CURDIR)/vendor/src/$(GOPKG)")
rm -f $(CURDIR)/vendor/src/$(GOPKG)
ln -sf $(PWD) $(CURDIR)/vendor/src/$(GOPKG)

build: install_hooks goget
dependencies:
@$(shell \
cd $(GOVENDOR) ; \
rm -rf src ; \
find . -mindepth 3 -maxdepth 3 -path ./src -prune -o -type d -print | \
sed -e 's/.\///' | \
xargs -I{} sh -c ' \
mkdir -p "src/`dirname {}`" ; \
ln -sfn "../../../{}" "src/{}" ; \
' \
)
@mkdir -p $(shell dirname $(GOVENDOR)/src/$(GOPKG))
@ln -sfn ../../../.. $(GOVENDOR)/src/$(GOPKG)

build: install_hooks dependencies
GOPATH=$(GOPATH) go build $(LDFLAGS) -o bin/pick .

test: goget
test: dependencies
GOPATH=$(GOPATH) go test -v $(FOLDERS)

install:
Expand Down Expand Up @@ -65,7 +73,6 @@ config:
fi

clean:
rm -rf vendor/
rm -rf bin/

.PHONY: all install_hooks goget build test install uninstall fmt gofmt govet config clean
.PHONY: all install_hooks dependencies build test install uninstall fmt gofmt govet config clean
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
pick
====
[![Build Status](https://travis-ci.org/bndw/pick.svg?branch=master)](https://travis-ci.org/bndw/pick)
[![Go Report Card](https://goreportcard.com/badge/github.com/bndw/pick)](https://goreportcard.com/report/github.com/bndw/pick)

A minimal password manager for OS X and Linux.

![demo](https://github.com/bndw/pick/raw/master/demo.gif)
![demo](./demo.gif)

## Install

Expand All @@ -26,6 +27,39 @@ $ make
$ make install
```

## Getting started

If you haven't used `pick` before, you first need to initialize your pick safe. This is straightforward:
```sh
$ pick init
```
Running `pick init` will ask you for a master password. Your master password is used to encrypt your pick safe. As this is the only password you need to remember to access all passwords and notes stored in your pick safe, make this a strong and unique one! Use `pick pass` to generate a strong password if you think you're not creative enough :).

### Adding a credential

Once `pick` has been initialized, adding a new credential is easy:
```sh
$ pick add github
```
This will ask you for your master password first which is required to store something in the pick safe.
Then type in your username which should be used for the `github` credential.
`pick` will now ask you if you already have a password for `github` or if should create a new one for you.
Done. Credential added.

### Listing your credentials

```sh
$ pick ls
```

### Copy a credential's password to your clipboard

```sh
$ pick cp github
```

For all commands, please refer to [Usage](#usage).

## Usage
```
Usage:
Expand All @@ -39,12 +73,21 @@ Available Commands:
edit Edit a credential
export Export decrypted credentials in JSON format
ls List all credentials
mv Rename a credential
note Create a note
pass Generate a password without storing it
rm Remove a credential
sync Sync current safe with another pick safe
version Print the version number of pick
Use "pick [command] --help" for more information about a command.
```

## Threat model

Although `pick` is focussed on security, once an adversary somehow gains write access to your computer where the `pick` binary is stored, he can simply exchange it and record your master password to decrypt your pick safe.
If you decide to store the pick safe on a remote drive (e.g. a remote server), the system will be secure even if an adversary can modify the pick safe. As this safe is encrypted and authenticated, he can not modify or decrypt it.

## Similar software
* [pwd.sh: Unix shell, GPG-based password manager](https://github.com/drduh/pwd.sh)
* [Pass: the standard unix password manager](http://www.passwordstore.org/)
* [Pass: the standard unix password manager](https://www.passwordstore.org/)
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.5.0
2 changes: 2 additions & 0 deletions backends/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ func New(config *Config) (Client, error) {
fallthrough
case ConfigTypeFile:
return NewDiskBackend(*config)
case ConfigTypeS3:
return NewS3Backend(*config)
case ConfigTypeMock:
return NewMockBackend(), nil
}
Expand Down
2 changes: 2 additions & 0 deletions backends/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ type backupConfig struct {

const (
ConfigTypeFile = "file"
ConfigTypeS3 = "s3"
ConfigTypeMock = "mock"
)

Expand All @@ -24,5 +25,6 @@ func NewDefaultConfig() Config {
AutoEnabled: true,
MaxFiles: 100,
},
Settings: make(map[string]interface{}),
}
}
6 changes: 3 additions & 3 deletions backends/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func NewDiskBackend(config Config) (*DiskBackend, error) {
func (db *DiskBackend) Load() ([]byte, error) {
if _, err := os.Stat(db.path); err != nil {
if os.IsNotExist(err) {
return nil, &errors.SafeNotFound{}
return nil, errors.ErrSafeNotFound
} else {
return nil, err
}
Expand Down Expand Up @@ -133,7 +133,7 @@ func (db *DiskBackend) Backup() error {
if db.backupConfig.MaxFiles == 0 {
// Keep no backups
db.cleanOldBackups(0)
return &errors.BackupDisabled{}
return errors.ErrBackupDisabled
} else if db.backupConfig.MaxFiles > 0 {
// Subtract one as we are about to create another backup
if err := db.cleanOldBackups(db.backupConfig.MaxFiles - 1); err != nil {
Expand All @@ -159,7 +159,7 @@ func (db *DiskBackend) Backup() error {
}

if _, err := os.Stat(backupPath); err == nil {
return &errors.BackupFileExists{}
return errors.ErrBackupFileExists
}

data, err := db.Load()
Expand Down
Loading

0 comments on commit 7d4e2c0

Please sign in to comment.