@@ -28,6 +28,7 @@ const (
28
28
writableKwd = "writable"
29
29
ipfsMountKwd = "mount-ipfs"
30
30
ipnsMountKwd = "mount-ipns"
31
+ unrestrictedApiAccess = "unrestricted-api"
31
32
// apiAddrKwd = "address-api"
32
33
// swarmAddrKwd = "address-swarm"
33
34
)
@@ -71,6 +72,7 @@ the port as you would other services or database (firewall, authenticated proxy,
71
72
cmds .BoolOption (writableKwd , "Enable writing objects (with POST, PUT and DELETE)" ),
72
73
cmds .StringOption (ipfsMountKwd , "Path to the mountpoint for IPFS (if using --mount)" ),
73
74
cmds .StringOption (ipnsMountKwd , "Path to the mountpoint for IPNS (if using --mount)" ),
75
+ cmds .BoolOption (unrestrictedApiAccess , "Allow API access to unlisted hashes" ),
74
76
75
77
// TODO: add way to override addresses. tricky part: updating the config if also --init.
76
78
// cmds.StringOption(apiAddrKwd, "Address for the daemon rpc API (overrides config)"),
@@ -281,6 +283,10 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
281
283
Writable : true ,
282
284
BlockList : & corehttp.BlockList {
283
285
Decider : func (s string ) bool {
286
+ unrestricted , _ , _ := req .Option (unrestrictedApiAccess ).Bool ()
287
+ if unrestricted {
288
+ return true
289
+ }
284
290
// for now, only allow paths in the WebUI path
285
291
for _ , webuipath := range corehttp .WebUIPaths {
286
292
if strings .HasPrefix (s , webuipath ) {
0 commit comments