Compare commits

..

5 Commits

Author SHA1 Message Date
LinkLeong
57e5a710e0 change changelog 2022-12-13 08:53:06 +00:00
link
062d95c1eb done (#750) 2022-12-10 17:42:05 +08:00
link
75643287a5 finish (#742) 2022-12-07 14:29:22 +08:00
link
6bda9406fb fixed (#741) 2022-12-07 10:57:27 +08:00
Tiger Wang
be9a010d17 fix sqlite db lock by reducing maximum open connections to 1 (#732) 2022-12-02 17:25:44 -05:00
4 changed files with 35 additions and 12 deletions

View File

@@ -16,8 +16,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security ### Security
## [0.4.0] - 2022-12-13
### Added
- [Developer] Included `casaos-cli` command tool for debugging
- [Developer] Added message bus for events and actions - Use `casaos-cli message-bus` to manage.
- [Disk] Disk notification in Dashboard
- [System] Restart/shutdown directly from CasaOS Dashboard
### Changed
- [General] CasaOS new logo!
- [App] Redesign of Featured App
- [App] Now you can choose to delete userdata along with app uninstallation
### Security
- [System] Fixed a shell injection issue for better security
### Fixed ### Fixed
- [System] Re-instate default zone0 for CPU Temp ([#694](https://github.com/IceWhaleTech/CasaOS/issues/694)) - [System] Re-instate default zone0 for CPU Temp ([#694](https://github.com/IceWhaleTech/CasaOS/issues/694))
- [Disk] Fixed storage name with extra `-1` after rebooting ([#698](https://github.com/IceWhaleTech/CasaOS/issues/698))
- [Disk] Fixed disk check so it does not impact disk going into idle ([#704](https://github.com/IceWhaleTech/CasaOS/issues/704))
## [0.3.8] 2022-11-21 ## [0.3.8] 2022-11-21

View File

@@ -34,7 +34,7 @@ func GetDb(dbPath string) *gorm.DB {
db, err := gorm.Open(sqlite.Open(dbPath+"/casaOS.db"), &gorm.Config{}) db, err := gorm.Open(sqlite.Open(dbPath+"/casaOS.db"), &gorm.Config{})
c, _ := db.DB() c, _ := db.DB()
c.SetMaxIdleConns(10) c.SetMaxIdleConns(10)
c.SetMaxOpenConns(100) c.SetMaxOpenConns(1)
c.SetConnMaxIdleTime(time.Second * 1000) c.SetConnMaxIdleTime(time.Second * 1000)
if err != nil { if err != nil {
logger.Error("sqlite connect error", zap.Any("db connect error", err)) logger.Error("sqlite connect error", zap.Any("db connect error", err))

View File

@@ -337,17 +337,12 @@ func GetSystemProxy(c *gin.Context) {
func PutSystemState(c *gin.Context) { func PutSystemState(c *gin.Context) {
state := c.Param("state") state := c.Param("state")
if state == "off" { if state == "off" {
go func() { service.MyService.System().SystemShutdown()
time.Sleep(30 * time.Second)
service.MyService.System().SystemShutdown()
}()
} else if state == "restart" { } else if state == "restart" {
go func() { service.MyService.System().SystemReboot()
time.Sleep(30 * time.Second)
service.MyService.System().SystemReboot()
}()
} }
c.JSON(http.StatusOK, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: "The operation will be executed after 30 seconds"}) c.JSON(http.StatusOK, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: "The operation will be completed shortly."})
} }
// @Summary 获取一个可用端口 // @Summary 获取一个可用端口

View File

@@ -1,6 +1,7 @@
package service package service
import ( import (
"errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
net2 "net" net2 "net"
@@ -63,8 +64,15 @@ func (c *systemService) GetMacAddress() (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
inter := interfaces[0] nets := MyService.System().GetNet(true)
return inter.HardwareAddr, nil for _, v := range interfaces {
for _, n := range nets {
if v.Name == n {
return v.HardwareAddr, nil
}
}
}
return "", errors.New("not found")
} }
func (c *systemService) MkdirAll(path string) (int, error) { func (c *systemService) MkdirAll(path string) (int, error) {