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

165 Commits

Author SHA1 Message Date
e221e941c7 fix(mfs): basic UnixFS sanity checks in files cp (#10701)
Signed-off-by: Abhinav Prakash <abhinav.prakash319@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
Co-authored-by: Andrew Gillis <11790789+gammazero@users.noreply.github.com>
2025-03-05 20:40:33 +01:00
9425421114 collection of typo fixes (#10647) 2024-12-29 21:27:41 -08:00
ecb25581c6 cmd/files: flush parent folders (#10630)
* cmd/files: flush parent folders

This is a mitigation to increased MFS memory usage in the course of many writes operations.

The underlying issue is the unbounded growth of the mfs directory cache in
boxo. In the latest boxo version, this cache can be cleared by calling Flush()
on the folder. In order to trigger that, we call Flush() on the parent folder
of the file/folder where the write-operations are happening.

To flushing the parent folder allows it to grow unbounded. Then, any read
operation to that folder or parents (i.e. stat), will trigger a sync-operation to match
the cache to the underlying unixfs structure (and obtain the correct node-cid).

This sync operation must visit every item in the cache. When the cache has grown too much,
and the underlying unixfs-folder has switched into a HAMT, the operation can take minutes.

Thus, we should clear the cache often and the Flush flag is a good indicator
that we can let it go. Users can always run with --flush=false and flush at
regular intervals during their MFS writes if they want to extract some performance.

Fixes #8694, #10588.

* cmd/files: docs and changelog for --flush changes
2024-12-19 14:07:17 -08:00
642e58ef3b chore: use errors.New to replace fmt.Errorf with no parameters (#10617) 2024-12-10 13:50:35 -08:00
2260e35df2 chore: upgrade to go 1.23 (#10486)
* chore: upgrade to go 1.23

https://tip.golang.org/doc/go1.23

* refactor: golangci-lint v1.60.2
2024-08-28 18:56:45 +02:00
263edb251e feat: Support storing UnixFS 1.5 Mode and ModTime (#10478)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-08-21 02:02:46 +02:00
8022e13a6b config: introduce Import section (#10421)
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2024-05-14 14:17:04 +00:00
58c29399cf chore: clean migration 2023-11-29 12:29:59 +01:00
a7c6518497 feat: path consolidation (#10063) 2023-10-06 16:14:44 +02:00
Kay
f12b372af9 style: gofumpt and godot [skip changelog] (#10081) 2023-08-17 14:02:08 +02:00
3ab1086f71 chore: migrate go-libipfs to boxo
Resolves #9677, #9676, #9675, #9736
2023-03-28 22:05:25 -04:00
cb1ba70a9b fix: handle new ProtoNode errors 2022-12-02 10:16:10 +11:00
9e5d0aaaec feat(cmds/add): --to-files option automates files cp (#8927)
* feat(cmds/add): --to-files option as files cp
* tests(to-files): ensure error handling is covered

this adds bunch of tests that guard UX around importing multiple files
into MFS, and the logic around trailing slash to indicate if the MFS
destination if a directory.

If the destination has a trailing slash, we ensure that the directory
exists and is a dir and not a file. this allows us to support
adding multipl files into MFS dir:

ipfs add file1.txt file2.txt --to-files /some/mfs/dir/

* docs: to-files helptext

Co-authored-by: Antonio Navarro Perez <antnavper@gmail.com>
Co-authored-by: Marcin Rataj <lidel@lidel.org>
2022-09-21 18:08:36 +02:00
82467bc936 refactor: rename to kubo 2022-07-06 18:40:37 +02:00
7bb3bfbc33 Bubble ErrNotFound improvements 2022-03-02 18:29:29 +01:00
898065e09c chore(cmds): encapsulate ipfs rm logic in another function (#8574) 2022-02-15 17:30:47 -05:00
440394682a docs: fix typo 2022-01-14 11:36:03 -05:00
f6223605e7 Add support for multiple files to ipfs files rm. 2021-11-12 12:07:58 -05:00
52a747763f docs: fix ipfs files cp examples (#8533) 2021-10-29 16:45:53 +02:00
c2e6a22bba Restore dropped error condition check 2021-08-12 09:40:24 -07:00
155435cb35 Add flag to create parent directories in files cp command
Closes #8289
2021-08-12 09:23:39 -07:00
0ff1cf33aa docs: cosmetic fixes of help text
Unfortunately, API docs are genereted from go-ipfs sources
via https://github.com/ipfs/http-api-docs
so it all gets lost when API docs for new version are re-generated.

This re-applies manual fixes from:
https://docs.ipfs.io/reference/http/api/
so the next time http-api-docs are re-generated, those changes stay.
2021-03-24 17:41:14 +01:00
e7ddd3894b Fix: innacuracies in MFS command documentation.
These also end up in API docs.
2021-03-22 19:42:04 +01:00
fa81f2a7b3 Update core/commands/files.go
Co-authored-by: Steven Allen <steven@stebalien.com>
2020-11-24 13:42:36 +05:30
0c4ad11cfb Update files.go 2020-11-16 17:52:30 +05:30
c6fe39a4a5 Explain that ipfs ls works on IPFS paths, and ipfs files ls works on both IPFS paths and MFS paths. 2020-11-07 12:51:01 +05:30
9033ba9cad Merge pull request #7181 from rex4539/fix-typos
Fix typos and cleanup
2020-04-20 21:43:47 -07:00
1e437c7e97 Fix typos and cleanup 2020-04-20 22:00:01 +03:00
ae5bd6f649 files.go: fix typos / wording 2020-04-06 01:52:08 +02:00
3b30e8e2b0 ipfs files cp: improve docstring with better words.
And align capitalization.
2020-04-02 20:46:31 +02:00
b5aaf75e25 Fix #4996: Improve help text for "ipfs files cp" 2020-04-01 12:08:48 +02:00
0ddc2751a4 docs: fix typo
Co-Authored-By: Johnny <9611008+johnnymatthews@users.noreply.github.com>
2020-03-02 15:57:04 +00:00
885e1125b8 docs: fix example for files.write
* Adds the `--parents` optiont to the first command so that it is runnable
* Updates the description to specifies the option to use if you _do_ want nonexistant intermediate directories created
2020-03-02 10:36:13 +00:00
effbc0a542 docs(commands): fix mfs wording 2020-02-07 07:27:27 -08:00
38ca2fbde2 core/commands/files: MFS docs, minor improvements after user feedback 2020-02-07 15:35:33 +01:00
e05ddfab23 /mfs/path -> /some/path
Co-Authored-By: Moritz <13287984+mohe2015@users.noreply.github.com>
2020-02-07 15:19:37 +01:00
10194de133 core/commands/files: log.Error -> flog.Error
This seems like a tiny leftover.
2020-02-07 14:55:16 +01:00
da584b8679 Fix #6878: Improve MFS Cli documentation 2020-02-07 14:55:01 +01:00
7fcf40eeee fix: use if over switch
License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
2019-11-25 14:51:30 +00:00
25694d0238 fix: ignore nonexistant when force rm
- Make `ipfs files rm --force /nonexistant` succeed when the path does not exist.
- Add shaness test for removing nonexistant paths
- Refactor duplicated code to find a parent dir into a function

I've been writing scripts against the files api, and having to stat things before removing them is a pain. So this PR aims to make --force do what I'd expect it to.

License: MIT
Signed-off-by: Oli Evans <oli@tableflip.io>
2019-11-25 11:38:29 +00:00
76f29603a8 feat: add --long as alias for -l in files.ls
Allow passing --long or ?long=true as a more descriptive option name than "l".

refs: https://github.com/ipfs/go-ipfs#issuecomment-392477565
2019-07-17 15:17:57 +01:00
5f64b270f8 cmdkit -> cmds
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-05-10 23:00:20 -07:00
a54b64bede coreiface: updates for path name refactor
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
667b7f9927 coreiface: updates for moving path to subpackage
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
2e77df04ca coreapi: Update path error handling
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
1f293eff1b chore: fix a bunch of issues caught by golangci-lint
Most of these are probably harmless but a few looked like they might actually be
bugs. Most of them are just faulty tests.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-29 11:57:45 +00:00
3d79102e44 Return CID from 'ipfs files flush'
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-03-19 21:44:15 +01:00
79b15d7b68 gomod: update go-mfs
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-03-18 17:59:02 +01:00
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
3fa1bfe1bc gx: update cmds and flatfs
fixes #6028, fixes crash when writing after closing on flatfs.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-01 12:17:49 -08:00