@@ -121,6 +121,11 @@ localApiUrl = '/ip4/127.0.0.1/tcp/5001'
121
121
localGatewayUrl = ' http://localhost:8080'
122
122
globalGatewayUrl = ' https://gateway.ipfs.io'
123
123
124
+ # grab values from env vars
125
+ localApiUrl = process .env .IPFS_LOCAL_API if process .env .IPFS_LOCAL_API
126
+ localGatewayUrl = process .env .IPFS_GLOBAL_GATEWAY if process .env .IPFS_GLOBAL_GATEWAY
127
+ globalGatewayUrl = process .env .IPFS_LOCAL_GATEWAY if process .env .IPFS_LOCAL_GATEWAY
128
+
124
129
ipfs = ipfsApi localApiUrl
125
130
126
131
# test it just to show if it's not online on startup.
@@ -327,11 +332,14 @@ module.exports = (robot) ->
327
332
path = cleanPath (res .match [1 ])
328
333
# todo: some path validation
329
334
testApi res, ->
330
- res .send " pinning #{ prettyPath path} "
335
+ res .send " pinning #{ prettyPath path} (warning: experimental) "
331
336
# todo: implement -r=false support (right now it assumes -r=true)
332
337
ipfs .refs path, {r : true }, mustSucceed res, (r ) ->
333
338
ipfs .pin .add path, {r : true }, mustSucceed res, (r ) ->
334
- res .send " success: pinned recursively: #{ prettyPath path} "
339
+ res .send """
340
+ success: pinned recursively: #{ prettyPath path}
341
+ (warning: this pinbot is experimental. do not rely on me yet.)
342
+ """
335
343
336
344
robot .respond / ipfs pin ls (\S + )/ i , runCmdPath ipfs .pin .ls ,
337
345
output : (o ) -> o .map ((e ) -> " #{ e .hash } #{ e .type } " ).join (' \n ' )
0 commit comments