Documentation ¶
Index ¶
- Constants
- Variables
- func SetPoolPasswordHash(password string) error
- type FileSystemAttributes
- type KeyPieceMap
- type KeyPieceStore
- func (ks KeyPieceStore) AddPiece(generation int64, nodeUUID string, piece *keyman.KeyPiece) error
- func (ks KeyPieceStore) DeleteGeneration(generation int64) error
- func (ks KeyPieceStore) DeletePiece(generation int64, nodeUUID string) error
- func (ks KeyPieceStore) GetPiece(generation int64, nodeUUID string) *keyman.KeyPiece
- func (ks KeyPieceStore) SaveToDisk() error
- type Node
Constants ¶
const ( // PasswordSaltLength is the length of the password salt PasswordSaltLength int = 64 )
Variables ¶
var BootTime time.Time
BootTime at which PFSD started. Used for calculating uptime.
var DiscoveryAddr string
DiscoveryAddr contains the connection sting to the discovery server
var Encrypted bool
Encrypted determines whether the whole filesystem is encrypted
var EncryptionKey *keyman.Key
EncryptionKey stores the actual key used for encryption
var HeldKeyPieces = make(KeyPieceStore)
HeldKeyPieces is an instance of KeyPieceStore
var KeyGenerated bool
KeyGenerated is set to true when the key is generated
var MountPoint string
MountPoint of the FUSE filesystem
var NetworkOff bool
NetworkOff if the network should not be used TODO: Rename it to NetworkActive
var Nodes = nodes{/* contains filtered or unexported fields */}
Nodes instance which controls all the information about other pfsd instances
var ParanoidDir string
ParanoidDir is the location of the stored encrypted data
var PoolPasswordHash []byte
PoolPasswordHash used to connect to the pool
var PoolPasswordSalt []byte
PoolPasswordSalt used to connect to the pool
var Quit = make(chan bool)
Quit channel used for killing the application TODO: Use struct{} instead
var RaftNetworkServer *raft.NetworkServer
RaftNetworkServer is an instance of the network server
var ResetInterval time.Duration
ResetInterval containing how often the Renew function has to be called
var ShuttingDown bool
ShuttingDown is set when the PFSD is in shutdown phase
var TLSEnabled bool
TLSEnabled if network encryption is used in all connections to and from PFSD
var TLSSkipVerify bool
TLSSkipVerify will cause PFSD to not verify the TLS credentials of anything it connects to
var UPnPEnabled bool
UPnPEnabled is kinda self explanatory
var Wait sync.WaitGroup
Wait for all goroutines in PFSD
Functions ¶
func SetPoolPasswordHash ¶
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 KeyPieceStore ¶
type KeyPieceStore map[int64]KeyPieceMap
KeyPieceStore maps key generations to individual key pieces
func (KeyPieceStore) AddPiece ¶
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