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

Commit

Permalink
Merge pull request #16 from scmn-dev/main
Browse files Browse the repository at this point in the history
merge with `abdfnx/secman` fork repo
  • Loading branch information
abdfnx authored Mar 14, 2022
2 parents b54d7e8 + 58d4fe3 commit 47bd5be
Show file tree
Hide file tree
Showing 54 changed files with 2,142 additions and 1,577 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zshrc text eol=lf
*.sh text eol=lf
108 changes: 108 additions & 0 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Secman CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
GITHUB_TOKEN: ${{ github.token }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
bfs: # build from source
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Set up `Task`
uses: arduino/setup-task@v1

- name: Building From Source
run: task bfs

- name: Run Help
run: secman help

bfs_windows: # build from source (windows)
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Set up `Task`
uses: arduino/setup-task@v1

- name: Building From Source
run: |
task build-core
task link-core
.\scripts\bfs.ps1
echo "::add-path::C:\Users\runneradmin\AppData\Local\secman\bin\;"
- name: Show Information
run: secman info

from_script:
needs: [ bfs ]

strategy:
matrix:
oses: [ macos-latest, ubuntu-latest ]

runs-on: ${{ matrix.oses }}

steps:
- uses: actions/checkout@v2

- name: Install from script
run: curl -sL https://u.secman.dev | bash

- name: Generate a password
run: secman generate --length 20

from_script_windows:
needs: [ bfs_windows ]

runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: Install from script
run: |
iwr -useb https://w.secman.dev | iex
echo "::add-path::C:\Users\runneradmin\AppData\Local\secman\bin\;"
- name: Run Secman Doctor
run: secman doctor

homebrew:
needs: [ bfs ]

runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Get Secman via homebrew
run: brew install scmn-dev/tap/secman

- name: Show Version
run: secman version
116 changes: 116 additions & 0 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Secman Docker CI

on:
push:
branches:
- main

env:
SM_DOCKER_REPO: https://github.com/scmn-dev/docker
SM_CONTAINER_DH_IMAGE: smcr/secman
SM_CONTAINER_GHCR_IMAGE: ghcr.io/scmn-dev/secman
SM_CLI_IMAGE: smcr/secman-cli

jobs:
# Secman Container Docker Image `smcr/secman` | DockerHub
sm_container_build_dh:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_SECMAN_TOKEN }}

- name: Run Build
run: |
docker pull $SM_CONTAINER_DH_IMAGE:latest
git clone $SM_DOCKER_REPO
docker build -t $SM_CONTAINER_DH_IMAGE --cache-from $SM_CONTAINER_DH_IMAGE:latest --file ./docker/container/Dockerfile .
docker push $SM_CONTAINER_DH_IMAGE
sm_container_run_dh:
needs: [ sm_container_build_dh ]

runs-on: ubuntu-latest

container:
image: smcr/secman:latest

steps:
- name: Run Secman in Docker Container
run: |
sudo secman
# Secman Container Docker Image `smcr/secman` | GitHub Packages
sm_container_build_ghcr:
needs: [ sm_container_build_dh ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to Github Packages
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- name: Run Build
run: |
docker pull $SM_CONTAINER_GHCR_IMAGE:latest
git clone $SM_DOCKER_REPO
docker build -t $SM_CONTAINER_GHCR_IMAGE --cache-from $SM_CONTAINER_GHCR_IMAGE:latest --file ./docker/container/Dockerfile .
docker push $SM_CONTAINER_GHCR_IMAGE
sm_container_run_ghcr:
needs: [ sm_container_build_ghcr ]

runs-on: ubuntu-latest

container:
image: ghcr.io/scmn-dev/secman:latest

steps:
- name: Run Secman in Github Docker Container
run: |
sudo secman
# Secman CLI Docker Image `smcr/secman-cli`
sm_cli_build:
needs: [ sm_container_build_dh, sm_container_run_dh, sm_container_build_ghcr, sm_container_run_ghcr ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_SECMAN_TOKEN }}

- name: Build Secman CLI
run: |
docker pull $SM_CLI_IMAGE:latest
git clone $SM_DOCKER_REPO
docker build -t $SM_CLI_IMAGE --cache-from $SM_CLI_IMAGE:latest --file ./docker/cli/Dockerfile .
docker push $SM_CLI_IMAGE
sm_cli_run:
needs: [ sm_cli_build ]

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run Secman CLI in Docker Container
run: |
# run `secman`
docker run --rm -i $SM_CLI_IMAGE
# run `secman version`
docker run --rm -i $SM_CLI_IMAGE -v
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

- name: Build
run: |
go mod tidy -compat=1.17
go run ./scripts/date.go >> date.txt
go build -ldflags "-X main.version=$(git describe --abbrev=0 --tags) -X main.buildDate=$(cat date.txt)" -o tran
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ vendor
# Optional npm cache directory
.npm

# Output of 'npm pack'
# Archive files
*.tgz
*.zip

# Yarn Integrity file
.yarn-integrity
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ release:

before:
hooks:
- go mod tidy
- go mod tidy -compat=1.17

builds:
- <<: &build_defaults
Expand Down
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,45 @@
---

## [[v6.2.0] 2022-03-11](#v620-2022-03-11)

> Secman v3 ✨
this release is the first release of secman v3

it's comes with **new features**, **new design**, **new infrastructure**, **and new secman**.

### Added

- Add `secman auth` command with `create`, `login`, `logout`, and `refresh` sub-commands.
- Add `secman delete` command.
- Create `secman docs` and `secman doctor` commands.
- Build `secman edit` command.
- Create `secman generate` command.
- Add `secman info` and `secman init` commands.
- Build `secman insert` command.
- Create `secman read` command.
- Build `secman whoami` command.
- Initialize **@go-task** config file.
- Add Terminal User Interface (TUI) to secman with **@charmbracelet** libraries.
- Create `secman doctor` command with `secman doctor fix` sub-command.
- Add `secman ui` command.
- Build [**SMUI**](https://github.com/david-tomson/smui) by **@david-tomson**.

### Changed

- Move **secman v2** to secman core cli (**scc**).
- Convert from typescript to golang with typescript.
- Update `README.md`.
- Update **vscode** config.
- Update secman contributing guide.

### Fixed

- Fix messages.
- Fix connections with **secman cloud**.
- Fix Secman Core CLI (scc)

## [[v6.1.3] 2022-01-10](#v613-2022-01-10)

### Added
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ brew install scmn-dev/tap/secman
### Scoop

```
scoop bucket add secman https://github.com/scmn-dev/scoop
scoop install secman
```

Expand Down
11 changes: 4 additions & 7 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tasks:
build:
cmds:
- task: set-tag-and-date
- go mod tidy
- go mod tidy -compat=1.17
- go build -ldflags "-X main.version=$(cat tag.txt) -X main.buildDate=$(cat date.txt)" -o secman

build-core:
Expand All @@ -41,7 +41,7 @@ tasks:
link-core:
dir: ./core
cmds:
- yarn link
- npm link

publish-core:
dir: ./core
Expand All @@ -56,9 +56,6 @@ tasks:
- task: link-core
- sudo mv ./secman "{{ .SECMAN_UNIX_PATH }}"

bfsw:
desc: build from source (windows)
scoop:
cmds:
- task: build-core
- task: link-core
- ./scripts/bfs.ps1
- node ./scripts/scoop/scoop-sm.js
Loading

0 comments on commit 47bd5be

Please sign in to comment.