Skip to content

Commit

Permalink
v0.1
Browse files Browse the repository at this point in the history
add deb package
add basic logs
  • Loading branch information
UnnoTed committed Feb 28, 2021
1 parent bcdf4e0 commit c2990d0
Show file tree
Hide file tree
Showing 33 changed files with 416 additions and 214 deletions.
Binary file added Icon/128x128/wireguard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/128x128/wireguard_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/16x16/wireguard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/16x16/wireguard_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/256x256/wireguard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/256x256/wireguard_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/32x32/wireguard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/32x32/wireguard_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/48x48/wireguard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/48x48/wireguard_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added Icon/wireguard_offz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/wireguardz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions deb/DEBIAN/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
wireguird (0.1) UNRELEASED; urgency=medium

* Initial release. (Closes: #XXXXXX)

-- unknown <unknown@unknown> Thu, 11 Feb 2021 01:36:25 +0100
9 changes: 9 additions & 0 deletions deb/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Package: wireguird
Source: wireguird
Version: 0.1
Section: utils
Priority: extra
Architecture: amd64
Depends: wireguard-tools, resolvconf, libgtk-3-dev, libappindicator3-dev (>= 1.0.0)
Maintainer: UnnoTed
Description: GTK GUI for Wireguard
2 changes: 2 additions & 0 deletions deb/usr/local/bin/wireguird
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
pkexec /opt/wireguird/wireguird
8 changes: 8 additions & 0 deletions deb/usr/share/applications/wireguird.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=false
Exec=/usr/local/bin/wireguird
Name=Wireguird
Icon=/opt/wireguird/Icon/128x128/wireguard.png
18 changes: 18 additions & 0 deletions deb/usr/share/polkit-1/actions/wireguird.policy
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="org.freedesktop.policykit.pkexec.wireguird">
<description>Wireguard GUI</description>
<message>Authentication is required to run wireguird</message>
<!-- <icon_name>accessories-text-editor</icon_name> -->
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>auth_admin</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/opt/wireguird/wireguird</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>
1 change: 1 addition & 0 deletions deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sudo apt install wireguard-tools libgtk-3-dev libappindicator3-dev
37 changes: 0 additions & 37 deletions fileb0x.toml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -115,43 +115,6 @@ debug = false

# type: array of objects
[[custom]]

# type: array of strings
files = ["./flags/*.png"]

# base is the path that will be removed from all files' path
# type: string
base = "./flags/"

# prefix is the path that will be added to all files' path
# type: string
prefix = ""

# build tags for this set of files
# it will only work if spread mode is enabled
tags = ""
# end: custom
# type: array of objects
[[custom]]

# type: array of strings
files = ["./icon/*"]

# base is the path that will be removed from all files' path
# type: string
base = "./"

# prefix is the path that will be added to all files' path
# type: string
prefix = ""

# build tags for this set of files
# it will only work if spread mode is enabled
tags = ""
# end: custom
# type: array of objects
[[custom]]

# type: array of strings
files = ["*.glade"]

Expand Down
1 change: 1 addition & 0 deletions go.mod
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/nwidger/jsoncolor v0.3.0 // indirect
github.com/olekukonko/ts v0.0.0-20171002115256-78ecb04241c0 // indirect
github.com/rs/zerolog v1.18.0
github.com/smartystreets/goconvey v1.6.4 // indirect
github.com/ungerik/go-dry v0.0.0-20180411133923-654ae31114c8
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200515170644-ec7f26be9d9e
Expand Down
15 changes: 14 additions & 1 deletion go.sum
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@ github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc
github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gotk3/gotk3 v0.4.0 h1:TIuhyQitGeRTxOQIV3AJlYtEWWJpC74JHwAIsxlH8MU=
github.com/gotk3/gotk3 v0.4.0/go.mod h1:Eew3QBwAOBTrfFFDmsDE5wZWbcagBL1NUslj1GhRveo=
github.com/gotk3/gotk3 v0.5.1 h1:zIZM2K4gmkGz1idEFVUPTQfAK/pnWoLKrlIjLOc4kzo=
github.com/jsimonetti/rtnetlink v0.0.0-20190606172950-9527aa82566a/go.mod h1:Oz+70psSo5OFh8DBl0Zv2ACw7Esh6pPUphlvZG9x7uw=
github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4 h1:nwOc1YaOrYJ37sEBrtWZrdqzK22hiJs3GpDmP3sR2Yw=
github.com/jsimonetti/rtnetlink v0.0.0-20200117123717-f846d4f6c1f4/go.mod h1:WGuG/smIU4J/54PblvSbh+xvCZmpJnFgr3ds6Z55XMQ=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/karrick/godirwalk v1.7.8 h1:VfG72pyIxgtC7+3X9CMHI0AOl4LwyRAg98WAgsvffi8=
github.com/karrick/godirwalk v1.7.8/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34=
github.com/labstack/echo v3.2.1+incompatible h1:J2M7YArHx4gi8p/3fDw8tX19SXhBCoRpviyAZSN3I88=
Expand All @@ -46,6 +53,7 @@ github.com/mdlayher/netlink v0.0.0-20190409211403-11939a169225/go.mod h1:eQB3mZE
github.com/mdlayher/netlink v1.0.0/go.mod h1:KxeJAFOFLG6AjpyDkQ/iIhxygIUKD+vcwqcnu43w/+M=
github.com/mdlayher/netlink v1.1.0 h1:mpdLgm+brq10nI9zM1BpX1kpDbh3NLl3RSnVq6ZSkfg=
github.com/mdlayher/netlink v1.1.0/go.mod h1:H4WCitaheIsdF9yOYu8CFmCgQthAPIWZmcKp9uZHgmY=
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721 h1:RlZweED6sbSArvlE924+mUcZuXKLBHA35U7LN621Bws=
github.com/mikioh/ipaddr v0.0.0-20190404000644-d465c8ab6721/go.mod h1:Ickgr2WtCLZ2MDGd4Gr0geeCH5HybhRJbonOgQpvSxc=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
Expand All @@ -63,6 +71,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/zerolog v1.18.0 h1:CbAm3kP2Tptby1i9sYy2MGRg0uxIN9cyDb59Ys7W8z8=
github.com/rs/zerolog v1.18.0/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/ungerik/go-dry v0.0.0-20180411133923-654ae31114c8 h1:p6JzR5AMj5LyCEovRh5MOxmyuuwOEtfcVDwKqsBn41I=
github.com/ungerik/go-dry v0.0.0-20180411133923-654ae31114c8/go.mod h1:+LeLocciSarKa1pxOY7gmBQ7dSk5nB1w1f3nvvLw0j0=
Expand Down Expand Up @@ -104,12 +116,13 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.zx2c4.com/wireguard v0.0.20200121 h1:vcswa5Q6f+sylDfjqyrVNNrjsFUUbPsgAQTBCAg/Qf8=
golang.zx2c4.com/wireguard v0.0.20200121/go.mod h1:P2HsVp8SKwZEufsnezXZA4GRX/T49/HlU7DGuelXsU4=
golang.zx2c4.com/wireguard v0.0.20200320 h1:1vE6zVeO7fix9cJX1Z9ZQ+ikPIIx7vIyU0o0tLDD88g=
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200515170644-ec7f26be9d9e h1:fqDhK9OlzaaiFjnyaAfR9Q1RPKCK7OCTLlHGP9f74Nk=
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200515170644-ec7f26be9d9e/go.mod h1:UdS9frhv65KTfwxME1xE8+rHYoFpbm36gOud1GhBe9c=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
1 change: 1 addition & 0 deletions gui/gui.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func ShowError(win *gtk.ApplicationWindow, err error, info ...string) {
}

if _, err := glib.IdleAdd(func() {
wlog("ERROR", err.Error())
dlg := gtk.MessageDialogNew(win, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "%s", err.Error())
dlg.SetTitle("Error")
dlg.Run()
Expand Down
124 changes: 89 additions & 35 deletions gui/tunnels.go
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,22 @@ func (t *Tunnels) Create() error {
var img *gtk.Image

if activeName == name {
green, err := gtk.ImageNewFromFile("./icon/dot-green.png")
green, err := gtk.ImageNewFromFile("/opt/wireguird/Icon/dot-green.png")
if err != nil {
return err
}

img = green
} else {
gray, err := gtk.ImageNewFromFile("./icon/dot-gray.png")
gray, err := gtk.ImageNewFromFile("/opt/wireguird/Icon/dot-gray.png")
if err != nil {
return err
}
img = gray
}

t.icons[name] = img
// img, err := gtk.ImageNewFromFile("./icon/dot-gray.png")
// img, err := gtk.ImageNewFromFile("/opt/wireguird/Icon/dot-gray.png")
// if err != nil {
// return err
// }
Expand Down Expand Up @@ -249,7 +249,7 @@ func (t *Tunnels) Create() error {

activeName = t.ActiveDeviceName()
for _, d := range list {
gray, err := gtk.ImageNewFromFile("./icon/dot-gray.png")
gray, err := gtk.ImageNewFromFile("/opt/wireguird/Icon/dot-gray.png")
if err != nil {
return err
}
Expand All @@ -266,6 +266,11 @@ func (t *Tunnels) Create() error {
}

row := tl.GetSelectedRow()
// row not found for config
if row == nil {
return nil
}

name, err := row.GetName()
if err != nil {
return err
Expand All @@ -274,7 +279,10 @@ func (t *Tunnels) Create() error {
// dont connect to the new one
if activeName != "" && activeName == name {
t.UpdateRow(row)
header.SetSubtitle("Not connected!")

glib.IdleAdd(func() {
header.SetSubtitle("Not connected!")
})
return nil
}

Expand All @@ -286,7 +294,7 @@ func (t *Tunnels) Create() error {
header.SetSubtitle("Connected to " + name)
})

green, err := gtk.ImageNewFromFile("./icon/dot-green.png")
green, err := gtk.ImageNewFromFile("/opt/wireguird/Icon/dot-green.png")
if err != nil {
return err
}
Expand All @@ -296,6 +304,11 @@ func (t *Tunnels) Create() error {
t.UpdateRow(row)
indicator.SetIcon("wireguard")
})

if err := wlog("INFO", "Connected to "+name); err != nil {
return err
}

return nil
}()

Expand All @@ -322,6 +335,11 @@ func (t *Tunnels) Create() error {
}

row := tl.GetSelectedRow()
if row == nil {
t.UnknownLabels()
continue
}

name, err := row.GetName()
if err != nil {
log.Error().Err(err).Msg("row get name err")
Expand All @@ -343,9 +361,10 @@ func (t *Tunnels) Create() error {

for _, p := range d.Peers {
hs := humanize.Time(p.LastHandshakeTime)
t.Peer.LatestHandshake.SetText(hs)

t.Peer.Transfer.SetText(humanize.Bytes(uint64(p.ReceiveBytes)) + " received, " + humanize.Bytes(uint64(p.TransmitBytes)) + " sent")
glib.IdleAdd(func() {
t.Peer.LatestHandshake.SetText(hs)
t.Peer.Transfer.SetText(humanize.Bytes(uint64(p.ReceiveBytes)) + " received, " + humanize.Bytes(uint64(p.TransmitBytes)) + " sent")
})
}
}
}()
Expand Down Expand Up @@ -376,15 +395,17 @@ func (t *Tunnels) UpdateRow(row *gtk.ListBoxRow) {
peersec := cfg.Section("Peer")
insec := cfg.Section("Interface")

t.Interface.Addresses.SetText(insec.Key("Address").String())
t.Interface.Status.SetText("Inactive")
t.Interface.DNS.SetText(insec.Key("DNS").String())
glib.IdleAdd(func() {
t.Interface.Addresses.SetText(insec.Key("Address").String())
t.Interface.Status.SetText("Inactive")
t.Interface.DNS.SetText(insec.Key("DNS").String())

t.ButtonChangeState.SetLabel("Activate")
t.ButtonChangeState.SetLabel("Activate")

t.Peer.AllowedIPs.SetText(peersec.Key("AllowedIPs").String())
t.Peer.PublicKey.SetText(peersec.Key("PublicKey").String())
t.Peer.Endpoint.SetText(peersec.Key("Endpoint").String())
t.Peer.AllowedIPs.SetText(peersec.Key("AllowedIPs").String())
t.Peer.PublicKey.SetText(peersec.Key("PublicKey").String())
t.Peer.Endpoint.SetText(peersec.Key("Endpoint").String())
})

for _, d := range ds {
if d.Name != id {
Expand All @@ -397,16 +418,20 @@ func (t *Tunnels) UpdateRow(row *gtk.ListBoxRow) {
// boxPeers.Remove(item.(*gtk.Widget))
// })

t.Interface.Status.SetText("Active")
t.ButtonChangeState.SetLabel("Deactivate")
t.Interface.PublicKey.SetText(d.PublicKey.String())
t.Interface.ListenPort.SetText(strconv.Itoa(d.ListenPort))
glib.IdleAdd(func() {
t.Interface.Status.SetText("Active")
t.ButtonChangeState.SetLabel("Deactivate")
t.Interface.PublicKey.SetText(d.PublicKey.String())
t.Interface.ListenPort.SetText(strconv.Itoa(d.ListenPort))
})

for _, p := range d.Peers {
hs := humanize.Time(p.LastHandshakeTime)
t.Peer.LatestHandshake.SetText(hs)

t.Peer.Transfer.SetText(humanize.Bytes(uint64(p.ReceiveBytes)) + " received, " + humanize.Bytes(uint64(p.TransmitBytes)) + " sent")
glib.IdleAdd(func() {
t.Peer.LatestHandshake.SetText(hs)
t.Peer.Transfer.SetText(humanize.Bytes(uint64(p.ReceiveBytes)) + " received, " + humanize.Bytes(uint64(p.TransmitBytes)) + " sent")
})
}

break
Expand All @@ -422,23 +447,25 @@ func (t *Tunnels) UpdateRow(row *gtk.ListBoxRow) {
}

func (t *Tunnels) UnknownLabels() {
t.ButtonChangeState.SetLabel("unknown")
glib.IdleAdd(func() {
t.ButtonChangeState.SetLabel("unknown")

t.Interface.Addresses.SetText("unknown")
t.Interface.Status.SetText("unknown")
t.Interface.DNS.SetText("unknown")
t.Interface.Addresses.SetText("unknown")
t.Interface.Status.SetText("unknown")
t.Interface.DNS.SetText("unknown")

t.Peer.AllowedIPs.SetText("unknown")
t.Peer.PublicKey.SetText("unknown")
t.Peer.Endpoint.SetText("unknown")
t.Peer.AllowedIPs.SetText("unknown")
t.Peer.PublicKey.SetText("unknown")
t.Peer.Endpoint.SetText("unknown")

t.Interface.Status.SetText("unknown")
t.ButtonChangeState.SetLabel("unknown")
t.Interface.PublicKey.SetText("unknown")
t.Interface.ListenPort.SetText("unknown")
t.Peer.LatestHandshake.SetText("unknown")
t.Interface.Status.SetText("unknown")
t.ButtonChangeState.SetLabel("unknown")
t.Interface.PublicKey.SetText("unknown")
t.Interface.ListenPort.SetText("unknown")
t.Peer.LatestHandshake.SetText("unknown")

t.Peer.Transfer.SetText("unknown")
t.Peer.Transfer.SetText("unknown")
})
}

func (t *Tunnels) ActiveDeviceName() string {
Expand All @@ -450,3 +477,30 @@ func (t *Tunnels) ActiveDeviceName() string {

return ""
}

func wlog(t string, text string) error {
wlogs, err := get.ListBox("wireguard_logs")
if err != nil {
return err
}

l, err := gtk.LabelNew("")
if err != nil {
return err
}

if t == "ERROR" {
t = `<span color="#FF0000">` + t + "</span>"
}

l.SetMarkup(`<span color="#008080">[` + time.Now().Format("02/Jan/06 15:04:05 MST") + `]</span>[` + t + `]: ` + text)
l.SetHExpand(true)
l.SetHAlign(gtk.ALIGN_START)

glib.IdleAdd(func() {
l.Show()
wlogs.Add(l)
})

return nil
}
Binary file removed icon/wireguard.png
Binary file not shown.
Binary file removed icon/wireguard_off.png
Binary file not shown.
Loading

0 comments on commit c2990d0

Please sign in to comment.