Skip to content

Commit

Permalink
V0.3.3 (IceWhaleTech#330)
Browse files Browse the repository at this point in the history
* switch branches

* update user interface

* switch branch

* switch branch

* change branch

* submit 0.3.3
  • Loading branch information
LinkLeong authored Jun 29, 2022
1 parent b0dc302 commit f99f49d
Show file tree
Hide file tree
Showing 127 changed files with 5,673 additions and 7,455 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ gen
/docs/
/web/
/conf/conf.ini
/conf/conf.json
__debug_bin
main
CasaOS
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

## [0.3.3-pre] -

### Added

- [System]Add interface call log
- Adding Developing file ([#311](https://github.com/IceWhaleTech/CasaOS/pull/311))
- [App] add new tips for app section.
- [System] UI Configurable function modules: support turning off the search bar and recommended apps module in the settings.
- [System] Custom wallpapers: two new preset wallpapers, support for custom uploads, support for setting images from Files as wallpapers, Also support right click on dashboard to change wallpaper.

### Changed

- [App] Cache app store index and category data
- [System] casaos master program adapted to FHS standards
- [App] Update casaos icons.
- [System] Update translation.

### Removed

- [System] Remove upnp function module
- [System] Remove ddns function module
- [System] Remove search function module
- [System] Remove zerotier function module
- [System] Remove task function module
- [System] Remove file share function module

### Fixed

- [Disk] Fixed hard drive won't hibernate problem ([#202](https://github.com/IceWhaleTech/CasaOS/issues/202))
- [File] Fixed the backspace key that causes the folder to rewind ([#252](https://github.com/IceWhaleTech/CasaOS/issues/252))
- [App] Fixed app logo is not loading when imported. ([#320](https://github.com/IceWhaleTech/CasaOS/issues/320))

## [0.3.2.1] - 2022-06-16(UTC)

### Changed
Expand Down
39 changes: 39 additions & 0 deletions alpha.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!--
* @Author: LinkLeong link@icewhale.com
* @Date: 2022-06-27 11:37:26
* @LastEditors: LinkLeong
* @LastEditTime: 2022-06-27 16:57:38
* @FilePath: /CasaOS/alpha.md
* @Description:
* @Website: https://www.casaos.io
* Copyright (c) 2022 by icewhale, All Rights Reserved.
-->

# alpha Test Description

## :warning: Warning

There is a risk of data loss in non-release versions, so please be careful to back up your data.

## Install/Update

``` curl -fsSL https://get.casaos.io/casaos_new.sh | bash -v v0.3.3-alpha ```

## Check change log

[CHANGELOG](https://github.com/IceWhaleTech/CasaOS/blob/main/CHANGELOG.md)

## Check Design drawings

[Design drawings](https://www.figma.com/file/pvlGobvuWEvbCb3GLqXfim/CasaOS-V0.3.3)

## 提交issue 需要打标签


## Retest after update

Wait for the fix to appear and update and retest, and follow up on the issue

## Thanks

Thank you for your great support, we will return your support from time to time.
40 changes: 40 additions & 0 deletions conf/conf.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[app]
PAGE_SIZE = 10
RuntimeRootPath = runtime/
LogPath = ./CasaOS/logs/server/
LogSaveName = log
LogFileExt = log
DateStrFormat = 20060102
DateTimeFormat = 2006-01-02 15:04:05
TimeFormat = 15:04:05
DateFormat = 2006-01-02
DBPath = ./CasaOS/server/db
ShellPath = ./CasaOS/server/shell
UserDataPath = ./CasaOS/conf
TempPath = ./CasaOS/temp

[server]
HttpPort = 8089
UDPPort = 54216
RunMode = release
;ServerApi = https://api.casaos.io/casaos-api
ServerApi = http://127.0.0.1:8091
Handshake = socket.casaos.io
Token = af268e4f-9f3a-408a-b59b-cf1a4f7f88c8
USBAutoMount =
SocketPort = 58313

[system]
ConfigStr = {"auto_update":false,"background":"","background_type":"","search_engine":"https://duckduckgo.com/?q=","search_switch":false,"shortcuts_switch":false,"widgets_switch":false,"lang":"en_us"}
WidgetList = [{"name":"clock","show":true},{"name":"cpu","show":true},{"name":"disks","show":true},{"name":"network","show":true}]

[file]
ShareDir =
DownloadDir = ./CasaOS/DATA/Downloads

[user]
Description = nothing
UserName = casaos
Initialized = true
PWD = 123456

10 changes: 5 additions & 5 deletions conf/conf.ini.sample → conf/conf.conf.sample
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[app]
PAGE_SIZE = 10
RuntimeRootPath = runtime/
LogSavePath = /casaOS/logs/server/
LogPath = /var/log/casaos/
LogSaveName = log
LogFileExt = log
DateStrFormat = 20060102
DateTimeFormat = 2006-01-02 15:04:05
TimeFormat = 15:04:05
DateFormat = 2006-01-02
ProjectPath = /casaOS/server
RootPath = /casaOS

DBPath = /var/lib/casaos
ShellPath = /usr/share/casaos/shell
UserDataPath = /var/lib/casaos/conf
TempPath = /var/lib/casaos/temp

[server]
HttpPort = 8089
Expand All @@ -23,7 +24,6 @@ USBAutoMount =


[system]
ConfigStr =
WidgetList =


Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ require (
github.com/go-openapi/spec v0.20.4 // indirect
github.com/go-playground/validator/v10 v10.6.1 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/golang-jwt/jwt/v4 v4.4.1
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/gomodule/redigo v1.8.5
github.com/google/go-github/v36 v36.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ=
github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d h1:C/hKUcHT483btRbeGkrRjJz+Zbcj8audldIi9tRJDCc=
github.com/golang/geo v0.0.0-20200319012246-673a6f80352d/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI=
Expand Down
42 changes: 33 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import (
"github.com/IceWhaleTech/CasaOS/pkg/cache"
"github.com/IceWhaleTech/CasaOS/pkg/config"
"github.com/IceWhaleTech/CasaOS/pkg/sqlite"
"github.com/IceWhaleTech/CasaOS/pkg/utils/encryption"
"github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
"github.com/IceWhaleTech/CasaOS/pkg/utils/random"
"github.com/IceWhaleTech/CasaOS/route"
"github.com/IceWhaleTech/CasaOS/service"

Expand All @@ -23,31 +25,30 @@ var sqliteDB *gorm.DB
var configFlag = flag.String("c", "", "config address")
var dbFlag = flag.String("db", "", "db path")
var showUserInfo = flag.Bool("show-user-info", false, "show user info")
var resetUser = flag.Bool("ru", false, "reset user")
var user = flag.String("user", "", "user name")

func init() {
flag.Parse()
config.InitSetup(*configFlag)
config.UpdateSetup()
loger.LogInit()
if len(*dbFlag) == 0 {
*dbFlag = config.AppInfo.ProjectPath + "/db"
*dbFlag = config.AppInfo.DBPath + "/db"
}
sqliteDB = sqlite.GetDb(*dbFlag)
//gredis.GetRedisConn(config.RedisInfo),
service.MyService = service.NewService(sqliteDB)
service.Cache = cache.Init()

go service.UDPService()

fmt.Println("t", service.GetToken())
service.GetToken()
service.UDPAddressMap = make(map[string]string)
//go service.SocketConnect()
service.CancelList = make(map[string]string)
service.InternalInspection = make(map[string][]string)
service.NewVersionApp = make(map[string]string)
route.InitFunction()

go service.SendIPToServer()
// go service.LoopFriend()
// go service.MyService.App().CheckNewImage()

Expand All @@ -72,7 +73,30 @@ func main() {
fmt.Println("Password:" + config.UserInfo.PWD)
return
}
fmt.Println("Reset User", *resetUser)
if *resetUser {

if user == nil || len(*user) == 0 {
fmt.Println("user is empty")
return
}
userData := service.MyService.User().GetUserAllInfoByName(*user)
if userData.Id == 0 {
fmt.Println("user not exist")
return
}
password := random.RandomString(6, false)
userData.Password = encryption.GetMD5ByStr(password)
service.MyService.User().UpdateUserPassword(userData)
fmt.Println("User reset successful")
fmt.Println("UserName:" + userData.UserName)
fmt.Println("Password:" + password)
return
}
go func() {
service.UDPService()
service.SendIPToServer()
}()
go route.SocketInit(service.NotifyMsg)
go func() {
for i := 0; i < 1000; i++ {
Expand Down Expand Up @@ -102,11 +126,11 @@ func main() {
}
err = cron2.AddFunc("0/5 * * * * *", func() {
if service.ClientCount > 0 {
// route.SendNetINfoBySocket()
// route.SendCPUBySocket()
// route.SendMemBySocket()
//route.SendNetINfoBySocket()
//route.SendCPUBySocket()
//route.SendMemBySocket()
// route.SendDiskBySocket()
// route.SendUSBBySocket()
//route.SendUSBBySocket()
route.SendAllHardwareStatusBySocket()
}
})
Expand Down
10 changes: 9 additions & 1 deletion middleware/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: LinkLeong link@icewhale.com
* @Date: 2021-10-08 10:29:08
* @LastEditors: LinkLeong
* @LastEditTime: 2022-05-25 19:17:45
* @LastEditTime: 2022-06-21 15:10:03
* @FilePath: /CasaOS/middleware/gin.go
* @Description:
* @Website: https://www.casaos.io
Expand All @@ -14,7 +14,9 @@ import (
"fmt"
"net/http"

"github.com/IceWhaleTech/CasaOS/pkg/utils/loger"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)

func Cors() gin.HandlerFunc {
Expand Down Expand Up @@ -48,3 +50,9 @@ func Cors() gin.HandlerFunc {
c.Next()
}
}
func WriteLog() gin.HandlerFunc {
return func(c *gin.Context) {
loger.Info("request:", zap.Any("path", c.Request.URL.String()), zap.Any("param", c.Params), zap.Any("query", c.Request.URL.Query()), zap.Any("body", c.Request.Body), zap.Any("method", c.Request.Method))
c.Next()
}
}
9 changes: 9 additions & 0 deletions model/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import (
"time"
)

type ServerAppListCollection struct {
List []ServerAppList `json:"list"`
Recommend []ServerAppList `json:"recommend"`
Community []ServerAppList `json:"community"`
Version string `json:"version"`
}

type ServerAppList struct {
Id uint `gorm:"column:id;primary_key" json:"id"`
Title string `json:"title"`
Expand All @@ -15,6 +22,7 @@ type ServerAppList struct {
Icon string `json:"icon"`
ScreenshotLink Strings `gorm:"type:json" json:"screenshot_link"`
Category string `json:"category"`
CategoryId int `json:"category_id"`
CategoryFont string `json:"category_font"`
PortMap string `json:"port_map"`
ImageVersion string `json:"image_version"`
Expand All @@ -38,6 +46,7 @@ type ServerAppList struct {
Plugins Strings `json:"plugins"`
Origin string `json:"origin"`
Type int `json:"type"`
QueryCount int `json:"query_count"`
Developer string `json:"developer"`
HostName string `json:"host_name"`
Privileged bool `json:"privileged"`
Expand Down
14 changes: 7 additions & 7 deletions model/category.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*
* @Author: link a624669980@163.com
* @Date: 2022-05-16 17:37:08
* @LastEditors: link a624669980@163.com
* @LastEditTime: 2022-06-07 17:12:30
* @FilePath: \CasaOS\model\category.go
* @LastEditors: LinkLeong
* @LastEditTime: 2022-06-22 17:45:53
* @FilePath: /CasaOS/model/category.go
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
package model

// type ServerCategoryList struct {
// Version string `json:"version"`
// Item []CategoryList `json:"item"`
// }
type ServerCategoryList struct {
Version string `json:"version"`
Item []CategoryList `json:"item"`
}
type CategoryList struct {
Id uint `gorm:"column:id;primary_key" json:"id"`
//CreatedAt time.Time `json:"created_at"`
//
Expand Down
10 changes: 6 additions & 4 deletions model/sys_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: LinkLeong link@icewhale.com
* @Date: 2022-05-13 18:15:46
* @LastEditors: LinkLeong
* @LastEditTime: 2022-05-30 16:43:59
* @LastEditTime: 2022-06-16 17:50:56
* @FilePath: /CasaOS/model/sys_common.go
* @Description:
* @Website: https://www.casaos.io
Expand Down Expand Up @@ -46,15 +46,17 @@ type ServerModel struct {

//服务配置
type APPModel struct {
LogSavePath string
LogPath string
LogSaveName string
LogFileExt string
DateStrFormat string
DateTimeFormat string
UserDataPath string
TimeFormat string
DateFormat string
ProjectPath string
RootPath string
DBPath string
ShellPath string
TempPath string
}

//公共返回模型
Expand Down
1 change: 0 additions & 1 deletion model/system.go

This file was deleted.

Loading

0 comments on commit f99f49d

Please sign in to comment.