Commit 553e8d09 authored by Steven's avatar Steven

chore: update public default value to false

parent 22ec0cf2
......@@ -110,7 +110,7 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)")
rootCmd.PersistentFlags().BoolVarP(&public, "public", "", true, "")
rootCmd.PersistentFlags().BoolVarP(&public, "public", "", false, "")
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
if err != nil {
......@@ -145,7 +145,7 @@ func init() {
viper.SetDefault("driver", "sqlite")
viper.SetDefault("addr", "")
viper.SetDefault("port", 8081)
viper.SetDefault("public", true)
viper.SetDefault("public", false)
viper.SetEnvPrefix("memos")
}
......@@ -166,9 +166,10 @@ dsn: %s
addr: %s
port: %d
mode: %s
public: %t
driver: %s
---
`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver)
`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Public, instanceProfile.Driver)
}
func printGreetings() {
......
......@@ -23,6 +23,9 @@ func (s *APIV1Service) GetWorkspaceProfile(ctx context.Context, _ *v1pb.GetWorks
}
if owner != nil {
workspaceProfile.Owner = owner.Name
} else {
// If owner is not found, set public to true.
workspaceProfile.Public = true
}
return workspaceProfile, nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment