Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move to using ~/.ipfs #970

Closed
jbenet opened this issue Mar 28, 2015 · 14 comments
Closed

move to using ~/.ipfs #970

jbenet opened this issue Mar 28, 2015 · 14 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up topic/repo Topic repo

Comments

@jbenet
Copy link
Member

jbenet commented Mar 28, 2015

from .go-ipfs -> .ipfs

@shizeeg
Copy link

shizeeg commented Apr 7, 2015

why not $XDG_CONFIG_HOME/ipfs ?
it's kinda standard:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

@whyrusleeping
Copy link
Member

This has been discussed before, and decided against. (although I do not recall the specific reasoning)

@jbenet
Copy link
Member Author

jbenet commented Apr 8, 2015

Yeah, @mildred wants this too.

I don't know how widely used XDG is. I'm not opposed to having the option of being compatible with it, but i don't think it makes sense as a default to force upon people.

> uname -a
Linux celebdil 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
> echo $XDG_CONFIG_HOME
>

@jbenet jbenet closed this as completed Apr 20, 2015
@jbenet jbenet removed the status/in-progress In progress label Apr 20, 2015
@mildred
Copy link
Contributor

mildred commented Sep 1, 2015

I don't know how widely used XDG is.

Most GNOME, XFCE, Qt and KDE apps, and many others :

  • fontconfig
  • epiphany
  • FreeCAD
  • libvirt
  • libreoffice
  • LyX
  • gtk
  • ImageMagick
  • XFCE
  • VLC
  • gconf
  • gajim
  • chromium
  • 0install
  • GnuNet
  • VirtualBox
  • Inkscape
  • and many more

I don't know how you managed to have an empty ~/.config and ~/.local/share directory, but mine is far from empty:

$ ls ~/.config | wc -l
203
$ ls ~/.local/share | wc -l
105

@whyrusleeping
Copy link
Member

whyrusleeping@idril ~> ls ~/.config/ | wc -l 
28
whyrusleeping@idril ~> ls ~/.local/share | wc -l
11

There are a few things there, but...

whyrusleeping@idril ~> ls -a ~ | grep "^\." | wc -l
74

People can set IPFS_PATH to $XDG_HOME/.ipfs if they want, but it primarily looks like a gtk thing.

@mildred
Copy link
Contributor

mildred commented Sep 1, 2015

I don't want to repeat myself too much, but the XDG spec separate three kind of files:

  • configuration files: small text files generally. What you want to use to configure applications: ~/.config
  • cache files: you can safely delete these because they can either be computed again or found fron the network. In ~/.cache. This include thumbnails and web cache files
  • data files: the current application state. These are not configuration files, and cannot be recovered in case they disappear. This is in ~/.local/share

Separating these can be useful. For example, I frequently rm -rf ~/.cache to clean up things, especially if I run out of disk space. Generally this is full of thumbnails. ~/.config is what I want to backup absolutely, or keep in a Git repository to sync across computers. ~/.local: I don't care that much but I won't remove it as easily as ~/.cache. I might backup some of its contents.

This is also the reason why historical applications such as Mozilla Firefox still keep everything in ~/.mozilla. They didn't took the time to separate these different files.

@mildred
Copy link
Contributor

mildred commented Sep 1, 2015

uname -a
Linux celebdil 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
echo $XDG_CONFIG_HOME

This is normal: this environment variable is empty by default. If it is empty, it has a default value of ~/.config

echo ${XDG_CONFIG_HOME:-$HOME/.config}
/home/mildred/.config

@whyrusleeping
Copy link
Member

@mildred so how would you recommend splitting up the repo?

@mildred
Copy link
Contributor

mildred commented Sep 1, 2015

I don't really know what's in .ipfs currently, but

  • config: in XDG_CONFIG_HOME or XDG_DATA_HOME as this is a little more than configuration (servers and private key)
  • logs: in XDG_DATA_HOME
  • lock file, right next to the files it is locking (or perhaps XDG_RUNTIME_DIR)
  • IPFS blocks unpinned, as in a web cache, in XDG_CACHE_HOME
  • IPFS blocks, pinned, in XDG_DATA_HOME
  • What's in datastore, I assume this contains the list of pinned blocks among other things, in XDG_DATA_HOME

@jbenet
Copy link
Member Author

jbenet commented Sep 1, 2015

Someone can make an xdgfsrepo that splits up fsrepo to work that way, but it will not be the default, and it will not be supported with our standard migrations. we already have a hard time as it is with migrations, and we control the directory entirely. sorry @mildred -- very strong reasons for this one. we must have the entire fs-repo be virtualizable in one location on the system, so it can be loaded from remote systems -- including things like S3 -- through simply mounting a single location, and so that people can run multiple IPFS nodes by just setting the IPFS_PATH (or maybe a cli opt later). (i do this all the time to run multiple nodes.

@fazo96
Copy link

fazo96 commented Sep 16, 2015

@jbenet maybe a simpler yet efficient solution would be to use XDG_CONFIG_HOME/ipfs if XDG_CONFIG_HOME is set, else just use ~/.ipfs

Having some other way (like a command line argument) to set the path to the ipfs folder would be a nice and appreciated alternative though 👍

@jbenet
Copy link
Member Author

jbenet commented Sep 16, 2015

You can use $IPFS_PATH already.

XDG_CONFIG_HOME may be ok, as well, as we keep the repo the same. @mildred would that be acceptable for you?

@mildred
Copy link
Contributor

mildred commented Sep 16, 2015

@fazo96 @jbenet What about XDG_DATA_HOME/ipfs because XDG_CONFIG_HOME is for configuration files (small text files) and we have much more in the IPFS dir.

There is another aspect to this whole "where do we put our data?" thing. If IPFS is to be run as a system daemon, I would expect configuration to be in /etc and most of everything in /var. I think having a way to separate config and data would be valuable for this use case. (but this is another issue than this one)

@jbenet
Copy link
Member Author

jbenet commented Sep 16, 2015

👍 to XDG_DATA_HOME/ipfs

@RichardLitt RichardLitt added the exp/novice Someone with a little familiarity can pick up label Feb 2, 2016
@aschmahmann aschmahmann mentioned this issue Sep 22, 2020
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up topic/repo Topic repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants