Dailymotion
Published in

Dailymotion

How to automate users management in Wireguard

Introduction to Asteroid, Dailymotion’s open-source application

Asteroid, our app created with Go

We wanted an application that allows us to easily add, remove and view peers on our Wireguard server. We chose the Go programming language as it has a small footprint and is easy to deploy as a single binary.

\e[0; 33m 

Adding a new peer or user with Asteroid

Here’s how Asteroid works; to add a new peer or user, we just run these commands:

$ asteroid add -address=”172.16.0.7/32" -key 
“eXaMPL3Ave8q+kmNVmiw4KdKiXc//M0EGOY6K9C14nw

Removing a peer or user with Asteroid

Removing a peer or user is also extremely simple:

$ asteroid delete -key “eXaMPL3Ave8q+kmNVmiw4KdKiXc//M0EGOY6K9C14nw

Viewing peers or users added to the server with Asteroid

To view peers or users added to the server, we use the view command:

$ asteroid view

The help command

The “help” command is very useful to check what each command does or which arguments to give:

$ asteroid -h

Why we chose to go for open source

Wireguard was built as an open-source component to improve upon the OpenVPN status-quo. We’re happy to have switched to this new alternative and open-sourcing our Asteroid tool is a way of giving back to the open-source community. In the coming weeks, we’re thinking of adding a way to batch adding and removing users.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store