Commit Graph

1031 Commits

Author SHA1 Message Date
Jeromy
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
Knut Ahlers
5649c7eb4d Fix: Use the right repo to encrypt secrets.
refs #1698

License: MIT
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2015-09-14 19:44:28 +02:00
Knut Ahlers
8b6d2b4c69 Added dockerhub trigger
License: MIT
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2015-09-14 17:10:12 +02:00
rht
8ec121239e Bump version of dir-index-html
Based on https://github.com/ipfs/go-ipfs/pull/1615

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-09-05 01:06:35 +07:00
Jeromy
71d2ab1fc9 use already created config in daemon.go
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-03 18:20:18 -07:00
Jeromy
ab0c668ab8 fix panic caused by accessing config after repo closed
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-03 09:28:36 -07:00
Juan Benet
8c652907de Merge pull request #1598 from ipfs/check-for-api
check for API -- WIP
2015-08-29 06:20:59 +02:00
Juan Benet
9f253dfa7a Merge pull request #1592 from prusnak/empty-repo
Add --empty-repo option for init (#1559)
2015-08-28 14:13:09 +02:00
Jeromy
94000e6490 replace nodebuilder with a nicer interface
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

use NewNode instead of NewIPFSNode in most of the codebase

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

make mocknet work with node constructor better

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

finish cleanup of old construction method

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

blockservice.New doesnt return an error anymore

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

break up node construction into separate function

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

add error case to default filling on node constructor

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-08-27 08:43:10 -07:00
Juan Batiz-Benet
5040fee906 implement support for --api option
This commit adds support for the --api option, which allows users
to specify an API endpoint to run the cli command against. It enables
much easier control of remote daemons.

It also
- ensures the API server version matches the API client
- implements support for the $IPFS_PATH/api file

Still TODO:
- tests!
- multiaddr to support /dns/

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-27 08:03:56 +02:00
Juan Benet
a052087974 Merge pull request #1569 from rht/daemon-msg
Notify when daemon is ready
2015-08-23 05:11:27 +02:00
Pavol Rusnak
73e820a8bc Add --empty-repo option for init (#1559)
License: MIT
Signed-off-by: Pavol Rusnak <stick@gk2.sk>
2015-08-20 01:01:08 +02:00
rht
dd99a70a7d Add readonly api to gateway
Based on https://github.com/ipfs/go-ipfs/pull/1389

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-15 17:08:59 +07:00
rht
35ab1e347b Notify when daemon is ready
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-08-13 09:51:52 +07:00
Juan Batiz-Benet
3f1cbe2f43 corehttp: add net.Listener to ServeOption
ServeOptions take the node and muxer, they should get the listener
too as sometimes they need to operate on the listener address.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-08-02 08:16:51 +02:00
Juan Batiz-Benet
7cf5e87cfe Added API + Gateway support for arbitrary HTTP headers
This commit fixes + improves CORS support

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:09 -07:00
Juan Batiz-Benet
470de9222d updated gobuilder dist
https://github.com/Luzifer/gobuilder/pull/52

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:35:50 -07:00
Jeromy
bb3a75aa08 remove context from context
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 20:53:06 -07:00
Jeromy
f9f3c6a527 make offline commands respect timeout
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-20 14:34:16 -07:00
Henry
1b16712b5a assets: seed gateway index assets on 'ipfs init'
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>

t0080-repo.sh: added gateway assets to pinning tests

License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-04 01:47:07 +02:00
Juan Batiz-Benet
0c9e1e47b5 Merge pull request #1419 from ipfs/bindataAssets
assets: switch to go-bindata
2015-07-03 12:02:25 -07:00
Henry
02377fabf8 assets: remove seed logic from init
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-03 10:22:21 +02:00
Henry
5fbf1e7416 assets: switch to go-bindata
License: MIT
Signed-off-by: Henry <cryptix@riseup.net>
2015-07-03 09:52:08 +02:00
Jason Carver
c4fb36b8c8 daemon help docs for CORS
Convey the basic idea, plus an example.  Don't encourage using `*`.

This would have saved me some code spelunking.
2015-07-02 18:06:58 -07:00
Lars Gierth
ed8d3ae388 api: add /metrics endpoint for prometheus
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-06-29 23:15:15 +02:00
Juan Batiz-Benet
e37fefdfd3 daemon option to optionally disable secio
This commit adds an option to turn off all encryption. This is a mode
used for tests, debugging, achieving protocol implementation interop,
learning about how the protocol works (nc ftw), and worst case
networks which _demand_ to be able to snoop on all the traffic.
(sadly, there are some private intranets like this...). (We should
consider at least _signing_ all this traffic.)

Because of the severity of this sort of thing, this is an
all-or-nothing deal. Either encryption is ON or OFF _fully_.
This way, partially unencrypted nodes cannot be accidentally left
running without the user's understanding. Nodes without encrypted
connections will simply not be able to speak to any of the global
bootstrap nodes, or anybody in the public network.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Juan Batiz-Benet
9716018ca5 daemon output includes swarm addresses
daemon output now includes initial swarm addresses. this is not a
full solution, as a change in network will not trigger re-printing.
We need a good way to do that.

This made me re-think how we're outputting these messages, perhaps
we should be throwing them as log.Events, and capturing some with
a special keyword to output to the user on stdout. Things like
network addresses being rebound, NATs being holepunched, external
network addresses being figured out, connections established, etc
may be valuable events to show the user. Of course, these should be
very few, as a noisy daemon is an annoying daemon.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-06-26 23:36:43 -07:00
Jeromy
6211ee46c2 close channels and allow daemon to shutdown
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-19 22:40:38 -07:00
Jeromy
a676b5a8ac move eventlogs to an http endpoint
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-18 12:44:01 -07:00
rht
78b6cc5f2d Replace Critical{,f} with Error{,f}
Except when there is an explicit os.Exit(1) after the Critical line,
then replace with Fatal{,f}.
golang's log and logrus already call os.Exit(1) by default with Fatal.

License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-06-18 10:03:57 +07:00
Lars Gierth
8d05fa47e8 cmd: remove dead ipfs_routingd and ipfs_bootstrapd
License: MIT
Signed-off-by: Lars Gierth <larsg@systemli.org>
2015-06-15 22:18:00 +02:00
Knut Ahlers
a7adb9b2d3 Added nofuse tag for windows builds
This configuration is supported since GoBuilder 1.16.0 so now we should be able to build windows binaries in GoBuilder

License: MIT
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2015-06-14 16:21:12 +02:00
Henry
4b337bb7e8 daemon: addressed CR comments 2015-06-08 11:08:10 +02:00
Henry
07b3415cdb http endpoints: dont print before listen
also splits api, gw and fuse bring up into helper functions
2015-06-08 10:56:05 +02:00
Harlan T Wood
e82e5cd87e fix typo 2015-06-06 13:42:54 -07:00
Jeromy
ef294431d4 move util.Key into its own package under blocks 2015-06-01 16:10:08 -07:00
rht
8cad2d2c89 Move 'tour' to core/commands
Side effect: this makes 'tour' accessible through the HTTP API
2015-05-26 21:04:03 +07:00
Juan Batiz-Benet
d51f28e895 Merge pull request #1254 from ipfs/fix/refs-fail
fix silent refs failure
2015-05-20 23:25:02 -04:00
Jeromy
002cf5128e fix silent refs failure 2015-05-20 09:46:22 -07:00
Jeromy
8ea502f1b3 clean up and fix init permissions handling 2015-05-20 09:46:09 -07:00
rht
ac7edddb94 Run 'gofmt -s -w' on these files 2015-05-19 06:11:15 +07:00
Kristoffer Ström
30f674af0e Add option to allow unrestricted API access 2015-05-10 22:25:36 +02:00
Juan Batiz-Benet
fab5e91a93 Merge pull request #1163 from ipfs/ds-metrics
Record Datastore metrics for flatfs and leveldb
2015-05-02 13:16:04 -07:00
Juan Batiz-Benet
fc28ef401f Merge pull request #1149 from ipfs/fix/better-mem-prof
write memory profiles every 30 seconds when enabled
2015-05-02 12:12:22 -07:00
Tommi Virtanen
c24f421bff Add Go runtime metrics to expvar 2015-05-01 10:51:14 -07:00
Tommi Virtanen
df70fe4ac7 Serve expvars and pprof on the API port 2015-05-01 10:50:44 -07:00
Tommi Virtanen
e78305546c gofmt 2015-04-28 16:18:26 -07:00
Juan Batiz-Benet
29c6a53e43 Merge pull request #1139 from AtnNn/flags
Improve command line parsing
2015-04-27 16:21:39 -07:00
Jeromy
dff606a347 write memory profiles every 30 seconds when enabled 2015-04-27 15:53:07 -07:00
Etienne Laurin
f168539030 Improve command line parsing 2015-04-27 17:19:38 +00:00
Juan Batiz-Benet
c9bf470302 Merge pull request #1140 from ipfs/flatfs-rides-again
Fix flatfs on Windows
2015-04-26 23:12:59 -07:00
Jeromy
3d80b9d27d refactored ipns records to point to paths
Also changed the ipns dns resolution to use the "dnslink" format
2015-04-26 22:32:12 -07:00
Tommi Virtanen
db2acd9b8d gofmt 2015-04-25 19:00:30 -07:00
Etienne Laurin
930cd8ea5d Mention correct key size in help for init 2015-04-25 04:43:23 +00:00
Juan Batiz-Benet
16f56e1c9b init: lower default rsa key size to 2048 for now
I think we should lower the default rsa key size to 2048 for now -- until we have a proper focus on securing everything. It's always a pain for new users to get hung on 4096 rsa key gen, when we have not even made sure we're using the keys perfectly correctly yet. (And 2048 is still considered secure)
2015-04-21 01:18:52 -07:00
Juan Batiz-Benet
db56c0f16a Merge pull request #1037 from torarnv/harden-shutdown-logic
Harden shutdown logic
2015-04-21 00:58:49 -07:00
Travis Person
e1f8dfa25a Check to see if the daemon is currently running
If the daemon is running we do not want to proceed with an
an initialization.

Return a client error telling the user to kill the daemon
before proceeding with the command.
2015-04-20 17:21:13 -07:00
Tor Arne Vestbø
bfd12114e7 Remove daemon InitDone guard in interrupt handler
Instead of just terminating right there and then, we cancel the
context, and let the daemon exit cleanly. This make take a few
seconds, as the node builder and its child processes do not
care too much about the context state while building nodes,
but this can be improved by injecting checks for ctx.Done()
before time-consuming steps.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
cf6a268cd3 Handle ipfs command interruption by cancelling the command context
Instead of assuming the command is the daemon command and closing
the node, which resulted in bugs like #1053, we cancel the context
and let the context children detect the cancellation and gracefully
clean up after themselves.

The shutdown logging has been moved into the daemon command, where
it makes more sense, so that commands like ping will not print out
the same output on cancellation.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
3d05764262 Sync up request context with root context just before calling command
The context passed on from main() may change before we hit callCommand,
so setting it in Parse is a bit optimistic.
2015-04-20 16:35:35 +02:00
Tor Arne Vestbø
00a6e595ba main: wait for interrupt to finish before ending command invocation
If a command invocation such as 'daemon' is interrupted, the interrupt
handler asks the node to close. The closing of the node will result in
the command invocation finishing, and possibly returning from main()
before the interrupt handler is done. In particular, the info logging
that a graceful shutdown was completed may never reach reach stdout.

As the whole point of logging "Gracefully shut down." is to give
confidence when debugging that the shutdown was clean, this is
slightly unfortunate.

The interrupt handler needs to be set up in main() instead of Run(),
so that we can defer the closing of the interrupt handler until just
before returning from main, not when Run() returns with a streaming
result reader.
2015-04-20 16:35:30 +02:00
Tor Arne Vestbø
61efc4de1d Revert "fix ugly error message when killing commands"
This reverts commit f74e71f965.

The 'Online' flag of the command context does not seem to be set in
any code paths, at least not when running commands such as 'ipfs daemon'
or 'ipfs ping'. The result after f74e71f9 is that we never shutdown
cleanly, as we'll always os.Exit(0) from the interrupt handler.

The os.Exit(0) itself is also dubious, as conceptually the interrupt
handler should ask whatever is stalling to stop stalling, so that
main() can return like normal. Exiting with -1 in error cases where
the interrupt handler is unable to stop the stall is fine, but the
normal case of interrupting cleanly should exit through main().
2015-04-20 14:55:41 +02:00
Jeromy
c419a489e1 make ipfs understand the new migration 2015-04-20 02:26:33 -07:00
Jeromy
f3fbedf312 no longer worry about moving key out of config file 2015-04-20 02:25:41 -07:00
Juan Batiz-Benet
140cd1fd1b remove debugerrors
We now consider debugerrors harmful: we've run into cases where
debugerror.Wrap() hid valuable error information (err == io.EOF?).
I've removed them from the main code, but left them in some tests.
Go errors are lacking, but unfortunately, this isn't the solution.

It is possible that debugerros.New or debugerrors.Errorf should
remain still (i.e. only remove debugerrors.Wrap) but we don't use
these errors often enough to keep.
2015-04-20 00:35:35 -07:00
Jeromy
0a6b880bee fix for #1008 and other pinning fixes
This commit adds a new set of sharness tests for pinning, and addresses
bugs that were pointed out by said tests.

test/sharness: added more pinning tests

Pinning is currently broken. See issue #1051. This commit introduces
a few more pinning tests. These are by no means exhaustive, but
definitely surface the present problems going on. I believe these
tests are correct, but not sure. Pushing them as failing so that
pinning is fixed in this PR.

make pinning and merkledag.Get take contexts

improve 'add' commands usage of pinning

FIXUP: fix 'pin lists look good'

ipfs-pin-stat simple script to help check pinning

This is a simple shell script to help check pinning.

We ought to strive towards making adding commands this easy.
The http api is great and powerful, but our setup right now
gets in the way. Perhaps we can clean up that area.

updated t0081-repo-pinning

- fixed a couple bugs with the tests
- made it a bit clearer (still a lot going on)
- the remaining tests are correct and highlight a problem with
  pinning. Namely, that recursive pinning is buggy. At least:
  towards the end of the test, $HASH_DIR4 and $HASH_FILE4 should
  be pinned indirectly, but they're not. And thus get gc-ed out.
  There may be other problems too.

cc @whyrusleeping

fix grep params for context deadline check

fix bugs in pin and pin tests

check for block local before checking recursive pin
2015-04-19 23:40:25 -07:00
Jeromy
f74e71f965 fix ugly error message when killing commands 2015-04-12 14:49:45 -07:00
Tor Arne Vestbø
675e2c7f85 Unify shutdown message format string 2015-04-07 14:12:22 +02:00
Juan Batiz-Benet
20b5f96e6a gobuilder improvements
- README.md
- install.sh script
- LICENSE
- trigger in main repo
2015-04-02 03:00:49 -07:00
Ho-Sheng Hsiao
bf22aeec0a Reorged imports from jbenet/go-ipfs to ipfs/go-ipfs
- Modified Godeps/Godeps.json by hand
- [TEST] Updated welcome docs hash to sharness
- [TEST] Updated contact doc
- [TEST] disabled breaking test (t0080-repo refs local)
2015-03-31 12:52:25 -07:00
Jeromy
c100b1be04 move keyspace init function into namesys 2015-03-17 16:19:39 -07:00
Tommi Virtanen
fdd1cd8dc0 Remove fsrepo.At, make Open a constructor function
Nobody calls At without immediately calling Open.

First step, a mechanical transformation. Cleanups will follow.
2015-03-13 20:19:03 -07:00
Konstantin Koroviev
01db359c0f Kill the daemon during its startup 2015-03-12 12:05:10 +02:00
Konstantin Koroviev
d23bed5baa Rename ContextIsReadyToBeClosed to InitDone 2015-03-12 11:42:07 +02:00
Konstantin Koroviev
afd497e194 Dirty hack to fix race conditions in the daemon 2015-03-09 16:39:41 +02:00
Henry
70819671d3 cleaned up 'ipfs init' 2015-03-09 10:22:12 +01:00
Konstantin Koroviev
6e5217fd97 Move the comment back to where it belongs 2015-03-09 06:36:06 +02:00
anarcat
5cdd8b5d61 expand the ports documentation
i took @jbenet's suggestion, but reorganised it a bit to *not* suggest what is actually warned against later. :)
2015-03-07 08:42:30 -05:00
anarcat
fb8a1ab161 document how to change daemon ports
this more clearly explains that the daemon is listening on the network. it also hints as to how to change the listening ports. this is also related to #874
2015-03-07 08:24:59 -05:00
Juan Batiz-Benet
25f042ce36 daemon: consolidate writable gway line 2015-03-04 08:17:54 -08:00
Henry
14090d4a11 moved pollEndpoint to thirdparty/ 2015-03-04 16:25:41 +01:00
Henry
3f932af14d removed crazy logging 2015-03-04 16:18:41 +01:00
Henry
56a32a306c using pollEndpoint to block in tests for 'daemon ready' (updates #844) 2015-03-04 14:50:17 +01:00
Henry
92d08db7a5 rewrote import paths of go.net/context to use golang.org/x/context
- updated go-ctxgroup and goprocess
ctxgroup: AddChildGroup was changed to AddChild. Used in two files:
- p2p/net/mock/mock_net.go
- routing/dht/dht.go

- updated context from hg repo to git
prev. commit in hg was ad01a6fcc8a19d3a4478c836895ffe883bd2ceab. (context: make parentCancelCtx iterative)
represents commit 84f8955a887232b6308d79c68b8db44f64df455c in git repo

- updated context to master (b6fdb7d8a4ccefede406f8fe0f017fb58265054c)

Aaron Jacobs (2):
net/context: Don't accept a context in the DoSomethingSlow example.
context: Be clear that users must cancel the result of WithCancel.

Andrew Gerrand (1):
go.net: use golang.org/x/... import paths

Bryan C. Mills (1):
net/context: Don't leak goroutines in Done example.

Damien Neil (1):
context: fix removal of cancelled timer contexts from parent

David Symonds (2):
context: Fix WithValue example code.
net: add import comments.

Sameer Ajmani (1):
context: fix TestAllocs to account for ints in interfaces
2015-02-25 11:58:19 +01:00
Jeromy
a0e5fc8294 add version and ipns serve options to bootstrapd 2015-02-20 12:20:29 -08:00
Jeromy
69e09d40c5 add version info endpoint to gateway 2015-02-20 11:49:48 -08:00
Brian Tiger Chow
bbcc824f8e feat(routingd) lose the mutex. the S3 datastore is threadsafe 2015-02-15 04:45:13 -08:00
Brian Tiger Chow
6ff1d3c844 better error 2015-02-15 04:41:19 -08:00
Brian Tiger Chow
b1fb213ad1 fix(ipfs_routingd) ttl documentation 2015-02-15 04:41:19 -08:00
Brian Tiger Chow
f3e141b3cf feat(routingd) add support for redis 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
c0ca02486b fix(corerouting) pass transport addr 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
2a322ad7fb feat(daemon) learns --routing=supernode 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
8ef61e7704 fix(routingd) listen for interrupts 2015-02-15 04:41:18 -08:00
Brian Tiger Chow
974c4842fa fix(routingd) update port and servers 2015-02-15 04:41:17 -08:00
Brian Tiger Chow
bea4ed78d5 feat(cmd/daemon) add --gcr option to run GCR routing client 2015-02-15 04:41:17 -08:00
Brian Tiger Chow
68e63440da rename binaries 2015-02-15 04:41:16 -08:00
Brian Tiger Chow
19eb35137b refactor(routing) rename grandcentral to supernode
thanks @mappum

remove .go-ipfs
2015-02-15 04:41:10 -08:00
Brian Tiger Chow
0918636651 feat(cmd/routingd) add executable 2015-02-14 14:13:57 -08:00
Brian Tiger Chow
0db1a94862 misc: suppress logs to Debug (from Info) 2015-02-14 14:13:53 -08:00
Brian Tiger Chow
a549cf57d6 add space 2015-02-14 14:13:53 -08:00
Juan Batiz-Benet
247649969e Merge pull request #726 from kevinwallace/gateway_hostname
gateway: attempt to resolve hostname to ipfs path
2015-02-12 18:52:16 -08:00
Jeromy
7a2545a14b implement nodebuilder 2015-02-11 21:47:07 +00:00
Jeromy
140c70d772 document some packages 2015-02-10 22:59:10 +00:00
Kevin Wallace
084cdc3ed8 gateway: attempt to resolve hostname to ipfs path
This allows someone to host a static site by pointing a TXT record at their
content in IPFS, and a CNAME record at an IPFS gateway.

Note that such a setup technically violates RFC1912 (section 2.4; "A CNAME
record is not allowed to coexist with any other data."), but tends to work in
practice.

We may want to consider changing the DNS->IPFS resolution scheme to allow this
scenario to be RFC-compliant (e.g. store the mapping on a well-known subdomain
to allow CNAME records on the domain itself).

License: MIT
Signed-off-by: Kevin Wallace <kevin@pentabarf.net>
2015-02-08 11:27:06 -08:00
Brian Tiger Chow
bbcb670ef2 rename binary 2015-02-06 08:28:53 -08:00
Brian Tiger Chow
1d01c0354f refactor(cmd/daemon) more compact representation!
exposed the Decider to make configuration nicer @mappum
2015-02-06 08:14:14 -08:00
Brian Tiger Chow
4bc2713a28 more compact respresentation 2015-02-06 08:13:15 -08:00
Juan Batiz-Benet
64a4c27913 corehttp: allow all webui paths we published.
Otherwise we break users links! cc @mappum
2015-02-06 07:30:42 -08:00
Matt Bell
b1ca07d6c5 core/corehttp: Added gateway path whitelisting 2015-02-04 18:46:54 -08:00
Brian Tiger Chow
9c489c37a4 feat(gateway-fs) use blocklist in gateway binary
log

fix main
2015-02-04 16:17:40 -08:00
Juan Batiz-Benet
58f39687cf logs: removed all log.Errors unhelpful to users
Let's save log.Error for things the user can take action on.
Moved all our diagnostics to log.Debug. We can ideally reduce them
even further.
2015-02-03 01:06:07 -08:00
Brian Tiger Chow
097c8a1166 feat(main): change pprof flag to IPFS_PROF
@jbenet @whyrusleeping thoughts?
2015-02-02 01:31:51 -08:00
Brian Tiger Chow
d56917d860 fix(main): profile at top-level since work may be async 2015-02-02 01:16:45 -08:00
Brian Tiger Chow
908e4498a8 refactor(gatewayserver) 2015-02-01 21:54:19 -08:00
Brian Tiger Chow
951ff4f747 repo is owned by node, so close the node 2015-02-01 21:54:17 -08:00
Brian Tiger Chow
c7f922b5fc set the root context at the earlist possible moment 2015-02-01 21:54:02 -08:00
Brian Tiger Chow
cbed858993 use plain-old core.IPFSNode constructor in daemon command
fix(cmd/daemon) set node on req context since it expects daemon to be
present when handling commands over the API

@jbenet revenge of the request context redux
2015-02-01 21:53:45 -08:00
Brian Tiger Chow
e45e153a93 rename to repo path
fix FIXUP repo -> config
2015-02-01 21:49:39 -08:00
Brian Tiger Chow
eeec8ab3d7 add TODO 2015-02-01 21:49:39 -08:00
Juan Batiz-Benet
c372255807 daemon: fix output + time waiting 2015-02-01 04:29:32 -08:00
Juan Batiz-Benet
f1d34a2a85 test/sharness: fix errors
- core: daemon stdout print to cmd + daemon init checks
- core: fixed bug where the gateway was printed as "API"
- sharness/test-lib: daemon init checks
- sharness/test-lib: portable TCP port check
- sharness/init: fix test bits output
- sharness: use common hashes in one place.
- move t0100-http-gateway -> t0111-gateway-writable
- sharness: test-lib funcs for gateway config
- sharness/t0111-gateway-writable: use sh funcs
- sharness/t0111-gateway-writable: fixes
  - escape all vars (always `cmd "$VAR"` never `cmd $VAR`)
  - use $FILEPATH, not $path
  - last test seems to fail
2015-01-31 22:54:34 -08:00
Mildred Ki'Lya
7d09da3c8b Make gateway read-only by default and add option to make it writable 2015-01-31 23:36:45 +01:00
Juan Batiz-Benet
73234479fa init docs: go generated welcome dir + files
updated sharness hashes
2015-01-31 07:51:30 -08:00
Brian Tiger Chow
3279047074 log(main) show IPFS_DIR/IPFS_PATH at start up
a one-time print out
2015-01-30 06:57:42 -08:00
Brian Tiger Chow
a97234288d rm updates... 2015-01-30 06:57:41 -08:00
Brian Tiger Chow
bbc8091085 provide flag to determine whether to perform GC 2015-01-29 02:29:02 -08:00
Matt Bell
7c5b276179 cmd/ipfs: daemon: Added root redirect handler to corehttp options (for both gateway and API) 2015-01-28 16:01:42 -08:00
Brian Tiger Chow
9ff4dae264 gateway server
initialize if not already initialized

remove gateway fs

add gateway server
2015-01-27 16:24:36 -08:00
Brian Tiger Chow
1ea9481a63 move config.Init into config package 2015-01-27 16:23:58 -08:00
Juan Batiz-Benet
1eb0bfe834 Merge pull request #668 from jbenet/hack
misc user-friendliness fixes
2015-01-26 19:00:09 -08:00
Juan Batiz-Benet
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
Matt Bell
2f2efc8463 cmd/ipfs: On command ClientError, suggest checking helptext instead of showing short helptext. Resovles #630 2015-01-24 21:40:19 -08:00
Brian Tiger Chow
98ad33e005 refactor(eventlog) integrate into fsrepo
now, eventlogger works wherever the fsrepo is used
2015-01-24 01:37:03 -08:00
Brian Tiger Chow
4b78b535b6 perform multiaddr conversion in the function 2015-01-24 01:37:03 -08:00
Brian Tiger Chow
bb49b0191a use best known path method 2015-01-24 01:32:27 -08:00
Brian Tiger Chow
e9d3c9828c perform multiaddr conversion in the function 2015-01-24 01:32:27 -08:00
Juan Batiz-Benet
4334f6fda3 Merge pull request #613 from jbenet/progress-bars
Progress Bars
2015-01-23 22:20:34 -08:00
Juan Batiz-Benet
9a05522966 Merge pull request #614 from jbenet/misc-1-16
Miscellaneous Changes
2015-01-23 19:42:56 -08:00
Matt Bell
4ee3d39253 cmd/ipfs: Added key size to 'ipfs init' output 2015-01-23 19:14:59 -08:00
Brian Tiger Chow
d05bbb83c4 add async 2015-01-23 19:06:30 -08:00
Brian Tiger Chow
9239a1d11d shut down cleanly 2015-01-23 19:06:30 -08:00
Brian Tiger Chow
a6eb39614c use --http flag to run expose IPFS HTTP API 2015-01-23 19:06:30 -08:00
Brian Tiger Chow
038ec6a5b3 feat: IPFSWatch 2015-01-23 19:06:30 -08:00
Matt Bell
5706471897 commands: Made PostRun signature match Run 2015-01-23 18:29:31 -08:00
Matt Bell
7b4de230eb commands: Refactored Command#Run function signature to (req Request, res Response) 2015-01-23 18:29:29 -08:00
Matt Bell
856d2896a7 commands: Added PreRun function to command 2015-01-23 18:19:40 -08:00
Matt Bell
1281b25105 commands: Added PostRun function, called on the client 2015-01-23 18:19:40 -08:00
Brian Tiger Chow
fadedf9e68 refactor(core) extract corehttp package
PACKAGE DOCUMENTATION

package corehttp

    FUNCTIONS

    func GatewayOption(n *core.IpfsNode, mux *http.ServeMux) error

    func ListenAndServe(n *core.IpfsNode, addr ma.Multiaddr, options
    ...ServeOption) error

    func WebUIOption(n *core.IpfsNode, mux *http.ServeMux) error

    TYPES

    type ServeOption func(*core.IpfsNode, *http.ServeMux) error

    func DaemonOption(cctx commands.Context) ServeOption
2015-01-22 01:08:59 -08:00
Jeromy
feeada0d90 fix fuse mounting issues
this time, without loading the private key on every startup
2015-01-19 08:05:52 +00:00
Brian Tiger Chow
b0596cd4ff rename coreio to coreunix 2015-01-18 14:41:43 -08:00
Brian Tiger Chow
de45277883 doc(core, main) 2015-01-18 14:41:43 -08:00
Brian Tiger Chow
deb1bbe74f fix(command/init) rm stale comment 2015-01-18 14:41:43 -08:00
Brian Tiger Chow
1291470bf0 use core_io/Add in commands/init/writeWelcomeFile 2015-01-18 14:41:42 -08:00
Brian Tiger Chow
4b5ff960c9 feat(core): use repo.Repo in core constructor 2015-01-18 14:41:42 -08:00
Brian Tiger Chow
884143bf9c move generic packages to thirdparty (see thirdparty/README.md) 2015-01-18 14:04:45 -08:00
Brian Tiger Chow
6ec20b3574 huh 2015-01-14 03:02:23 -08:00
Brian Tiger Chow
40e41d24f7 feat(fsrepo): protect with a repo lockfile
NB: daemon is one spot the repo lock is typically acquired
2015-01-14 03:02:23 -08:00
Brian Tiger Chow
5705ea9859 style(init): -> errRepoExists
@jbenet
2015-01-13 03:09:33 -08:00
Brian Tiger Chow
97b865ff6f fix(init): simpler initialization logic
@jbenet this removes everything under the path
2015-01-13 03:09:33 -08:00
Brian Tiger Chow
4aba282379 feat(fsrepo): handle safe Removal 2015-01-13 03:09:33 -08:00
Brian Tiger Chow
80c2e97692 refactor(main): use fsrepo to load config 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
1b700864f9 refactor(repo): all config writes must go through repo 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
405afd2a02 refactor(config, repo): all writes go through FSRepo. next: privatize these 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
c2877b2045 refactor(init, repo): init logs in fsrepo 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
c5da1561b9 check datastore directory when opening the repo for use 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
0d88f70c6e feat(init): remove datastore path override 2015-01-13 03:09:31 -08:00
Brian Tiger Chow
fa4cfe8da2 refactor(init, fsrepo): go through repo to write to config 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
a2d1e3395e refactor(init): write config at top level 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
44f3d95c3b refactor(repo/fsrepo): use repo to check whether config exists 2015-01-13 03:09:30 -08:00
Brian Tiger Chow
5b3164de5c refactor(repo/config) move config under repo 2015-01-13 03:09:30 -08:00
Juan Batiz-Benet
cac7e025b8 daemon: log error from gateway 2015-01-12 01:31:59 -08:00
Juan Batiz-Benet
4afb4e090f daemon gateway async 2015-01-12 01:14:32 -08:00
Juan Batiz-Benet
2c83cd5627 daemon: only try gateway addr if there 2015-01-12 01:05:15 -08:00
Juan Batiz-Benet
f215eee3ed gateway: cleaned up ServeHTTP func 2015-01-12 01:01:22 -08:00
Juan Batiz-Benet
ed41ac27fd daemon: refactor common parts of serve funcs 2015-01-12 01:01:21 -08:00
Matt Bell
f39f3fe432 cmd/ipfs: Redirect requests to /webui to webui app 2015-01-11 22:15:33 -08:00
Matt Bell
b5300f1d27 cmd/ipfs: Added gateway MIME type resolution 2015-01-11 22:15:33 -08:00
Matt Bell
e25b08231c cmd/ipfs: Renamed 'ipfsHandler' to 'gatewayHandler' 2015-01-11 22:15:33 -08:00
Matt Bell
cb84a376bd cmd/ipfs: Added an ipfsHandler constructor 2015-01-11 22:15:33 -08:00
Simon Kirkby
64cb1b6bf8 CR updates
replaced H
moved internal errors into function.

Signed-off-by: Simon Kirkby <tigger@interthingy.com>
2015-01-11 22:15:33 -08:00
Simon Kirkby
32823d2085 Static Website serving and listing
adds
 trailing slash redirection
 index.html return
 templated directory listing

Signed off : Simon Kirkby <tigger@interthingy.com>
2015-01-11 22:15:33 -08:00
Matt Bell
9119435cb6 cmd/ipfs: Added gateway server to daemon 2015-01-11 22:15:32 -08:00
Brian Tiger Chow
57b3ffa533 feat: new core constructor + config options (Standard, Online, Offline) 2015-01-11 01:23:25 -08:00
Juan Batiz-Benet
e1cde6bc8c Merge pull request #462 from jbenet/feat/indirect
Implement recursive indirect block creation for DAGs
2015-01-06 12:08:28 -08:00
Jeromy
e3cf893616 implement recursive indirect blocks
improve efficiency of multilayered indirect blocks

clean up tests

panic cleanup

clean up logic, improve readability

add final root node to the dagservice upon creation

importer: simplified dag generation

test: updated hashes using latest code

@whyrusleeping this is why the sharness tests
were failing: the hashes are added manually to
make sure our generation doesn't change.

cleanup after CR

fix merkledag tests

fix small block generation (no subblocks!)
2015-01-06 19:43:56 +00:00
Juan Batiz-Benet
517d3e99b8 bootstrap addrs: moved parsing around
this commit:
* moves parsing of bootstrap peers into config
* moves location of bootstrap addrs into core/commands
* refactor `*BootstrapPeer -> BootstrapPeer
2015-01-06 00:25:17 -08:00
Juan Batiz-Benet
64cb32dadd disable utp
utp is BROKEN!! it causes tests to fail.
2015-01-05 00:16:53 -08:00
Juan Batiz-Benet
cf62f63b58 better daemon + main exit semantics 2015-01-04 00:47:27 -08:00
Juan Batiz-Benet
e21b1f662b fuse mount lifecycle fixes
This commit cleans up how mounting was being done.
It now successfully signals when it is properly mounted
and listen to close signals correctly.
2015-01-04 00:47:27 -08:00
Juan Batiz-Benet
cc0d7c9b57 crypto -> p2p/crypto
The crypto package moves into p2p. Nothing in it so far is ipfs
specific; everything is p2p-general.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
89f5cd4c94 introducing p2p pkg
I think it's time to move a lot of the peer-to-peer networking
but-not-ipfs-specific things into its own package: p2p.
This could in the future be split off into its own library.
The first thing to go is the peer.
2015-01-02 08:46:45 -08:00
Juan Batiz-Benet
c84a714b16 peer change: peer.Peer -> peer.ID
this is a major refactor of the entire codebase
it changes the monolithic peer.Peer into using
a peer.ID and a peer.Peerstore.

Other changes:
- removed handshake3.
-	testutil vastly simplified peer
-	secio bugfix + debugging logs
-	testutil: RandKeyPair
-	backpressure bugfix: w.o.w.
-	peer: added hex enc/dec
-	peer: added a PeerInfo struct
  PeerInfo is a small struct used to pass around a peer with
 	a set of addresses and keys. This is not meant to be a
 	complete view of the system, but rather to model updates to
 	the peerstore. It is used by things like the routing system.
-	updated peer/queue + peerset
-	latency metrics
-	testutil: use crand for PeerID gen
 	RandPeerID generates random "valid" peer IDs. it does not
 	NEED to generate keys because it is as if we lost the key
 	right away. fine to read some randomness and hash it. to
 	generate proper keys and an ID, use:
 	  sk, pk, _ := testutil.RandKeyPair()
 	  id, _ := peer.IDFromPublicKey(pk)
 	Also added RandPeerIDFatal helper
- removed old spipe
- updated seccat
- core: cleanup initIdentity
- removed old getFromPeerList
2014-12-23 08:33:32 -08:00
Markus Amalthea Magnuson
dbefedbb2e Fix typo.
”configurationx” -> ”configuration”
2014-12-14 20:55:29 +01:00
Juan Batiz-Benet
e7edeca392 added log.Events to secio 2014-12-12 03:29:09 -08:00
Juan Batiz-Benet
5b142948ab seccat (to test sio) 2014-12-12 02:45:23 -08:00
Juan Batiz-Benet
ac2be0b68b util/log: SetDebugLogging 2014-12-12 02:45:22 -08:00
Brian Tiger Chow
fb45e7b7fb fix: name
editing in the browser here goes nothing
2014-12-09 15:27:02 -08:00
Brian Tiger Chow
c2c95d1105 start threading context through the system
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-09 07:11:48 -08:00
Brian Tiger Chow
6780228765 fix: seed the random number generator
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-09 00:06:53 -08:00
Brian Tiger Chow
bd685045c8 fix: uranus and saturn IP addresses
Mistake: Saturn referred to the NY node and vice versa.

Correction: Fittingly, Uranus is in NY and _S_aturn is _S_ingapore.

I'll have to reboot the testnet to rectify the changes.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-08 23:19:52 -08:00
Brian Tiger Chow
af01e0a53c add names
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-07 17:45:49 -08:00
Brian Tiger Chow
7ea2b2d80e feat(bootstrap!) add saturn, neptune, pluto, uranus
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-07 17:07:15 -08:00
Jeromy
e8536db351 make bitswap sub-RPC's timeout (slowly for now) 2014-12-05 20:53:33 +00:00
Jeromy
514b26e2b8 remove sigquit from handled signals 2014-12-05 20:53:33 +00:00
Brian Tiger Chow
8d6f2ed0bc chore(main) move logging statement to more appropriate place
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-27 17:06:20 -08:00
Brian Tiger Chow
9e6177ef2e log(main) add log event for executing pre-command hooks
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:39 -08:00
Brian Tiger Chow
b5dc686fda feat(main) create root context
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-25 06:16:39 -08:00
Matt Bell
706ebe8d24 daemon: Set allowed API origins in API_ORIGIN environment variable 2014-11-25 06:12:35 -08:00
Brian Tiger Chow
90ed148209 fix(eventlog) apply settings upon initialization
This commit applies the logging settings to the logging system upon
initialization `ipfs init` and `ipfs daemon --init`.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-24 16:05:51 -08:00
Brian Tiger Chow
4d497f1c6e refactor(repo) mv ConfigureLogger to repo package
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Conflicts:
	cmd/ipfs/main.go
2014-11-24 16:05:51 -08:00
Brian Tiger Chow
2c38487eb0 fix(eventlog) configure logging if repo is initialized
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-24 16:05:51 -08:00
Christian Couder
8b8b6ce9e2 Remove dot and slash before files in cmd/ipfs/.gitignore
It looks like files are not ignored when they are listed
starting with ./ in a .gitignore file.

At least this is true for me on Linux for the "ipfs"
binary in "cmd/ipfs/.gitignore".

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
2014-11-22 21:55:12 +01:00
Jeromy
34da5f039c log formatting (info -> infof) 2014-11-21 03:54:26 +00:00
Juan Batiz-Benet
a1dcbbad80 init: note about addrs 2014-11-20 09:15:48 -08:00
Juan Batiz-Benet
1a5cb300cb config: swarm is list of addrs 2014-11-20 09:14:48 -08:00
Juan Batiz-Benet
43452fdeb7 updated multiaddr + multiaddr-net
I broke out multiaddr/net to its own package so
that multiaddr parsing could remain lean. multiaddr-net
will vendor special implementations of protocols (like utp)
2014-11-20 00:58:48 -08:00
Juan Batiz-Benet
a7d1fd42d8 updating daemon addr output 2014-11-18 08:19:25 -08:00
Brian Tiger Chow
e12edd2053 fix(daemon) ensure IPFS is initialized before starting the daemon
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-18 06:42:44 -08:00
Juan Batiz-Benet
5aaa45db9a transitioned ipfs2 -> ipfs 2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
ad3f3e003f removed old commands files
https://www.youtube.com/watch?v=kyFyAqLtHq8
2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
2b32e698d0 remove ipfs2 from gitignore 2014-11-18 06:15:00 -08:00
Juan Batiz-Benet
f43954fcd1 ensure node constructed is online for daemon 2014-11-18 05:20:04 -08:00
Juan Batiz-Benet
d3c9c5978e remove daemon node constructor 2014-11-18 03:47:28 -08:00
Matt Bell
7a4491ada3 Added --mount flag to mount when running 'ipfs daemon' 2014-11-18 03:31:32 -08:00
Matt Bell
d1f1d2f5bf core/commands2: Fixed commands to use string arguments 2014-11-18 02:13:55 -08:00
Juan Batiz-Benet
eba0599dd2 bugfix: node teardown is the last man to go down
Warning: during normal execution node teardown must be the
last thing that happens because command requests return
io.Readers, which may still be constructing or processing
their output. The node (and its subservices) is needed for
this. good night and good luck.
2014-11-17 23:13:18 -08:00
Brian Tiger Chow
8d4c21694c fix
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:19 -08:00
Brian Tiger Chow
7cebc3cc38 inline prints
looking forward to fixing these again

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:19 -08:00
Brian Tiger Chow
ef65bb1ce3 revert to debug error
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
bc396610de fix(2/daemon) initialized --> init
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
061200452f feat(2/daemon) --initialized
@jbenet

now, ipfs can be built and executed in one step:
```
docker run jbenet/go-ipfs daemon --initialized
```

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
2bbfe4d56f debug(core, datastore, daemon) wrap errors
@jbenet @whyrusleeping @mappum

very helpful for tracking down errors. the stack traces are only
shown when debug mode is visible. They function best when caught at the
source.

I propose we use this errors package as a drop-in replacement for
fmt.Errorf and errors.New in all of our code, and use errors.Wrap for
external errors as they emerge from others' libraries.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
d0a3f9ba9a feat(2/init) expose init with defaults
will support daemon initialization

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
6a380ff532 refactor(2/init) use util.FileExists
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
c883f7dc36 refactor(2/init) extract const
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:18 -08:00
Brian Tiger Chow
81f5d6fd5f debug(2/ipfs) make cmdDetails loggable
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-17 22:36:17 -08:00
Brian Tiger Chow
cf8fb87df1 refactor(errors) debugerror -> errors
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-17 00:44:18 -08:00
Brian Tiger Chow
c4ea0b78ba fix(2/init) msg
@jbenet i presume you prefer it without the period

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 08:28:08 -08:00
Brian Tiger Chow
c8c062fe13 refactor(config/init) add hooks to identity generation. useful for displaying messages to the user
@jbenet this commit re-introduces the peer identity line. It's very
useful. I understand it may have been removed because of the clashing of
the IDs. To alleviate this, this commit places some negative space
between the two lines.

'to test' -> 'to get started' as a stronger call to action

```
λ. ipfs2 init -f
initializing ipfs node at /Users/btc/.go-ipfs
generating key pair...done.
peer identity: QmWzjxNEYKjDAxuHJqvtLP1dZTDjreBSUsArWoHai1v9yP

to get started, enter: ipfs cat QmYpv2VEsxzTTXRYX3PjDg961cnJE3kY1YDXLycHGQ3zZB
```

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 08:13:26 -08:00
Brian Tiger Chow
1c4c7412b4 fix(misc) address PR comments
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:40:05 -08:00
Brian Tiger Chow
02d8da09ae fix(2/init) message displayed during init
TODO use a writer to get the command output

resulting appearance:
```
go-ipfs (feat/machine-readable-logging) λ. make install_2; ipfs2 init -f
cd cmd/ipfs2 && go install
initializing ipfs node at /Users/btc/.go-ipfs
generating key pair...
peer identity: %s QmcPLgrqfvnneJ3vr3oGpkTiS9Psx8p3HxevjnoZYToDRm
```

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:01 -08:00
Brian Tiger Chow
6fec76d93e fix(imports) misc
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
25c98e8e61 refactor(eventlog) elog -> eventlog
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
ac69aba561 feat(2/main) configure event logger
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
be62b76516 refactor(2/main) use debugerror
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
3a927cbcec feat(init) init logs upon config initialization
TODO allow user dir override

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)

Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
d28c9cc7b4 refactor(init) extract initCheckDir function
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

# TYPES
# feat
# fix
# docs
# style (formatting, missing semi colons, etc; no code change):
# refactor
# test (adding missing tests, refactoring tests; no production code change)
# chore (updating grunt tasks etc; no production code change)
2014-11-16 07:01:00 -08:00
Brian Tiger Chow
4cadbc1673 style rename for clarity
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
15f850f08c refactor(2/main) helper methods for details object
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
55896a86d6 logs(2/main) place log statements approppriately
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:59 -08:00
Brian Tiger Chow
2c88e342db feat(elog) implement event logger
a wrapper around the util.Logger
metadata is loggable

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 07:00:58 -08:00
Brian Tiger Chow
57689ffc2b fix(2/version) make it possible to execute before init
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-16 03:20:10 -08:00
Juan Batiz-Benet
e290b54d9e Merge pull request #351 from jbenet/mount-fixes
Mount, Daemon, and Signal Handler Fixes
2014-11-16 02:40:31 -08:00
Juan Batiz-Benet
4ac6db9a24 ipfs1/mount: text + unmounting 2014-11-16 02:35:13 -08:00
Juan Batiz-Benet
13c390b0b5 fix ipfs1 mount so it will compile 2014-11-16 02:30:29 -08:00
Juan Batiz-Benet
705465db8b main + daemon signal handlers
This commit changes the signal handler to be added once
the command is executing. this is because the daemon
has its own signal handler, that must try to shut down
the node gracefully first. You know, just in case.
2014-11-16 02:22:43 -08:00
Juan Batiz-Benet
99f2378bac mount: fixed mount init + teardown
This commit adds a Mount abstraction (which is really just
a wrapped context closer). It makes sure to bind the mount
to the fate of the Node (i.e. close it if the node ends).
This fixes #350
2014-11-16 01:42:42 -08:00
Juan Batiz-Benet
61c1e39a51 Merge pull request #266 from jbenet/defaulthash
add in a default file hash and cleaned up init function a bit
2014-11-16 00:21:18 -08:00
Juan Batiz-Benet
ab09c3649c defaulthash: let's not ignore errors
@maybebtc fixed it. cc @whyrusleeping
2014-11-15 22:55:58 -08:00
Juan Batiz-Benet
7596bcce2d cleaned up ipfs init 2014-11-15 22:50:42 -08:00
Juan Batiz-Benet
7806973e67 vendor manners 2014-11-15 22:21:52 -08:00
Juan Batiz-Benet
8cf765af33 daemon: listen for term signals 2014-11-15 22:11:11 -08:00
Jeromy
e857a5bc9f move default hash into ipfs2, committed on freemont troll 2014-11-15 18:28:54 -08:00
Jeromy
ab805f3382 add in a default file hash and cleaned up init functiona bit 2014-11-15 17:50:05 -08:00
Juan Batiz-Benet
3df1513ea6 cmds: fixed help stdio use 2014-11-15 09:04:49 -08:00
Brian Tiger Chow
162169af77 fix(2/main) respect IPFS_LOGGING == debug behvaior
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-15 02:10:53 -08:00
Brian Tiger Chow
e940643f20 docs
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-15 01:00:09 -08:00
Brian Tiger Chow
56d732f9b1 fix(2/main) s/preemptsUpdates/preemptsAutoUpdate
addresses...

https://github.com/jbenet/go-ipfs/pull/336#discussion_r20397834

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-15 00:39:28 -08:00
Brian Tiger Chow
408fadc8be fix(2/main) don't check for updates when running init
@jbenet @mappum

Yeah, there's some duplicated work. But there's also a separation of
concerns. In one case, we check to determine where the command should
run. In the other case, we check to determine which hooks should run.
Having these actions separated reduces complexity in a nice way.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 17:04:54 -08:00
Brian Tiger Chow
eb5bb1daa8 feat(debugerror)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

impl errorf

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>

return a debug error

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 17:04:48 -08:00
Brian Tiger Chow
ee378e2fbd fix(test) tour content struct now exists
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:31:06 -08:00
Juan Batiz-Benet
fa8fc1aefc cmds2: check for updates 2014-11-14 03:20:46 -08:00
Matt Bell
1abe97617e main: Pass Stdin to CLI request parser 2014-11-14 03:20:11 -08:00
Brian Tiger Chow
8b07b35467 ignore binary
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:09 -08:00
Juan Batiz-Benet
e0ba14c0eb cmds2: use cmdDetails on level cmds 2014-11-14 03:20:09 -08:00
Brian Tiger Chow
0eeed7cc68 add string method to command details
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:09 -08:00
Brian Tiger Chow
65eb1d86fa rm todos
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:08 -08:00
Brian Tiger Chow
476aab9552 rm unused tests
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:08 -08:00
Brian Tiger Chow
1065ae45aa s/number/id "the id of the topic you'd like to tour"
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:08 -08:00
Brian Tiger Chow
f1c20b4e3a don't use the marshaler
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:08 -08:00
Brian Tiger Chow
35da357dc5 fix(tour) patch up and verify tour output
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
Brian Tiger Chow
c99e9e6000 feat(details) add funcs to negate negations
not immediately useful, but nice to have

tagging you to make sure i didn't make a mistake here @jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
Brian Tiger Chow
5c4fa5a783 feat(tour) show list of topics when user tries to view topic that doesn't exist
eg.

```
ipfs2 (cmd-ref-part2) λ. go build ./...; ./ipfs2 tour 0

Tour 0 - Hello Mars

Hello Mars

ipfs2 (cmd-ref-part2) λ. go build ./...; ./ipfs2 tour 10

ERROR
    no topic with id: 10

TOPICS

    0 - Hello Mars
    0.1 - Hello Mars 2

```
2014-11-14 03:20:07 -08:00
Juan Batiz-Benet
afa5eedb44 cmds2: commandShouldRunOnDaemon
This commit adds the pretty-complicated decision function
to check whether a command should run on the daemon.

@maybebtc @mappum double check the logic?
2014-11-14 03:20:07 -08:00
Juan Batiz-Benet
bb8d4ebd6b cmds2: cmdDetailsMap 2014-11-14 03:20:07 -08:00
Brian Tiger Chow
ca2828f33c feat(commands) add ClientError(msg) helper and use it to return a fancy error to the client in the tour
@jbenet this exists now

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
Brian Tiger Chow
c5e75f91a6 tests(2/main) errClient
Discovered this quirk about interfaces.

@whyrusleeping
@mappum
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00
Brian Tiger Chow
0a93f9d764 style(tour) newline at the end
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:06 -08:00
Matt Bell
db361d9403 commands/cli: Made Parse return an error if request has unrecognized options 2014-11-14 03:20:06 -08:00
Matt Bell
815efdb125 daemon: Added a ShortDescription 2014-11-14 03:20:06 -08:00
Brian Tiger Chow
ff6c4ce6a4 test(tour) ensure template renders without failure
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:06 -08:00
Juan Batiz-Benet
047d2e2d62 cmd2: Marshaller -> Marshaler (see golang/encoding)
Also:
- map[cmds.EncodingType]cmds.Marshaller -> MarshalMap

cc @mappum @maybebtc
2014-11-14 03:20:05 -08:00
Matt Bell
c973776049 main: Fixed logical error in remote/local check 2014-11-14 03:20:05 -08:00
Matt Bell
e700b16576 Ported remaining command helptext to HelpText struct 2014-11-14 03:20:05 -08:00
Matt Bell
b4735eb10b main: Test if commands are local-only when choosing daemon vs. local 2014-11-14 03:20:04 -08:00
Matt Bell
188bf779db Removed cmdInvocation.root 2014-11-14 03:20:03 -08:00
Matt Bell
9afb85714a commands/cli: Don't return root in Parse 2014-11-14 03:20:03 -08:00
Matt Bell
b7b15b8b30 cmd/ipfs2: Added isLocal function for testing if a command is local only 2014-11-14 03:20:03 -08:00
Matt Bell
2dd6f24157 core/commands2: Refactored some commands to HelpText struct for helptext fields 2014-11-14 03:20:03 -08:00
Matt Bell
2fd8f39c65 cmd/ipfs2: Added comments to explain purpose of CLI root 2014-11-14 03:20:03 -08:00
Juan Batiz-Benet
7daf888902 cmds2: handle error return codes 2014-11-14 03:20:03 -08:00
Juan Batiz-Benet
d18902df27 cmds2: changed how the ctx.Node works 2014-11-14 03:20:02 -08:00
Juan Batiz-Benet
3352aeee15 cmds2: fixed show help on root + noncallable 2014-11-14 03:20:02 -08:00
Juan Batiz-Benet
f738e899c2 cmd2: simplified main
Attention @maybebtc @mappum

I cleaned up + simplified the main flow. Now, all printing
is contained inside main itself! (:cheer:). I do this with
the help of a cmdInvocation struct that has both
a Parse and Run. The only major clunkiness left is that the
"CallCommand" is still its own function. But *shrug*.

Please test it works as we would expect. i changed much of
the flow, so likely that i missed a complicated edge case.

main roadmap:
- parse the commandline to get a cmdInvocation
- if user requests, help, print it and exit.
- run the command invocation
- output the response
- if anything fails, print error, maybe with help
2014-11-14 03:20:02 -08:00
Matt Bell
092524fcbb cmd/ipfs2: Added a 'commands' command for CLI root 2014-11-14 03:20:01 -08:00
Matt Bell
fd8b1930af cmd/ipfs2: Copy subcommands from core/commands2 root into cmd/ipfs2 root 2014-11-14 03:20:01 -08:00
Brian Tiger Chow
4e740f63eb docs(ipfs2/main)
@mappum

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:01 -08:00
Brian Tiger Chow
22a4cc7d30 fix(ipfs2) output info to logger when checking daemon status 2014-11-14 03:20:01 -08:00
Juan Batiz-Benet
a2d06b5f9a cmds2: errHelpRequested error 2014-11-14 03:20:01 -08:00
Matt Bell
78bc748342 cmd/ipfs: Fixed bug where handleParseError sets error to nil 2014-11-14 03:19:59 -08:00
Juan Batiz-Benet
ec8be23cbc cmds/main decomposed handleParseError 2014-11-14 03:19:59 -08:00
Brian Tiger Chow
7060e7dfe2 rename variable 2014-11-14 03:19:58 -08:00
Brian Tiger Chow
fed2f8d2c6 fix(2/main) option value signature 2014-11-14 03:19:58 -08:00
Brian Tiger Chow
013d98a35a fix(2/init, 2/add) fix optionvalue signature 2014-11-14 03:19:58 -08:00
Matt Bell
7a505b44c7 Handle -h and --help differently (short text vs long text) 2014-11-14 03:17:42 -08:00
Matt Bell
c76a52e422 cmd/ipfs2: Show short help text instead for usage errors 2014-11-14 03:17:42 -08:00
Matt Bell
4970d8b5a3 commands/cli: Use template for helptext generation 2014-11-14 03:17:41 -08:00
Matt Bell
e23b537f32 Override root command help text 2014-11-14 03:17:41 -08:00
Matt Bell
b358bb3ffd cmd/ipfs2: Added comment to explain default encoding logic 2014-11-14 03:17:40 -08:00
Matt Bell
aea2fce987 cmd/ipfs2: Added explanation comment to ipfsHandler 2014-11-14 03:17:40 -08:00
Matt Bell
4902361fd5 cmd/ipfs2: Updated readme 2014-11-14 03:17:40 -08:00
Matt Bell
c468a4dbf5 core/commands2: Use Argument constructors in commands 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
8b14012bba refactor(ipfs2/main) rm exit 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
ad5ad912ce refactor(ipfs2/main) use guard 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
74b38cb65f refactor(ipfs2/main) change the way we handle profiling 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
d72af9c910 refactor(ipfs2/main) return err 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
9268bdd56e refactor(ipfs2/main) replace with equivalent action 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
fa5ca3f27f refactor(ipfs2/main) output response 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
cda68a19d0 refactor(ipfs2/main) return err 2014-11-14 03:17:39 -08:00
Brian Tiger Chow
13a90537d6 refactor(ipfs2/main)
* bring debug checking back to top level so we have more control over
  CPU profiling.

* bring help text up to top level so we can exit from the program
  at the top level instead of within an arbitrary function
2014-11-14 03:17:38 -08:00
Brian Tiger Chow
2473d2d720 refactor(ipfs2/main) same for debug 2014-11-14 03:17:38 -08:00
Brian Tiger Chow
28be8a6171 refactor(ipfs2/main) check err before 2014-11-14 03:17:38 -08:00
Brian Tiger Chow
f79f1267f7 refactor(ipfs2/main) split lines 2014-11-14 03:17:38 -08:00
Brian Tiger Chow
203a0723ba refactor(ipfs2/main) return errors in main 2014-11-14 03:17:38 -08:00
Matt Bell
17c5923160 core/commands2: Fixed init option definition 2014-11-14 03:17:38 -08:00
Matt Bell
3e507f7c9f commands: Changed option accessor API (Request#Option now returns an OptionValue) 2014-11-14 03:17:38 -08:00
Matt Bell
d700a2ce87 cmd/ipfs2: Cleaned up main option checking (no longer need temporary Request) 2014-11-14 03:17:37 -08:00
Matt Bell
8ee3e996cc core/commands2: Use Option constructors in commands 2014-11-14 03:17:37 -08:00
Matt Bell
3e30093c2b core/commands2: Updated commands to new Run function API 2014-11-14 03:17:37 -08:00
Brian Tiger Chow
f4d0b8baa0 clarity(util) ToReaders -> CastToReaders 2014-11-14 03:17:36 -08:00
Brian Tiger Chow
38a6d0ead0 fix(init) version 2014-11-14 03:17:36 -08:00
Brian Tiger Chow
8ffd27a6e1 fix(init) inline bootstrap peers 2014-11-14 03:17:36 -08:00
Matt Bell
b3ea49954a cmd/ipfs2: Handle SIGTERM 2014-11-14 03:17:35 -08:00
Matt Bell
cc519c47a3 cmd/ipfs2: Ensure process exits smoothly 2014-11-14 03:17:35 -08:00
Matt Bell
35983b480a cmd/ipfs2: Made '/ipfs' handler return more accurate HTTP response codes, resolves #287 2014-11-14 03:17:35 -08:00
Matt Bell
897e0f869f cmds/ipfs2: Added '/ipfs' HTTP handling 2014-11-14 03:17:35 -08:00
Matt Bell
3d94e89dd1 cmd/ipfs2: Made error messages more visible 2014-11-14 03:17:34 -08:00
Matt Bell
165c69543b cmd/ipfs2: Output generated help text on error or help flag 2014-11-14 03:17:34 -08:00
Matt Bell
2b8ef917b8 cmd/ipfs2: Added descriptions for 'init', 'tour' 2014-11-14 03:17:33 -08:00
Brian Tiger Chow
aa1c3cae4a fix(tour) variadic -> false 2014-11-14 03:17:31 -08:00
Brian Tiger Chow
99d5098450 named imports 2014-11-14 03:17:31 -08:00
Matt Bell
7ead660738 cmd/ipfs2: Set all loggers to DEBUG level when running with 'debug' flag 2014-11-14 03:17:30 -08:00
Brian Tiger Chow
520240d385 feat(commands2/tour) impl 2014-11-14 03:17:30 -08:00
Brian Tiger Chow
c65b01c55c fix(add) cast safely 2014-11-14 03:17:30 -08:00
Brian Tiger Chow
084ffd97aa fix(cli) tear down node 2014-11-14 03:17:30 -08:00
Matt Bell
1cb94a1231 cmd/ipfs2: Display subcommand help text on parse error 2014-11-14 03:17:27 -08:00
Brian Tiger Chow
d180832f3e add todo 2014-11-14 03:17:26 -08:00
Brian Tiger Chow
8960a4ff8b TODO(ipfs2/init) add FIXME note as a reminder about
c6b74207bc
2014-11-14 03:17:26 -08:00
Brian Tiger Chow
79015e7891 fix(ipfs2/init) declarative 2014-11-14 03:17:26 -08:00
Brian Tiger Chow
e305e45e81 fix(ipfs2/init) identity 2014-11-14 03:17:26 -08:00
Brian Tiger Chow
62fd9166ce fix(ipfs2/init) datastore 2014-11-14 03:17:26 -08:00
Brian Tiger Chow
542c2a2da3 fix(ipfs2/init) extract bootstrap 2014-11-14 03:17:26 -08:00
Brian Tiger Chow
96fd88e916 feat(ipfs2/main) port mem-profiling from previous main
was added 5 days ago in...

7510ef2081
2014-11-14 03:17:26 -08:00
Brian Tiger Chow
46f1afbe08 refactor(init) re-order 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
a1e738e297 docs(init) rename filename var 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
8d7ebcb582 refactor(init) rename extracted method 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
3b7983e028 refactor(init) extract response 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
1b5e4032ff refactor(init) extract context 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
f3048ab712 refactor(init) extract bits flag 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
630b88d227 refactor(init) extract force flag 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
b987c99eea refactor(init) extract dspath 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
3c8657503c refactor(init) check file after 2014-11-14 03:17:25 -08:00
Brian Tiger Chow
d894924152 refactor(init) return an error 2014-11-14 03:17:24 -08:00
Brian Tiger Chow
faf6454df6 refactor(init) extract method 2014-11-14 03:17:24 -08:00
Brian Tiger Chow
fee3b0dd31 +2 characters for readability 2014-11-14 03:17:24 -08:00
Brian Tiger Chow
c67e377162 docs(ipfs2/daemon) add some copy
can replace if desired, but at least it's not an end-user TODO
2014-11-14 03:17:24 -08:00
Matt Bell
283c175fc4 commands/http: Refactored API to a Client object that takes a string address 2014-11-14 03:17:24 -08:00
Matt Bell
f95476c19a commands: Allow overriding marshaller for any encoding type 2014-11-14 03:17:24 -08:00
Matt Bell
3dd7a9a5c8 cmd/ipfs2: Broke up main into subfunctions 2014-11-14 03:17:23 -08:00
Matt Bell
7c1e45786a cmd/ipfs2: Stricter option type coercion in main 2014-11-14 03:17:23 -08:00
Matt Bell
7d4d55a84d commands/http: Unexported Handler fields and created constructor 2014-11-14 03:17:23 -08:00
Matt Bell
39a60e7f1d commands: Return a reader in a Response#Reader method, instead of making Response implementing io.Reader 2014-11-14 03:17:23 -08:00
Matt Bell
6bab1f47fb commands: Removed inpout stream from Request 2014-11-14 03:17:22 -08:00
Matt Bell
d8afd9a9bb cmd/ipfs: Show usage text if input fails to parse 2014-11-14 03:17:21 -08:00
Matt Bell
cac8844b8d cmd/ipfs: Reverted back to secondary CLI root command 2014-11-14 03:17:21 -08:00
Matt Bell
9356e1a0a1 cmd/ipfs: Moved private commands to core/commands2 2014-11-14 03:17:21 -08:00
Matt Bell
fb12530822 cmd/ipfs2: Got rid of second root command in favor of Command#Private 2014-11-14 03:17:21 -08:00
Matt Bell
e01f1ba8a1 cmd/ipfs2: daemon command: Handle lock before initializing node 2014-11-14 03:17:20 -08:00
Matt Bell
decda21889 cmd/ipfs2: Changed command variable naming convention 2014-11-14 03:17:20 -08:00
Matt Bell
9fb20dabb3 cmd/ipfs2: Added init command 2014-11-14 03:17:20 -08:00
Brian Tiger Chow
db7a42e73c refactor(cmd/ipfs2) rename to match cmd/ipfs1 2014-11-14 03:17:20 -08:00
Brian Tiger Chow
b3e7cbb9a5 refactor(commands) swap argument order to match Http(w, r) idiom 2014-11-14 03:17:20 -08:00
Brian Tiger Chow
026c30fa71 fix(cmd/ipfs2/daemon) imports 2014-11-14 03:16:06 -08:00
Brian Tiger Chow
93e959a459 fix(cmd/ipfs2, commands) imports 2014-11-14 03:16:05 -08:00
Brian Tiger Chow
510a4a9093 move new commands to new place 2014-11-14 03:16:05 -08:00
Brian Tiger Chow
3d9331512d move originals back to ipfs 2014-11-14 03:16:05 -08:00
Brian Tiger Chow
b3a96d2bb3 move temporarily 2014-11-14 03:16:04 -08:00
Matt Bell
aea52132cb cmd/ipfs: Initialize IpfsNode when running locally or starting daemon 2014-11-14 03:16:04 -08:00
Matt Bell
54587897c1 cmd/ipfs: Default to plaintext encoding if avilable, otherwise JSON 2014-11-14 03:16:04 -08:00
Matt Bell
b3ff407d38 commands: Gave Requests a reference to the command they are being called on 2014-11-14 03:16:04 -08:00
Matt Bell
4bbd579068 cmd/ipfs: Added 'local' flag to call command locally instead of executing on daemon 2014-11-14 03:16:03 -08:00
Matt Bell
063cb536df cmd/ipfs: Display help text when help flag is set 2014-11-14 03:16:03 -08:00
Matt Bell
8edfee2a58 cmd/ipfs: Removed new commands (to be refactored later) 2014-11-14 03:16:03 -08:00
Matt Bell
c679783084 cmd/ipfs: Log to show API server is listening 2014-11-14 03:16:03 -08:00
Matt Bell
0b73a48b84 commands/http: Made Handler set request contexts 2014-11-14 03:16:03 -08:00
Matt Bell
3f4da97c58 cmd/ipfs: Use daemon lock functions 2014-11-14 03:16:03 -08:00
Matt Bell
7efa174f2d cmd/ipfs: Made daemon command use request context instead of loading config 2014-11-14 03:16:03 -08:00
Matt Bell
2419ffdb2d cmd/ipfs: Load config and put in request context 2014-11-14 03:16:02 -08:00
Matt Bell
7d53e736cf cmd/ipfs: Added getConfig function 2014-11-14 03:16:02 -08:00
Matt Bell
cf60fdd3d9 cmd/ipfs: Load API address from config 2014-11-14 03:16:02 -08:00
Matt Bell
e2ed10b85b cmd/ipfs: Use lock to check if daemon is running, if not then run command locally 2014-11-14 03:16:02 -08:00
Matt Bell
e011d950bb cmd/ipfs: Obtain lock when starting daemon 2014-11-14 03:16:02 -08:00
Matt Bell
d87aad1e3a cmd/ipfs: Do command option conversion in CLI entry point 2014-11-14 03:16:02 -08:00
Matt Bell
b4fc0dba96 cmd/ipfs: Added basic daemon command 2014-11-14 03:16:02 -08:00
Matt Bell
e82532c7d1 cmd/ipfs: Added ipfs.exe to .gitignore 2014-11-14 03:16:02 -08:00
Matt Bell
36bdc456d2 commands/http: Moved HTTP RPC into commands/http package 2014-11-14 03:16:01 -08:00
Matt Bell
201ad30a7b cmd/ipfs: Run CLI-specific subcommands locally in CLI entry point 2014-11-14 03:16:01 -08:00
Matt Bell
ccfb10dde0 cmd/ipfs: Added root command for CLI-specific subcommands (init, daemon, etc.) 2014-11-14 03:16:01 -08:00
Matt Bell
c89826c1ef cmd/ipfs: Added HTTP RPC client to entry point 2014-11-14 03:16:01 -08:00
Matt Bell
26495b799d cmd/ipfs: Deleted existing CLI commands (to be refactored for the commands API) 2014-11-14 03:16:01 -08:00
Matt Bell
3e062f6e1e cmd/ipfs: Rewrote entry point to invoke commands via new command API 2014-11-14 03:16:01 -08:00
Brian Tiger Chow
d1fa4bd9b5 copy to old location 2014-11-14 03:16:00 -08:00
Brian Tiger Chow
bc6800035b move ipfs commands 2014-11-14 03:16:00 -08:00
Brian Tiger Chow
67bc9cc89d feat(init) display peer id in init command
use case:

Just configured and installed a node.

benefits:

1) reduces friction when setting up a new node

2) reveals useful details about the workings of the system. It's the
user's first encounter with her node's identity. The tour can build on
the user's knowledge.

```
ipfs (maybebtc-november) λ. ipfs init -f
initializing ipfs node at /Users/btc/.go-ipfs
generating key pair
peer identity: QmcRbn41Vc2CvbpLYfN36mAWusErKWvAAHbq92LPra2gFT
```
2014-11-05 10:15:17 -08:00
Juan Batiz-Benet
c6b74207bc config/init: init Version with CheckPeriod #265 2014-11-04 19:15:25 -08:00
Juan Batiz-Benet
866c2c8915 updates + config: moved location of current version number 2014-11-04 18:58:15 -08:00
Juan Batiz-Benet
3eb43d1cb4 mount: darwin osx fuse check fix
committed my test case accidentally :(
2014-11-01 22:38:13 -07:00
Juan Batiz-Benet
7972f3a7ee fixed osx fuse checks 2014-11-01 22:38:12 -07:00
Jeromy
c7ef55a450 move OSX specific calls to build tagged files 2014-10-31 19:46:42 +00:00
Juan Batiz-Benet
ca1bf26744 check osxfuse version. Fixes #202. 2014-10-31 10:10:12 -07:00
Brian Tiger Chow
7510ef2081 feat(cmd/ipfs1) add mem profiling in debug mode
TODO add memory profiling to ipfs2
2014-10-29 18:24:32 -07:00
Brian Tiger Chow
1e847059bc style(cmd/ipfs/pprof) move defer close to initialization 2014-10-29 18:24:32 -07:00
Juan Batiz-Benet
0ee4b3ec77 tour list: left justify 2014-10-26 10:03:38 -07:00
Juan Batiz-Benet
6f7bab389e tour: command 2014-10-26 08:32:08 -07:00
Juan Batiz-Benet
d8eb8b1191 ipfs cmd help now shows update
+ reorder of plumbing
2014-10-22 15:22:01 -07:00
Henry
4f42a26836 fixed --force flag for shutdown after update 2014-10-22 12:42:13 +02:00
Henry
0a0c38fb91 using @jbenet's industrial lipstick to clean this up 2014-10-22 11:25:30 +02:00
Henry
0115d1e0de respect cfg.Version.Check 2014-10-22 11:25:30 +02:00
Henry
cb73ea7ba4 removed duplicate logic 2014-10-22 11:25:30 +02:00
Henry
81f84d6cea updated error messages and explicit import names 2014-10-22 11:25:30 +02:00
Henry
8d41021b89 check AutoUpdate settings and apply 2014-10-22 11:25:30 +02:00
Henry
7ddf3836d0 implemented manual check and update (with signature verification) 2014-10-22 11:25:30 +02:00
Henry
5fa3053e19 added command stubs 2014-10-22 11:24:34 +02:00
Henry
2806260f5c use inconshreveable's go-update to check for updates 2014-10-22 11:24:34 +02:00
Jeromy
65385b37ea fix rm flags 2014-10-22 00:28:41 -07:00
Jeromy
6f750572cd add lock to pinner and rework cli 2014-10-22 00:28:41 -07:00
Jeromy
31b0ff0307 add testing for pins 2014-10-22 00:28:41 -07:00
Juan Batiz-Benet
9e3bfa28bb Merge pull request #185 from cryptix/cmdObjects
object plumbing commands
2014-10-19 16:58:47 -07:00
Juan Batiz-Benet
e989d6febe move IDFromPubKey to peer pkg 2014-10-18 04:28:26 -07:00
Juan Batiz-Benet
d2671afd66 command help spacing 2014-10-18 04:28:23 -07:00
Henry
02659c68b6 fix IPFS_DEBUG (was set after SetupLogging) 2014-10-18 12:03:47 +02:00
Henry
e735addbb2 object plumbing commands 2014-10-18 04:35:12 +02:00
Henry
0631a39492 cleaned up SetupLogging() 2014-10-15 14:23:54 +02:00
Henry
0557b1052d updated cmdIpfsLog help text 2014-10-15 14:04:46 +02:00
Henry
ea76b66b7f output these errors directly to the user 2014-10-15 14:00:03 +02:00
Henry
db1ac7499a added help about wildcard 2014-10-15 13:36:14 +02:00
Henry
3455846b35 add log command 2014-10-15 13:18:00 +02:00
Henry
c98b0e83b4 use log.Error() config.PathRoot() and CmdIpfs.Dispatch() err 2014-10-15 13:18:00 +02:00
Juan Batiz-Benet
8f1c12efe0 addCmd -> nameCmd
Thanks to @cryptix
2014-10-14 03:15:02 -07:00
Henry
a269e46017 fix setupCmdContext() for subcommands (fixes #163) 2014-10-14 10:49:01 +02:00
Henry
f613af438c updated help for block commands 2014-10-14 09:55:14 +02:00
Henry
4abba7bc03 put has no key argument (it's derived from the valfile) 2014-10-14 00:13:12 +02:00
Henry
5b635bb9ea removed old examples from block help 2014-10-13 20:48:37 +02:00
Henry
f93732a9c5 added block get and put commands to daemon 2014-10-13 20:47:09 +02:00
Henry
08bb6f149f templates for block commands (updates #138) 2014-10-13 20:31:14 +02:00
Jeromy
bb84c232e1 make add command use absolute paths and print properly, issue #151 2014-10-10 13:46:51 -07:00
Jeromy
26574b5345 add net-diag to help message 2014-10-10 13:18:20 -07:00
Jeromy
a7b69500b1 address concerns in PR and make log stuff more fun 2014-10-10 13:18:20 -07:00
Jeromy
96af2a1f81 pretty output 2014-10-10 13:18:20 -07:00
Jeromy
5c14df0a13 turn logging back off for @jbenet's sanity 2014-10-10 13:18:19 -07:00
Jeromy
77cec59083 actually put diagCmd into the super command so it can be run 2014-10-10 13:18:19 -07:00
Jeromy
d5f0476c1c implement diagnostics command 2014-10-10 13:18:19 -07:00
Jeromy
280c7e7e06 implement diagnostics service 2014-10-10 13:18:19 -07:00
Juan Batiz-Benet
7652f86c6f fixed a parsing bug on Version.CheckPeriod
And refactored a few names/comments
2014-10-09 20:31:26 -07:00
Peter Borzov
b60f0d582f Limit update checks to once per configurable time period to avoid HTTP request time delay 2014-10-09 19:59:47 -07:00
Peter Borzov
8b90071478 Clean up error/warning messages for consistency 2014-10-09 19:59:32 -07:00
Peter Borzov
98ba0be060 Move versioning/updates stuff to a separate package 2014-10-09 19:59:15 -07:00
Peter Borzov
9f7dc48201 Add supported Version.Check values as consts 2014-10-09 19:58:51 -07:00
Peter Borzov
4c167a42e2 Rename config.Updates to config.Version 2014-10-09 19:58:51 -07:00
Peter Borzov
bd9142f042 Turn on update checker for local nodes 2014-10-09 19:58:19 -07:00
Peter Borzov
f6650b0289 Check for updates:if github releases with higher tag semvers exist 2014-10-09 19:57:59 -07:00
Peter Borzov
c8678666e3 Save ipfs version used to initialize config 2014-10-09 19:57:59 -07:00
Peter Borzov
6f033dd7a1 Initialize Updates.check config setting 2014-10-09 19:57:59 -07:00
Peter Borzov
ecd6f3b00c Add Updates.Check field to Config 2014-10-09 19:57:58 -07:00
Juan Batiz-Benet
ab83c52431 Merge branch 'master' into ipns
Conflicts:
	cmd/ipfs/ipfs.go
2014-10-09 03:46:35 -07:00
Juan Batiz-Benet
2fa43ce46c ipfs name cmd improvements
- cleaned up cmd help
- ipfs name publish [<name>] <ref>
- ipfs name resolve [<name>]
- publish validates <ref>
- both validate n args
2014-10-09 03:39:47 -07:00
Juan Batiz-Benet
ffe2bdceef init SetupLoggers
this is useful so that loggers are all setup during tests
2014-10-08 02:50:42 -07:00
Jeromy
5ba2efc2b8 make tests pass 2014-10-08 04:25:51 +00:00
Juan Batiz-Benet
abefd93fb8 edited bootstrap cmd
- safer parsing
- multiple inputs
- add: dup detection
- common cfg writing
2014-10-06 02:14:05 -07:00
Juan Batiz-Benet
091f6f8516 added getConfig 2014-10-05 17:46:44 -07:00
Siraj Ravel
a2c2c48773 Implement ipfs bootstrap command.
This set of commits implements the bootstrap commands,
following from the description in #117
2014-10-05 17:18:42 -07:00
Juan Batiz-Benet
0c8ae7674e loggers: set level 2014-10-04 03:53:21 -07:00
Juan Batiz-Benet
7e1cd59259 initialize loggers at ERROR 2014-10-04 03:36:30 -07:00
Jeromy
d872e0cce5 move publish and resolve under the 'name' subcommand 2014-10-02 22:30:50 +00:00
Juan Batiz-Benet
a76f6af1df remove old cat 2014-10-02 03:33:20 -07:00
Juan Batiz-Benet
bc0769e370 ipfs + ipns mounts with flags + config 2014-10-02 03:05:49 -07:00
Juan Batiz-Benet
068c0375f9 bugfix: get to root cmd for config flag 2014-10-02 03:05:05 -07:00
Juan Batiz-Benet
7bf7afb7a9 logging on gen 2014-10-02 03:04:48 -07:00
Juan Batiz-Benet
e91b2b8aec use makeCommand for publish + resolve 2014-10-02 02:50:55 -07:00
Juan Batiz-Benet
330ee8c79f added command struct for makeCommand 2014-10-02 02:50:33 -07:00