Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New VPN Rockon Based on WireGuard #347

Merged
merged 5 commits into from
Dec 15, 2023
Merged

Conversation

Hooverdan96
Copy link
Member

Simple setup WireGuard + Admin UI container

General information on project

This pull request proposes to add a new rock-on for the following project:

  • name: WireGuard Easy
  • website: https://wireguard.com
  • description: Simple container for setting up a VPN server, includes an easy to use administration WebUI.

Information on docker image

  • docker image: [https://hub.docker.com/r/weejewel/wg-easy
  • No. The benefit of this implementation is that this Wireguard server comes with a WebUI that allows convenient setup of a client using a QR code (simpler than, say, the OpenVPN Rockon). By exposing variables like DNS, it can easily be integrated and used alongside pi-hole, etc.

Checklist

  • Passes JSONlint validation
  • Entry added to root.json in alphabetical order (for new rock-on only)
  • "description" object lists and links to the docker image used
  • "description" object provides information on the image's particularities (advantage over another existing rock-on for the same project, for instance)
  • "website" object links to project's main website

Simple setup WireGuard container
include WebUI
@Hooverdan96
Copy link
Member Author

Hooverdan96 commented May 18, 2023

Installation example (tested on RC 4.5.9-0):

image

After installation starting up WebUI and logging on with specified password:

image

adding new VPN clients:

image

Creating the settings for a new VPN client is as simple as naming it, and provide the new client with e.g. a QR code:

image

on iPhone, e.g. use the available WireGuard app, which allows for scanning a QR code. On Windows computer there is a free client app available (like WireguardPro) for which one can export the config file from the WebUI and import.

image

Also, each client can be disabled or deleted via the WebUI.

Only additional configuration pre-req is to provide port forwarding on the router to the udp port configured.

@phillxnet
Copy link
Member

@Hooverdan96 Thanks for submitting this. It looks like a really nice Rock-on.

@phillxnet phillxnet added the needs review Test install, function, on / off behaviour, all links / info. label May 21, 2023
@phillxnet
Copy link
Member

@Hooverdan96 I've just tested this, as if merged, from a local repo and I get the following:

[14/Dec/2023 15:24:28] ERROR [storageadmin.util:41] (Error while processing Rock-on profile at (http://build.lan/rockons/WireGuardEasy.json).). Lower level exception: (Expecting ':' delimiter: line 86 column 344 (char 2989)).
[14/Dec/2023 15:24:28] ERROR [storageadmin.util:45] Exception: Expecting ':' delimiter: line 86 column 344 (char 2989)
Traceback (most recent call last):
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting ':' delimiter: line 86 column 344 (char 2989)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py", line 41, in _handle_exception
    yield
  File "/opt/rockstor/src/rockstor/storageadmin/views/rockon.py", line 503, in _get_available
    meta_cfg.update(cur_res.json())
                    ^^^^^^^^^^^^^^
  File "/opt/rockstor/.venv/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting ':' delimiter: line 86 column 344 (char 2989)

Looks like we could also do with a pr format checker in this repo re JSON :).

Double checking in an online linter: http://jsonlint.vearne.cc/

Error: Parse error on line 86:
...4 architecture.</p>",		"ui": {			"slug
-----------------------^
Expecting ':', got ','

Which looks to be pretty similar. Something it trying to tell us to get our GitHub actions in order re basic formatting checks :) .

@phillxnet
Copy link
Member

From a quick look at the raw file, it looks to be missing the description tag, likely lost in some merge of sorts!

@Hooverdan96
Copy link
Member Author

argh! As always, thanks for your due diligence. I definitely json linted it, but since that's always a copy/past action on my part, I must have screwed up something with the final commit. I'll take care of that.

One the other hand, do we need this at all, since @FroggyFlox now introduced the wireguard setup as a native functionality (albeit still in testing channel?

In any case, I'll fix the json ...

@FroggyFlox
Copy link
Member

I just wanted to chime in on the following:

One the other hand, do we need this at all, since @FroggyFlox now introduced the wireguard setup as a native functionality (albeit still in testing channel?

I personally think we do as this Rock-On and Tailscale address two different possible uses or, most likely, two different types of users. Some may use Tailscale to remotely access their Rockstor box, while other may prefer to use their own, or an existing, WireGuard setup.

@Hooverdan96
Copy link
Member Author

ok, that makes sense to me too. I hopefully updated the json correctly this time around

Copy link
Member

@phillxnet phillxnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Hooverdan96 Thanks for sumitting this, it looks to be a great addition. I've only tested install, on/off, uninstall - reinstall, persistence through reboot, and Web-UI button/loging. And have added a single client. But I understand you've proven actual function. So I'll go ahead and merge.

Quite the nice addition actually.

Installed

wireguard-rockon-Installed

Web-UI

pr346

Tested on a custom 5.0.5-2764 Leap 15.5 base.

@phillxnet phillxnet merged commit b06c601 into rockstor:master Dec 15, 2023
@phillxnet
Copy link
Member

PR product PRODUCTION published.

@Hooverdan96 Hooverdan96 deleted the WG_Easy branch December 15, 2023 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Test install, function, on / off behaviour, all links / info.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants