Task modified to remote acquisition

token modified to no expiration time
This commit is contained in:
a624669980 2021-09-29 19:49:34 +08:00
parent c3dba45e17
commit 40617185e9
20 changed files with 26 additions and 5507 deletions

2
UI

@ -1 +1 @@
Subproject commit ea83f81a5ba7e44be9003246e74a7df7f503fd63 Subproject commit 1f2ebd05fad22128a402d2aef3972d1c67efc24c

View file

@ -1,8 +1,7 @@
[app] [app]
PAGE_SIZE = 10 PAGE_SIZE = 10
RuntimeRootPath = runtime/ RuntimeRootPath = runtime/
;LogSavePath = /casaOS/logs/server/ LogSavePath = /casaOS/logs/server/
LogSavePath = /oasis/logs/server/
LogSaveName = log LogSaveName = log
LogFileExt = log LogFileExt = log
; 必须的格式 ; 必须的格式
@ -10,17 +9,13 @@ DateStrFormat = 20060102
DateTimeFormat = 2006-01-02 15:04:05 DateTimeFormat = 2006-01-02 15:04:05
TimeFormat = 15:04:05 TimeFormat = 15:04:05
DateFormat = 2006-01-02 DateFormat = 2006-01-02
;ProjectPath = /casaOS/server ProjectPath = /casaOS/server
ProjectPath = /oasis/server
[server] [server]
HttpPort = 8089 HttpPort = 8089
RunMode = debug RunMode = release
;ServerApi = http://113.52.135.30:8090 ServerApi = https://api.casaos.zimaboard.com
;ServerApi = https://casaos.zimaboard.com
;ServerApi = http://192.168.2.167:8090
ServerApi = http://192.168.2.142:8090
[user] [user]
UserName = admin UserName = admin
@ -47,6 +42,5 @@ SearchSwitch = true
WidgetsSwitch = false WidgetsSwitch = false
ShortcutsSwitch = true ShortcutsSwitch = true
SearchEngine = baidu SearchEngine = baidu
Background = http://baidu.com1 Background = http://google.com
BackgroundType = d BackgroundType = d

View file

@ -44,12 +44,12 @@ func main() {
//model.Setup() //model.Setup()
//gredis.Setup() //gredis.Setup()
r := route.InitRouter(swagHandler) r := route.InitRouter(swagHandler)
service.SyncTask(sqliteDB) //service.SyncTask(sqliteDB)
cron2 := cron.New() //创建一个cron实例 cron2 := cron.New() //创建一个cron实例
//执行定时任务每5秒执行一次 //执行定时任务每5秒执行一次
err := cron2.AddFunc("0 0 0 1/1 * *", func() { err := cron2.AddFunc("0 0 0 1/1 * *", func() {
//service.UpdataDDNSList(mysqldb) //service.UpdataDDNSList(mysqldb)
service.SyncTask(sqliteDB) //service.SyncTask(sqliteDB)
}) })
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)

View file

@ -7,7 +7,6 @@ import (
oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err" oasis_err2 "github.com/IceWhaleTech/CasaOS/pkg/utils/oasis_err"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"net/http" "net/http"
"time"
) )
func JWT(swagHandler gin.HandlerFunc) gin.HandlerFunc { func JWT(swagHandler gin.HandlerFunc) gin.HandlerFunc {
@ -22,13 +21,15 @@ func JWT(swagHandler gin.HandlerFunc) gin.HandlerFunc {
code = oasis_err2.INVALID_PARAMS code = oasis_err2.INVALID_PARAMS
} }
if swagHandler == nil { if swagHandler == nil {
claims, err := ParseToken(token) //claims, err := ParseToken(token)
_, err := ParseToken(token)
if err != nil { if err != nil {
code = oasis_err2.ERROR_AUTH_TOKEN code = oasis_err2.ERROR_AUTH_TOKEN
} else if time.Now().Unix() > claims.ExpiresAt {
code = oasis_err2.ERROR_AUTH_TOKEN
} }
//else if time.Now().Unix() > claims.ExpiresAt {
// code = oasis_err2.ERROR_AUTH_TOKEN
//}
} }
if code != oasis_err2.SUCCESS { if code != oasis_err2.SUCCESS {

View file

@ -80,12 +80,12 @@ func (s *taskService) GetServerTasks() []model.TaskDBModel {
list := []model.TaskDBModel{} list := []model.TaskDBModel{}
json2.Unmarshal([]byte(gjson.Get(listS, "data").String()), &list) json2.Unmarshal([]byte(gjson.Get(listS, "data").String()), &list)
go func(list []model.TaskDBModel) { //go func(list []model.TaskDBModel) {
for _, dbModel := range list { // for _, dbModel := range list {
dbModel.Id = 0 // dbModel.Id = 0
s.db.Create(&dbModel) // s.db.Create(&dbModel)
} // }
}(list) //}(list)
return list return list
} }
func (s *taskService) SyncTaskService() { func (s *taskService) SyncTaskService() {
@ -133,12 +133,12 @@ func SyncTask(db *gorm.DB) {
list := []model.TaskDBModel{} list := []model.TaskDBModel{}
json2.Unmarshal([]byte(gjson.Get(listS, "data").String()), &list) json2.Unmarshal([]byte(gjson.Get(listS, "data").String()), &list)
//go func(list []model.TaskDBModel) { go func(list []model.TaskDBModel) {
// for _, dbModel := range list { for _, dbModel := range list {
// dbModel.Id = 0 dbModel.Id = 0
// db.Create(&dbModel) db.Create(&dbModel)
// } }
//}(list) }(list)
} }
func NewTaskService(db *gorm.DB, log loger2.OLog) TaskService { func NewTaskService(db *gorm.DB, log loger2.OLog) TaskService {
return &taskService{db: db, log: log} return &taskService{db: db, log: log}

View file

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/ui/img/icon/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

View file

@ -1,25 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="200.000000pt" height="200.000000pt" viewBox="0 0 200.000000 200.000000"
preserveAspectRatio="xMidYMid meet">
<metadata>
Created by potrace 1.14, written by Peter Selinger 2001-2017
</metadata>
<g transform="translate(0.000000,200.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M875 1894 c-11 -2 -51 -11 -88 -20 -341 -78 -610 -364 -673 -714 -82
-459 197 -902 647 -1030 94 -27 277 -37 378 -21 303 47 575 261 690 540 55
133 66 192 65 361 -1 136 -4 165 -27 235 -36 116 -62 170 -123 261 -123 186
-347 336 -566 379 -42 8 -276 15 -303 9z m250 -168 c11 -2 42 -9 70 -16 131
-30 288 -135 387 -260 160 -201 198 -506 93 -745 l-22 -50 2 80 c3 180 -64
351 -184 476 -209 216 -544 260 -807 105 -201 -117 -326 -347 -319 -587 l2
-74 -19 44 c-63 140 -80 332 -44 476 24 94 87 219 147 292 109 133 290 238
448 259 25 3 47 7 49 9 5 4 173 -3 197 -9z m8 -501 c33 -8 85 -31 116 -50 227
-137 305 -418 183 -651 l-21 -39 -1 35 c-9 251 -245 439 -490 389 -186 -38
-323 -200 -330 -389 l-1 -35 -23 45 c-101 194 -61 429 99 578 130 122 292 162
468 117z m-27 -499 c182 -85 183 -345 1 -438 -53 -27 -161 -26 -215 1 -146 75
-180 267 -69 390 63 69 190 90 283 47z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:2;}
</style>
<path class="st0" d="M12,22c5.5,0,10-4.5,10-10S17.5,2,12,2S2,6.5,2,12S6.5,22,12,22z"/>
<path class="st0" d="M12,22c3.9,0,7-3.1,7-7s-3.1-7-7-7s-7,3.1-7,7S8.1,22,12,22z"/>
<path class="st0" d="M12,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S9.8,22,12,22z"/>
</svg>

Before

Width:  |  Height:  |  Size: 729 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

View file

@ -1,34 +0,0 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="apple-touch-icon" sizes="180x180" href="/ui/img/icon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/ui/img/icon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/ui/img/icon/favicon-16x16.png">
<link rel="manifest" href="/ui/site.webmanifest">
<link rel="mask-icon" href="/ui/img/icon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link rel="icon" href="/ui/favicon.ico">
<link rel="stylesheet" href="//cdn.materialdesignicons.com/2.0.46/css/materialdesignicons.min.css">
<script src="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.4/js/all.js"
integrity="sha256-GaerX2a/DuOnPrxn/4vH13dobiFUe/27LO6gCZDNauA=" crossorigin="anonymous"></script>
<title>
CasaOS
</title>
<link href="/ui/js/app.js" rel="preload" as="script"><link href="/ui/js/chunk-vendors.js" rel="preload" as="script"></head>
<body>
<noscript>
<strong>We're sorry but CasaOS doesn't work properly without JavaScript enabled.
Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
<script type="text/javascript" src="/ui/js/chunk-vendors.js"></script><script type="text/javascript" src="/ui/js/app.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1,14 +0,0 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/ui/img/icon/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}