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 system setting default value (#1665)

boojack1a8310f027c1
diff --git a/server/resource.go b/server/resource.go
index fe3f908e9..240750f7d 100644
--- a/server/resource.go
+++ b/server/resource.go
@@ -137,7 +137,7 @@ func (s *Server) registerResourceRoutes(g *echo.Group) {
if err != nil && common.ErrorCode(err) != common.NotFound {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find local storage path setting").SetInternal(err)
}
- localStoragePath := ""
+ localStoragePath := "assets/{timestamp}_{filename}"
if systemSettingLocalStoragePath != nil {
err = json.Unmarshal([]byte(systemSettingLocalStoragePath.Value), &localStoragePath)
if err != nil {
diff --git a/server/system.go b/server/system.go
index c98d2bd2d..fd852fd83 100644
--- a/server/system.go
+++ b/server/system.go
@@ -44,7 +44,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
AllowSignUp: false,
IgnoreUpgrade: false,
DisablePublicMemos: false,
- MaxUploadSizeMiB: 32, // this is the frontend default value
+ MaxUploadSizeMiB: 32,
AdditionalStyle: "",
AdditionalScript: "",
CustomizedProfile: api.CustomizedProfile{
@@ -56,7 +56,7 @@ func (s *Server) registerSystemRoutes(g *echo.Group) {
ExternalURL: "",
},
StorageServiceID: api.DatabaseStorage,
- LocalStoragePath: "",
+ LocalStoragePath: "assets/{timestamp}_{filename}",
}
systemSettingList, err := s.Store.FindSystemSettingList(ctx, &api.SystemSettingFind{})
diff --git a/store/db/migration/prod/0.12/05__default_local_storage_path.sql b/store/db/migration/prod/0.12/05__default_local_storage_path.sql
deleted file mode 100644
index 71908e84a..000000000
--- a/store/db/migration/prod/0.12/05__default_local_storage_path.sql
+++ /dev/null
@@ -1,7 +0,0 @@
-INSERT
- OR IGNORE INTO system_setting(name, value)
-VALUES
- (
- 'local-storage-path',
- '"assets/{timestamp}_{filename}"'
- );
\ No newline at end of file
diff --git a/store/db/seed/10005__system_setting.sql b/store/db/seed/10005__system_setting.sql
deleted file mode 100644
index 145a8acc5..000000000
--- a/store/db/seed/10005__system_setting.sql
+++ /dev/null
@@ -1,5 +0,0 @@
-INSERT INTO
- system_setting (`name`, `value`, `description`)
-VALUES
- ('allow-signup', 'true', ''),
- ('max-upload-size-mib', '32', '');
\ No newline at end of file
diff --git a/store/db/seed/10006__tag.sql b/store/db/seed/10005__tag.sql
similarity index 100%
rename from store/db/seed/10006__tag.sql
rename to store/db/seed/10005__tag.sql