Skip to content

Commit

Permalink
Merge pull request #8 from rwillert/modify-build
Browse files Browse the repository at this point in the history
fix lint and use own modules namespace
  • Loading branch information
rwillert authored Dec 17, 2024
2 parents 95afa8d + 86543c8 commit 6ff0832
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 52 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.62
8 changes: 2 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@ jobs:
fail-fast: false
matrix:
# build and publish in parallel: linux/386, linux/amd64, darwin/386, darwin/amd64
goos: [linux, freebsd, darwin]
goarch: [386, amd64, arm, arm64]
goos: [linux, darwin]
goarch: [amd64, arm, arm64]
exclude:
- goarch: 386
goos: darwin
- goarch: arm
goos: darwin
- goarch: arm64
goos: darwin
goarm:
- 7
steps:
Expand Down
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
run:
timeout: 5m
skip-dirs:
- .github
- hack
- vendor
linters:
disable-all: true
enable:
Expand All @@ -24,3 +20,7 @@ linters-settings:
disabled: true
issues:
exclude-use-default: false
exclude-dirs:
- .github
- hack
- vendor
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ngoduykhanh/wireguard-ui
module github.com/rwillert/wireguard-ui

go 1.23

Expand Down
10 changes: 5 additions & 5 deletions handler/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import (
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/ngoduykhanh/wireguard-ui/emailer"
"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/ngoduykhanh/wireguard-ui/telegram"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/emailer"
"github.com/rwillert/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/store"
"github.com/rwillert/wireguard-ui/telegram"
"github.com/rwillert/wireguard-ui/util"
)

var usernameRegexp = regexp.MustCompile("^\\w[\\w\\-.]*$")
Expand Down
4 changes: 2 additions & 2 deletions handler/routes_wake_on_lan.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (

"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/rwillert/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/store"
"github.com/sabhiram/go-wol/wol"
)

Expand Down
2 changes: 1 addition & 1 deletion handler/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/util"
)

func ValidSession(next echo.HandlerFunc) echo.HandlerFunc {
Expand Down
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ import (

"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/ngoduykhanh/wireguard-ui/telegram"

"github.com/ngoduykhanh/wireguard-ui/emailer"
"github.com/ngoduykhanh/wireguard-ui/handler"
"github.com/ngoduykhanh/wireguard-ui/router"
"github.com/ngoduykhanh/wireguard-ui/store/jsondb"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/store"
"github.com/rwillert/wireguard-ui/telegram"

"github.com/rwillert/wireguard-ui/emailer"
"github.com/rwillert/wireguard-ui/handler"
"github.com/rwillert/wireguard-ui/router"
"github.com/rwillert/wireguard-ui/store/jsondb"
"github.com/rwillert/wireguard-ui/util"
)

var (
// command-line banner information
appVersion = "development"
gitCommit = "N/A"
gitRef = "N/A"
buildTime = fmt.Sprintf(time.Now().UTC().Format("01-02-2006 15:04:05"))
buildTime = time.Now().UTC().Format("01-02-2006 15:04:05")
// configuration variables
flagDisableLogin = false
flagBindAddress = "0.0.0.0:5000"
Expand Down Expand Up @@ -161,7 +161,7 @@ func init() {
fmt.Println("Git Commit\t:", gitCommit)
fmt.Println("Git Ref\t\t:", gitRef)
fmt.Println("Build Time\t:", buildTime)
fmt.Println("Git Repo\t:", "https://github.com/ngoduykhanh/wireguard-ui")
fmt.Println("Git Repo\t:", "https://github.com/rwillert/wireguard-ui")
fmt.Println("Authentication\t:", !util.DisableLogin)
fmt.Println("Bind address\t:", util.BindAddress)
//fmt.Println("Sendgrid key\t:", util.SendgridApiKey)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "Wireguard web interface",
"main": "index.js",
"repository": "git@github.com:ngoduykhanh/wireguard-ui.git",
"repository": "git@github.com:rwillert/wireguard-ui.git",
"author": "Khanh Ngo <k@ndk.name>",
"license": "MIT",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/gommon/log"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/util"
)

// TemplateRegistry is a custom html/template renderer for Echo framework
Expand Down
4 changes: 2 additions & 2 deletions store/jsondb/jsondb.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/skip2/go-qrcode"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"

"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/util"
)

type JsonDB struct {
Expand Down
4 changes: 2 additions & 2 deletions store/jsondb/jsondb_wake_on_lan.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"path"

"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/ngoduykhanh/wireguard-ui/util"
"github.com/rwillert/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/util"
)

func (o *JsonDB) GetWakeOnLanHosts() ([]model.WakeOnLanHost, error) {
Expand Down
2 changes: 1 addition & 1 deletion store/store.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package store

import (
"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/model"
)

type IStore interface {
Expand Down
2 changes: 1 addition & 1 deletion telegram/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/NicoNex/echotron/v3"
"github.com/labstack/gommon/log"
"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/rwillert/wireguard-ui/store"
)

type SendRequestedConfigsToTelegram func(db store.IStore, userid int64) []string
Expand Down
8 changes: 4 additions & 4 deletions templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ <h3 class="card-title">About Wireguard-UI</h3>
</div>
<strong>Copyright &copy;
<script>document.write(new Date().getFullYear())</script>
<a href="https://github.com/ngoduykhanh/wireguard-ui" target="_blank">Wireguard UI</a>.
<a href="https://github.com/rwillert/wireguard-ui" target="_blank">Wireguard UI</a>.
</strong> All rights reserved.

</div>
Expand All @@ -83,7 +83,7 @@ <h3 class="card-title">About Wireguard-UI</h3>
$.ajax({
cache: false,
method: 'GET',
url: 'https://api.github.com/repos/ngoduykhanh/wireguard-ui/releases/tags/' + $("#version").val(),
url: 'https://api.github.com/repos/rwillert/wireguard-ui/releases/tags/' + $("#version").val(),
dataType: 'json',
contentType: "application/json",
success: function (data) {
Expand All @@ -99,7 +99,7 @@ <h3 class="card-title">About Wireguard-UI</h3>
$.ajax({
cache: false,
method: 'GET',
url: 'https://api.github.com/repos/ngoduykhanh/wireguard-ui/releases/latest',
url: 'https://api.github.com/repos/rwillert/wireguard-ui/releases/latest',
dataType: 'json',
contentType: "application/json",
success: function (data) {
Expand All @@ -121,7 +121,7 @@ <h3 class="card-title">About Wireguard-UI</h3>
$.ajax({
cache: false,
method: 'GET',
url: 'https://api.github.com/repos/ngoduykhanh/wireguard-ui/contributors',
url: 'https://api.github.com/repos/rwillert/wireguard-ui/contributors',
dataType: 'json',
contentType: "application/json",
success: function (data) {
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ <h1>{{template "page_title" .}}</h1>
<div class="float-right d-none d-sm-block">
<b>Version</b> {{ .appVersion }}
</div>
<strong>Copyright &copy; <script>document.write(new Date().getFullYear())</script> <a href="https://github.com/ngoduykhanh/wireguard-ui">Wireguard UI</a>.</strong> All rights
<strong>Copyright &copy; <script>document.write(new Date().getFullYear())</script> <a href="https://github.com/rwillert/wireguard-ui">Wireguard UI</a>.</strong> All rights
reserved.
</footer>
-->
Expand Down
2 changes: 1 addition & 1 deletion templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="https://github.com/ngoduykhanh/wireguard-ui">WireGuard UI</a>
<a href="https://github.com/rwillert/wireguard-ui">WireGuard UI</a>
</div>
<!-- /.login-logo -->
<div class="card">
Expand Down
2 changes: 1 addition & 1 deletion templates/wake_on_lan_hosts.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h4 class="modal-title">Remove</h4>

<div class="row">
{{ range $idx, $host := .hosts }}
{{- /*gotype: github.com/ngoduykhanh/wireguard-ui/model.WakeOnLanHost*/ -}}
{{- /*gotype: github.com/rwillert/wireguard-ui/model.WakeOnLanHost*/ -}}
<div class="col-sm-4" id="{{ $host.ResolveResourceName }}">
<div class="info-box">
<div class="info-box-content">
Expand Down
2 changes: 1 addition & 1 deletion templates/wg.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated using wireguard-ui (https://github.com/ngoduykhanh/wireguard-ui)
# This file was generated using wireguard-ui (https://github.com/rwillert/wireguard-ui)
# Please don't modify it manually, otherwise your change might get replaced.

# Address updated at: {{ .serverConfig.Interface.UpdatedAt }}
Expand Down
6 changes: 3 additions & 3 deletions util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import (
"text/template"
"time"

"github.com/ngoduykhanh/wireguard-ui/store"
"github.com/ngoduykhanh/wireguard-ui/telegram"
"github.com/rwillert/wireguard-ui/store"
"github.com/rwillert/wireguard-ui/telegram"
"github.com/skip2/go-qrcode"
"golang.org/x/mod/sumdb/dirhash"

externalip "github.com/glendc/go-external-ip"
"github.com/labstack/gommon/log"
"github.com/ngoduykhanh/wireguard-ui/model"
"github.com/rwillert/wireguard-ui/model"
"github.com/sdomino/scribble"
)

Expand Down

0 comments on commit 6ff0832

Please sign in to comment.