1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 11:12:21 +08:00

95 Commits

Author SHA1 Message Date
d7dab3afea Use gx vendored go-ipfs-utils where possible
For the rest of the packages in util, move them to thirdparty
and update the references. util is gone!

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-02-12 17:21:40 -08:00
5a0b8023be Merge pull request #2256 from ipfs/feat/gx-libp2p
vendor libp2p with gx
2016-02-05 16:52:02 -08:00
0e8a6700f9 correct go-log dep
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:10 -08:00
0e312f5caf initial vendoring of libp2p outside of the repo with gx
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:06 -08:00
rht
fdba13a3e2 Wire ctx to getdag operations in gc.GC
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2016-01-30 14:10:31 +07:00
4d5af93f43 vendor in new go-datastore
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:22:55 -08:00
3ffebd942f Record datastore metrics for non-default datastores
License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
8f2d820412 S3 datastore support
To test it, set up an S3 bucket (in an AWS region that is not US
Standard, for read-after-write consistency), run `ipfs init`, then
edit `~/.ipfs/config` to say

      "Datastore": {
        "Type": "s3",
        "Region": "us-west-1",
        "Bucket": "mahbukkit",
        "ACL": "private"
      },

with the right values. Set `AWS_ACCESS_KEY_ID` and
`AWS_SECRET_ACCESS_KEY` in the environment and you should be able to
run `ipfs add` and `ipfs cat` and see the bucket be populated.

No automated tests exist, unfortunately. S3 is thorny to simulate.

License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
9497e26fbd Implement pluggable Datastore types, with nothing implemented yet
License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
b76581d6c7 fsrepo: Refactor to extract datastore internals
License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
dc73744082 fsrepo: Detect uninitialized repo by missing config file
Earlier, it also checked checked the leveldb directory. That part
added no crash safety to the application, and just hardcoded
assumptions about the datastore.

If anything, this should rely on the absolute last item created by
fsrepo.Init, and there should be fsync guarantees about ordering.

License: MIT
Signed-off-by: Tommi Virtanen <tv@eagain.net>
2016-01-12 08:22:55 -08:00
896601f6cb bump fsrepo version to 3
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-12 08:21:13 -08:00
rht
48a33ffb67 Add fixed period repo GC + test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-11-10 14:03:29 +07:00
a23609fc4d improve conn refused error check
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>

rewrite path to filepath in fsrepo

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

remove api file on repo close

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

update function to check normal net.OpErrors

License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-08 16:09:47 -08:00
2f5563b3c0 fix log hanging issue, and implement close-notify for commands
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-05 15:57:28 -08:00
94bdce63a7 vendor logging lib update
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-11-05 15:57:21 -08:00
c023d187b5 update code to use new logging changes
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-27 11:04:56 -07:00
8f0623255d replace imports with absolute path instead of using symlink
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-10-03 14:30:50 -07:00
35a5ca0ef5 update go-datastore to latest
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-15 17:15:29 -07:00
e5a2896c0e extract logging
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-09-14 17:35:50 -07:00
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
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
rht
541836c4a3 Auto-assert setconfig value to predefined struct
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-04 22:29:10 +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
rht
f5d5095b1b Add newline to 'ipfs init' error message 2015-05-30 13:40:38 +07:00
rht
17d71c49ce Add test for no repo error message 2015-05-30 13:13:27 +07:00
8ea502f1b3 clean up and fix init permissions handling 2015-05-20 09:46:09 -07:00
96a86cac98 Record Datastore metrics for flatfs and leveldb 2015-05-01 10:58:29 -07:00
a0af9f5e8d If ErrNoRepo is not an error value anymore, then make it an error type 2015-04-28 16:18:09 -07:00
f168539030 Improve command line parsing 2015-04-27 17:19:38 +00:00
c1b8d292fb repo: clean up migration errors
Improved the repo migration errors to provide instructions
to the user.
2015-04-20 02:26:34 -07: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
24daeec70c Use flatfs to store objects under /blocks outside of LevelDB
WARNING: No migration performed! That needs to come in a separate
commit, perhaps amended into this one.

Migration must move keyspace "/b" from leveldb to the flatfs subdir,
while removing the "b" prefix (keys should start with just "/").
2015-04-20 02:24:23 -07:00
59aa209164 Let FSRepo Close know explicitly about LevelDB
This allows replacing the datastore without needing to write Close
through to every wrapped datastore.
2015-04-20 02:22:46 -07:00
26cebac6d8 Remove comment referring to old code
FSRepo.Open is dead since fdd1cd8dc045db90b06497a15df7f6f232f76bda
2015-04-20 02:21:49 -07:00
5cb8d80bb6 LevelDB is no longer "the" datastore, adjust identifiers 2015-04-20 02:21:49 -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
03bc2ccb9d Take FSRepo lock way earlier
There is no way this was safe before.

Be careful to unlock on the error paths.
2015-03-13 20:29:02 -07:00
55228dae11 Simplify FSRepo life cycle, it's either open or closed 2015-03-13 20:29:02 -07:00
384ca525b4 Clean up fsrepo path handling 2015-03-13 20:29:02 -07:00
431cf1c902 Remove fsrepo refcounting
No code attempts to open the same repo multiple times.

Error handling is still buggy, but it's starting to get clearer.
2015-03-13 20:28:51 -07:00
543adf91f1 Move fsrepo lockfile from global map to struct field 2015-03-13 20:26:42 -07:00
d5ce5da5fe Remove fsrepo Datastore refcounting
repo.Once now does refcounts on a whole Repo level, returning the same
pointer to multiple Openers. This removes the need for the weird model
of separate FSRepo instances pointing to the same underlying storage,
and the races caused by that.
2015-03-13 20:26:42 -07:00
c8992f2c1b repo.OnlyOne tracks open Repos and reuses them
This will replace the elaborate refcounting in fsrepo, to make it
easier to maintain.
2015-03-13 20:26:22 -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
215fed1051 fsrepo.LockedByOtherProcess no longer checks for local opens
This is only called from `ipfs` command line tool well before it opens
the repo. The behavior change here causes a false positive if the
current process has already opened the repo. That's a bit late to ask
this question, anyway, and is not expected to have ever triggered.
2015-03-13 19:43:06 -07:00
e0bee137e9 fsrepo.Remove no longer checks for concurrently open instances
The only caller is `ipfs init`, which at that time does not hold a
repository open, and refuses to run on existing repos anyway.
2015-03-13 19:43:04 -07:00
24a32af3f1 fsrepo components simplification: directly use datastore 2015-03-11 12:55:13 -07:00