@cryptotaxi247 / kubo / commits / 96a22c5bb

config: change default config dir name to .ipfs

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>

Christian Couder committed Mar 29, 2015 at 13:25 UTC 96a22c5bb1713b0ecf6502ee2bd01f383b4956ec
22 files changed +45 -43
.gitignore
+1 -1
@@ -8,6 +8,6 @@
8 *.test
9 *.orig
10 *~
11 -.go-ipfs
11
12 /test/bin
13 +.ipfs
README.md
+1 -1
@@ -145,7 +145,7 @@ accomplished with the following command:
145 ### Troubleshooting
146 If you have previously installed ipfs before and you are running into
147 problems getting a newer version to work, try deleting (or backing up somewhere
148 -else) your ipfs config directory (~/.go-ipfs by default) and rerunning `ipfs init`.
148 +else) your ipfs config directory (~/.ipfs by default) and rerunning `ipfs init`.
149 This will reinitialize the config file to its defaults and clear out the local
150 datastore of any bad entries.
151
core/commands/config.go
+1 -1
@@ -49,7 +49,7 @@ Get the value of the 'datastore.path' key:
49
50 Set the value of the 'datastore.path' key:
51
52 - ipfs config datastore.path ~/.go-ipfs/datastore
52 + ipfs config datastore.path ~/.ipfs/datastore
53 `,
54 },
55
docs/fuse.md
+1 -1
@@ -1,6 +1,6 @@
1 # FUSE
2
3 -As a golang project, `go-ipfs` is easily downloaded and installed with `go get github.com/ipfs/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.
3 +As a golang project, `go-ipfs` is easily downloaded and installed with `go get github.com/ipfs/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.
4
5 As a precursor, you will have to create the `/ipfs` and `/ipns` directories explicitly. Note that modifying root requires sudo permissions.
6
jenkins/network-test.sh
+3 -3
@@ -8,6 +8,6 @@ make clean
8 make test
9 make save_logs
10
11 -docker cp dockertest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
12 -docker cp dockertest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
13 -docker cp dockertest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log
11 +docker cp dockertest_server_1:/root/.ipfs/logs/events.log $(PWD)/build/server-events.log
12 +docker cp dockertest_bootstrap_1:/root/.ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
13 +docker cp dockertest_client_1:/root/.ipfs/logs/events.log $(PWD)/build/client-events.log
repo/config/config.go
+3 -1
@@ -29,8 +29,10 @@ type Config struct {
29 }
30
31 const (
32 + // DefaultPathName is the default config dir name
33 + DefaultPathName = ".ipfs"
34 // DefaultPathRoot is the path to the default config dir location.
33 - DefaultPathRoot = "~/.go-ipfs"
35 + DefaultPathRoot = "~/" + DefaultPathName
36 // DefaultConfigFile is the filename of the configuration file
37 DefaultConfigFile = "config"
38 // EnvDir is the environment variable used to change the path root.
repo/fsrepo/doc.go
+1 -1
@@ -2,7 +2,7 @@
2 //
3 // TODO explain the package roadmap...
4 //
5 -// .go-ipfs/
5 +// .ipfs/
6 // ├── client/
7 // | ├── client.lock <------ protects client/ + signals its own pid
8 // │ ├── ipfs-client.cpuprof
test/3nodetest/bootstrap/Dockerfile
+1 -1
@@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img
2
3 RUN ipfs init -b=1024
4 ADD . /tmp/id
5 -RUN mv -f /tmp/id/config /root/.go-ipfs/config
5 +RUN mv -f /tmp/id/config /root/.ipfs/config
6 RUN ipfs id
7
8 ENV IPFS_PROF true
test/3nodetest/bootstrap/config
+2 -2
@@ -5,7 +5,7 @@
5 },
6 "Datastore": {
7 "Type": "leveldb",
8 - "Path": "/root/.go-ipfs/datastore"
8 + "Path": "/root/.ipfs/datastore"
9 },
10 "Addresses": {
11 "Swarm": [
@@ -30,7 +30,7 @@
30 "Last": ""
31 },
32 "Logs": {
33 - "Filename": "/root/.go-ipfs/logs/events.log",
33 + "Filename": "/root/.ipfs/logs/events.log",
34 "MaxSizeMB": 0,
35 "MaxBackups": 0,
36 "MaxAgeDays": 0
test/3nodetest/client/Dockerfile
+1 -1
@@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img
2
3 RUN ipfs init -b=1024
4 ADD . /tmp/id
5 -RUN mv -f /tmp/id/config /root/.go-ipfs/config
5 +RUN mv -f /tmp/id/config /root/.ipfs/config
6 RUN ipfs id
7
8 EXPOSE 4031 4032/udp
test/3nodetest/client/config
+2 -2
@@ -8,7 +8,7 @@
8 "Bootstrap": [
9 ],
10 "Datastore": {
11 - "Path": "/root/.go-ipfs/datastore",
11 + "Path": "/root/.ipfs/datastore",
12 "Type": "leveldb"
13 },
14 "Identity": {
@@ -16,7 +16,7 @@
16 "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=="
17 },
18 "Logs": {
19 - "Filename": "/root/.go-ipfs/logs/events.log",
19 + "Filename": "/root/.ipfs/logs/events.log",
20 "MaxAgeDays": 0,
21 "MaxBackups": 0,
22 "MaxSizeMB": 0
test/3nodetest/server/Dockerfile
+1 -1
@@ -2,7 +2,7 @@ FROM zaqwsx_ipfs-test-img
2
3 RUN ipfs init -b=1024
4 ADD . /tmp/test
5 -RUN mv -f /tmp/test/config /root/.go-ipfs/config
5 +RUN mv -f /tmp/test/config /root/.ipfs/config
6 RUN ipfs id
7 RUN chmod +x /tmp/test/run.sh
8
test/3nodetest/server/config
+2 -2
@@ -8,7 +8,7 @@
8 "Bootstrap": [
9 ],
10 "Datastore": {
11 - "Path": "/root/.go-ipfs/datastore",
11 + "Path": "/root/.ipfs/datastore",
12 "Type": "leveldb"
13 },
14 "Identity": {
@@ -16,7 +16,7 @@
16 "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=="
17 },
18 "Logs": {
19 - "Filename": "/root/.go-ipfs/logs/events.log",
19 + "Filename": "/root/.ipfs/logs/events.log",
20 "MaxAgeDays": 0,
21 "MaxBackups": 0,
22 "MaxSizeMB": 0
test/bench/bench_cli_ipfs_add/main.go
+1 -1
@@ -53,7 +53,7 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
53 defer os.RemoveAll(tmpDir)
54
55 env := append(
56 - []string{fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, ".go-ipfs"))}, // first in order to override
56 + []string{fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, config.DefaultPathName))}, // first in order to override
57 os.Environ()...,
58 )
59 setupCmd := func(cmd *exec.Cmd) {
test/bench/offline_add/main.go
+1 -1
@@ -43,7 +43,7 @@ func benchmarkAdd(amount int64) (*testing.BenchmarkResult, error) {
43 }
44 defer os.RemoveAll(tmpDir)
45
46 - env := append(os.Environ(), fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, ".go-ipfs")))
46 + env := append(os.Environ(), fmt.Sprintf("%s=%s", config.EnvDir, path.Join(tmpDir, config.DefaultPathName)))
47 setupCmd := func(cmd *exec.Cmd) {
48 cmd.Env = env
49 }
test/jenkins/network-test.sh
+3 -3
@@ -8,6 +8,6 @@ make clean
8 make test
9 make save_logs
10
11 -docker cp 3nodetest_server_1:/root/.go-ipfs/logs/events.log $(PWD)/build/server-events.log
12 -docker cp 3nodetest_bootstrap_1:/root/.go-ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
13 -docker cp 3nodetest_client_1:/root/.go-ipfs/logs/events.log $(PWD)/build/client-events.log
11 +docker cp 3nodetest_server_1:/root/.ipfs/logs/events.log $(PWD)/build/server-events.log
12 +docker cp 3nodetest_bootstrap_1:/root/.ipfs/logs/events.log $(PWD)/build/bootstrap-events.log
13 +docker cp 3nodetest_client_1:/root/.ipfs/logs/events.log $(PWD)/build/client-events.log
test/sharness/README.md
+5 -5
@@ -68,11 +68,11 @@ This means cating certain files, or running diagnostic commands.
68 For example:
69
70 ```
71 -test_expect_success ".go-ipfs/ has been created" '
72 - test -d ".go-ipfs" &&
73 - test -f ".go-ipfs/config" &&
74 - test -d ".go-ipfs/datastore" ||
75 - test_fsh ls -al .go-ipfs
71 +test_expect_success ".ipfs/ has been created" '
72 + test -d ".ipfs" &&
73 + test -f ".ipfs/config" &&
74 + test -d ".ipfs/datastore" ||
75 + test_fsh ls -al .ipfs
76 '
77 ```
78
test/sharness/lib/test-lib.sh
+1 -1
@@ -148,7 +148,7 @@ test_init_ipfs() {
148 # todo: in the future, use env?
149
150 test_expect_success "ipfs init succeeds" '
151 - export IPFS_PATH="$(pwd)/.go-ipfs" &&
151 + export IPFS_PATH="$(pwd)/.ipfs" &&
152 ipfs init -b=1024 > /dev/null
153 '
154
test/sharness/t0020-init.sh
+6 -6
@@ -9,16 +9,16 @@ test_description="Test init command"
9 . lib/test-lib.sh
10
11 test_expect_success "ipfs init succeeds" '
12 - export IPFS_PATH="$(pwd)/.go-ipfs" &&
12 + export IPFS_PATH="$(pwd)/.ipfs" &&
13 BITS="2048" &&
14 ipfs init --bits="$BITS" >actual_init
15 '
16
17 -test_expect_success ".go-ipfs/ has been created" '
18 - test -d ".go-ipfs" &&
19 - test -f ".go-ipfs/config" &&
20 - test -d ".go-ipfs/datastore" ||
21 - test_fsh ls -al .go-ipfs
17 +test_expect_success ".ipfs/ has been created" '
18 + test -d ".ipfs" &&
19 + test -f ".ipfs/config" &&
20 + test -d ".ipfs/datastore" ||
21 + test_fsh ls -al .ipfs
22 '
23
24 test_expect_success "ipfs config succeeds" '
test/sharness/t0060-daemon.sh
+6 -6
@@ -10,7 +10,7 @@ test_description="Test daemon command"
10
11 # this needs to be in a different test than "ipfs daemon --init" below
12 test_expect_success "setup IPFS_PATH" '
13 - IPFS_PATH="$(pwd)/.go-ipfs"
13 + IPFS_PATH="$(pwd)/.ipfs"
14 '
15
16 # NOTE: this should remove bootstrap peers (needs a flag)
@@ -54,11 +54,11 @@ test_expect_failure "ipfs daemon output looks good" '
54 test_cmp_repeat_10_sec expected actual_daemon
55 '
56
57 -test_expect_success ".go-ipfs/ has been created" '
58 - test -d ".go-ipfs" &&
59 - test -f ".go-ipfs/config" &&
60 - test -d ".go-ipfs/datastore" ||
61 - test_fsh ls .go-ipfs
57 +test_expect_success ".ipfs/ has been created" '
58 + test -d ".ipfs" &&
59 + test -f ".ipfs/config" &&
60 + test -d ".ipfs/datastore" ||
61 + test_fsh ls .ipfs
62 '
63
64 # begin same as in t0010
test/supernode_client/.gitignore
+1 -1
@@ -1 +1 @@
1 -.go-ipfs/
1 +.ipfs/
test/supernode_client/main.go
+1 -1
@@ -63,7 +63,7 @@ func run() error {
63 if err != nil {
64 return err
65 }
66 - repoPath := gopath.Join(cwd, ".go-ipfs")
66 + repoPath := gopath.Join(cwd, config.DefaultPathName)
67 if err := ensureRepoInitialized(repoPath); err != nil {
68 }
69 repo, err := fsrepo.Open(repoPath)