-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added systemd configs & build scripts, prepared for release
- Loading branch information
Showing
7 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/.idea | ||
*.exe | ||
/mwgp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ import ( | |
) | ||
|
||
var ( | ||
MWGPVersion = "2.0.0" | ||
MWGPVersion = "Unknown" | ||
) | ||
|
||
var rootCmd = cobra.Command{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
grt() { | ||
cd "$(git rev-parse --show-toplevel || echo ".")" | ||
} | ||
|
||
version_dirty() { | ||
git diff --quiet || echo '-dirty' | ||
} | ||
|
||
version() { | ||
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' | ||
} | ||
|
||
_goldflags="-X 'main.MWGPVersion=$(version)$(version_dirty)'" | ||
|
||
grt | ||
|
||
go build \ | ||
-o mwgp \ | ||
-ldflags "$_goldflags" \ | ||
./cmd/mwgp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Multi-WireGuard Proxy Client for %i | ||
After=network-online.target nss-lookup.target | ||
Wants=network-online.target nss-lookup.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/mwgp client %i.json | ||
WorkingDirectory=/etc/mwgp | ||
Environment=MWGP_CACHE_FILE=/var/cache/mwgp/%i.json | ||
User=mwgp | ||
Group=mwgp | ||
Restart=on-failure | ||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
NoNewPrivileges=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[Unit] | ||
Description=Multi-WireGuard Proxy Server for %i | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/usr/bin/mwgp server %i.json | ||
WorkingDirectory=/etc/mwgp | ||
Environment=MWGP_CACHE_FILE=/var/cache/mwgp/%i.json | ||
User=mwgp | ||
Group=mwgp | ||
Restart=on-failure | ||
CapabilityBoundingSet=CAP_NET_BIND_SERVICE | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
NoNewPrivileges=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
u mwgp - "Multi-WireGuard Proxy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d /var/cache/mwgp 0755 mwgp mwgp |