Giter VIP home page Giter VIP logo

opass's Introduction

Opass

opass is a simple password database written in ocaml. It uses gpg for storing the db and all operation are performed in memory. No tricks are used to to ensure the security of this program. It depends on being run in a secure location, but since the data is stored on gpg it should be safe to store in an insecure location.

Right now opass just does things I care about so don’t expect it to work well for you.

Operations

In each operation a database is created if none exists

Adding

opass add

This adds an entry to the database. Duplicates are not allowed. The database is copied to a .bak file prior to writing the contents back out incase the write fails.

Searching

opass search <term>

Searches for a term. The password or note’s name, location, and username are all searched case insenitively. `opass search` will print the entire db

Editing

opass edit <entry name>

Edits a single entry. You can change all attributes about it, even generating a new password. The entry name must be the exact name. Use quotes if it contains spaces.

Deleting

opass del <entryname1> <entryname2> …

Will confirm and delete all matching entry names. The entry names must be exact matches. Use quotes if there are spaces in the name.

Merging

opass merge -t 1password -f /path/to/text/dump

This merges a 1Password exported file into opass. 1Password may have duplicates and this will simply error in that case, more helpful debugging will be added in the future.

Generating random passwords

opass password [-l length] [-c charset]

opass can be used to generate random passwords. Valid value for charset are `any`, `alpha`, `alphanum`. Example:

opass password -l 12

Neat! But…

Why should I use this over 1Password?

Maybe you shouldn’t! I wrote this because I wanted a solution with a CLI interface and worked on Linux. I think 1Password is a great product and I even paid for a license, but I have come to value portability and control over my platform more.

Why should I use this at all?

Maybe you shouldn’t! I wrote this for my own needs and it develops at that pace. I am willing to handle feature requests as long as they are reasonable and correspond to my own goals, but if you think the product is incomplete at this point and aren’t comfortable enough in Ocaml to fork it yourself then you probably shouldn’t use opass.

opass's People

Contributors

constfun avatar orbitz avatar orbitz-other avatar pdonadeo avatar yminsky-janestreet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

opass's Issues

Installation on OSX failed (from opam)

Building opass.1.0.0:
  make
  make PREFIX=/Users/bruno/.opam/system install
[ERROR] The compilation of opass.1.0.0 failed.
Removing opass.1.0.0.
  rm -v /Users/bruno/.opam/system/bin/opass


===== ERROR while installing opass.1.0.0 =====
# opam-version 1.1.1
# os           darwin
# command      make
# path         /Users/bruno/.opam/system/build/opass.1.0.0
# compiler     system (4.01.0)
# exit-code    2
# env-file     /Users/bruno/.opam/system/build/opass.1.0.0/opass-40732-e4db2f.env
# stdout-file  /Users/bruno/.opam/system/build/opass.1.0.0/opass-40732-e4db2f.out
# stderr-file  /Users/bruno/.opam/system/build/opass.1.0.0/opass-40732-e4db2f.err
### stdout ###
# ...[truncated]
# ocamlfind ocamlc -thread -I +camlp4 -package core -c entry.mli
# ocamlfind ocamlopt -thread -I +camlp4 -for-pack ueditable -package core  -c \
#   entry.ml
# ocamlfind ocamlc -thread -I +camlp4 -package core -c form.mli
# ocamlfind ocamlopt -thread -I +camlp4 -for-pack ueditable -package core  -c \
#   form.ml
# ocamlfind ocamlc -thread -I +camlp4 -package core -c engine.mli
# ocamlfind ocamlopt -thread -I +camlp4 -for-pack ueditable -package core  -c \
#   engine.ml
# ocamlfind ocamlopt -pack -o editable.cmx entry.cmx form.cmx engine.cmx
### stderr ###
# File "editable.cmx", line 1:
# Error: File entry.cmx
# was not compiled with the `-for-pack Editable' option
# make[3]: *** [editable.cmx] Error 2
# make[2]: *** [editable] Error 2
# make[1]: *** [all_trampoline] Error 2
# make: *** [all] Error 2

Uninformative error message when GPG is not installed

$ ./lib/main/opass add
Password/note (P/n): P
Name: Dude Guy
Location: Some Place
Username: dude
Password: y#yi,%vUqe3Lda^4o%1fGD*5
Add, retry, cancel? (A/r/c): A
Uncaught exception:

  (lib/shell.ml.Process.Failed
   ((command
     ((program /bin/sh) (arguments (-c "gpg -a --symmetric 2>/dev/null"))))
    (status (Exited 127)) (stdout "") (stderr "")))

db package not found during build

I have installed the latest stable release of Jane St's core and am using Ocaml 4.00.1.

make -C lib
make -C db .d
ocamlfind ocamldep -package core,sexplib,sexplib.syntax -syntax camlp4o db.mli > .d
make[2]: .d' is up to date. make -C db ocamlfind ocamlc -thread -I +camlp4 -package core,sexplib,sexplib.syntax -syntax camlp4o -c db.mli ocamlfind ocamlopt -thread -I +camlp4 -package core,sexplib,sexplib.syntax -syntax camlp4o -c db.ml ocamlfind ocamlopt -package core,sexplib,sexplib.syntax -syntax camlp4o -a -thread -I +camlp4 -o db.cmxa db.cmx ocamlfind ocamlc -thread -I +camlp4 -package core,sexplib,sexplib.syntax -syntax camlp4o -c db.ml ocamlfind ocamlc -package core,sexplib,sexplib.syntax -syntax camlp4o -custom -a -thread -I +camlp4 -o db.cma db.cmo make -C password .d ocamlfind ocamldep -package core password.ml password.mli > .d make[2]:.d' is up to date.
make -C password
ocamlfind ocamlc -thread -I +camlp4 -package core -c password.mli
ocamlfind ocamlopt -thread -I +camlp4 -package core -c password.ml
ocamlfind ocamlopt -package core -a -thread -I +camlp4 -o password.cmxa password.cmx
ocamlfind ocamlc -thread -I +camlp4 -package core -c password.ml
ocamlfind ocamlc -package core -custom -a -thread -I +camlp4 -o password.cma password.cmo
make -C editable .d
ocamlfind ocamldep -package core entry.ml form.ml engine.ml entry.mli form.mli engine.mli > .d
make[2]: .d' is up to date. make -C editable ocamlfind ocamlc -thread -I +camlp4 -package core -c entry.mli ocamlfind ocamlopt -thread -I +camlp4 -for-pack Editable -package core -c entry.ml ocamlfind ocamlc -thread -I +camlp4 -package core -c form.mli ocamlfind ocamlopt -thread -I +camlp4 -for-pack Editable -package core -c form.ml ocamlfind ocamlc -thread -I +camlp4 -package core -c engine.mli ocamlfind ocamlopt -thread -I +camlp4 -for-pack Editable -package core -c engine.ml ocamlfind ocamlopt -pack -o editable.cmx entry.cmx form.cmx engine.cmx ocamlfind ocamlopt -for-pack Editable -package core -a -thread -I +camlp4 -o editable.cmxa editable.cmx ocamlfind ocamlc -thread -I +camlp4 -package core -c entry.ml ocamlfind ocamlc -thread -I +camlp4 -package core -c form.ml ocamlfind ocamlc -thread -I +camlp4 -package core -c engine.ml ocamlfind ocamlc -pack -o editable.cmo entry.cmo form.cmo engine.cmo ocamlfind ocamlc -package core -custom -a -thread -I +camlp4 -o editable.cma editable.cmo make -C main .d ocamlfind ocamldep -package str,core,core_extended,db,password,editable forms.ml db_io.ml oui.ml import_1password.ml main.ml forms.mli db_io.mli oui.mli import_1password.mli > .d ocamlfind: Packagedb' not found
make[2]: *** No rule to make target `.d'. Stop.
make[1]: *** [main] Error 2
make: *** [all] Error 2

Another import filter

It's just another quick hack. I have a directory full of text files, and I want to import all of them into opass, just like you do with 1password. Since the text files are not structured at all, I plan to import them as "notes".

So I wrote a quick hack to do so, and it works. Are you interested in this "feature"? I can push it tomorrow, or I can keep it in my fork.

Let me know :-)

opam packaging

I made a go at packaging opass for opam. It seems like the OCAMLPATH issue which you attempted to fix with commit 6694406 is cropping up again ("ocamlfind: Package 'db' not found"). Manually setting the OCAMLPATH before running opam install opass seems to resolve the issue so I would guess that the way that opam is running make is somehow preventing the OCAMLPATH from being set as you expect.

I'm also surprised that setting the environment variable in the Makefile worked at all because I was under the impression that make runs each rule in its own independent shell. In any case, perhaps it would be good to make the Makefiles not depend on this if possible? I'm taking a look now and will make a pull request if I come up with anything good.

Here is my attempt at packaging opass for opam: https://gist.github.com/4414043

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.