Commit Graph

557 Commits

Author SHA1 Message Date
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