Skip to content

Commit

Permalink
fixing privileges; checking flags on start up
Browse files Browse the repository at this point in the history
  • Loading branch information
sravotto committed Nov 18, 2022
1 parent f16d9d0 commit cd92fca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions internal/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package server

import (
"errors"
"os"
"os/signal"
"syscall"
Expand All @@ -41,6 +42,12 @@ func Command() *cobra.Command {
./visus start --bindAddr "127.0.0.1:15432" `,
RunE: func(cmd *cobra.Command, _ []string) error {
ctx := cmd.Context()
if (cfg.BindCert == "" || cfg.BindKey == "") && !cfg.Insecure {
return errors.New("--insecure must be specfied if certificates and private key are missing")
}
if cfg.URL == "" {
return errors.New("--url must be specified")
}
conn, err := database.DefaultFactory.New(ctx, cfg.URL)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/store/sql/ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GRANT CONNECT ON DATABASE _visus to visus;

USE _visus;

ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO visus_monitor;
ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO visus;

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

Expand Down

0 comments on commit cd92fca

Please sign in to comment.