mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-21 20:12:33 +03:00
Add favicon
This commit is contained in:
parent
f256668a99
commit
8b581a2a71
7 changed files with 17 additions and 0 deletions
|
@ -53,6 +53,7 @@ Note:
|
||||||
| `WGUI_USERNAME` | The username for the login page. Used for db initialization only | `admin` |
|
| `WGUI_USERNAME` | The username for the login page. Used for db initialization only | `admin` |
|
||||||
| `WGUI_PASSWORD` | The password for the user on the login page. Will be hashed automatically. Used for db initialization only | `admin` |
|
| `WGUI_PASSWORD` | The password for the user on the login page. Will be hashed automatically. Used for db initialization only | `admin` |
|
||||||
| `WGUI_PASSWORD_HASH` | The password hash for the user on the login page. (alternative to `WGUI_PASSWORD`). Used for db initialization only | N/A |
|
| `WGUI_PASSWORD_HASH` | The password hash for the user on the login page. (alternative to `WGUI_PASSWORD`). Used for db initialization only | N/A |
|
||||||
|
| `WGUI_FAVICON_FILE_PATH` | The file path used as website favicon | Embedded WireGuard logo |
|
||||||
| `WGUI_ENDPOINT_ADDRESS` | The default endpoint address used in global settings | Resolved to your public ip address |
|
| `WGUI_ENDPOINT_ADDRESS` | The default endpoint address used in global settings | Resolved to your public ip address |
|
||||||
| `WGUI_DNS` | The default DNS servers (comma-separated-list) used in the global settings | `1.1.1.1` |
|
| `WGUI_DNS` | The default DNS servers (comma-separated-list) used in the global settings | `1.1.1.1` |
|
||||||
| `WGUI_MTU` | The default MTU used in global settings | `1450` |
|
| `WGUI_MTU` | The default MTU used in global settings | `1450` |
|
||||||
|
|
BIN
custom/img/favicon.ico
Normal file
BIN
custom/img/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
|
@ -6,6 +6,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -32,6 +33,15 @@ func Health() echo.HandlerFunc {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Favicon() echo.HandlerFunc {
|
||||||
|
return func(c echo.Context) error {
|
||||||
|
if favicon, ok := os.LookupEnv(util.FaviconFilePathEnvVar); ok {
|
||||||
|
return c.File(favicon)
|
||||||
|
}
|
||||||
|
return c.Redirect(http.StatusFound, util.BasePath+"/static/custom/img/favicon.ico")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// LoginPage handler
|
// LoginPage handler
|
||||||
func LoginPage() echo.HandlerFunc {
|
func LoginPage() echo.HandlerFunc {
|
||||||
return func(c echo.Context) error {
|
return func(c echo.Context) error {
|
||||||
|
|
1
main.go
1
main.go
|
@ -148,6 +148,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
app.GET(util.BasePath+"/_health", handler.Health())
|
app.GET(util.BasePath+"/_health", handler.Health())
|
||||||
|
app.GET(util.BasePath+"/favicon", handler.Favicon())
|
||||||
app.POST(util.BasePath+"/new-client", handler.NewClient(db), handler.ValidSession, handler.ContentTypeJson)
|
app.POST(util.BasePath+"/new-client", handler.NewClient(db), handler.ValidSession, handler.ContentTypeJson)
|
||||||
app.POST(util.BasePath+"/update-client", handler.UpdateClient(db), handler.ValidSession, handler.ContentTypeJson)
|
app.POST(util.BasePath+"/update-client", handler.UpdateClient(db), handler.ValidSession, handler.ContentTypeJson)
|
||||||
app.POST(util.BasePath+"/email-client", handler.EmailClient(db, sendmail, defaultEmailSubject, defaultEmailContent), handler.ValidSession, handler.ContentTypeJson)
|
app.POST(util.BasePath+"/email-client", handler.EmailClient(db, sendmail, defaultEmailSubject, defaultEmailContent), handler.ValidSession, handler.ContentTypeJson)
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
<title>{{template "title" .}}</title>
|
<title>{{template "title" .}}</title>
|
||||||
<!-- Tell the browser to be responsive to screen width -->
|
<!-- Tell the browser to be responsive to screen width -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<!-- Favicon -->
|
||||||
|
<link rel="icon" href="{{.basePath}}/favicon">
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link rel="stylesheet" href="{{.basePath}}/static/plugins/fontawesome-free/css/all.min.css">
|
<link rel="stylesheet" href="{{.basePath}}/static/plugins/fontawesome-free/css/all.min.css">
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
<title>WireGuard UI</title>
|
<title>WireGuard UI</title>
|
||||||
<!-- Tell the browser to be responsive to screen width -->
|
<!-- Tell the browser to be responsive to screen width -->
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<!-- Favicon -->
|
||||||
|
<link rel="icon" href="{{.basePath}}/favicon">
|
||||||
|
|
||||||
<!-- Font Awesome -->
|
<!-- Font Awesome -->
|
||||||
<link rel="stylesheet" href="{{.basePath}}/static/plugins/fontawesome-free/css/all.min.css">
|
<link rel="stylesheet" href="{{.basePath}}/static/plugins/fontawesome-free/css/all.min.css">
|
||||||
|
|
|
@ -34,6 +34,7 @@ const (
|
||||||
UsernameEnvVar = "WGUI_USERNAME"
|
UsernameEnvVar = "WGUI_USERNAME"
|
||||||
PasswordEnvVar = "WGUI_PASSWORD"
|
PasswordEnvVar = "WGUI_PASSWORD"
|
||||||
PasswordHashEnvVar = "WGUI_PASSWORD_HASH"
|
PasswordHashEnvVar = "WGUI_PASSWORD_HASH"
|
||||||
|
FaviconFilePathEnvVar = "WGUI_FAVICON_FILE_PATH"
|
||||||
EndpointAddressEnvVar = "WGUI_ENDPOINT_ADDRESS"
|
EndpointAddressEnvVar = "WGUI_ENDPOINT_ADDRESS"
|
||||||
DNSEnvVar = "WGUI_DNS"
|
DNSEnvVar = "WGUI_DNS"
|
||||||
MTUEnvVar = "WGUI_MTU"
|
MTUEnvVar = "WGUI_MTU"
|
||||||
|
|
Loading…
Add table
Reference in a new issue