config

package
v0.0.0-...-96a3d8b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 27 Imported by: 3

Documentation

Index

Constants

View Source
const BUFFER_SIZE int = 4096

todo: use circl from cloudfare to encrypt data post quantum crystals-kyber, crystals-dilithium, sphincs=, FALCON

View Source
const IV_SIZE int = 16
View Source
const MySecret string = "abd&1*~#^2^#s0^=)^^7%c34" // must be 24 characters
View Source
const Password = "123456" // default password shipped with app

default gui password

Variables

View Source
var Dark = 0
View Source
var DarkButton = color.RGBA{187, 188, 201, 32}

var DarkButton = color.RGBA{162, 168, 250, 64}

View Source
var DarkDisabled = color.RGBA{187, 188, 201, 64}
View Source
var DarkFocus = color.RGBA{187, 188, 201, 64}
View Source
var DarkHover = color.RGBA{187, 188, 201, 64}
View Source
var DarkHyperlink = color.RGBA{187, 188, 201, 255}
View Source
var DarkInputBackground = color.RGBA{187, 188, 201, 32}
View Source
var DarkInputBorder = color.RGBA{187, 188, 201, 64}
View Source
var DarkPlaceholder = color.RGBA{187, 188, 201, 220}
View Source
var DarkPressed = color.RGBA{187, 188, 201, 220}
View Source
var DarkPrimary = color.RGBA{187, 188, 201, 255}
View Source
var DarkScrollBar = color.RGBA{187, 188, 201, 64}
View Source
var DarkSelection = color.RGBA{187, 188, 201, 128}
View Source
var DarkSeparator = color.RGBA{187, 188, 201, 64}
View Source
var DarkShadow = color.RGBA{187, 188, 201, 64}
View Source
var DevCancel = false
View Source
var FyneApp fyne.App
View Source
var FyneDeviceList fyne.Widget
View Source
var FyneDeviceWin fyne.Window
View Source
var FyneFilter bool
View Source
var FyneFilterDevices bool
View Source
var FyneMainWin fyne.Window
View Source
var FyneMessageList fyne.Widget
View Source
var FyneMessageWin fyne.Window
View Source
var KeyAes = []byte{35, 46, 57, 24, 85, 35, 24, 74, 87, 35, 88, 98, 66, 32, 14, 05} // must be 16 bytes

default encryption

View Source
var KeyHmac = []byte{36, 45, 53, 21, 87, 35, 24, 74, 87, 35, 88, 98, 66, 32, 14, 05} // must be 16 bytes
View Source
var Light = 1
View Source
var LightButton = color.RGBA{129, 137, 252, 250}
View Source
var LightDisabled = color.RGBA{129, 137, 252, 64}
View Source
var LightFocus = color.RGBA{129, 137, 252, 64}
View Source
var LightHover = color.RGBA{129, 137, 252, 250}
View Source
var LightHyperlink = color.RGBA{129, 137, 252, 1}
View Source
var LightInputBackground = color.RGBA{129, 137, 252, 32}
View Source
var LightInputBorder = color.RGBA{129, 137, 252, 250}
View Source
var LightPlaceholder = color.RGBA{129, 137, 252, 220}
View Source
var LightPressed = color.RGBA{129, 137, 252, 220}
View Source
var LightPrimary = color.RGBA{129, 137, 252, 255}
View Source
var LightScrollBar = color.RGBA{129, 137, 252, 250}
View Source
var LightSelection = color.RGBA{129, 137, 252, 200}
View Source
var LightSeparator = color.Black
View Source
var LightShadow = color.RGBA{129, 137, 252, 64}
View Source
var LoggedOn bool
View Source
var MessageToSend string
View Source
var MsgCancel = false

var NatsCONSUMER nats.JetStream var NatsJETSTREAM nats.JetStream

View Source
var MyLangs = map[string]string{}/* 399 elements not displayed */

eng esp cmn

View Source
var NATSSTREAM = "NATS"
View Source
var NatsAdmin = "natsadmin"

defaults

View Source
var NatsAlias string
View Source
var NatsCaroot = "" /* 1448-byte string literal not displayed */
View Source
var NatsClientcert = "" /* 1538-byte string literal not displayed */
View Source
var NatsClientkey = "" /* 1706-byte string literal not displayed */
View Source
var NatsMessages = make(map[int]MessageStore)
View Source
var NatsMessagesDevice = make(map[int]MessageStore)
View Source
var NatsMessagesIndex = make(map[string]bool)
View Source
var NatsMessagesIndexDevice = make(map[string]bool)
View Source
var NatsMsgMaxAge string
View Source
var NatsNodeUUID string
View Source
var NatsQueueDurable = "snatsdurable"
View Source
var NatsQueuePassword = "987654321098765432109876"
View Source
var NatsReceivingMessages bool
View Source
var NatsServer = "nats://nats.newhorizons3000.org:4222"
View Source
var NatsUser = "natsoperator"
View Source
var NatsUserAuthorizations = "natsauthorizations"
View Source
var NatsUserAuthorizationsPassword = "PASSWORD"
View Source
var NatsUserCommands = "natscommands"
View Source
var NatsUserCommandsPassword = "PASSWORD"
View Source
var NatsUserDevices = "natsdevices"
View Source
var NatsUserDevicesPassword = "PASSWORD"
View Source
var NatsUserEvents = "natsevents"
View Source
var NatsUserEventsPassword = "PASSWORD"
View Source
var NatsUserPassword = "hjscr44iod"
View Source
var PasswordHash string
View Source
var PreferedLanguage string
View Source
var Retro = 2
View Source
var RetroButton = color.RGBA{116, 207, 103, 250}
View Source
var RetroDisabled = color.RGBA{116, 207, 103, 64}
View Source
var RetroFocus = color.RGBA{116, 207, 103, 64}
View Source
var RetroHover = color.RGBA{116, 207, 103, 250}
View Source
var RetroHyperlink = color.RGBA{116, 207, 103, 1}
View Source
var RetroInputBackground = color.RGBA{116, 207, 103, 32}
View Source
var RetroInputBorder = color.RGBA{116, 207, 103, 250}
View Source
var RetroPlaceholder = color.RGBA{116, 207, 103, 255}
View Source
var RetroPressed = color.RGBA{116, 207, 103, 220}
View Source
var RetroPrimary = color.RGBA{116, 207, 103, 255}
View Source
var RetroScrollBar = color.RGBA{116, 207, 103, 250}
View Source
var RetroSelection = color.RGBA{116, 207, 103, 200}
View Source
var RetroSeparator = color.Black
View Source
var RetroShadow = color.RGBA{116, 207, 103, 64}
View Source
var Selected = 0

Functions

func CheckAUTHORIZATIONS

func CheckAUTHORIZATIONS(alias string) bool

func CheckDEVICE

func CheckDEVICE(alias string) bool

func ComparePasswords

func ComparePasswords(hashedPwd string, plainPwd []byte) bool

validate password

func DataStore

func DataStore(file string) fyne.URI

func Decrypt

func Decrypt(text string, secret string) string

decrypt string

func DecryptFile

func DecryptFile(filePathIn, filePathOut string) error

func DeleteNatsMessage

func DeleteNatsMessage(seq uint64)

secure delete messages

func Edit

func Edit(action string, value string) bool

func Encrypt

func Encrypt(text string, secret string) string

encrypt string

func EncryptFile

func EncryptFile(filePathIn, filePathOut string) error

func GetLangs

func GetLangs(c string) string

do translation

func HashAndSalt

func HashAndSalt(pwd []byte) string

hash and salt

func LoadHashWithDefault

func LoadHashWithDefault(filename string, password string) (string, bool)

create and load hash

func NatsSetup

func NatsSetup()

security erase jetstream data

func ParseURL

func ParseURL(urlStr string) *url.URL

func ReceiveDEVICE

func ReceiveDEVICE(alias string)

thread for receiving messages

func ReceiveMESSAGE

func ReceiveMESSAGE()

func SaveHash

func SaveHash(filename string, hash string) (string, bool)

save hash

func Send

func Send(subject, m, alias string) bool

send message to nats

func SetupDetails

func SetupDetails(queue string, age string)

}

func SetupNATS

func SetupNATS()

Types

type CommandStore

type CommandStore struct {
	CMDalias    string // alias
	CMDtype     int    // 1 = bash, 2 = bat. 3 = snmp
	CMDinterval string // how often
	CMDcommand  string // command to execute
	CMDexpected string // expected result from command
	CMDtimeout  int    // time to wait in seconds, 0 one ti,e

}

type DeviceStore

type DeviceStore struct {
	DSiduuid    string // message id
	DSalias     string // alias
	DShostname  string // hostname
	DSipadrs    string // ip address
	DSmacid     string // macids
	DSnodeuuid  string // unique id
	DSmessage   string // message payload
	DSdate      string // message date
	DSsubject   string // message subject
	DSos        string // device os
	DSsequence  uint64 // consumer sequence for secure delete
	DSelementid int    // order in array
}

type MessageStore

type MessageStore struct {
	MSiduuid    string // message id
	MSalias     string // alias
	MShostname  string // hostname
	MSipadrs    string // ip address
	MSmacid     string // macids
	MSmessage   string // message payload
	MSnodeuuid  string // unique id
	MSdate      string // message date
	MSsubject   string // message subject
	MSos        string // device os
	MSsequence  uint64 // consumer sequence for secure delete
	MSelementid int    // order in array
}

type MyTheme

type MyTheme struct{}

func (MyTheme) Color

func (m MyTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color

func (MyTheme) Font

func (m MyTheme) Font(style fyne.TextStyle) fyne.Resource

func (MyTheme) Icon

func (m MyTheme) Icon(name fyne.ThemeIconName) fyne.Resource

func (MyTheme) SetIcon

func (m MyTheme) SetIcon(name fyne.ThemeIconName, variant fyne.ThemeVariant)

func (MyTheme) Size

func (m MyTheme) Size(name fyne.ThemeSizeName) float32

type Natsjs

type Natsjs struct {
	NatsConnect *nats.Conn
	Js          jetstream.Stream
	Jetstream   jetstream.JetStream
	//Con         jetstream.Consumer
	Ctx    context.Context
	Ctxcan context.CancelFunc
}

func NewNatsJS

func NewNatsJS() (*Natsjs, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL