Skip to content

Commit cd92fca

Browse files
committed
fixing privileges; checking flags on start up
1 parent f16d9d0 commit cd92fca

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

internal/cmd/server/server.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package server
1717

1818
import (
19+
"errors"
1920
"os"
2021
"os/signal"
2122
"syscall"
@@ -41,6 +42,12 @@ func Command() *cobra.Command {
4142
./visus start --bindAddr "127.0.0.1:15432" `,
4243
RunE: func(cmd *cobra.Command, _ []string) error {
4344
ctx := cmd.Context()
45+
if (cfg.BindCert == "" || cfg.BindKey == "") && !cfg.Insecure {
46+
return errors.New("--insecure must be specfied if certificates and private key are missing")
47+
}
48+
if cfg.URL == "" {
49+
return errors.New("--url must be specified")
50+
}
4451
conn, err := database.DefaultFactory.New(ctx, cfg.URL)
4552
if err != nil {
4653
return err

internal/store/sql/ddl.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GRANT CONNECT ON DATABASE _visus to visus;
66

77
USE _visus;
88

9-
ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO visus_monitor;
9+
ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO visus;
1010

1111
CREATE TYPE IF NOT EXISTS _visus.scope AS ENUM ('node', 'cluster');
1212

0 commit comments

Comments
 (0)