Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: update public default value to false

Steven553e8d09ddad
diff --git a/bin/memos/main.go b/bin/memos/main.go
index 1e5855bc1..56cd4dd86 100644
--- a/bin/memos/main.go
+++ b/bin/memos/main.go
@@ -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() {
diff --git a/server/router/api/v1/workspace_service.go b/server/router/api/v1/workspace_service.go
index 3796d3f46..2cbc67fb2 100644
--- a/server/router/api/v1/workspace_service.go
+++ b/server/router/api/v1/workspace_service.go
@@ -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
}