Add VPN User #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Add VPN User | |
on: | |
workflow_dispatch: | |
inputs: | |
wireguard_vpn_ip_address: | |
description: 'wireguard_vpn_ip_address' | |
required: true | |
default: '192.0.2.1' | |
ssh_username: | |
description: 'ssh_username' | |
required: true | |
default: 'root' | |
PSONO_SECRET_ID: | |
description: 'PSONO_SECRET_ID' | |
required: true | |
jobs: | |
generate-user-vpn-config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setting up SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.VPN_SSH_PRIVATE_KEY }} | |
- name: SSH into remote host | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ inputs.ssh_username }}@${{ inputs.wireguard_vpn_ip_address }} "date" | |
- name: Generate new vpn peer config & Add save client config to password manager | |
run: | | |
ssh -o StrictHostKeyChecking=no ${{ inputs.ssh_username }}@${{ inputs.wireguard_vpn_ip_address }} -C "cd /etc/wireguard && PSONO_CI_API_KEY_ID=${{ secrets.PSONO_CI_API_KEY_ID }} PSONO_CI_API_SECRET_KEY_HEX=${{ secrets.PSONO_CI_API_SECRET_KEY_HEX }} PSONO_CI_SERVER_URL=${{ secrets.PSONO_CI_SERVER_URL }} PSONO_SECRET_ID=${{ inputs.PSONO_SECRET_ID }} ./add-vpn-user.sh" | |
# Enable tmate debugging of manually-triggered workflows if the input option was provided | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ failure() }} |