@@ -56,6 +56,7 @@ const (
5656 initProfileOptionKwd = "init-profile"
5757 ipfsMountKwd = "mount-ipfs"
5858 ipnsMountKwd = "mount-ipns"
59+ mfsMountKwd = "mount-mfs"
5960 migrateKwd = "migrate"
6061 mountKwd = "mount"
6162 offlineKwd = "offline" // global option
@@ -173,6 +174,7 @@ Headers.
173174 cmds .BoolOption (mountKwd , "Mounts IPFS to the filesystem using FUSE (experimental)" ),
174175 cmds .StringOption (ipfsMountKwd , "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting." ),
175176 cmds .StringOption (ipnsMountKwd , "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting." ),
177+ cmds .StringOption (mfsMountKwd , "Path to the mountpoint for MFS (if using --mount). Defaults to config setting." ),
176178 cmds .BoolOption (unrestrictedAPIAccessKwd , "Allow RPC API access to unlisted hashes" ),
177179 cmds .BoolOption (unencryptTransportKwd , "Disable transport encryption (for debugging protocols)" ),
178180 cmds .BoolOption (enableGCKwd , "Enable automatic periodic repo garbage collection" ),
@@ -458,6 +460,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
458460 cfg .Identity .PeerID ,
459461 cfg .Addresses ,
460462 cfg .Identity .PrivKey ,
463+ cfg .HTTPRetrieval .Enabled .WithDefault (config .DefaultHTTPRetrievalEnabled ),
461464 )
462465 default :
463466 return fmt .Errorf ("unrecognized routing option: %s" , routingOption )
@@ -485,6 +488,14 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
485488 // This should never happen, but better safe than sorry
486489 log .Fatal ("Private network does not work with Routing.Type=auto. Update your config to Routing.Type=dht (or none, and do manual peering)" )
487490 }
491+ if cfg .Provider .Strategy .WithDefault ("" ) != "" && cfg .Reprovider .Strategy .IsDefault () {
492+ log .Fatal ("Invalid config. Remove unused Provider.Strategy and set Reprovider.Strategy instead. Documentation: https://github.com/ipfs/kubo/blob/master/docs/config.md#reproviderstrategy" )
493+ }
494+ if cfg .Experimental .StrategicProviding {
495+ log .Error ("Experimental.StrategicProviding was removed. Remove it from your config and set Provider.Enabled=false to remove this message. Documentation: https://github.com/ipfs/kubo/blob/master/docs/experimental-features.md#strategic-providing" )
496+ cfg .Experimental .StrategicProviding = false
497+ cfg .Provider .Enabled = config .False
498+ }
488499
489500 printLibp2pPorts (node )
490501
@@ -619,17 +630,19 @@ take effect.
619630 }()
620631
621632 if ! offline {
622- // Warn users who were victims of 'lowprofile' footgun (https://github.com/ipfs/kubo/pull/10524)
623- if cfg .Experimental . StrategicProviding {
633+ // Warn users when provide systems are disabled
634+ if ! cfg .Provider . Enabled . WithDefault ( config . DefaultProviderEnabled ) {
624635 fmt .Print (`
625- ⚠️ Reprovide system is disabled due to 'Experimental.StrategicProviding=true'
636+
637+ ⚠️ Provide and Reprovide systems are disabled due to 'Provide.Enabled=false'
626638⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
627- ⚠️ If this is not intentional, call 'ipfs config profile apply announce-on'
639+ ⚠️ If this is not intentional, call 'ipfs config profile apply announce-on' or set Provide.Enabled=true'
628640
629641` )
630642 } else if cfg .Reprovider .Interval .WithDefault (config .DefaultReproviderInterval ) == 0 {
631643 fmt .Print (`
632- ⚠️ Reprovider system is disabled due to 'Reprovider.Interval=0'
644+
645+ ⚠️ Provide and Reprovide systems are disabled due to 'Reprovider.Interval=0'
633646⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
634647⚠️ If this is not intentional, call 'ipfs config profile apply announce-on', or set 'Reprovider.Interval=22h'
635648
@@ -1052,23 +1065,58 @@ func mountFuse(req *cmds.Request, cctx *oldcmds.Context) error {
10521065 if ! found {
10531066 fsdir = cfg .Mounts .IPFS
10541067 }
1068+ if err := checkFusePath ("Mounts.IPFS" , fsdir ); err != nil {
1069+ return err
1070+ }
10551071
10561072 nsdir , found := req .Options [ipnsMountKwd ].(string )
10571073 if ! found {
10581074 nsdir = cfg .Mounts .IPNS
10591075 }
1076+ if err := checkFusePath ("Mounts.IPNS" , nsdir ); err != nil {
1077+ return err
1078+ }
1079+
1080+ mfsdir , found := req .Options [mfsMountKwd ].(string )
1081+ if ! found {
1082+ mfsdir = cfg .Mounts .MFS
1083+ }
1084+ if err := checkFusePath ("Mounts.MFS" , mfsdir ); err != nil {
1085+ return err
1086+ }
10601087
10611088 node , err := cctx .ConstructNode ()
10621089 if err != nil {
10631090 return fmt .Errorf ("mountFuse: ConstructNode() failed: %s" , err )
10641091 }
10651092
1066- err = nodeMount .Mount (node , fsdir , nsdir )
1093+ err = nodeMount .Mount (node , fsdir , nsdir , mfsdir )
10671094 if err != nil {
10681095 return err
10691096 }
10701097 fmt .Printf ("IPFS mounted at: %s\n " , fsdir )
10711098 fmt .Printf ("IPNS mounted at: %s\n " , nsdir )
1099+ fmt .Printf ("MFS mounted at: %s\n " , mfsdir )
1100+ return nil
1101+ }
1102+
1103+ func checkFusePath (name , path string ) error {
1104+ if path == "" {
1105+ return fmt .Errorf ("%s path cannot be empty" , name )
1106+ }
1107+
1108+ fileInfo , err := os .Stat (path )
1109+ if err != nil {
1110+ if os .IsNotExist (err ) {
1111+ return fmt .Errorf ("%s path (%q) does not exist: %w" , name , path , err )
1112+ }
1113+ return fmt .Errorf ("error while inspecting %s path (%q): %w" , name , path , err )
1114+ }
1115+
1116+ if ! fileInfo .IsDir () {
1117+ return fmt .Errorf ("%s path (%q) is not a directory" , name , path )
1118+ }
1119+
10721120 return nil
10731121}
10741122
0 commit comments