Skip to content

Commit

Permalink
Update code and deps, add api key (#36)
Browse files Browse the repository at this point in the history
* Update code and deps, add api key

* Remove codeql gh action

* Fix release wf

* Update release wf

* Fix deprecation notices
  • Loading branch information
slavovojacek authored Feb 7, 2025
1 parent fe6849f commit 3e0c076
Show file tree
Hide file tree
Showing 14 changed files with 373 additions and 803 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

55 changes: 28 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: ci
name: Go CI

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

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
build-and-test:
name: Test, Lint, and Build
runs-on: ubuntu-latest

steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
-
name: Download dependencies
run: go mod download
-
name: Build
run: go build
-
name: Test
run: go test ./...
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.23

- name: Install dependencies
run: go mod tidy

- name: Run tests
run: go test ./... -v

- name: Lint the project
uses: golangci/golangci-lint-action@v6
with:
version: v1.60

- name: Build the project
run: go build -v main.go
71 changes: 0 additions & 71 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

27 changes: 12 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: release
name: Go Release

on:
push:
Expand All @@ -9,22 +9,19 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.17
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
go-version: 1.23

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --rm-dist
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 5 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2

builds:
-
goos:
- goos:
- linux
- windows
- darwin
Expand All @@ -11,7 +12,7 @@ builds:
- -s -w -X github.com/sniptt-official/ots/build.Version={{.Version}}

archives:
- format: tar.gz
- formats: tar.gz
format_overrides:
- goos: windows
format: zip
formats: zip
42 changes: 7 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<p align="center">
<b>Looking to self-host? Use <a href="https://github.com/sniptt-official/ots-aws">the official CDK construct</a></b>
</p>

<p align="center">
<a href="https://sniptt.com">
<img src=".github/assets/ots-social-cover.svg" alt="Ots Logo" />
<img src=".github/assets/ots-social-cover.svg" alt="OTS Logo" />
</a>
</p>

<p align="right">
<i>If you use this repo, star it ✨</i>
<i>If you use this repo, please star it ✨</i>
</p>

***
Expand Down Expand Up @@ -55,6 +51,8 @@ go get -u github.com/sniptt-official/ots
Enter your secret:
```

The default expiry is 24 hours.

### Pipeline

You can also use pipes, for example
Expand All @@ -73,41 +71,15 @@ cat .env | ots new

Use `--region` to choose where the secrets reside.

```
ots new -x 24h --region eu-central-1
```

### Self-hosting

Please refer to [the official CDK construct](https://github.com/sniptt-official/ots-aws) for detailed instructions.
The default region is `us-east-1`.

Grab your API Gateway URL, API key and configure `~/.ots.yaml` (or whatever you provide to `--config`):

```yaml
apiUrl: https://YOUR_API_ID.execute-api.YOUR_REGION.amazonaws.com/prod/secrets
apiKey: YOUR_API_KEY
```
Use `ots` as before:

```
> ots new -x 2h
Using config file: /Users/xxx/.ots.yaml
Enter your secret: ***
Your secret is now available on the below URL.

https://my-ots-web-view.com/burn-secret?id=xxx&ref=ots-cli&region=us-east-1&v=debug#xxx

You should only share this URL with the intended recipient.

Please note that once retrieved, the secret will no longer
be available for viewing. If not viewed, the secret will
automatically expire at approximately xx xxx xxxx xx:xx:xx.
ots new -x 24h --region eu-central-1
```

## FAQs

Please refer to our Q\&A discussions.
Please refer to our Q&A discussions.

* [Why should I trust you with my secrets?](https://github.com/sniptt-official/ots/discussions/13)
* [Can I persist my secrets for later use?](https://github.com/sniptt-official/ots/discussions/15)
Expand Down
Loading

0 comments on commit 3e0c076

Please sign in to comment.