Skip to content

Commit 27bd32c

Browse files
committed
chore: Initial commit
0 parents  commit 27bd32c

File tree

17 files changed

+34629
-0
lines changed

17 files changed

+34629
-0
lines changed

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
"on":
3+
push:
4+
branches:
5+
- main
6+
- beta
7+
- alpha
8+
permissions:
9+
contents: read # for checkout
10+
jobs:
11+
release:
12+
permissions:
13+
contents: write # to be able to publish a GitHub release
14+
issues: write # to be able to comment on released issues
15+
pull-requests: write # to be able to comment on released pull requests
16+
id-token: write # to enable use of OIDC for npm provenance
17+
18+
if: "!contains(github.event.head_commit.message, '[ci skip]')"
19+
name: release
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: npm
26+
node-version: lts/*
27+
- run: npm ci
28+
- run: npx semantic-release
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
name: Test usage of OpenVPN
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install OpenVPN
18+
run: |
19+
sudo apt-get update
20+
sudo apt-get install -y openvpn openvpn-systemd-resolved
21+
22+
- name: Test OpenVPN
23+
uses: "./"
24+
with:
25+
config_file: ${{ secrets.VPN_CONFIG_FILE }}
26+
certificate: ${{ secrets.VPN_CERTIFICATE }}
27+
certificate_name: ${{ secrets.VPN_CERTIFICATE_NAME }}
28+
29+
- name: Check if connected
30+
run: curl -v http://172.16.0.61

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# GitHub action code
2+
!dist/
3+
4+
# Optional npm cache directory
5+
.npm
6+
7+
# Optional eslint cache
8+
.eslintcache
9+
10+
# Dependency directories
11+
node_modules/
12+
13+
### Node ###
14+
# Logs
15+
logs
16+
*.log
17+
npm-debug.log*

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm install
5+
nom run build
6+
git add dist/index.js

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.14.0

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Clive Walkden
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.

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Sonassi OpenVPN Connection GitHub Action
2+
3+
The Sonassi OpenVPN Connection GitHub Action allows you to establish a secure connection to a Sonassi VPN server within your GitHub Actions workflow.
4+
5+
To use this action, you need to provide the necessary configuration details for your Sonassi VPN server. This includes the configuration file, certificate, and certificate name.
6+
7+
## Inputs
8+
9+
- `config`: The config file provided in the VPN bundle for Linux. (required)
10+
- `certificate`: The p12 file provided in the VPN bundle for Linux. (required)
11+
- `certificate_name`: The p12 filename as configured inside the config file (required)
12+
13+
## Example Usage
14+
15+
```yaml
16+
- name: Connect to Sonassi VPN
17+
uses: sozo-design/actions-sonassi-openvpn-connection@v1
18+
with:
19+
config: ${{ secrets.VPN_SERVER_CONFIG }}
20+
certificate: ${{ secrets.VPN_CERTIFICATE }}
21+
certificate_name: ${{ secrets.VPN_CERTIFICATE_NAME }}
22+
```
23+
24+
Make sure to store your sensitive information (such as the config, certificate, and certificate_name) as secrets in your GitHub repository to keep them secure.
25+
26+
For more information on how to use this action, please refer to the [GitHub Action documentation](https://docs.github.com/actions).
27+

action.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Sonassi OpenVPN Connect"
2+
description: "Connect to Sonassi OpenVPN"
3+
branding:
4+
color: "blue"
5+
icon: "lock"
6+
inputs:
7+
config_file:
8+
description: "The OpenVPN configuration file"
9+
required: true
10+
certificate:
11+
description: "The OpenVPN certificate"
12+
required: true
13+
certificate_name:
14+
description: "The OpenVPN certificate name as declared in the configuration file"
15+
required: true
16+
default: "certificate.p12"
17+
runs:
18+
using: "node20"
19+
main: "dist/index.js"
20+
post: "dist/index.js"

0 commit comments

Comments
 (0)