Skip to content

Commit 1d01ce2

Browse files
committed
experimental warnings
1 parent 1497873 commit 1d01ce2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/ipfs.coffee

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ localApiUrl = '/ip4/127.0.0.1/tcp/5001'
121121
localGatewayUrl = 'http://localhost:8080'
122122
globalGatewayUrl = 'https://gateway.ipfs.io'
123123

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+
124129
ipfs = ipfsApi localApiUrl
125130

126131
# test it just to show if it's not online on startup.
@@ -327,11 +332,14 @@ module.exports = (robot) ->
327332
path = cleanPath(res.match[1])
328333
# todo: some path validation
329334
testApi res, ->
330-
res.send "pinning #{prettyPath path}"
335+
res.send "pinning #{prettyPath path} (warning: experimental)"
331336
# todo: implement -r=false support (right now it assumes -r=true)
332337
ipfs.refs path, {r: true}, mustSucceed res, (r) ->
333338
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+
"""
335343

336344
robot.respond /ipfs pin ls (\S+)/i, runCmdPath ipfs.pin.ls,
337345
output: (o) -> o.map((e) -> "#{e.hash} #{e.type}").join('\n')

0 commit comments

Comments
 (0)