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.

fix: some fields of profile leaked without auth (#2408)

Athurg Goothfd5d51ee5475
diff --git a/api/v1/system.go b/api/v1/system.go
index 4d9c6f380..381b988c7 100644
--- a/api/v1/system.go
+++ b/api/v1/system.go
@@ -72,7 +72,10 @@ func (s *APIV1Service) GetSystemStatus(c echo.Context) error {
ctx := c.Request().Context()
systemStatus := SystemStatus{
- Profile: *s.Profile,
+ Profile: profile.Profile{
+ Mode: s.Profile.Mode,
+ Version: s.Profile.Version,
+ },
// Allow sign up by default.
AllowSignUp: true,
MaxUploadSizeMiB: 32,
diff --git a/server/profile/profile.go b/server/profile/profile.go
index c8be8aecb..cdac30d58 100644
--- a/server/profile/profile.go
+++ b/server/profile/profile.go
@@ -24,10 +24,10 @@ type Profile struct {
// Data is the data directory
Data string `json:"-"`
// DSN points to where memos stores its own data
- DSN string `json:"dsn"`
+ DSN string `json:"-"`
// Driver is the database driver
// sqlite, mysql
- Driver string `json:"driver"`
+ Driver string `json:"-"`
// Version is the current version of server
Version string `json:"version"`
}