Skip to content

Commit

Permalink
update SD help menu
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Mar 6, 2024
1 parent 5cf9b81 commit fc2075a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cmd/service-discovery/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -57,20 +58,26 @@ func init() {
RootCmd.Flags().StringVarP(&whitelistKeys, "whitelist-keys", "w", "", "list of whitelisted keys of network monitor used for deregistration")
RootCmd.Flags().BoolVarP(&testMode, "test", "t", false, "run in test mode and disable auth")
RootCmd.Flags().StringVarP(&apiKey, "api-key", "g", "", "geo API key")
RootCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "d", "", "url of dmsg-discovery default:\n"+skyenv.DmsgDiscAddr)
RootCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "d", skyenv.DmsgDiscAddr, "url of dmsg-discovery")
RootCmd.Flags().BoolVarP(&testEnvironment, "test-environment", "n", false, "distinguished between prod and test environment")
RootCmd.Flags().VarP(&sk, "sk", "s", "dmsg secret key\n")
RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r")
RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value")
}

// RootCmd contains the root service-discovery command
var RootCmd = &cobra.Command{
Use: "sd",
Use: func() string {
return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0]
}(),
Short: "Service discovery server",
Long: `
┌─┐┌─┐┬─┐┬ ┬┬┌─┐┌─┐ ┌┬┐┬┌─┐┌─┐┌─┐┬ ┬┌─┐┬─┐┬ ┬
└─┐├┤ ├┬┘└┐┌┘││ ├┤───│││└─┐│ │ │└┐┌┘├┤ ├┬┘└┬┘
└─┘└─┘┴└─ └┘ ┴└─┘└─┘ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ `,
└─┘└─┘┴└─ └┘ ┴└─┘└─┘ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴
----- depends: redis, postgresql and initial DB setup -----
sudo -iu postgres createdb sd
keys-gen | tee sd-config.json
PG_USER="postgres" PG_DATABASE="sd" PG_PASSWORD="" service-discovery --sk $(tail -n1 sd-config.json)`,
Run: func(_ *cobra.Command, _ []string) {
if dmsgDisc == "" {
dmsgDisc = skyenv.DmsgDiscAddr
Expand Down

0 comments on commit fc2075a

Please sign in to comment.