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

Commit

Permalink
Merge pull request #2 from secman-team/main
Browse files Browse the repository at this point in the history
Pull New
  • Loading branch information
Timothee-Cardoso authored Apr 2, 2021
2 parents 7816508 + 4fc2c07 commit 15ed5f3
Show file tree
Hide file tree
Showing 25 changed files with 259 additions and 586 deletions.
112 changes: 77 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,103 @@
version: 2.1

orbs:
ruby: circleci/[email protected]
win: circleci/[email protected]

linux_environment: &linux_environment
PLATFORM: "linux"

windows_environment: &windows_environment
PLATFORM: "windows"

install_secman_linux: &install_secman_linux
name: Install Secman (Linux)
command: curl -fsSL https://secman-team.github.io/install.sh | bash

install_secman_windows: &install_secman_windows
name: Install Secman (Windows)
command: iwr -useb https://secman-team.github.io/install.ps1 | iex

test_secman: &test_secman
name: Run Secman && Test It
command: |
git clone https://github.com/secman-team/.secman.ex $HOME/.secman
secman
jobs:
build:
docker:
# specify the version
- image: circleci/golang:1.9

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

#### TEMPLATE_NOTE: go expects specific checkout path representing url
#### expecting it in the form of
#### /go/src/github.com/circleci/go-tool
#### /go/src/bitbucket.org/circleci/go-tool
working_directory: /go/src/github.com/{{ORG_NAME}}/{{REPO_NAME}}
steps:
- checkout

# specify any bash command here prefixed with `run: `
- run: go get -d ./...

install_secman:

linux_build:
environment:
<<: *linux_environment

machine:
image: ubuntu-1604:202004-01
image: ubuntu-1604:201903-01

steps:
- checkout
- run:
name: Install Secman
command: |
curl -fsSL https://secman-team.github.io/install/install.sh | bash
<<: *install_secman_linux

clone_dot_secman_ex:
machine:
image: ubuntu-1604:202004-01
linux_test:
environment:
<<: *linux_environment

steps:
- run: git clone https://github.com/secman-team/.secman.ex ~/.secman

test_secman:
machine:
image: ubuntu-1604:202004-01
image: ubuntu-1604:201903-01

steps:
- checkout
- run:
<<: *install_secman_linux

- run:
name: Test Secman
command: |
curl -fsSL https://secman-team.github.io/install/install.sh | bash
secman
<<: *test_secman

windows_build:
environment:
<<: *windows_environment

executor: win/default

steps:
- checkout
- run:
<<: *install_secman_windows
shell: powershell.exe

windows_test:
environment:
<<: *windows_environment

executor: win/default

steps:
- checkout
- run:
<<: *install_secman_windows
shell: powershell.exe

- run:
<<: *test_secman
shell: powershell.exe

workflows:
test_install_secman:
version: 2.1
linux_jobs:
jobs:
- install_secman

test__secman:
- linux_build
- linux_test

windows_jobs:
jobs:
- clone_dot_secman_ex
- test_secman
- windows_build
- windows_test
2 changes: 1 addition & 1 deletion .github/workflows/secman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2

- name: Install secman
run: curl -fsSL https://secman-team.github.io/install/install.sh | bash
run: curl -fsSL https://secman-team.github.io/install.sh | bash

- name: Clone .secman (ex folder)
run: git clone https://github.com/secman-team/.secman.ex ~/.secman
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ secret_key.rb

# beta folder
/api/sync/beta
go.sum
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@
[submodule "shell"]
path = plugins/shell
url = https://github.com/secman-team/shell.git

[submodule "docs"]
path = docs
url = https://github.com/secman-team/docs.git
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# [<img src="https://github.com/secman-team/secman/blob/main/.github/assets/secman.svg" width="300" align="center">][smUrl]

[![RELEASE](https://img.shields.io/github/v/release/secman-team/secman?style=flat)](https://github.com/secman-team/secman/releases/latest)
[![RELEASE](https://img.shields.io/github/v/release/secman-team/secman?style=for-the-badge)](https://github.com/secman-team/secman/releases/latest)

## Code Status

![CircleCI](https://circleci.com/gh/secman-team/secman.svg?style=svg)
![CodeQL](https://img.shields.io/github/workflow/status/secman-team/secman/CodeQL?color=blue&label=CodeQL%20Build&logo=github)
![Go](https://img.shields.io/github/workflow/status/secman-team/secman/Go%20CI?color=blue&label=Go%20Build&logo=go)
![Secman CI](https://img.shields.io/github/workflow/status/secman-team/secman/Secman%20CI?color=blue&label=Secman%20CI&logo=github-actions&logoColor=white)
![CodeQL](https://img.shields.io/github/workflow/status/secman-team/secman/CodeQL?color=blue&label=CodeQL%20Build&logo=github&style=for-the-badge)
![Go](https://img.shields.io/github/workflow/status/secman-team/secman/Go%20CI?color=blue&label=Go%20Build&logo=go&style=for-the-badge)
![Secman CI](https://img.shields.io/github/workflow/status/secman-team/secman/Secman%20CI?color=blue&label=Secman%20CI&logo=github-actions&logoColor=white&style=for-the-badge)

---

Expand All @@ -19,35 +19,34 @@

> secman needs [**go**][goUrl], [**git**](https://git-scm.com), [**ruby**](https://www.ruby-lang.org) and [**gh cli**](https://cli.github.com)
- ![go](https://img.shields.io/static/v1?label=%20&message=v1.11%20and%20above&color=9cf&logo=go)
- ![git](https://img.shields.io/static/v1?label=%20&message=git&color=9cf&logo=git)
- ![ruby](https://img.shields.io/static/v1?label=%20&message=ruby&color=9cf&logo=ruby&logoColor=red)
- ![gh cli](https://img.shields.io/static/v1?label=%20&message=gh%20cli&color=9cf&logo=github&logoColor=black)
- ![windows needs bash](https://img.shields.io/static/v1?label=%20&message=windows%20needs%20bash&color=9cf&logo=gnu-bash&logoColor=black)
- [![go](https://img.shields.io/static/v1?label=%20&message=v1.11%20and%20above&color=9cf&logo=go&style=for-the-badge)](https://golang.org)
- just if you want to [download secman from source](https://secman.vercel.app/docs/getting_started/installation#installing-from-source)
- [![git](https://img.shields.io/static/v1?label=%20&message=git&color=9cf&logo=git&style=for-the-badge)](https://git-scm.com)
- [![ruby](https://img.shields.io/static/v1?label=%20&message=ruby&color=9cf&logo=ruby&logoColor=red&style=for-the-badge)](https://www.ruby-lang.org/en/)
- _ruby for windows_: **https://rubyinstaller.org/**
- [![gh cli](https://img.shields.io/static/v1?label=%20&message=gh%20cli&color=9cf&logo=github&logoColor=black&style=for-the-badge)](https://cli.github.com)

### Using Shell (macOS and Linux)

```sh
curl -fsSL https://secman-team.github.io/install/install.sh | bash
```bash
curl -fsSL https://secman-team.github.io/install.sh | bash
```

### Using PowerShell (Windows)

```sh
iwr -useb https://secman-team.github.io/install/install.ps1 | iex
```powershell
iwr -useb https://secman-team.github.io/install.ps1 | iex
```

### Using [Homebrew](https://brew.sh) (macOS and Linux)

```sh
```bash
brew tap secman-team/smx
brew install secman
```

### Using [Scoop](https://scoop.sh) (Windows)

```pwsh
scoop bucket add secman https://github.com/secman-team/secman
```powershell
scoop bucket add secman https://github.com/secman-team/sm-scoop
scoop install secman
```

Expand All @@ -57,29 +56,29 @@ scoop install secman
## Build from source

see [docs/from_source.md](https://github.com/secman-team/secman/blob/main/docs/from_source.md)
see [installing from source](https://secman.vercel.app/docs/getting_started/installation#installing-from-source)

## Getting started with secman

> Initializing Vault
```sh
```bash
secman init
```

> Start using `secman`
```sh
```bash
secman insert MY_SECRET_TOKEN
```

> Sync your passwords
```sh
secman-sync sync
```bash
secman start-sync
```

> see [commands](https://github.com/secman-team/secman/blob/main/docs/commands.md)
> see [commands](https://secman.vercel.app/docs/commands)
## License

Expand All @@ -88,5 +87,5 @@ secman-sync sync
[MIT][mitUrl]

[goUrl]: https://goland.org
[smUrl]: https://secman.web.app
[smUrl]: https://secman.vercel.app
[mitUrl]: https://github.com/abdfnx/secman/blob/main/LICENSE
5 changes: 5 additions & 0 deletions api/sm.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
$releases = "https://api.github.com/repos/secman-team/secman/releases"

$tag = (Invoke-WebRequest -Uri $releases -UseBasicParsing | ConvertFrom-Json)[0].tag_name

Write-Host $tag
68 changes: 48 additions & 20 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import (

"github.com/secman-team/shell"

"github.com/secman-team/secman/v5/api/sync"
"github.com/secman-team/secman/v5/edit"
"github.com/secman-team/secman/v5/fetch"
"github.com/secman-team/secman/v5/gen"
"github.com/secman-team/secman/v5/initialize"
"github.com/secman-team/secman/v5/insert"
"github.com/secman-team/secman/v5/pio"
"github.com/secman-team/secman/v5/plugins"
"github.com/secman-team/secman/v5/show"
"github.com/secman-team/secman/v5/upgrade"
"github.com/secman-team/secman/v5/clean"
"github.com/secman-team/secman/api/sync"
"github.com/secman-team/secman/edit"
"github.com/secman-team/secman/fetch"
"github.com/secman-team/secman/gen"
"github.com/secman-team/secman/initialize"
"github.com/secman-team/secman/insert"
"github.com/secman-team/secman/pio"
"github.com/secman-team/secman/plugins"
"github.com/secman-team/secman/show"
"github.com/secman-team/secman/upgrade"
"github.com/secman-team/secman/clean"
"github.com/spf13/cobra"
)

Expand Down Expand Up @@ -78,16 +78,12 @@ directory, and initialize your cryptographic keys.`,
},
}

upgCmd = &cobra.Command{
Use: "upg",
Aliases: []string{"upgrade"},
upgradeCmd = &cobra.Command{
Use: "upgrade",
Aliases: []string{"upg"},
Short: "Upgrade your secman if there's a new release.",
Run: func(cmd *cobra.Command, args []string) {
if runtime.GOOS == "windows" {
fmt.Println("Sorry, the upg/upgrade command only supports MacOS/Linux.. Maybe in the future it may support windows")
} else {
upg.Upgrade()
}
upg.Upgrade()
},
}

Expand Down Expand Up @@ -126,6 +122,36 @@ Will prompt for confirmation when a site path is not unique.`,
},
}


slashCmd = &cobra.Command{
Use:"/",
Example:"clone your .secman",
Run:func(cmd *cobra.Command,args []string){
if runtime.GOOS=="windows"{
shell.PWSLCmd("& $HOME/sm/secman-sync.ps1 cn")
} else {
shell.ShellCmd("secman-sync cn")
}

checker.Checker()
},
}

start_syncCmd = &cobra.Command{
Use: "start-sync",
Example: "secman start-sync",
Short: "Start Sync your passwords.",
Run: func(cmd *cobra.Command, args []string) {
if runtime.GOOS == "windows" {
shell.PWSLCmd("& ~/sm/secman-sync.ps1 sync")
} else {
shell.ShellCmd("secman-sync sync")
}

checker.Checker()
},
}

generateCmd = &cobra.Command{
Use: "gen",
Aliases: []string{"generate"},
Expand Down Expand Up @@ -232,8 +258,10 @@ func init() {
RootCmd.AddCommand(renameCmd)
RootCmd.AddCommand(showCmd)
RootCmd.AddCommand(versionCmd)
RootCmd.AddCommand(upgCmd)
RootCmd.AddCommand(upgradeCmd)
RootCmd.AddCommand(verxCmd)
RootCmd.AddCommand(start_syncCmd)
RootCmd.AddCommand(slashCmd)
}

// main
Expand Down
1 change: 0 additions & 1 deletion docs
Submodule docs deleted from 633f28
4 changes: 2 additions & 2 deletions edit/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import (

"golang.org/x/crypto/nacl/box"

"github.com/secman-team/secman/v5/pc"
"github.com/secman-team/secman/v5/pio"
"github.com/secman-team/secman/pc"
"github.com/secman-team/secman/pio"
)

// Remove is used to remove a site entry from the password vault given a path.
Expand Down
2 changes: 1 addition & 1 deletion gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package gen
import (
"log"

"github.com/secman-team/secman/v5/pc"
"github.com/secman-team/secman/pc"
)

var (
Expand Down
Loading

0 comments on commit 15ed5f3

Please sign in to comment.