Skip to content
This repository was archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
abdfnx committed Dec 27, 2020
1 parent 0e3dffe commit 7e22540
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM --platform=${BUILDPLATFORM} golang:1.14.3-alpine AS build
WORKDIR /src
ENV CGO_ENABLED=0
COPY . .
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o secman.go .

FROM scratch AS bin-unix
COPY --from=build secman.go /

FROM bin-unix AS bin-linux
FROM bin-unix AS bin-darwin

FROM scratch AS bin-windows
COPY --from=build secman.go /example.exe

FROM bin-${TARGETOS} AS bin
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ it's store the vault in the default location `~/.secman`. All subcommands will r

```code
❯ secman
├──git
| └──github.com
├──ionic
| └──pass
└──dev
└──dev.to
```
Expand All @@ -63,13 +63,13 @@ By default, secman will create your password vault in the `.secman` directory wi
### Inserting a password

```code
❯ secman insert git/github.com
Enter password for git/github.com:
❯ secman insert accounts/ionic
Enter password for accounts/ionic:
```

Inserting a password in to your vault is easy. If you wish to group multiple entries together, it can be accomplished by prepending a group name followed by a slash to the pass-name.

Here we are adding mint.com to the password store within the money group.
Here we are adding ionic to the password store within the money group.

### Inserting a file 📝

Expand All @@ -82,7 +82,7 @@ Adding a file works almost the same as insert. Instead it has an extra argument.
### Retrieving a password

```code
❯ secman show git/github.com
❯ secman show accounts/ionic
Enter master password:
github_is_🤩
```
Expand All @@ -92,11 +92,11 @@ Show is used to display a password in standard out.
### Rename a password

```code
❯ secman rename mney/mint.com
Enter new site name for mney/mint.com: git/github.com
❯ secman rename accounts/ionic-hub
Enter new site name for accounts/ionic-hub: accounts/ionic
```

If a password is added with the wrong name it can be updated later. Here we rename our mint.com site after misspelling the group name.
If a password is added with the wrong name it can be updated later. Here we rename ionic site after misspelling the group name.

### Updating/Editing a password

Expand Down
Binary file modified secman
Binary file not shown.
12 changes: 6 additions & 6 deletions secman.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ directory, and initialize your cryptographic keys.`,
Run: func(cmd *cobra.Command, args []string) {
info, ok := debug.ReadBuildInfo()
if !ok {
fmt.Println("(unknown)")
fmt.Println("[email protected]")
return
}
fmt.Println(info.Main.Version)
Expand All @@ -57,7 +57,7 @@ directory, and initialize your cryptographic keys.`,
insertCmd = &cobra.Command{
Use: "insert",
Short: "Insert a file or password in to your vault",
Example: "secman insert money/bank.com",
Example: "secman insert core/docker.com",
Args: cobra.RangeArgs(1, 2),
Long: `Add a site to your password store. This site can optionally be a part
of a group by prepending a group name and slash to the site name.
Expand All @@ -76,7 +76,7 @@ Will prompt for confirmation when a site path is not unique.`,

showCmd = &cobra.Command{
Use: "show",
Example: "secman show money/bank.com",
Example: "secman show core/docker.com",
Short: "Print the password of a secman entry.",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down Expand Up @@ -126,7 +126,7 @@ one group or all sites that contain a certain word in the group or name`,
renameCmd = &cobra.Command{
Use: "rename",
Short: "Rename an entry in the password vault",
Example: "secman rename money/bank.com",
Example: "secman rename core/docker.com",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
path := args[0]
Expand All @@ -138,7 +138,7 @@ one group or all sites that contain a certain word in the group or name`,
Use: "edit",
Aliases: []string{"update"},
Short: "Change the password of a site in the vault.",
Example: "secman edit money/bank.com",
Example: "secman edit core/docker.com",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
path := args[0]
Expand All @@ -149,7 +149,7 @@ one group or all sites that contain a certain word in the group or name`,
removeCmd = &cobra.Command{
Use: "remove",
Aliases: []string{"rm"},
Example: "secman remove money/bank.com",
Example: "secman remove core/docker.com",
Short: "Remove a site from the password vault by specifying the entire site-path.",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 7e22540

Please sign in to comment.