mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-02-12 16:12:44 +00:00
Initial open source release
This commit is contained in:
17
backend/cli/env.go
Normal file
17
backend/cli/env.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// OutputEnv outputs the available environment variables
|
||||
// These are used for CI or similar enviroment tests
|
||||
func OutputEnv() {
|
||||
fmt.Println("Available environment variables:")
|
||||
fmt.Println("APP_MODE = production, development, integration_test")
|
||||
fmt.Println("TEST_DB_LOG_LEVEL = silent, debug, error, warn, info")
|
||||
fmt.Println("HTTP_PROXY - sets outgoing http proxy")
|
||||
fmt.Println("HTTPS_PROXY - sets outgoing https proxy")
|
||||
fmt.Println("NO_PROXY - hosts that should not be proxied")
|
||||
|
||||
}
|
||||
44
backend/cli/info.go
Normal file
44
backend/cli/info.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
// PrintVersion outputs the version of the application
|
||||
func PrintVersion(
|
||||
name,
|
||||
version string,
|
||||
) {
|
||||
fmt.Printf("%s (%s)\n", name, version)
|
||||
}
|
||||
|
||||
// PrintBanner outputs the banner for the application
|
||||
func PrintBanner() {
|
||||
blue := color.New(color.FgBlue)
|
||||
_, _ = blue.Println(`
|
||||
|
||||
--:
|
||||
.@@@@@*-.
|
||||
.@@@@@@@@++:
|
||||
.+*=. .@@@@@@@@@@@@*-.
|
||||
+@@@@++- .+@@@@@@@@@@@@@@#=:
|
||||
*@@@@@@@@#=. .=#@@@@@@@@@@@@@@@+*-
|
||||
*@@@@@@@@@@@+- :#@@@@@@@@@@@@@@@@#.
|
||||
*@@@@@@@@@@@@= +@@@@@@@@@@@@@@@@@=
|
||||
*@@@@@@@@++: .=#@@@@@@@@@@@@@@@@++:
|
||||
*@@@@@*=. .+@@@@@@@@@@@@@@@@#=.
|
||||
.*#+: .@@@@@@@@@@@@@+*-
|
||||
.@@@@@@@@@@#=.
|
||||
.@@@@@@+*-
|
||||
++@#=. `)
|
||||
_, _ = fmt.Println()
|
||||
_, _ = fmt.Println()
|
||||
}
|
||||
func PrintServerStarted(
|
||||
name string,
|
||||
address string,
|
||||
) {
|
||||
fmt.Printf("%s available:\nhttps://%s\n\n", name, address)
|
||||
}
|
||||
37
backend/cli/outputter.go
Normal file
37
backend/cli/outputter.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package cli
|
||||
|
||||
import (
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
type Outputter interface {
|
||||
PrintInitialAdminAccount(username, password string)
|
||||
}
|
||||
|
||||
type cliOutputter struct {
|
||||
color *color.Color
|
||||
}
|
||||
|
||||
// NewCLIOutputter creates a new CLIOutputter
|
||||
func NewCLIOutputter() Outputter {
|
||||
return &cliOutputter{
|
||||
color: color.New(),
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cliOutputter) PrintInitialAdminAccount(
|
||||
username,
|
||||
password string,
|
||||
) {
|
||||
bold := color.New(color.Bold)
|
||||
italic := color.New(color.Bold)
|
||||
_, _ = italic.Println("One time credentials for account setup")
|
||||
_, _ = c.color.Println()
|
||||
_, _ = c.color.Print("Username: ")
|
||||
_, _ = bold.Println(username)
|
||||
_, _ = c.color.Printf("Password: ")
|
||||
_, _ = bold.Println(password)
|
||||
_, _ = bold.Println()
|
||||
_, _ = c.color.Println()
|
||||
c.color.DisableColor()
|
||||
}
|
||||
Reference in New Issue
Block a user