Skip to content

Commit

Permalink
✨ Added existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Wakeful-Cloud committed Mar 23, 2024
0 parents commit 01a962a
Show file tree
Hide file tree
Showing 56 changed files with 7,417 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: monthly

- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Create a release when a new tag is pushed
name: release
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install apt dependencies
run: sudo apt install -y libpam0g libpam0g-dev

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Setup nfpm
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest

- name: Setup Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Build and package
run: task package

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/pkg/*
27 changes: 27 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Run security audits
name: security-audits
on:
- push
- pull_request
jobs:
# Audit all source code with Secure Go (https://securego.io)
secure-go:
name: Audit source code with Secure Go
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install apt dependencies
run: sudo apt install -y libpam0g libpam0g-dev

- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

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

- name: Audit code
uses: securego/gosec@master
with:
args: ./...
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore

# Build
dist/

# Dev
dev/

# Taskfile
.task

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

dist/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "lib/json"]
path = lib/json
url = https://github.com/sheredom/json.h.git
223 changes: 223 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Generate Man Pages (Client)",
"presentation": {
"hidden": false,
"group": "client",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"buildFlags": [
"-tags",
"man"
],
"program": "${workspaceFolder}/cmd/client",
"args": [
"man"
]
},
{
"name": "Initialize (Client)",
"presentation": {
"hidden": false,
"group": "client",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/client",
"args": [
"--config",
"${workspaceFolder}/dev/client.toml",
"initialize"
]
},
{
"name": "Run (Client)",
"presentation": {
"hidden": false,
"group": "client",
"order": 2
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/client",
"args": [
"--config",
"${workspaceFolder}/dev/client.toml",
"run"
],
"env": {
"PAM_USER": "test"
}
},
{
"name": "Generate Man Pages (Login)",
"presentation": {
"hidden": false,
"group": "login",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"buildFlags": [
"-tags",
"man"
],
"program": "${workspaceFolder}/cmd/login",
"args": [
"man"
]
},
{
"name": "Run (Login)",
"presentation": {
"hidden": false,
"group": "login",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/login",
"args": [],
"env": {
"PAM_OAUTH_CONFIG": "${workspaceFolder}/dev/client.toml",
"PAM_OAUTH_CHALLENGE_ID": "[REDACTED]"
}
},
{
"name": "Generate Man Pages (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"buildFlags": [
"-tags",
"man"
],
"program": "${workspaceFolder}/cmd/server",
"args": [
"man"
]
},
{
"name": "Initialize (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 1
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"args": [
"--config",
"${workspaceFolder}/dev/server.toml",
"initialize",
"--server-common-name",
"localhost",
"--server-ip-san",
"127.0.0.1",
"--server-ip-san",
"::1",
"--server-ip-san",
"172.17.0.1"
]
},
{
"name": "Add client (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 2
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"args": [
"--config",
"${workspaceFolder}/dev/server.toml",
"client",
"add",
"--common-name",
"test2",
// "--client-cert",
// "${workspaceFolder}/dev/internal-client.crt",
// "--client-key",
// "${workspaceFolder}/dev/internal-client.key"
]
},
{
"name": "List clients (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 3
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"args": [
"--config",
"${workspaceFolder}/dev/server.toml",
"client",
"list"
]
},
{
"name": "Remove client (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 4
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"args": [
"--config",
"${workspaceFolder}/dev/server.toml",
"client",
"remove",
"--common-name",
"test"
]
},
{
"name": "Serve (Server)",
"presentation": {
"hidden": false,
"group": "server",
"order": 5
},
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceFolder}/cmd/server",
"args": [
"--config",
"${workspaceFolder}/dev/server.toml",
"serve"
]
},
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"gopls": {
"build.buildFlags": [
"-tags",
"man"
]
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Wakeful-Cloud

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 01a962a

Please sign in to comment.