1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-10 05:52:20 +08:00

67 Commits

Author SHA1 Message Date
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
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
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
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
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
a676b5a8ac move eventlogs to an http endpoint
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-06-18 12:44:01 -07:00
4b337bb7e8 daemon: addressed CR comments 2015-06-08 11:08:10 +02:00
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
e82e5cd87e fix typo 2015-06-06 13:42:54 -07:00
30f674af0e Add option to allow unrestricted API access 2015-05-10 22:25:36 +02:00
c24f421bff Add Go runtime metrics to expvar 2015-05-01 10:51:14 -07:00
df70fe4ac7 Serve expvars and pprof on the API port 2015-05-01 10:50:44 -07:00
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
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
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
c419a489e1 make ipfs understand the new migration 2015-04-20 02:26:33 -07:00
f3fbedf312 no longer worry about moving key out of config file 2015-04-20 02:25:41 -07:00
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
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
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
d23bed5baa Rename ContextIsReadyToBeClosed to InitDone 2015-03-12 11:42:07 +02:00
afd497e194 Dirty hack to fix race conditions in the daemon 2015-03-09 16:39:41 +02:00
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
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
25f042ce36 daemon: consolidate writable gway line 2015-03-04 08:17:54 -08:00
56a32a306c using pollEndpoint to block in tests for 'daemon ready' (updates #844) 2015-03-04 14:50:17 +01:00
69e09d40c5 add version info endpoint to gateway 2015-02-20 11:49:48 -08:00
c0ca02486b fix(corerouting) pass transport addr 2015-02-15 04:41:18 -08:00
2a322ad7fb feat(daemon) learns --routing=supernode 2015-02-15 04:41:18 -08:00
bea4ed78d5 feat(cmd/daemon) add --gcr option to run GCR routing client 2015-02-15 04:41:17 -08:00
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
7a2545a14b implement nodebuilder 2015-02-11 21:47:07 +00:00
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
1d01c0354f refactor(cmd/daemon) more compact representation!
exposed the Decider to make configuration nicer @mappum
2015-02-06 08:14:14 -08:00
4bc2713a28 more compact respresentation 2015-02-06 08:13:15 -08:00
64a4c27913 corehttp: allow all webui paths we published.
Otherwise we break users links! cc @mappum
2015-02-06 07:30:42 -08:00
b1ca07d6c5 core/corehttp: Added gateway path whitelisting 2015-02-04 18:46:54 -08:00
951ff4f747 repo is owned by node, so close the node 2015-02-01 21:54:17 -08:00
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
c372255807 daemon: fix output + time waiting 2015-02-01 04:29:32 -08:00
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
7d09da3c8b Make gateway read-only by default and add option to make it writable 2015-01-31 23:36:45 +01:00
73234479fa init docs: go generated welcome dir + files
updated sharness hashes
2015-01-31 07:51:30 -08:00
7c5b276179 cmd/ipfs: daemon: Added root redirect handler to corehttp options (for both gateway and API) 2015-01-28 16:01:42 -08:00
76d9d89aff user friendliness in logs + output 2015-01-26 17:01:00 -08:00
4b78b535b6 perform multiaddr conversion in the function 2015-01-24 01:37:03 -08:00
e9d3c9828c perform multiaddr conversion in the function 2015-01-24 01:32:27 -08:00
7b4de230eb commands: Refactored Command#Run function signature to (req Request, res Response) 2015-01-23 18:29:29 -08:00
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
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