Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pkg/wireguard): replace bash script with native code #161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions cmd/agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ package main
import (
"flag"
"fmt"
"log"
"os"

"github.com/go-logr/stdr"
"github.com/jodevsa/wireguard-operator/internal/iptables"
"github.com/jodevsa/wireguard-operator/pkg/agent"
"github.com/jodevsa/wireguard-operator/pkg/wireguard"
"log"
"os"
)

func main() {
Expand All @@ -23,42 +24,42 @@ func main() {
flag.StringVar(&wgUserspaceImplementationFallback, "wg-userspace-implementation-fallback", "wireguard-go", "The userspace implementation of wireguard to fallback to")
flag.IntVar(&wireguardListenPort, "wg-listen-port", 51820, "the UDP port wireguard is listening on")
flag.IntVar(&verbosity, "v", 1, "the verbosity level")
flag.BoolVar(&wgUseUserspaceImpl, "wg-use-userspace-implementation", false, "Use userspace implementation")
flag.BoolVar(&wgUseUserspaceImpl, "wg-use-userspace-implementation", true, "Use userspace implementation")
flag.Parse()

println(fmt.Sprintf(
`
.:::::::::::::::::::::::::...::::::::::::::::::::.
.::::::::::::::::::::.:^7J5PBGY!^::::::::::::::::::::.
:::::::::::::::::::::~?J??5&@@@@@&G!~~~::::::::::::::::. WG Agent Configuration
::::::::::::::::::::::^7&@@@@@@@@@@@@&&&G^:::::::::::::::. ------------------------------------------
.::::::::::::::::::::::!J#@@@@@@@BBBGPPG7:::::::::::::::::. wg-iface: %s
.:::::::::::::::::::::^?Y5#@@@@@@5^...::::::::::::::::::::: state: %s
.::::::::::::::::::::::..:!7Y#@@@@@#Y~:.::::::::::::::::::. wg-listen-port: %d
.:::::::::::::::::::.:^!?JYYJ?JG&@@@@@#7::::::::::::::::::. wg-use-userspace-implementation: %v
.:::::::::::::::::.^J#@@@@@@@@@&#B&@@@@@G:::::::::::::::::. wg-userspace-implementation-fallback: %s
.:::::::::::::::::J@@@@@@@@@@@@@@@&G@@@@@J.:::::::::::::::.
.::::::::::::::::5@@@@@#?~~~7P@@@@@&B@@@@P.:::::::::::::::.
.:::::::::::::::^@@@@@P..::::.~@@@@B&@@@@!::::::::::::::::.
.:::::::::::::::~@@@@@J.::::::^@@@#&@@@@P:::::::::::::::::.
.::::::::::::::::B@@@@@P!^:.:~G&&&@@@@@5::::::::::::::::::.
.:::::::::::::::::G@@@@@&#BB&@@@@@@@@B~.::::::::::::::::::.
.::::::::::::::::..~G&&&@@@@@@@@@&&&&&P^.:::::::::::::::::.
.::::::::::::::.:~YGGY&@@@@@&GY7JB@@@@@@7:::::::::::::::::.
.::::::::::::::?&@@@B&@@@@#!:..:::~B@@@@@~::::::::::::::::.
.:::::::::::::J&#P5?5@@@@@:.::::::::&@@@@5.:::::::::::::::.
.:::::::::::::^:....J@@@@@~.::::::.^@@@@@5.::::::::::::::::
.::::::::::::::::::::&@@@@@Y~::::^J&@@@@&^::::::::::::::::.
::::::::::::::::::::^B@@@@@@&##&@@@@@@#~:::::::::::::::::.
:::::::::::::::::::::7B@@@@@@@@@@@@#?::::::::::::::::::.
.::::::::::::::::::::.^7YGB##BGY7^:.:::::::::::::::::.
.:::::::::::::::::::::..::::..::::::::::::::::::..
.....:...............................:.....
`
.:::::::::::::::::::::::::...::::::::::::::::::::.
.::::::::::::::::::::.:^7J5PBGY!^::::::::::::::::::::.
:::::::::::::::::::::~?J??5&@@@@@&G!~~~::::::::::::::::. WG Agent Configuration
::::::::::::::::::::::^7&@@@@@@@@@@@@&&&G^:::::::::::::::. ------------------------------------------
.::::::::::::::::::::::!J#@@@@@@@BBBGPPG7:::::::::::::::::. wg-iface: %s
.:::::::::::::::::::::^?Y5#@@@@@@5^...::::::::::::::::::::: state: %s
.::::::::::::::::::::::..:!7Y#@@@@@#Y~:.::::::::::::::::::. wg-listen-port: %d
.:::::::::::::::::::.:^!?JYYJ?JG&@@@@@#7::::::::::::::::::. wg-use-userspace-implementation: %v
.:::::::::::::::::.^J#@@@@@@@@@&#B&@@@@@G:::::::::::::::::. wg-userspace-implementation-fallback: %s
.:::::::::::::::::J@@@@@@@@@@@@@@@&G@@@@@J.:::::::::::::::.
.::::::::::::::::5@@@@@#?~~~7P@@@@@&B@@@@P.:::::::::::::::.
.:::::::::::::::^@@@@@P..::::.~@@@@B&@@@@!::::::::::::::::.
.:::::::::::::::~@@@@@J.::::::^@@@#&@@@@P:::::::::::::::::.
.::::::::::::::::B@@@@@P!^:.:~G&&&@@@@@5::::::::::::::::::.
.:::::::::::::::::G@@@@@&#BB&@@@@@@@@B~.::::::::::::::::::.
.::::::::::::::::..~G&&&@@@@@@@@@&&&&&P^.:::::::::::::::::.
.::::::::::::::.:~YGGY&@@@@@&GY7JB@@@@@@7:::::::::::::::::.
.::::::::::::::?&@@@B&@@@@#!:..:::~B@@@@@~::::::::::::::::.
.:::::::::::::J&#P5?5@@@@@:.::::::::&@@@@5.:::::::::::::::.
.:::::::::::::^:....J@@@@@~.::::::.^@@@@@5.::::::::::::::::
.::::::::::::::::::::&@@@@@Y~::::^J&@@@@&^::::::::::::::::.
::::::::::::::::::::^B@@@@@@&##&@@@@@@#~:::::::::::::::::.
:::::::::::::::::::::7B@@@@@@@@@@@@#?::::::::::::::::::.
.::::::::::::::::::::.^7YGB##BGY7^:.:::::::::::::::::.
.:::::::::::::::::::::..::::..::::::::::::::::::..
.....:...............................:.....

/ \ / \/ _____/ / _ \ / ___\ ____ _____/ |_
\ \/\/ / \ ___ / /_\ \ / /_/ _/ __ \ / \ __\
\ /\ \_\ \ / | \\___ /\ ___/| | | |
\__/\ / \______ / \____|__ /_____/ \___ |___| |__|
/ \ / \/ _____/ / _ \ / ___\ ____ _____/ |_
\ \/\/ / \ ___ / /_\ \ / /_/ _/ __ \ / \ __\
\ /\ \_\ \ / | \\___ /\ ___/| | | |
\__/\ / \______ / \____|__ /_____/ \___ |___| |__|
\/ \/ \/ \/ \/
`, iface, configFilePath, wireguardListenPort, wgUseUserspaceImpl, wgUserspaceImplementationFallback))

Expand Down
Loading