From 62744e081b17b9674f3fadbbc6c100306983212b Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 17 Jun 2021 15:57:41 +0200 Subject: [PATCH] get HTTPD binding from env: respect the documented default --- config/config.go | 5 ++++- config/config_test.go | 4 ---- docs/howto/getting-started.md | 3 ++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index a7462bc6..4910caa2 100644 --- a/config/config.go +++ b/config/config.go @@ -806,7 +806,10 @@ func getWebDAVDBindingFromEnv(idx int) { } func getHTTPDBindingFromEnv(idx int) { - binding := httpd.Binding{} + binding := httpd.Binding{ + EnableWebAdmin: true, + EnableWebClient: true, + } if len(globalConf.HTTPDConfig.Bindings) > idx { binding = globalConf.HTTPDConfig.Bindings[idx] } diff --git a/config/config_test.go b/config/config_test.go index 3f142349..96d827bf 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -628,8 +628,6 @@ func TestHTTPDBindingsFromEnv(t *testing.T) { os.Setenv("SFTPGO_HTTPD__BINDINGS__1__ADDRESS", "127.0.0.1") os.Setenv("SFTPGO_HTTPD__BINDINGS__1__PORT", "8000") os.Setenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_HTTPS", "0") - os.Setenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_WEB_ADMIN", "1") - os.Setenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_WEB_CLIENT", "1") os.Setenv("SFTPGO_HTTPD__BINDINGS__2__ADDRESS", "127.0.1.1") os.Setenv("SFTPGO_HTTPD__BINDINGS__2__PORT", "9000") os.Setenv("SFTPGO_HTTPD__BINDINGS__2__ENABLE_WEB_ADMIN", "0") @@ -645,8 +643,6 @@ func TestHTTPDBindingsFromEnv(t *testing.T) { os.Unsetenv("SFTPGO_HTTPD__BINDINGS__1__ADDRESS") os.Unsetenv("SFTPGO_HTTPD__BINDINGS__1__PORT") os.Unsetenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_HTTPS") - os.Unsetenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_WEB_ADMIN") - os.Unsetenv("SFTPGO_HTTPD__BINDINGS__1__ENABLE_WEB_CLIENT") os.Unsetenv("SFTPGO_HTTPD__BINDINGS__2__ADDRESS") os.Unsetenv("SFTPGO_HTTPD__BINDINGS__2__PORT") os.Unsetenv("SFTPGO_HTTPD__BINDINGS__2__ENABLE_HTTPS") diff --git a/docs/howto/getting-started.md b/docs/howto/getting-started.md index 1b1ccfc6..7deda12e 100644 --- a/docs/howto/getting-started.md +++ b/docs/howto/getting-started.md @@ -346,13 +346,14 @@ We suppose you have installed CocroackDB this way: ```shell sudo su -export CRDB_VERSION=20.2.10 # set the latest available version here +export CRDB_VERSION=21.1.2 # set the latest available version here wget -qO- https://binaries.cockroachdb.com/cockroach-v${CRDB_VERSION}.linux-amd64.tgz | tar xvz cp -i cockroach-v${CRDB_VERSION}.linux-amd64/cockroach /usr/local/bin/ mkdir -p /usr/local/lib/cockroach cp -i cockroach-v${CRDB_VERSION}.linux-amd64/lib/libgeos.so /usr/local/lib/cockroach/ cp -i cockroach-v${CRDB_VERSION}.linux-amd64/lib/libgeos_c.so /usr/local/lib/cockroach/ mkdir /var/lib/cockroach +chown sftpgo:sftpgo /var/lib/cockroach mkdir -p /etc/cockroach/{certs,ca} chmod 700 /etc/cockroach/ca /usr/local/bin/cockroach cert create-ca --certs-dir=/etc/cockroach/certs --ca-key=/etc/cockroach/ca/ca.key