Skip to content

Commit 2d13602

Browse files
committed
feat: change config paths for CLI and Database Lab server (#151)
1 parent b1146c7 commit 2d13602

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

Dockerfile.dblab-server

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Run with config.yml mount:
1+
# Run with server.yml mount:
22
# sudo docker run \
33
# --name dblab_server \
44
# --label dblab_control \
@@ -7,7 +7,7 @@
77
# --restart on-failure \
88
# --volume /var/run/docker.sock:/var/run/docker.sock \
99
# --volume /var/lib/dblab:/var/lib/dblab:rshared \
10-
# --volume ~/.dblab/configs/config.yml:/home/dblab/configs/config.yml \
10+
# --volume ~/.dblab/server.yml:/home/dblab/configs/config.yml \
1111
# --env VERIFICATION_TOKEN=secret_token \
1212
# --detach \
1313
# postgresai/dblab-server:latest
@@ -21,7 +21,7 @@
2121
# --restart on-failure \
2222
# --volume /var/run/docker.sock:/var/run/docker.sock \
2323
# --volume /var/lib/dblab:/var/lib/dblab:rshared \
24-
# --volume ~/.dblab/configs/config.yml:/home/dblab/configs/config.yml \
24+
# --volume ~/.dblab/server.yml:/home/dblab/configs/config.yml \
2525
# --env VERIFICATION_TOKEN=token \
2626
# --env MOUNT_DIR=/var/lib/dblab/clones \
2727
# --env UNIX_SOCKET_DIR=/var/lib/dblab/sockets \

cmd/cli/commands/config/file.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ package config
66

77
import (
88
"io/ioutil"
9-
"os"
109
"os/user"
10+
"path"
1111

1212
"gopkg.in/yaml.v2"
1313
)
1414

1515
const (
1616
configPath = ".dblab"
17-
configFilename = "config"
17+
configFilename = "cli.yml"
1818
)
1919

2020
// GetDirname returns the CLI config path located in the current user's home directory.
@@ -24,7 +24,7 @@ func GetDirname() (string, error) {
2424
return "", err
2525
}
2626

27-
dirname := currentUser.HomeDir + string(os.PathSeparator) + configPath
27+
dirname := path.Join(currentUser.HomeDir, configPath)
2828

2929
return dirname, nil
3030
}
@@ -41,7 +41,7 @@ func GetFilename() (string, error) {
4141

4242
// BuildFileName builds a config filename.
4343
func BuildFileName(dirname string) string {
44-
return dirname + string(os.PathSeparator) + configFilename
44+
return path.Join(dirname, configFilename)
4545
}
4646

4747
// Load loads a CLI config by a provided filename.

configs/config.example.logical_generic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copy the following to: ./configs/config.yaml
1+
# Copy the following to: ~/.dblab/server.yml
22

33
# Database Lab API server. This API is used to work with clones
44
# (list them, create, delete, see how to connect to a clone).

configs/config.example.logical_rds.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copy the following to: ./configs/config.yaml
1+
# Copy the following to: ~/.dblab/server.yml
22

33
# Database Lab API server. This API is used to work with clones
44
# (list them, create, delete, see how to connect to a clone).

configs/config.example.physical_generic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copy the following to: ./configs/config.yaml
1+
# Copy the following to: ~/.dblab/server.yml
22

33
# Database Lab API server. This API is used to work with clones
44
# (list them, create, delete, see how to connect to a clone).

configs/config.example.physical_walg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copy the following to: ./configs/config.yaml
1+
# Copy the following to: ~/.dblab/server.yml
22

33
# Database Lab API server. This API is used to work with clones
44
# (list them, create, delete, see how to connect to a clone).

0 commit comments

Comments
 (0)