egor-tensin / setup-wireguard

GitHub action to set up WireGuard
MIT License
63 stars 22 forks source link

Action get's stuck in "wg-quick.target is a disabled or a static unit, not starting it." #4

Open andresbravog opened 2 years ago

andresbravog commented 2 years ago

GH Action runs on ubuntu-latest

OutPut

Run intellum/setup-wireguard@v1
  with:
    endpoint: <secret>:51820
    endpoint_public_key: <secret>
    ips: 10.50.0.29/32
    allowed_ips: 0.0.0.0/0
    private_key: <secret>
    preshared_key: <secret>
Run set -o errexit -o pipefail -o nounset
  set -o errexit -o pipefail -o nounset

  readonly endpoint='<secret>:51820'
  readonly endpoint_public_key='<secret>'
  readonly ips='10.50.0.29/32'
  readonly allowed_ips='0.0.0.0/0'
  readonly private_key='<secret>'
  readonly preshared_key='<secret>'

  readonly minport=51000
  readonly maxport=51999

  ifname="wg$( openssl rand -hex 4 )"
  readonly ifname
  port="$( shuf "--input-range=$minport-$maxport" --head-count=1 )"
  readonly port

  via_systemd() ***
      local netdev_path
      netdev_path="/etc/systemd/network/$ifname.netdev"
      local network_path
      network_path="/etc/systemd/network/$ifname.network"

      local netdev_contents
      netdev_contents="
      [NetDev]
      Name=$ifname
      Kind=wireguard
      Description=WireGuard tunnel $ifname

      [WireGuard]
      ListenPort=$port
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:4 http://azure.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:5 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease [10.5 kB]
Hit:6 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Get:7 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1815 kB]
Get:8 http://azure.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [333 kB]
Get:9 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [15.2 kB]
Get:10 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [998 kB]
Get:11 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [142 kB]
Get:12 http://azure.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [520 B]
Get:13 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [924 kB]
Get:14 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [207 kB]
Get:15 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [20.7 kB]
Get:16 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [24.4 kB]
Get:17 http://azure.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [596 B]
Get:18 http://azure.archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [44.5 kB]
Get:19 http://azure.archive.ubuntu.com/ubuntu focal-backports/main Translation-en [10.9 kB]
Get:20 http://azure.archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [980 B]
Get:21 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [23.6 kB]
Get:22 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [15.9 kB]
Get:23 http://azure.archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [860 B]
Get:24 http://azure.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1471 kB]
Get:25 http://azure.archive.ubuntu.com/ubuntu focal-security/main Translation-en [252 kB]
Get:26 http://azure.archive.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [10.2 kB]
Get:27 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [934 kB]
Get:28 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [133 kB]
Get:29 http://azure.archive.ubuntu.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [520 B]
Get:30 http://azure.archive.ubuntu.com/ubuntu focal-security/universe amd64 Packages [703 kB]
Get:31 http://azure.archive.ubuntu.com/ubuntu focal-security/universe Translation-en [126 kB]
Get:32 http://azure.archive.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [14.4 kB]
Get:33 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [22.2 kB]
Get:34 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse Translation-en [5376 B]
Get:35 http://azure.archive.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [512 B]
Get:36 https://packages.microsoft.com/ubuntu/20.04/prod focal/main amd64 Packages [161 kB]
Get:37 https://packages.microsoft.com/ubuntu/20.04/prod focal/main arm64 Packages [27.0 kB]
Get:38 https://packages.microsoft.com/ubuntu/20.04/prod focal/main armhf Packages [21.7 kB]
Fetched 8806 kB in 2s (4706 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  openresolv | resolvconf
The following NEW packages will be installed:
  wireguard-tools
0 upgraded, 1 newly installed, 0 to remove and 51 not upgraded.
Need to get 83.3 kB of archives.
After this operation, 327 kB of additional disk space will be used.
Get:1 http://azure.archive.ubuntu.com/ubuntu focal-updates/universe amd64 wireguard-tools amd64 1.0.20200513-1~20.04.2 [83.3 kB]
Fetched 83.3 kB in 0s (1278 kB/s)
Selecting previously unselected package wireguard-tools.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... [2427](https://github.com/intellum/data-ingestion-pipelines/runs/6607019413?check_suite_focus=true#step:3:2458)23 files and directories currently installed.)
Preparing to unpack .../wireguard-tools_1.0.20200513-1~20.04.2_amd64.deb ...
Unpacking wireguard-tools (1.0.20200513-1~20.04.2) ...
Setting up wireguard-tools (1.0.20200513-1~20.04.2) ...
wg-quick.target is a disabled or a static unit, not starting it.

Step setup

    - name: Set up WireGuard
      uses: egor-tensin/setup-wireguard@v1
      with:
        endpoint: <our-wiregard-ip>:51820
        endpoint_public_key: <our-public-key>
        ips: 10.50.0.29/32
        allowed_ips: 0.0.0.0/0
        private_key: <our-private-key>
        preshared_key: <our-preshared-key>

Notes

we also have DNS on wirward setup set to 1.1.1.1 but the actions does not offer input for DNS

andresbravog commented 2 years ago

This answer seems relevant https://askubuntu.com/a/1242803

nconnector commented 1 year ago

Having the same issue.

LaQuay commented 1 year ago

Same issue here.