• Stars
    star
    142
  • Rank 258,445 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Install, upgrade or remove WireGuard (WireGuard/wireguard-vyatta-ubnt) on Ubiquiti hardware

vyatta-wireguard-installer

Install, upgrade or remove WireGuard (WireGuard/wireguard-vyatta-ubnt) on Ubiquiti hardware. By default, the installer caches the deb-package so that the same version of WireGuard can be restored after a firmware upgrade.

Installation

Simply copy the script onto your Ubiquiti router and run it.

Note: By placing this script in /config/scripts/post-config.d, the WireGuard installation will persist across firmware upgrades.

curl -sSL https://github.com/mafredri/vyatta-wireguard-installer/raw/master/wireguard.sh -o /config/scripts/post-config.d/wireguard.sh
chmod +x /config/scripts/post-config.d/wireguard.sh

Usage

$ ./wireguard.sh help
Install, upgrade or remove WireGuard (github.com/WireGuard/wireguard-vyatta-ubnt) on
Ubiquiti hardware. By default, the installer caches the deb-package so that the
same version of WireGuard can be restored after a firmware upgrade.

Note: This script can be placed in /config/scripts/post-config.d for automatic
installation after firmware upgrades.

Usage:
  ./wireguard.sh [COMMAND] [OPTION]...

Commands:
  check        Check if there's a new version of WireGuard (without installing)
  install      Install the latest version of WireGuard
  upgrade      Upgrade WireGuard to the latest version
  remove       Remove WireGuard
  self-update  Fetch the latest version of this script
  help         Show this help
  version      Show the version of this tool

Options:
      --no-cache  Disable package caching, cache is used during (re)install

Configuration

Automatic upgrade

The script in this repo can be used to perform automatic upgrades via the VyOS task scheduler. See VyOS Wiki: Task scheduler for more configuration options.

WARNING: There is no rollback functionality implemented (yet). If something goes wrong during the auto upgrade you could be left with a non-functioning WireGuard install.

On device configuration

This configuration method can be used on any Ubiquti device, but will not persist across provisions on the USG.

configure
set system task-scheduler task wireguard_auto_upgrade executable path /config/scripts/post-config.d/wireguard.sh
set system task-scheduler task wireguard_auto_upgrade executable arguments upgrade
set system task-scheduler task wireguard_auto_upgrade interval 14d
commit
save
exit

Ubiquiti Security Gateway

Update your config.gateway.json to include the following:

{
  "system": {
    "task-scheduler": {
      "task": {
        "wireguard_auto_upgrade": {
          "executable": {
            "path": "/config/scripts/post-config.d/wireguard.sh",
            "arguments": "upgrade"
          },
          "interval": "14d"
        }
      }
    }
  }
}

Todo

  • Investigate using /config/scripts/pre-config.d for post-firmware upgrade installation
    • Why? It would make WireGuard available by the time the initial configuration is run
    • Possible, since we cache the installer in /config/user-data/wireguard/cache.
  • Periodically check for new releases via cron (+automatic upgrades)
  • Support rollback if a release doesn't work as expected?
  • Check compatibility with current kernel / firmware version?

Resources

More Repositories

1

zsh-async

Because your terminal should be able to perform tasks asynchronously without external tools!
Shell
710
star
2

cdp

Package cdp provides type-safe bindings for the Chrome DevTools Protocol (CDP), written in the Go programming language.
Go
686
star
3

phoenix-config

My personal Phoenix (kasper/phoenix) configuration, written in TypeScript
TypeScript
38
star
4

phoenix-typings

TypeScript typings for Phoenix (kasper/phoenix)
29
star
5

macos-display-overrides

Display overrides to make (my) monitors work better on macOS
Ruby
22
star
6

go-trueskill

An implementation of the TrueSkillâ„¢ ranking system (by Microsoft) in Go
Go
22
star
7

macos-brightness

Simple CLI for changing brightness on macOS
Go
20
star
8

asustor-platform-driver

Linux kernel platform driver for ASUSTOR NAS hardware (leds, buttons)
C
19
star
9

zeet

My personal Zsh setup
Shell
16
star
10

openbttn

Open source firmware for bt.tn buttons
C
16
star
11

asustor_as-6xxt

All things ASUSTOR AS-6XXT sans ADM
Shell
13
star
12

asustor-packages

Collection of packages for ASUSTOR ADM
Shell
9
star
13

lcm

Implementation of the ASUSTOR NAS LCD serial port communication protocol
Go
8
star
14

asdev

ASUSTOR development tool, upload apps, etc.
Go
7
star
15

safari-bookmarklets

Bookmarklets for Safari (macOS / iOS)
JavaScript
7
star
16

gpg-notify

Notify about GPG events (pinentry, smartcard)
Go
6
star
17

fineli-sql

Convert Fineli, the Finnish Food Composition Database, into sqlite3 / SQL
Shell
5
star
18

macos-darkmode

Simple CLI for controlling macOS Dark Mode via Apples private API
Go
5
star
19

debian-my-live-build

Set up a custom debian live image (CD / USB)
Shell
5
star
20

goodspeaker

This package speaks the LG speaker wire protocol which is used by both LG Music Flow Player and LG Wi-Fi Speaker
Go
4
star
21

asustor-radarr

Radarr for ASUSTOR ADM
Shell
4
star
22

magic4linux

Allows you to use the magic remote on your webOS LG TV as a keyboard/mouse for your Linux machine
Go
4
star
23

asustor-deluge

Build Deluge package for ASUSTOR ADM
Shell
4
star
24

asustor-libcec

Shell
3
star
25

go-gaussian

Normal (gaussian) distribution for Go
Go
3
star
26

musicflow

This package and its commands can be used to control LG speakers that use the Music Flow app
Go
3
star
27

kodi-watchedlist-sync

Sync Kodi watched status without watchedlist plugin (MySQL)
PLpgSQL
2
star
28

vyatta-dhcp-option-6rd-reporter

Add IPv6 6RD reporting for UniFi Security Gateway
Shell
2
star
29

svenska-yle-rss-content-fixer

Attach content to Svenska Yle RSS feeds
Go
2
star
30

go-trueskilld

A simple http API for mafredri/go-trueskill (https://github.com/mafredri/go-trueskill).
Go
2
star
31

asustor-qbittorrent

qBittorrent for ASUSTOR ADM
Shell
2
star
32

kinesis-advantage2

Configuration for my Kinesis Advantage2
Shell
1
star
33

asustor-sonarr

Sonarr for ASUSTOR ADM
Shell
1
star
34

asustor-go

The Go Programming Language for ASUSTOR ADM
Shell
1
star
35

asustor-jackett

Jackett for ASUSTOR ADM
Shell
1
star
36

vyatta-dhcp-global-option

Add support for configuring dhclient global options on UniFi Security Gateway
Perl
1
star
37

asustor-mono-latest

An up-to-date version of Mono for ASUSTOR ADM
Shell
1
star
38

go-mathextra

Extra math functions for Go
Go
1
star
39

asustor-python-cec

Python
1
star
40

as-search

Search from ASUSTOR NAS using Searchligt
Python
1
star
41

mafredri.github.io

HTML
1
star
42

asustor-rtorrent

rTorrent for Asustor ADM
Shell
1
star
43

playgoround

My Golang playground (playGoRound)
Go
1
star