Skip to content

Commit 3e0c076

Browse files
authored
Update code and deps, add api key (#36)
* Update code and deps, add api key * Remove codeql gh action * Fix release wf * Update release wf * Fix deprecation notices
1 parent fe6849f commit 3e0c076

File tree

14 files changed

+373
-803
lines changed

14 files changed

+373
-803
lines changed

.github/FUNDING.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
name: ci
1+
name: Go CI
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
5-
branches: [ main ]
68

79
jobs:
8-
build:
9-
runs-on: ${{ matrix.os }}
10-
11-
strategy:
12-
matrix:
13-
os: [macos-latest, ubuntu-latest, windows-latest]
10+
build-and-test:
11+
name: Test, Lint, and Build
12+
runs-on: ubuntu-latest
1413

1514
steps:
16-
-
17-
name: Checkout
18-
uses: actions/checkout@v2
19-
with:
20-
fetch-depth: 0
21-
-
22-
name: Set up Go
23-
uses: actions/setup-go@v2
24-
with:
25-
go-version: 1.17
26-
-
27-
name: Download dependencies
28-
run: go mod download
29-
-
30-
name: Build
31-
run: go build
32-
-
33-
name: Test
34-
run: go test ./...
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Go
19+
uses: actions/setup-go@v5
20+
with:
21+
go-version: 1.23
22+
23+
- name: Install dependencies
24+
run: go mod tidy
25+
26+
- name: Run tests
27+
run: go test ./... -v
28+
29+
- name: Lint the project
30+
uses: golangci/golangci-lint-action@v6
31+
with:
32+
version: v1.60
33+
34+
- name: Build the project
35+
run: go build -v main.go

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: Go Release
22

33
on:
44
push:
@@ -9,22 +9,19 @@ jobs:
99
goreleaser:
1010
runs-on: ubuntu-latest
1111
steps:
12-
-
13-
name: Checkout
14-
uses: actions/checkout@v2
15-
with:
16-
fetch-depth: 0
17-
-
18-
name: Set up Go
19-
uses: actions/setup-go@v2
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
2017
with:
21-
go-version: 1.17
22-
-
23-
name: Run GoReleaser
24-
uses: goreleaser/goreleaser-action@v2
18+
go-version: 1.23
19+
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v6
2522
with:
2623
distribution: goreleaser
27-
version: latest
28-
args: release --rm-dist
24+
version: '~> v2'
25+
args: release --clean
2926
env:
3027
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
version: 2
2+
13
builds:
2-
-
3-
goos:
4+
- goos:
45
- linux
56
- windows
67
- darwin
@@ -11,7 +12,7 @@ builds:
1112
- -s -w -X github.com/sniptt-official/ots/build.Version={{.Version}}
1213

1314
archives:
14-
- format: tar.gz
15+
- formats: tar.gz
1516
format_overrides:
1617
- goos: windows
17-
format: zip
18+
formats: zip

README.md

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
<p align="center">
2-
<b>Looking to self-host? Use <a href="https://github.com/sniptt-official/ots-aws">the official CDK construct</a></b>
3-
</p>
4-
51
<p align="center">
62
<a href="https://sniptt.com">
7-
<img src=".github/assets/ots-social-cover.svg" alt="Ots Logo" />
3+
<img src=".github/assets/ots-social-cover.svg" alt="OTS Logo" />
84
</a>
95
</p>
106

117
<p align="right">
12-
<i>If you use this repo, star it ✨</i>
8+
<i>If you use this repo, please star it ✨</i>
139
</p>
1410

1511
***
@@ -55,6 +51,8 @@ go get -u github.com/sniptt-official/ots
5551
Enter your secret:
5652
```
5753

54+
The default expiry is 24 hours.
55+
5856
### Pipeline
5957

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

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

76-
```
77-
ots new -x 24h --region eu-central-1
78-
```
79-
80-
### Self-hosting
81-
82-
Please refer to [the official CDK construct](https://github.com/sniptt-official/ots-aws) for detailed instructions.
74+
The default region is `us-east-1`.
8375

84-
Grab your API Gateway URL, API key and configure `~/.ots.yaml` (or whatever you provide to `--config`):
85-
86-
```yaml
87-
apiUrl: https://YOUR_API_ID.execute-api.YOUR_REGION.amazonaws.com/prod/secrets
88-
apiKey: YOUR_API_KEY
8976
```
90-
91-
Use `ots` as before:
92-
93-
```
94-
> ots new -x 2h
95-
Using config file: /Users/xxx/.ots.yaml
96-
Enter your secret: ***
97-
Your secret is now available on the below URL.
98-
99-
https://my-ots-web-view.com/burn-secret?id=xxx&ref=ots-cli&region=us-east-1&v=debug#xxx
100-
101-
You should only share this URL with the intended recipient.
102-
103-
Please note that once retrieved, the secret will no longer
104-
be available for viewing. If not viewed, the secret will
105-
automatically expire at approximately xx xxx xxxx xx:xx:xx.
77+
ots new -x 24h --region eu-central-1
10678
```
10779

10880
## FAQs
10981

110-
Please refer to our Q\&A discussions.
82+
Please refer to our Q&A discussions.
11183

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

0 commit comments

Comments
 (0)