mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
updated git workflow per deployment
Yes to protected wireguard tunnels Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -9,13 +9,35 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
# nodejs-api only accepts SSH over its WireGuard tunnel (public :22 was
|
||||||
|
# removed). This peer is scoped to AllowedIPs 10.100.1.3/32 on the
|
||||||
|
# droplet side, so it can only ever reach 10.100.1.1 — nothing else.
|
||||||
|
- name: Bring up WireGuard tunnel
|
||||||
|
run: |
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y wireguard-tools
|
||||||
|
umask 077
|
||||||
|
sudo mkdir -p /etc/wireguard
|
||||||
|
cat <<EOF | sudo tee /etc/wireguard/wg0.conf > /dev/null
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = ${{ secrets.CI_WG_PRIVATE_KEY }}
|
||||||
|
Address = 10.100.1.3/32
|
||||||
|
|
||||||
|
[Peer]
|
||||||
|
PublicKey = ${{ secrets.NODEJS_API_WG_PUBLIC_KEY }}
|
||||||
|
Endpoint = 68.183.239.171:51820
|
||||||
|
AllowedIPs = 10.100.1.1/32
|
||||||
|
PersistentKeepalive = 25
|
||||||
|
EOF
|
||||||
|
sudo wg-quick up wg0
|
||||||
|
|
||||||
# The key below is restricted server-side to only run
|
# The key below is restricted server-side to only run
|
||||||
# /opt/new_starr/deploy.sh (see authorized_keys forced-command on the
|
# /opt/new_starr/deploy.sh (see authorized_keys forced-command on the
|
||||||
# droplet) — it can't run arbitrary commands even if this secret leaks.
|
# droplet) — it can't run arbitrary commands even if this secret leaks.
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
uses: appleboy/ssh-action@v1
|
uses: appleboy/ssh-action@v1
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.DEPLOY_HOST }}
|
host: 10.100.1.1
|
||||||
username: deploy
|
username: deploy
|
||||||
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
key: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
script: deploy
|
script: deploy
|
||||||
|
|||||||
Reference in New Issue
Block a user