Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/OnitiFR/mulch
/ functions
Functions
644 in github.com/OnitiFR/mulch
⨍
Functions
644
◇
Types & classes
148
↓ 4 callers
Function
ParseDuration
ParseDuration returns a duration from string (ex: 1h, 10d, 1y) An empty string is valid (expiration = 0)
cmd/mulch/client/tools.go:34
↓ 4 callers
Function
RemoveAPIKeyFromString
RemoveAPIKeyFromString replace any API key appearance in the string
common/api.go:20
↓ 4 callers
Method
Run
Run will start the app (in the foreground)
cmd/mulch-proxy/app.go:294
↓ 4 callers
Method
SetOperation
SetOperation change VM WIP
cmd/mulchd/server/vm.go:97
↓ 4 callers
Method
Trace
Trace sends an MessageTrace Message
cmd/mulch-proxy/log.go:87
↓ 4 callers
Function
VMBackup
VMBackup launch the backup process (returns backup filename)
cmd/mulchd/server/vm.go:1210
↓ 4 callers
Function
vmConfigGetScript
(tScript string, prefixURL string, origins *Origins)
cmd/mulchd/server/vm_config.go:143
↓ 3 callers
Method
CloneVolume
CloneVolume clones a source volume to a destination volume in the same pool
cmd/mulchd/server/libvirt.go:279
↓ 3 callers
Method
Count
Count returns the number of VMs in the database
cmd/mulchd/server/vm_database.go:593
↓ 3 callers
Function
CreateSSHMulchDir
CreateSSHMulchDir creates (if needed) user SSH config path and, inside, mulch directory.
cmd/mulch/client/ssh.go:27
↓ 3 callers
Method
Decrypt
decrypt data with the passphrase using AES and GCM
cmd/mulchd/server/secret_database.go:404
↓ 3 callers
Method
Encrypt
encrypt data with the passphrase using AES and GCM
cmd/mulchd/server/secret_database.go:382
↓ 3 callers
Method
GetActiveByName
GetActiveByName return the active VM with the specified name
cmd/mulchd/server/vm_database.go:522
↓ 3 callers
Method
GetByName
GetByName lookups a SSHPair by its name, or nil if not found
cmd/mulchd/server/sshpair_database.go:125
↓ 3 callers
Method
GetOrCreateStoragePool
GetOrCreateStoragePool retreives (and create, if necessary) a storage pool (mode is the Unix access mode for the pool directory) I've seen strange th
cmd/mulchd/server/libvirt.go:111
↓ 3 callers
Function
GetSSHHost
GetSSHHost returns the SSH server hostname based on mulchd API URL
cmd/mulch/client/ssh.go:50
↓ 3 callers
Method
GetVMsUsingSecret
GetVMsUsingSecret returns a list of VMs that use a given secret, including other peers.
cmd/mulchd/server/secret_database.go:556
↓ 3 callers
Method
IsActive
()
cmd/mulch-proxy/rate_controller.go:55
↓ 3 callers
Method
Load
ExtraCertsDB will load the extra certificates from the configuration file
cmd/mulch-proxy/extra_certs.go:79
↓ 3 callers
Function
MakeSSHKey
MakeSSHKey generates a OpenSSH formatted key pair (ED25519)
cmd/mulchd/server/ssh_keys.go:17
↓ 3 callers
Function
NewVM
NewVM builds a new virtual machine from config TODO: this function is HUUUGE and needs to be splitted. It's tricky because there's a "transaction" her
cmd/mulchd/server/vm.go:233
↓ 3 callers
Function
NewVolumeDownloadToWriter
NewVolumeDownloadToWriter creates a VolumeDownload instance, allowing to download a file from a libvirt storage pool to an io.WriteCloser
cmd/mulchd/volumes/volume_download.go:18
↓ 3 callers
Method
RefreshReverseProxies
RefreshReverseProxies create new (internal) ReverseProxy instances This function should be called when DomainDB is updated
cmd/mulch-proxy/proxy.go:407
↓ 3 callers
Method
Register
Register a new client of the Hub clientInfo is not currently used but is supposed to differentiate the client. Target may be common.MessageNoTarget.
cmd/mulchd/server/hub.go:79
↓ 3 callers
Function
RenderTableString
(headers []string, data [][]string, conf tablewriter.Config)
cmd/mulch/client/table.go:12
↓ 3 callers
Method
Save
Save the database on the disk
cmd/mulchd/server/api_keys.go:139
↓ 3 callers
Method
String
String will convert a right to a string
cmd/mulchd/server/api_keys.go:546
↓ 3 callers
Method
SyncPeers
SyncPeers syncs the secret database with peers
cmd/mulchd/server/secret_database.go:426
↓ 3 callers
Method
UploadFileToLibvirt
UploadFileToLibvirt is a variant using a file as source
cmd/mulchd/server/libvirt.go:390
↓ 3 callers
Function
VMDetachBackup
VMDetachBackup detach the backup volume from the VM
cmd/mulchd/server/vm.go:1163
↓ 3 callers
Function
VMGetDiskName
VMGetDiskName return VM's disk filename
cmd/mulchd/server/vm.go:739
↓ 3 callers
Function
VMRestoreNoChecks
VMRestoreNoChecks launch the restore process, this function is a symetric of VMBackup, since a few checks are missing because it's supposed to be call
cmd/mulchd/server/vm.go:1418
↓ 3 callers
Function
VMStartByName
VMStartByName starts a VM using its name and waits until the VM phones home. (or timeouts)
cmd/mulchd/server/vm.go:842
↓ 3 callers
Function
deleteBackup
(backupName string, req *server.Request)
cmd/mulchd/controllers/backup.go:77
↓ 3 callers
Method
genErrorPage
(code int, message string)
cmd/mulch-proxy/proxy.go:188
↓ 3 callers
Method
isKeyAllowed
(key ssh.PublicKey)
cmd/mulchd/server/ssh_agent.go:32
↓ 3 callers
Function
newTestProxyFront
newTestProxyFront builds an httptest server that proxies to backendURL using the errorHandlingRoundTripper, optionally simulating the concurrent rate-
cmd/mulch-proxy/proxy_test.go:24
↓ 3 callers
Method
rebuildDHCPStaticLeases
non-mutex-locked internal version of RebuildDHCPStaticLeases
cmd/mulchd/server/libvirt_dhcp.go:53
↓ 3 callers
Method
save
This is done internaly, because it must be done with the mutex locked, but we can't lock it here, since save() is called by functions that are already
cmd/mulchd/server/backup_database.go:59
↓ 3 callers
Method
save
save the database to disk (without a mutex lock)
cmd/mulchd/server/secret_database.go:238
↓ 2 callers
Method
AddNew
AddNew and add a SSH pair
cmd/mulchd/server/sshpair_database.go:101
↓ 2 callers
Method
AddNew
AddNew generates a new key and adds it to the database
cmd/mulchd/server/api_keys.go:226
↓ 2 callers
Function
BackupDelete
(backupName string, app *App)
cmd/mulchd/server/backup.go:19
↓ 2 callers
Function
CleanURL
CleanURL clean the URL using path.Clean rules
common/api.go:10
↓ 2 callers
Method
Dump
Dump RequestList content to a Log
cmd/mulch-proxy/request_list.go:64
↓ 2 callers
Method
GetAllVMsUsingSecret
GetAllVMsUsingSecret returns a list of VMs that use a given secret, including on other peers.
cmd/mulchd/server/secret_database.go:619
↓ 2 callers
Method
GetKeys
GetKeys returns all keys
cmd/mulchd/server/secret_database.go:207
↓ 2 callers
Method
GetOriginFromPath
GetOriginFromPath returns the origin, the subpath and an error if any - if the path does not use an origin, it returns an empty origin and no error
cmd/mulchd/server/origin.go:99
↓ 2 callers
Method
GetSecretsMap
GetSecretsMap returns a map of secrets for a VM The map contains all existing secrets, even if err is not nil
cmd/mulchd/server/vm.go:103
↓ 2 callers
Method
GetTotalConnections
GetTotalConnections return the total connection count for all listeners
cmd/mulch-proxy/port_server.go:49
↓ 2 callers
Function
GetURLScheme
GetURLScheme returns the scheme of the given URL
cmd/mulchd/server/tools.go:44
↓ 2 callers
Function
IPStringToInt
IPStringToInt convert an IPv4 string to a unsigned int 32
cmd/mulchd/server/network.go:12
↓ 2 callers
Method
IsPaused
IsPaused returns true if the seed is paused
cmd/mulchd/server/seeds.go:516
↓ 2 callers
Function
IsRebuildNeeded
IsRebuildNeeded return true if lastRebuild is older than rebuildSetting
cmd/mulchd/server/auto_rebuild.go:97
↓ 2 callers
Method
Listen
Listen will wait for client connections
cmd/mulch-proxy/port_listener.go:60
↓ 2 callers
Method
MatchTarget
MatchTarget returns true if the message matches the target exact searches are usefull for specific target logs (excluding all "global" messages)
common/message.go:80
↓ 2 callers
Function
NewLog
NewLog creates a new log
cmd/mulch-proxy/log.go:41
↓ 2 callers
Function
NewVMController
NewVMController creates a new VM
cmd/mulchd/controllers/vm.go:151
↓ 2 callers
Method
RebuildDHCPStaticLeases
RebuildDHCPStaticLeases will clean static DHCP leases database
cmd/mulchd/server/libvirt_dhcp.go:45
↓ 2 callers
Method
RefreshSeed
RefreshSeed will download a seed image using its URL
cmd/mulchd/server/seeds.go:369
↓ 2 callers
Method
RefreshSeeder
RefreshSeeder will rebuild seeder using a VM
cmd/mulchd/server/seeds.go:234
↓ 2 callers
Method
ResizeDisk
ResizeDisk will change volume ("disk") size (do not reduce a volume without knowing what you are doing!)
cmd/mulchd/server/libvirt.go:429
↓ 2 callers
Function
SSHSendKeepAlive
SSHSendKeepAlive sends a keepalive request using a timeout
cmd/mulchd/server/ssh.go:115
↓ 2 callers
Method
Save
Save the DB to disk
cmd/mulchd/server/sshpair_database.go:55
↓ 2 callers
Method
Save
Save the database to disk
cmd/mulchd/server/secret_database.go:222
↓ 2 callers
Function
StringExpandVariables
StringExpandVariables expands "variables" ($test, for instance) in str and returns a new string
common/tools.go:103
↓ 2 callers
Method
Success
Success sends an MessageSuccess Message
cmd/mulchd/server/log.go:88
↓ 2 callers
Method
SyncWithDatabase
SyncWithDatabase syncs our secret database with another database (ex: from another peer) It returns (our) "newer" entries so the remote peer can merge
cmd/mulchd/server/secret_database.go:518
↓ 2 callers
Method
Update
Update saves the DB with current VM states
cmd/mulchd/server/vmstate_database.go:89
↓ 2 callers
Method
UpdateForwardMap
UpdateForwardMap will update our forwarding config
cmd/mulch-proxy/port_listener.go:139
↓ 2 callers
Method
UploadFileToLibvirtFromReader
UploadFileToLibvirtFromReader uploads a file to libvirt storage
cmd/mulchd/server/libvirt.go:343
↓ 2 callers
Function
VMAttachBackup
VMAttachBackup attach a backup volume to the VM
cmd/mulchd/server/vm.go:1096
↓ 2 callers
Function
VMControllerConfigCheck
VMControllerConfigCheck will validate TOML sent in the 'config' request field and check if VM is a duplicate
cmd/mulchd/controllers/vm.go:62
↓ 2 callers
Function
VMRebuild
VMRebuild delete VM and rebuilds it from a backup (using revisions)
cmd/mulchd/server/vm.go:1649
↓ 2 callers
Method
WaitRestore
WaitRestore blocks until VM states are not restored, so non-crucial tasks can kindly wait for a "quiter" system load. NOTE: very crude timeout-baed im
cmd/mulchd/server/vmstate_database.go:214
↓ 2 callers
Method
Warningf
Warningf sends a formated string MessageWarning Message
cmd/mulch-proxy/log.go:70
↓ 2 callers
Function
WriteSSHPair
WriteSSHPair overwrites public and private API SSH files, using an APISSHPair reader (see "GET /sshpair") as input. Returns public key filepath, priva
cmd/mulch/client/ssh.go:62
↓ 2 callers
Method
checkPSK
(request *http.Request)
cmd/mulch-proxy/api_server.go:63
↓ 2 callers
Method
close
close the forwarding
cmd/mulch-proxy/port_forward.go:88
↓ 2 callers
Function
downloadFile
(filename string, reader io.Reader)
cmd/mulch/client/apicall.go:315
↓ 2 callers
Function
getContentFromFileURL
file:// protocol (also accepts file paths: /home/user/file.txt)
cmd/mulchd/server/origin.go:149
↓ 2 callers
Function
getContentFromHttpURL
http:// or https:// protocol (with conditional GET caching)
cmd/mulchd/server/origin.go:173
↓ 2 callers
Method
keyExists
keyExists return true if the key address exists in the database
cmd/mulchd/server/api_keys.go:182
↓ 2 callers
Function
listScripts
(scriptsPath string)
cmd/mulchd/server/alert.go:35
↓ 2 callers
Method
load
()
cmd/mulch-proxy/domain_database.go:45
↓ 2 callers
Method
pipe
pipe a reader to a writer
cmd/mulch-proxy/port_forward.go:69
↓ 2 callers
Function
portExtractComment
portExtractComment extracts the (comment) from a port string
cmd/mulchd/server/vm_port.go:333
↓ 2 callers
Method
refreshListeners
sync listeners and update forward maps
cmd/mulch-proxy/port_server.go:58
↓ 2 callers
Method
refreshParentDomains
contact our parent proxy and send all our routes so he can forward requests
cmd/mulch-proxy/app.go:251
↓ 2 callers
Method
registerRouteHandlers
(mux *http.ServeMux, inRoutes map[string][]*Route)
cmd/mulchd/server/route_handler.go:180
↓ 2 callers
Method
reportError
(seed *Seed, err error)
cmd/mulchd/server/seeds.go:179
↓ 2 callers
Function
requestGetMulchParam
extract a generic parameter from the request (API key, protocol, etc) from the headers (new way, "Mulch-Name") or from FormValue (old way, "name")
cmd/mulchd/server/route_handler.go:47
↓ 2 callers
Method
runChannels
runChannels is the the core of the ssh-proxy, where we manage channels and requests the usual destination is the VM, but see ClientHandleChannelOpen()
cmd/mulchd/server/ssh_proxy.go:108
↓ 2 callers
Method
save
This is done internaly, because it must be done with the mutex locked, but we can't lock it here, since save() is called by functions that are already
cmd/mulchd/server/vmstate_database.go:57
↓ 2 callers
Method
save
only needed for proxy chain parents
cmd/mulch-proxy/domain_database.go:64
↓ 2 callers
Method
saveToWriter
save the database to a writer (without a mutex lock)
cmd/mulchd/server/secret_database.go:252
↓ 2 callers
Method
scheduleSSHKeepAlives
Send sparses keepalives to detect dead connections, a failed SendRequest will set channels to nil, closing the connections (and we use a timeout as we
cmd/mulchd/server/ssh_proxy.go:91
↓ 2 callers
Method
selfCall
()
cmd/mulchd/server/cert_manager.go:130
↓ 2 callers
Function
sshProxyCopyChan
(dst ssh.Channel, src ssh.Channel, way string, wgChannels *sync.WaitGroup, wgClosed *sync.WaitGroup, log *Log)
cmd/mulchd/server/ssh_proxy.go:51
↓ 2 callers
Function
vmCheckScriptURL
(scriptURL string, origins *Origins)
cmd/mulchd/server/vm_config.go:122
← previous
next →
101–200 of 644, ranked by callers