globals

package
v0.0.0-...-dde4a86 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PasswordSaltLength is the length of the password salt
	PasswordSaltLength int = 64
)

Variables

View Source
var BootTime time.Time

BootTime at which PFSD started. Used for calculating uptime.

View Source
var DiscoveryAddr string

DiscoveryAddr contains the connection sting to the discovery server

View Source
var Encrypted bool

Encrypted determines whether the whole filesystem is encrypted

View Source
var EncryptionKey *keyman.Key

EncryptionKey stores the actual key used for encryption

View Source
var HeldKeyPieces = make(KeyPieceStore)

HeldKeyPieces is an instance of KeyPieceStore

View Source
var KeyGenerated bool

KeyGenerated is set to true when the key is generated

View Source
var MountPoint string

MountPoint of the FUSE filesystem

View Source
var NetworkOff bool

NetworkOff if the network should not be used TODO: Rename it to NetworkActive

View Source
var Nodes = nodes{/* contains filtered or unexported fields */}

Nodes instance which controls all the information about other pfsd instances

View Source
var ParanoidDir string

ParanoidDir is the location of the stored encrypted data

View Source
var PoolPasswordHash []byte

PoolPasswordHash used to connect to the pool

View Source
var PoolPasswordSalt []byte

PoolPasswordSalt used to connect to the pool

View Source
var Quit = make(chan bool)

Quit channel used for killing the application TODO: Use struct{} instead

View Source
var RaftNetworkServer *raft.NetworkServer

RaftNetworkServer is an instance of the network server

View Source
var ResetInterval time.Duration

ResetInterval containing how often the Renew function has to be called

View Source
var ShuttingDown bool

ShuttingDown is set when the PFSD is in shutdown phase

View Source
var TLSEnabled bool

TLSEnabled if network encryption is used in all connections to and from PFSD

View Source
var TLSSkipVerify bool

TLSSkipVerify will cause PFSD to not verify the TLS credentials of anything it connects to

View Source
var UPnPEnabled bool

UPnPEnabled is kinda self explanatory

Wait for all goroutines in PFSD

Functions

func SetPoolPasswordHash

func SetPoolPasswordHash(password string) error

SetPoolPasswordHash generates and sets a new password hash from the password

Types

type FileSystemAttributes

type FileSystemAttributes struct {
	Encrypted    bool `json:"encrypted"`
	KeyGenerated bool `json:"keygenerated"`
	NetworkOff   bool `json:"networkoff"`
	// EncryptionKey key is only saved to file in this manner if networking is turned off.
	EncryptionKey keyman.Key `json:"encryptionkey,omitempty"`
}

FileSystemAttributes stores the information written onto the disk

type KeyPieceMap

type KeyPieceMap map[string]*keyman.KeyPiece

KeyPieceMap of the key pieces

type KeyPieceStore

type KeyPieceStore map[int64]KeyPieceMap

KeyPieceStore maps key generations to individual key pieces

func (KeyPieceStore) AddPiece

func (ks KeyPieceStore) AddPiece(generation int64, nodeUUID string, piece *keyman.KeyPiece) error

AddPiece adds a specific piece of the key, associated with the node to a generation

func (KeyPieceStore) DeleteGeneration

func (ks KeyPieceStore) DeleteGeneration(generation int64) error

DeleteGeneration removes the whole generation

func (KeyPieceStore) DeletePiece

func (ks KeyPieceStore) DeletePiece(generation int64, nodeUUID string) error

DeletePiece for a node from a given generation

func (KeyPieceStore) GetPiece

func (ks KeyPieceStore) GetPiece(generation int64, nodeUUID string) *keyman.KeyPiece

GetPiece gets the key piece based on the generation and the UUID of the node. It returns nil if the key is not found.

func (KeyPieceStore) SaveToDisk

func (ks KeyPieceStore) SaveToDisk() error

SaveToDisk saves all the keypieces in the meta directory

type Node

type Node struct {
	IP         string
	Port       string
	CommonName string
	UUID       string
}

Node struct

var ThisNode Node

ThisNode stores information about the current node

func (Node) String

func (n Node) String() string

Jump to

Keyboard shortcuts

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