Skip to content

Commit

Permalink
config: change default config dir name to .ipfs
Browse files Browse the repository at this point in the history
This changes .go-ipfs to .ipfs everywhere.
And by the way this defines a DefaultPathName const
for this name.

License: MIT
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
  • Loading branch information
chriscool committed Mar 29, 2015
1 parent 11dc94b commit 2a7cb92
Show file tree
Hide file tree
Showing 22 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
*.test
*.orig
*~
.go-ipfs
.ipfs
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Basic proof of 'ipfs working' locally:
### Troubleshooting
If you have previously installed ipfs before and you are running into
problems getting a newer version to work, try deleting (or backing up somewhere
else) your ipfs config directory (~/.go-ipfs by default) and rerunning `ipfs init`.
else) your ipfs config directory (~/.ipfs by default) and rerunning `ipfs init`.
This will reinitialize the config file to its defaults and clear out the local
datastore of any bad entries.

Expand Down
2 changes: 1 addition & 1 deletion core/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Get the value of the 'datastore.path' key:
Set the value of the 'datastore.path' key:
ipfs config datastore.path ~/.go-ipfs/datastore
ipfs config datastore.path ~/.ipfs/datastore
`,
},

Expand Down
2 changes: 1 addition & 1 deletion docs/fuse.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FUSE

As a golang project, `go-ipfs` is easily downloaded and installed with `go get github.com/jbenet/go-ipfs`. All data is stored in a leveldb data store in `~/.go-ipfs/datastore`. If, however, you would like to mount the datastore (`ipfs mount /ipfs`) and use it as you would a normal filesystem, you will need to install fuse.
As a golang project, `go-ipfs` is easily downloaded and installed with `go get github.com/jbenet/go-ipfs`. All data is stored in a leveldb data store in `~/.ipfs/datastore`. If, however, you would like to mount the datastore (`ipfs mount /ipfs`) and use it as you would a normal filesystem, you will need to install fuse.

As a precursor, you will have to create the `/ipfs` and `/ipns` directories explicitly. Note that modifying root requires sudo permissions.

Expand Down
6 changes: 3 additions & 3 deletions jenkins/network-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ make clean
make test
make save_logs

docker cp dockertest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp dockertest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp dockertest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log
docker cp dockertest_server_1:/root/.ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp dockertest_bootstrap_1:/root/.ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp dockertest_client_1:/root/.ipfs/logs/events.log $(PWD)/build/client-events.log
4 changes: 3 additions & 1 deletion repo/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ type Config struct {
}

const (
// DefaultPathName is the default config dir name
DefaultPathName = ".ipfs"
// DefaultPathRoot is the path to the default config dir location.
DefaultPathRoot = "~/.go-ipfs"
DefaultPathRoot = "~/" + DefaultPathName
// DefaultConfigFile is the filename of the configuration file
DefaultConfigFile = "config"
// EnvDir is the environment variable used to change the path root.
Expand Down
2 changes: 1 addition & 1 deletion repo/fsrepo/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// TODO explain the package roadmap...
//
// .go-ipfs/
// .ipfs/
// ├── client/
// | ├── client.lock <------ protects client/ + signals its own pid
// │ ├── ipfs-client.cpuprof
Expand Down
2 changes: 1 addition & 1 deletion test/3nodetest/bootstrap/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img

RUN ipfs init -b=1024
ADD . /tmp/id
RUN mv -f /tmp/id/config /root/.go-ipfs/config
RUN mv -f /tmp/id/config /root/.ipfs/config
RUN ipfs id

ENV IPFS_PROF true
Expand Down
4 changes: 2 additions & 2 deletions test/3nodetest/bootstrap/config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"Datastore": {
"Type": "leveldb",
"Path": "/root/.go-ipfs/datastore"
"Path": "/root/.ipfs/datastore"
},
"Addresses": {
"Swarm": [
Expand All @@ -30,7 +30,7 @@
"Last": ""
},
"Logs": {
"Filename": "/root/.go-ipfs/logs/events.log",
"Filename": "/root/.ipfs/logs/events.log",
"MaxSizeMB": 0,
"MaxBackups": 0,
"MaxAgeDays": 0
Expand Down
2 changes: 1 addition & 1 deletion test/3nodetest/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img

RUN ipfs init -b=1024
ADD . /tmp/id
RUN mv -f /tmp/id/config /root/.go-ipfs/config
RUN mv -f /tmp/id/config /root/.ipfs/config
RUN ipfs id

EXPOSE 4031 4032/udp
Expand Down
4 changes: 2 additions & 2 deletions test/3nodetest/client/config
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"Bootstrap": [
],
"Datastore": {
"Path": "/root/.go-ipfs/datastore",
"Path": "/root/.ipfs/datastore",
"Type": "leveldb"
},
"Identity": {
"PeerID": "Qmbtc35vdjVh5o9w2AaT2SgcWwigsaoZUpRfq2FSrFD6mb",
"PrivKey": "CAAS4AQwggJcAgEAAoGBANlJUjOCbPXgYUfo1Pr6nlIjJDPNwN81ACamhaoEZ9VRHXI3fPe7RVAaaXrWLHb892mRqFi1ScE2lcMTLc7WGfyc7dwPqBOZqkVvT0KpCx3Mg246+WvnG8I3HCbWyjSP9tJflOBQxVq6qT2yZSXjNTtDdO4skd4PsPqBco53guYTAgMBAAECgYEAtIcYhrdMNBSSfp5RpZxnwbJ0t52xK0HruDEOSK2UX0Ufg+/aIjEza1QmYupi0xFltg5QojMs7hyd3Q+oNXro5tKsYVeiqrLsUh9jMjaQofzSlV9Oc+bhkkl48YWvF6Y8qx88UYAX+oJqB627H4S1gxLdNEJhPjEAD6n/jql3zUECQQDmHP75wJ7nC4TlxT1SHim5syMAqWNs/SOHnvX8yLrFV9FrMRzsD5qMlIEGBrAjaESzEck6XpbqkyxB8KKGo7OjAkEA8brtEh/AMoQ/yoSWdYT2MRbJxCAn+KG2c6Hi9AMMmJ+K779HxywpUIDYIa22hzLKYumYIuRa1X++1glOAFGq0QJAPQgXwFoMSy9M8jwcBXmmi3AtqnFCw5doIwJQL9l1X/3ot0txZlLFJOAGUHjZoqp2/h+LhYWs9U5PgLW4BYnJjQJAPydY/J0y93+5ss1FCdr8/wI3IHhOORT2t+sZgiqxxcYY5F4TAKQ2/wNKdDIQN+47FfB1gNgsKw8+6mhv6oFroQJACBF2yssNVXiXa2Na/a9tKYutGvxbm3lXzOvmpkW3FukbsObKYS344J1vdg0nzM6EWQCaiBweSA5TQ27iNW6BzQ=="
},
"Logs": {
"Filename": "/root/.go-ipfs/logs/events.log",
"Filename": "/root/.ipfs/logs/events.log",
"MaxAgeDays": 0,
"MaxBackups": 0,
"MaxSizeMB": 0
Expand Down
2 changes: 1 addition & 1 deletion test/3nodetest/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img

RUN ipfs init -b=1024
ADD . /tmp/test
RUN mv -f /tmp/test/config /root/.go-ipfs/config
RUN mv -f /tmp/test/config /root/.ipfs/config
RUN ipfs id
RUN chmod +x /tmp/test/run.sh

Expand Down
4 changes: 2 additions & 2 deletions test/3nodetest/server/config
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
"Bootstrap": [
],
"Datastore": {
"Path": "/root/.go-ipfs/datastore",
"Path": "/root/.ipfs/datastore",
"Type": "leveldb"
},
"Identity": {
"PeerID": "Qmbtc2C7rqmAfdeMTM7FX4YF8CeBumMCfk5Z1GBCMbMTfY",
"PrivKey": "CAAS4AQwggJcAgEAAoGBANW3mJMmDSJbdRyykO0Ze5t6WL6jeTtpOhklxePBIkJL/Uil78Va/tODx6Mvv3GMCkbGvzWslTZXpaHa9vBmjE3MVZSmd5fLRybKT0zZ3juABKcx+WIVNw8JlkpEORihJdwb+5tRUC5pUcMzxqHSmGX+d6e9KZqLnv7piNKg2+r7AgMBAAECgYAqc6+w+wv82SHoM2gqULeG6MScCajZLkvGFwS5+vEtLh7/wUZhc3PO3AxZ0/A5Q9H+wRfWN5PkGYDjJ7WJhzUzGfTbrQ821JV6B3IUR4UHo2IgJkZO4EUB5L9KBUqvYxDJigtGBopgQh0EeDSS+9X8vaGmit5l4zcAfi+UGYPgMQJBAOCJQU8N2HW5SawBo2QX0bnCAAnu5Ilk2QaqwDZbDQaM5JWFcpRpGnjBhsZihHwVWvKCbnq83JhAGRQvKAEepMUCQQDzqjvIyM+Au42nP7SFDHoMjEnHW8Nimvz8zPbyrSUEHe4l9/yS4+BeRPxpwI5xgzp8g1wEYfNeXt08buYwCsy/AkBXWg5mSuSjJ+pZWGnQTtPwiGCrfJy8NteXmGYev11Z5wYmhTwGML1zrRZZp4oTG9u97LA+X6sSMB2RlKbjiKBhAkEAgl/hoSshK+YugwCpHE9ytmgRyeOlhYscNj+NGofeOHezRwmLUSUwlgAfdo4bKU1n69t1TrsCNspXYdCMxcPhjQJAMNxkJ8t2tFMpucCQfWJ09wvFKZSHX1/iD9GKWL0Qk2FcMCg3NXiqei5NL3NYqCWpdC/IfjsAEGCJrTFwp/OoUw=="
},
"Logs": {
"Filename": "/root/.go-ipfs/logs/events.log",
"Filename": "/root/.ipfs/logs/events.log",
"MaxAgeDays": 0,
"MaxBackups": 0,
"MaxSizeMB": 0
Expand Down
2 changes: 1 addition & 1 deletion test/bench/bench_cli_ipfs_add/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
defer os.RemoveAll(tmpDir)

env := append(
[]string{fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, ".go-ipfs"))}, // first in order to override
[]string{fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, config.DefaultPathName))}, // first in order to override
os.Environ()...,
)
setupCmd := func(cmd *exec.Cmd) {
Expand Down
2 changes: 1 addition & 1 deletion test/bench/offline_add/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
}
defer os.RemoveAll(tmpDir)

env := append(os.Environ(), fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, ".go-ipfs")))
env := append(os.Environ(), fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, config.DefaultPathName)))
setupCmd := func(cmd *exec.Cmd) {
cmd.Env = env
}
Expand Down
6 changes: 3 additions & 3 deletions test/jenkins/network-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ make clean
make test
make save_logs

docker cp 3nodetest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp 3nodetest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp 3nodetest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log
docker cp 3nodetest_server_1:/root/.ipfs/logs/events.log $(PWD)/build/server-events.log
docker cp 3nodetest_bootstrap_1:/root/.ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
docker cp 3nodetest_client_1:/root/.ipfs/logs/events.log $(PWD)/build/client-events.log
10 changes: 5 additions & 5 deletions test/sharness/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ This means cating certain files, or running diagnostic commands.
For example:

```
test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" &&
test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" ||
test_fsh ls -al .go-ipfs
test_expect_success ".ipfs/ has been created" '
test -d ".ipfs" &&
test -f ".ipfs/config" &&
test -d ".ipfs/datastore" ||
test_fsh ls -al .ipfs
'
```

Expand Down
2 changes: 1 addition & 1 deletion test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ test_init_ipfs() {
# todo: in the future, use env?

test_expect_success "ipfs init succeeds" '
export IPFS_PATH="$(pwd)/.go-ipfs" &&
export IPFS_PATH="$(pwd)/.ipfs" &&
ipfs init -b=1024 > /dev/null
'

Expand Down
12 changes: 6 additions & 6 deletions test/sharness/t0020-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ test_description="Test init command"
. lib/test-lib.sh

test_expect_success "ipfs init succeeds" '
export IPFS_PATH="$(pwd)/.go-ipfs" &&
export IPFS_PATH="$(pwd)/.ipfs" &&
BITS="2048" &&
ipfs init --bits="$BITS" >actual_init
'

test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" &&
test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" ||
test_fsh ls -al .go-ipfs
test_expect_success ".ipfs/ has been created" '
test -d ".ipfs" &&
test -f ".ipfs/config" &&
test -d ".ipfs/datastore" ||
test_fsh ls -al .ipfs
'

test_expect_success "ipfs config succeeds" '
Expand Down
12 changes: 6 additions & 6 deletions test/sharness/t0060-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_description="Test daemon command"

# this needs to be in a different test than "ipfs daemon --init" below
test_expect_success "setup IPFS_PATH" '
IPFS_PATH="$(pwd)/.go-ipfs"
IPFS_PATH="$(pwd)/.ipfs"
'

# NOTE: this should remove bootstrap peers (needs a flag)
Expand Down Expand Up @@ -54,11 +54,11 @@ test_expect_failure "ipfs daemon output looks good" '
test_cmp_repeat_10_sec expected actual_daemon
'

test_expect_success ".go-ipfs/ has been created" '
test -d ".go-ipfs" &&
test -f ".go-ipfs/config" &&
test -d ".go-ipfs/datastore" ||
test_fsh ls .go-ipfs
test_expect_success ".ipfs/ has been created" '
test -d ".ipfs" &&
test -f ".ipfs/config" &&
test -d ".ipfs/datastore" ||
test_fsh ls .ipfs
'

test_expect_success "daemon is still running" '
Expand Down
2 changes: 1 addition & 1 deletion test/supernode_client/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.go-ipfs/
.ipfs/
2 changes: 1 addition & 1 deletion test/supernode_client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func run() error {
if err != nil {
return err
}
repoPath := gopath.Join(cwd, ".go-ipfs")
repoPath := gopath.Join(cwd, config.DefaultPathName)
if err := ensureRepoInitialized(repoPath); err != nil {
}
repo, err := fsrepo.Open(repoPath)
Expand Down

0 comments on commit 2a7cb92

Please sign in to comment.