diff --git a/modules/initipfs/main.go b/modules/initipfs/main.go index 20eea3a..59a564c 100644 --- a/modules/initipfs/main.go +++ b/modules/initipfs/main.go @@ -178,6 +178,7 @@ func main() { updateIPFSConfigIdentity(&ipfsCfg, config) updateIPFSConfigBootstrap(&ipfsCfg, config.IpfsBootstrapNodes, users) + updateDatastorePath(&ipfsCfg, "/internal/badgerds") writeIPFSConfig(ipfsConfigPath, ipfsCfg) writePredefinedFiles() @@ -324,6 +325,14 @@ func updateIPFSConfigIdentity(ipfsCfg *IPFSConfig, cfg ConfigYAML) { ipfsCfg.Identity.PeerID = generatePeerIDFromIdentity(cfg.Identity) } +func updateDatastorePath(ipfsCfg *IPFSConfig, newPath string) { + // Check if the Datastore.Spec.child is not nil and the path exists + if ipfsCfg.Datastore.Spec.Child.Path != "" { + // Update the path to the new specified path + ipfsCfg.Datastore.Spec.Child.Path = newPath + } +} + func generatePeerIDFromIdentity(identity string) string { // Decode the base64 encoded identity to get the private key bytes privateKeyBytes, err := base64.StdEncoding.DecodeString(identity)