Skip to content

Commit

Permalink
do it now?
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreKoepke committed Nov 17, 2024
1 parent 1d3f756 commit cceaddb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/publish-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ jobs:
needs: publish
steps:
- uses: actions/checkout@v4
- uses: ./deploy/connect-with-wireguard
- id: wireguard
uses: ./deploy/connect-with-wireguard
with:
WIREGUARD_CLIENT_PRIVATE_KEY: ${{ secrets.WIREGUARD_CLIENT_PRIVATE_KEY }}
WIREGUARD_CLIENT_IP: ${{ secrets.WIREGUARD_CLIENT_IP }}
WIREGUARD_ALLOWED_IPS: ${{ WIREGUARD_ALLOWED_IPS }}
WIREGUARD_SERVER_PUBLIC_KEY: ${{ secrets.WIREGUARD_SERVER_PUBLIC_KEY }}
WIREGUARD_ENDPOINT: ${{ secrets.WIREGUARD_ENDPOINT }}
client-private-key: ${{ secrets.WIREGUARD_CLIENT_PRIVATE_KEY }}
client-ip: ${{ secrets.WIREGUARD_CLIENT_IP }}
allowed-ips: ${{ WIREGUARD_ALLOWED_IPS }}
server-public-key: ${{ secrets.WIREGUARD_SERVER_PUBLIC_KEY }}
endpoint: ${{ secrets.WIREGUARD_ENDPOINT }}
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
with:
Expand Down
16 changes: 8 additions & 8 deletions deploy/connect-with-wireguard/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ defaults:
shell: bash

inputs:
WIREGUARD_CLIENT_PRIVATE_KEY:
client-private-key:
description: 'Private Client Key'
required: true
WIREGUARD_CLIENT_IP:
client-ip:
description: 'IP for the client'
required: true
WIREGUARD_ALLOWED_IPS:
allowed-ips:
description: 'Allowed IPs'
required: true
WIREGUARD_SERVER_PUBLIC_KEY:
server-public-key:
description: 'Public key of the server'
required: true
WIREGUARD_ENDPOINT:
endpoint:
description: 'Endpoint of the server'
required: true

Expand All @@ -27,9 +27,9 @@ runs:
using: composite
steps:
- run: sudo apt install wireguard
- run: echo "${{ inputs.WIREGUARD_CLIENT_PRIVATE_KEY }}" > privatekey
- run: echo "${{ inputs.client-private-key }}" > privatekey
- run: sudo ip link add dev wg0 type wireguard
- run: sudo ip address add dev wg0 ${{ inputs.WIREGUARD_CLIENT_IP }} peer ${{ inputs.WIREGUARD_ALLOWED_IPS }}
- run: sudo wg set wg0 private-key privatekey peer ${{ inputs.WIREGUARD_SERVER_PUBLIC_KEY }} allowed-ips ${{ inputs.WIREGUARD_ALLOWED_IPS }} endpoint ${{ inputs.WIREGUARD_ENDPOINT }}
- run: sudo ip address add dev wg0 ${{ inputs.client-ip }} peer ${{ inputs.allowed-ips }}
- run: sudo wg set wg0 private-key privatekey peer ${{ inputs.server-public-key }} allowed-ips ${{ inputs.allowed-ips }} endpoint ${{ inputs.endpoint }}
- run: sudo ip link set up dev wg0

0 comments on commit cceaddb

Please sign in to comment.