@@ -56,6 +56,7 @@ const (
56
56
initProfileOptionKwd = "init-profile"
57
57
ipfsMountKwd = "mount-ipfs"
58
58
ipnsMountKwd = "mount-ipns"
59
+ mfsMountKwd = "mount-mfs"
59
60
migrateKwd = "migrate"
60
61
mountKwd = "mount"
61
62
offlineKwd = "offline" // global option
@@ -173,6 +174,7 @@ Headers.
173
174
cmds .BoolOption (mountKwd , "Mounts IPFS to the filesystem using FUSE (experimental)" ),
174
175
cmds .StringOption (ipfsMountKwd , "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting." ),
175
176
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." ),
176
178
cmds .BoolOption (unrestrictedAPIAccessKwd , "Allow RPC API access to unlisted hashes" ),
177
179
cmds .BoolOption (unencryptTransportKwd , "Disable transport encryption (for debugging protocols)" ),
178
180
cmds .BoolOption (enableGCKwd , "Enable automatic periodic repo garbage collection" ),
@@ -458,6 +460,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
458
460
cfg .Identity .PeerID ,
459
461
cfg .Addresses ,
460
462
cfg .Identity .PrivKey ,
463
+ cfg .HTTPRetrieval .Enabled .WithDefault (config .DefaultHTTPRetrievalEnabled ),
461
464
)
462
465
default :
463
466
return fmt .Errorf ("unrecognized routing option: %s" , routingOption )
@@ -485,6 +488,14 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
485
488
// This should never happen, but better safe than sorry
486
489
log .Fatal ("Private network does not work with Routing.Type=auto. Update your config to Routing.Type=dht (or none, and do manual peering)" )
487
490
}
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
+ }
488
499
489
500
printLibp2pPorts (node )
490
501
@@ -619,17 +630,19 @@ take effect.
619
630
}()
620
631
621
632
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 ) {
624
635
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'
626
638
⚠️ 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'
628
640
629
641
` )
630
642
} else if cfg .Reprovider .Interval .WithDefault (config .DefaultReproviderInterval ) == 0 {
631
643
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'
633
646
⚠️ Local CIDs will not be announced to Amino DHT, making them impossible to retrieve without manual peering
634
647
⚠️ If this is not intentional, call 'ipfs config profile apply announce-on', or set 'Reprovider.Interval=22h'
635
648
@@ -1052,23 +1065,58 @@ func mountFuse(req *cmds.Request, cctx *oldcmds.Context) error {
1052
1065
if ! found {
1053
1066
fsdir = cfg .Mounts .IPFS
1054
1067
}
1068
+ if err := checkFusePath ("Mounts.IPFS" , fsdir ); err != nil {
1069
+ return err
1070
+ }
1055
1071
1056
1072
nsdir , found := req .Options [ipnsMountKwd ].(string )
1057
1073
if ! found {
1058
1074
nsdir = cfg .Mounts .IPNS
1059
1075
}
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
+ }
1060
1087
1061
1088
node , err := cctx .ConstructNode ()
1062
1089
if err != nil {
1063
1090
return fmt .Errorf ("mountFuse: ConstructNode() failed: %s" , err )
1064
1091
}
1065
1092
1066
- err = nodeMount .Mount (node , fsdir , nsdir )
1093
+ err = nodeMount .Mount (node , fsdir , nsdir , mfsdir )
1067
1094
if err != nil {
1068
1095
return err
1069
1096
}
1070
1097
fmt .Printf ("IPFS mounted at: %s\n " , fsdir )
1071
1098
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
+
1072
1120
return nil
1073
1121
}
1074
1122
0 commit comments