app

package
v0.0.0-...-8d63230 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

This file is part of thor (https://github.com/notapipeline/thor).

Copyright (c) 2024 Martin Proffitt <mproffitt@choclab.net>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

This file is part of thor (https://github.com/notapipeline/thor).

Copyright (c) 2024 Martin Proffitt <mproffitt@choclab.net>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

This file is part of thor (https://github.com/notapipeline/thor).

Copyright (c) 2024 Martin Proffitt <mproffitt@choclab.net>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

This file is part of thor (https://github.com/notapipeline/thor).

Copyright (c) 2024 Martin Proffitt <mproffitt@choclab.net>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

View Source
const (
	BUFFER_SIZE     int = 1024
	BUFFER_SIZE_MAX int = 1048576
	TIME_MAX        int = 10

	INFO  int = 1
	WARN  int = 2
	ERROR int = 3
)
View Source
const KEYSIZE int = 2048
View Source
const LOGOUT_SCRIPT string = `x=($(ps -Ao pid,tt,user | awk '/%s/{print $1}')); { [ ${#x[@]} -gt 0 ] && kill -SIGKILL ${x[@]}; } || echo`

Variables

Functions

func CreateSSLCertificates

func CreateSSLCertificates(hostname string) (tls.Certificate, error)

func LoadSSLCertificates

func LoadSSLCertificates(c *config.Config) (tls.Certificate, error)

Types

type App

type App struct {
	Stop chan bool
	// contains filtered or unexported fields
}

func NewApp

func NewApp(errors *chan LogItem, binpath string) (*App, error)

func (*App) Dtls

func (a *App) Dtls()

func (*App) DtlsReadLoop

func (a *App) DtlsReadLoop(conn net.Conn, hub *Hub)

func (*App) Notify

func (a *App) Notify()

func (*App) Rotate

func (a *App) Rotate()

type Hub

type Hub struct {
	// contains filtered or unexported fields
}

Hub is a helper to handle one to many chat

func NewHub

func NewHub() *Hub

NewHub builds a new hub

func (*Hub) Register

func (h *Hub) Register(conn net.Conn, a *App)

Register adds a new conn to the Hub

func (*Hub) Stop

func (h *Hub) Stop()

func (*Hub) Unregister

func (h *Hub) Unregister(conn net.Conn) error

type LogItem

type LogItem struct {
	Level   int
	Message string
}

func NewLogItem

func NewLogItem(level int, message string) LogItem

type Thor

type Thor struct {
	// contains filtered or unexported fields
}

func NewThor

func NewThor(hostname, namespace string, paths []string, apikey *string) *Thor

func (*Thor) Register

func (thor *Thor) Register(c *config.Agent, shasum string, l *chan LogItem) error

func (*Thor) RequestToken

func (thor *Thor) RequestToken() error

type Vault

type Vault struct {
	// contains filtered or unexported fields
}

func NewVault

func NewVault(address, namespace string) *Vault

func (*Vault) GetToken

func (v *Vault) GetToken() string

func (*Vault) RotationCredentials

func (v *Vault) RotationCredentials(paths []string, token string) (map[string]string, error)

func (*Vault) SetToken

func (v *Vault) SetToken(token, key string) error

func (*Vault) Thor

func (v *Vault) Thor(t *Thor)

func (*Vault) Unwrap

func (v *Vault) Unwrap(what string) (string, error)

func (*Vault) UnwrapWithCheck

func (v *Vault) UnwrapWithCheck(what string, requesting *bool) (string, error)

Jump to

Keyboard shortcuts

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