From 9f093d97b1a05b543096db54cc490de299f00829 Mon Sep 17 00:00:00 2001 From: Ioannis Dressos <96877388+idressos@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:39:30 +0200 Subject: [PATCH] Capitalize 'g' in Wireguard --- README.md | 6 ++--- examples/docker-compose/README.md | 8 +++---- handler/routes.go | 38 +++++++++++++++---------------- main.go | 2 +- package.json | 2 +- templates/about.html | 4 ++-- templates/base.html | 6 ++--- templates/global_settings.html | 12 +++++----- templates/server.html | 16 ++++++------- util/util.go | 2 +- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 23cbcbd..eafa86b 100644 --- a/README.md +++ b/README.md @@ -186,9 +186,9 @@ rc-update add wgui default ### Using Docker -Set `WGUI_MANAGE_RESTART=true` to manage Wireguard interface restarts. -Using `WGUI_MANAGE_START=true` can also replace the function of `wg-quick@wg0` service, to start Wireguard at boot, by -running the container with `restart: unless-stopped`. These settings can also pick up changes to Wireguard Config File +Set `WGUI_MANAGE_RESTART=true` to manage WireGuard interface restarts. +Using `WGUI_MANAGE_START=true` can also replace the function of `wg-quick@wg0` service, to start WireGuard at boot, by +running the container with `restart: unless-stopped`. These settings can also pick up changes to WireGuard Config File Path, after restarting the container. Please make sure you have `--cap-add=NET_ADMIN` in your container config to make this feature work. diff --git a/examples/docker-compose/README.md b/examples/docker-compose/README.md index 951df08..4b645a3 100644 --- a/examples/docker-compose/README.md +++ b/examples/docker-compose/README.md @@ -2,7 +2,7 @@ ### Kernel Module -Depending on if the Wireguard kernel module is available on your system you have more or less choices which example to use. +Depending on if the WireGuard kernel module is available on your system you have more or less choices which example to use. You can check if the kernel modules are available via the following command: ```shell @@ -21,10 +21,10 @@ For security reasons it's highly recommended to change them before the first sta ## Examples - **[system](system.yml)** - If you have Wireguard already installed on your system and only want to run the UI in docker this might fit the most. + If you have WireGuard already installed on your system and only want to run the UI in docker this might fit the most. - **[linuxserver](linuxserver.yml)** - If you have the Wireguard kernel modules installed (included in the mainline kernel since version 5.6) but want it running inside of docker, this might fit the most. + If you have the WireGuard kernel modules installed (included in the mainline kernel since version 5.6) but want it running inside of docker, this might fit the most. - **[boringtun](boringtun.yml)** - If Wireguard kernel modules are not available, you can switch to an userspace implementation like [boringtun](https://github.com/cloudflare/boringtun). + If WireGuard kernel modules are not available, you can switch to an userspace implementation like [boringtun](https://github.com/cloudflare/boringtun). diff --git a/handler/routes.go b/handler/routes.go index 232f32b..53cd8d7 100644 --- a/handler/routes.go +++ b/handler/routes.go @@ -347,7 +347,7 @@ func WireGuardClients(db store.IStore) echo.HandlerFunc { } } -// GetClients handler return a JSON list of Wireguard client data +// GetClients handler return a JSON list of WireGuard client data func GetClients(db store.IStore) echo.HandlerFunc { return func(c echo.Context) error { @@ -362,7 +362,7 @@ func GetClients(db store.IStore) echo.HandlerFunc { } } -// GetClient handler returns a JSON object of Wireguard client data +// GetClient handler returns a JSON object of WireGuard client data func GetClient(db store.IStore) echo.HandlerFunc { return func(c echo.Context) error { @@ -419,12 +419,12 @@ func NewClient(db store.IStore) echo.HandlerFunc { guid := xid.New() client.ID = guid.String() - // gen Wireguard key pair + // gen WireGuard key pair if client.PublicKey == "" { key, err := wgtypes.GeneratePrivateKey() if err != nil { log.Error("Cannot generate wireguard key pair: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate WireGuard key pair"}) } client.PrivateKey = key.String() client.PublicKey = key.PublicKey().String() @@ -432,7 +432,7 @@ func NewClient(db store.IStore) echo.HandlerFunc { _, err := wgtypes.ParseKey(client.PublicKey) if err != nil { log.Error("Cannot verify wireguard public key: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify Wireguard public key"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify WireGuard public key"}) } // check for duplicates clients, err := db.GetClients(false) @@ -454,7 +454,7 @@ func NewClient(db store.IStore) echo.HandlerFunc { if err != nil { log.Error("Cannot generated preshared key: ", err) return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{ - false, "Cannot generate Wireguard preshared key", + false, "Cannot generate WireGuard preshared key", }) } client.PresharedKey = presharedKey.String() @@ -465,7 +465,7 @@ func NewClient(db store.IStore) echo.HandlerFunc { _, err := wgtypes.ParseKey(client.PresharedKey) if err != nil { log.Error("Cannot verify wireguard preshared key: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify Wireguard preshared key"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify WireGuard preshared key"}) } } client.CreatedAt = time.Now().UTC() @@ -577,12 +577,12 @@ func UpdateClient(db store.IStore) echo.HandlerFunc { return c.JSON(http.StatusBadRequest, jsonHTTPResponse{false, "Extra Allowed IPs must be in CIDR format"}) } - // update Wireguard Client PublicKey + // update WireGuard Client PublicKey if client.PublicKey != _client.PublicKey && _client.PublicKey != "" { _, err := wgtypes.ParseKey(_client.PublicKey) if err != nil { - log.Error("Cannot verify provided Wireguard public key: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify provided Wireguard public key"}) + log.Error("Cannot verify provided WireGuard public key: ", err) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify provided WireGuard public key"}) } // check for duplicates clients, err := db.GetClients(false) @@ -597,7 +597,7 @@ func UpdateClient(db store.IStore) echo.HandlerFunc { } } - // When replacing any PublicKey, discard any locally stored Wireguard Client PrivateKey + // When replacing any PublicKey, discard any locally stored WireGuard Client PrivateKey // Client PubKey no longer corresponds to locally stored PrivKey. // QR code (needs PrivateKey) for this client is no longer possible now. @@ -607,12 +607,12 @@ func UpdateClient(db store.IStore) echo.HandlerFunc { } - // update Wireguard Client PresharedKey + // update WireGuard Client PresharedKey if client.PresharedKey != _client.PresharedKey && _client.PresharedKey != "" { _, err := wgtypes.ParseKey(_client.PresharedKey) if err != nil { - log.Error("Cannot verify provided Wireguard preshared key: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify provided Wireguard preshared key"}) + log.Error("Cannot verify provided WireGuard preshared key: ", err) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot verify provided WireGuard preshared key"}) } } @@ -770,11 +770,11 @@ func WireGuardServerInterfaces(db store.IStore) echo.HandlerFunc { func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc { return func(c echo.Context) error { - // gen Wireguard key pair + // gen WireGuard key pair key, err := wgtypes.GeneratePrivateKey() if err != nil { log.Error("Cannot generate wireguard key pair: ", err) - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate WireGuard key pair"}) } var serverKeyPair model.ServerKeypair @@ -783,7 +783,7 @@ func WireGuardServerKeyPair(db store.IStore) echo.HandlerFunc { serverKeyPair.UpdatedAt = time.Now().UTC() if err := db.SaveServerKeyPair(serverKeyPair); err != nil { - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate WireGuard key pair"}) } log.Infof("Updated wireguard server interfaces settings: %v", serverKeyPair) @@ -936,7 +936,7 @@ func GlobalSettingSubmit(db store.IStore) echo.HandlerFunc { // write config to the database if err := db.SaveGlobalSettings(globalSettings); err != nil { - return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate Wireguard key pair"}) + return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, "Cannot generate WireGuard key pair"}) } log.Infof("Updated global settings: %v", globalSettings) @@ -1010,7 +1010,7 @@ func SuggestIPAllocation(db store.IStore) echo.HandlerFunc { } } -// ApplyServerConfig handler to write config file and restart Wireguard server +// ApplyServerConfig handler to write config file and restart WireGuard server func ApplyServerConfig(db store.IStore, tmplDir fs.FS) echo.HandlerFunc { return func(c echo.Context) error { diff --git a/main.go b/main.go index dc725bd..a94bb84 100644 --- a/main.go +++ b/main.go @@ -116,7 +116,7 @@ func init() { // print only if log level is INFO or lower if lvl, _ := util.ParseLogLevel(util.LookupEnvOrString(util.LogLevel, "INFO")); lvl <= log.INFO { // print app information - fmt.Println("Wireguard UI") + fmt.Println("WireGuard UI") fmt.Println("App Version\t:", appVersion) fmt.Println("Git Commit\t:", gitCommit) fmt.Println("Git Ref\t\t:", gitRef) diff --git a/package.json b/package.json index a0cda64..4644748 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "wireguard-ui", "version": "1.0.0", - "description": "Wireguard web interface", + "description": "WireGuard web interface", "main": "index.js", "repository": "git@github.com:ngoduykhanh/wireguard-ui.git", "author": "Khanh Ngo ", diff --git a/templates/about.html b/templates/about.html index 46339cc..226d6d6 100644 --- a/templates/about.html +++ b/templates/about.html @@ -22,7 +22,7 @@ About
-

About Wireguard-UI

+

About WireGuard-UI

@@ -63,7 +63,7 @@ About
Copyright © - Wireguard UI. + WireGuard UI. All rights reserved.
diff --git a/templates/base.html b/templates/base.html index b0a26fd..8308fdd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -130,7 +130,7 @@

- Wireguard Server + WireGuard Server

@@ -197,7 +197,7 @@