mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update public default value to false
This commit is contained in:
@@ -110,7 +110,7 @@ func init() {
|
|||||||
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
|
rootCmd.PersistentFlags().StringVarP(&data, "data", "d", "", "data directory")
|
||||||
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
|
rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver")
|
||||||
rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)")
|
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"))
|
err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -145,7 +145,7 @@ func init() {
|
|||||||
viper.SetDefault("driver", "sqlite")
|
viper.SetDefault("driver", "sqlite")
|
||||||
viper.SetDefault("addr", "")
|
viper.SetDefault("addr", "")
|
||||||
viper.SetDefault("port", 8081)
|
viper.SetDefault("port", 8081)
|
||||||
viper.SetDefault("public", true)
|
viper.SetDefault("public", false)
|
||||||
viper.SetEnvPrefix("memos")
|
viper.SetEnvPrefix("memos")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -166,9 +166,10 @@ dsn: %s
|
|||||||
addr: %s
|
addr: %s
|
||||||
port: %d
|
port: %d
|
||||||
mode: %s
|
mode: %s
|
||||||
|
public: %t
|
||||||
driver: %s
|
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() {
|
func printGreetings() {
|
||||||
|
@@ -23,6 +23,9 @@ func (s *APIV1Service) GetWorkspaceProfile(ctx context.Context, _ *v1pb.GetWorks
|
|||||||
}
|
}
|
||||||
if owner != nil {
|
if owner != nil {
|
||||||
workspaceProfile.Owner = owner.Name
|
workspaceProfile.Owner = owner.Name
|
||||||
|
} else {
|
||||||
|
// If owner is not found, set public to true.
|
||||||
|
workspaceProfile.Public = true
|
||||||
}
|
}
|
||||||
return workspaceProfile, nil
|
return workspaceProfile, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user