Skip to content

Commit 01a962a

Browse files
committed
✨ Added existing files
0 parents  commit 01a962a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+7417
-0
lines changed

.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: docker
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly

.github/workflows/release.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Create a release when a new tag is pushed
2+
name: release
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 10
11+
steps:
12+
- name: Install apt dependencies
13+
run: sudo apt install -y libpam0g libpam0g-dev
14+
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Setup Go
21+
uses: actions/setup-go@v5
22+
23+
- name: Setup nfpm
24+
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
25+
26+
- name: Setup Task
27+
uses: arduino/setup-task@v2
28+
with:
29+
version: 3.x
30+
repo-token: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Build and package
33+
run: task package
34+
35+
- name: Create Release
36+
uses: softprops/action-gh-release@v2
37+
with:
38+
files: ./dist/pkg/*

.github/workflows/security.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Run security audits
2+
name: security-audits
3+
on:
4+
- push
5+
- pull_request
6+
jobs:
7+
# Audit all source code with Secure Go (https://securego.io)
8+
secure-go:
9+
name: Audit source code with Secure Go
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
steps:
13+
- name: Install apt dependencies
14+
run: sudo apt install -y libpam0g libpam0g-dev
15+
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
submodules: recursive
20+
21+
- name: Setup Go
22+
uses: actions/setup-go@v5
23+
24+
- name: Audit code
25+
uses: securego/gosec@master
26+
with:
27+
args: ./...

.gitignore

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
4+
# Build
5+
dist/
6+
7+
# Dev
8+
dev/
9+
10+
# Taskfile
11+
.task
12+
13+
# Binaries for programs and plugins
14+
*.exe
15+
*.exe~
16+
*.dll
17+
*.so
18+
*.dylib
19+
20+
# Test binary, built with `go test -c`
21+
*.test
22+
23+
# Output of the go coverage tool, specifically when used with LiteIDE
24+
*.out
25+
26+
# Dependency directories (remove the comment below to include it)
27+
# vendor/
28+
29+
# Go workspace file
30+
go.work
31+
32+
dist/

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/json"]
2+
path = lib/json
3+
url = https://github.com/sheredom/json.h.git

.vscode/launch.json

+223
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Generate Man Pages (Client)",
9+
"presentation": {
10+
"hidden": false,
11+
"group": "client",
12+
"order": 1
13+
},
14+
"type": "go",
15+
"request": "launch",
16+
"mode": "auto",
17+
"buildFlags": [
18+
"-tags",
19+
"man"
20+
],
21+
"program": "${workspaceFolder}/cmd/client",
22+
"args": [
23+
"man"
24+
]
25+
},
26+
{
27+
"name": "Initialize (Client)",
28+
"presentation": {
29+
"hidden": false,
30+
"group": "client",
31+
"order": 1
32+
},
33+
"type": "go",
34+
"request": "launch",
35+
"mode": "auto",
36+
"program": "${workspaceFolder}/cmd/client",
37+
"args": [
38+
"--config",
39+
"${workspaceFolder}/dev/client.toml",
40+
"initialize"
41+
]
42+
},
43+
{
44+
"name": "Run (Client)",
45+
"presentation": {
46+
"hidden": false,
47+
"group": "client",
48+
"order": 2
49+
},
50+
"type": "go",
51+
"request": "launch",
52+
"mode": "auto",
53+
"program": "${workspaceFolder}/cmd/client",
54+
"args": [
55+
"--config",
56+
"${workspaceFolder}/dev/client.toml",
57+
"run"
58+
],
59+
"env": {
60+
"PAM_USER": "test"
61+
}
62+
},
63+
{
64+
"name": "Generate Man Pages (Login)",
65+
"presentation": {
66+
"hidden": false,
67+
"group": "login",
68+
"order": 1
69+
},
70+
"type": "go",
71+
"request": "launch",
72+
"mode": "auto",
73+
"buildFlags": [
74+
"-tags",
75+
"man"
76+
],
77+
"program": "${workspaceFolder}/cmd/login",
78+
"args": [
79+
"man"
80+
]
81+
},
82+
{
83+
"name": "Run (Login)",
84+
"presentation": {
85+
"hidden": false,
86+
"group": "login",
87+
"order": 1
88+
},
89+
"type": "go",
90+
"request": "launch",
91+
"mode": "auto",
92+
"program": "${workspaceFolder}/cmd/login",
93+
"args": [],
94+
"env": {
95+
"PAM_OAUTH_CONFIG": "${workspaceFolder}/dev/client.toml",
96+
"PAM_OAUTH_CHALLENGE_ID": "[REDACTED]"
97+
}
98+
},
99+
{
100+
"name": "Generate Man Pages (Server)",
101+
"presentation": {
102+
"hidden": false,
103+
"group": "server",
104+
"order": 1
105+
},
106+
"type": "go",
107+
"request": "launch",
108+
"mode": "auto",
109+
"buildFlags": [
110+
"-tags",
111+
"man"
112+
],
113+
"program": "${workspaceFolder}/cmd/server",
114+
"args": [
115+
"man"
116+
]
117+
},
118+
{
119+
"name": "Initialize (Server)",
120+
"presentation": {
121+
"hidden": false,
122+
"group": "server",
123+
"order": 1
124+
},
125+
"type": "go",
126+
"request": "launch",
127+
"mode": "auto",
128+
"program": "${workspaceFolder}/cmd/server",
129+
"args": [
130+
"--config",
131+
"${workspaceFolder}/dev/server.toml",
132+
"initialize",
133+
"--server-common-name",
134+
"localhost",
135+
"--server-ip-san",
136+
"127.0.0.1",
137+
"--server-ip-san",
138+
"::1",
139+
"--server-ip-san",
140+
"172.17.0.1"
141+
]
142+
},
143+
{
144+
"name": "Add client (Server)",
145+
"presentation": {
146+
"hidden": false,
147+
"group": "server",
148+
"order": 2
149+
},
150+
"type": "go",
151+
"request": "launch",
152+
"mode": "auto",
153+
"program": "${workspaceFolder}/cmd/server",
154+
"args": [
155+
"--config",
156+
"${workspaceFolder}/dev/server.toml",
157+
"client",
158+
"add",
159+
"--common-name",
160+
"test2",
161+
// "--client-cert",
162+
// "${workspaceFolder}/dev/internal-client.crt",
163+
// "--client-key",
164+
// "${workspaceFolder}/dev/internal-client.key"
165+
]
166+
},
167+
{
168+
"name": "List clients (Server)",
169+
"presentation": {
170+
"hidden": false,
171+
"group": "server",
172+
"order": 3
173+
},
174+
"type": "go",
175+
"request": "launch",
176+
"mode": "auto",
177+
"program": "${workspaceFolder}/cmd/server",
178+
"args": [
179+
"--config",
180+
"${workspaceFolder}/dev/server.toml",
181+
"client",
182+
"list"
183+
]
184+
},
185+
{
186+
"name": "Remove client (Server)",
187+
"presentation": {
188+
"hidden": false,
189+
"group": "server",
190+
"order": 4
191+
},
192+
"type": "go",
193+
"request": "launch",
194+
"mode": "auto",
195+
"program": "${workspaceFolder}/cmd/server",
196+
"args": [
197+
"--config",
198+
"${workspaceFolder}/dev/server.toml",
199+
"client",
200+
"remove",
201+
"--common-name",
202+
"test"
203+
]
204+
},
205+
{
206+
"name": "Serve (Server)",
207+
"presentation": {
208+
"hidden": false,
209+
"group": "server",
210+
"order": 5
211+
},
212+
"type": "go",
213+
"request": "launch",
214+
"mode": "auto",
215+
"program": "${workspaceFolder}/cmd/server",
216+
"args": [
217+
"--config",
218+
"${workspaceFolder}/dev/server.toml",
219+
"serve"
220+
]
221+
},
222+
]
223+
}

.vscode/settings.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"gopls": {
3+
"build.buildFlags": [
4+
"-tags",
5+
"man"
6+
]
7+
}
8+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Wakeful-Cloud
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)