Initial open source release

This commit is contained in:
Ronni Skansing
2025-08-21 16:14:09 +02:00
commit 11cf01f08e
488 changed files with 97180 additions and 0 deletions

17
backend/cli/env.go Normal file
View 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
View 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
View 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()
}