Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
40617185e9 | ||
|
|
c3dba45e17 | ||
|
|
83f58366a6 | ||
|
|
3fa09dad8e | ||
|
|
f0f0eb2ef0 | ||
|
|
436b87f8a8 | ||
|
|
f0888ef2ac | ||
|
|
03e23ec203 |
102
.github/workflows/casa.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# This is a basic workflow to help you get started with Actions
|
||||||
|
|
||||||
|
name: Build CasaOS
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- created
|
||||||
|
|
||||||
|
env:
|
||||||
|
REPO_URL: https://github.com/IceWhaleTech/CasaOS.git
|
||||||
|
REPO_BRANCH: main
|
||||||
|
PACK_SH_URL: https://raw.githubusercontent.com/jerrykuku/actions-casa/main/pack.sh
|
||||||
|
PACK_SH: pack.sh
|
||||||
|
TZ: Asia/Shanghai
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
xgo:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
go_version:
|
||||||
|
- 1.17.1
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Get release
|
||||||
|
id: get_release
|
||||||
|
uses: bruceadams/get-release@v1.2.3
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Initialization environment
|
||||||
|
env:
|
||||||
|
DEBIAN_FRONTEND: noninteractive
|
||||||
|
run: |
|
||||||
|
sudo timedatectl set-timezone "$TZ"
|
||||||
|
sudo mkdir -p /workdir
|
||||||
|
sudo chown $USER:$GROUPS /workdir
|
||||||
|
|
||||||
|
- name: Clone source code
|
||||||
|
working-directory: /workdir
|
||||||
|
run: |
|
||||||
|
df -hT $PWD
|
||||||
|
git clone $REPO_URL -b $REPO_BRANCH --recursive casa
|
||||||
|
ln -sf /workdir/casa $GITHUB_WORKSPACE/casa
|
||||||
|
ls
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Build frontend with nodejs and yarn
|
||||||
|
run: |
|
||||||
|
cd casa/UI
|
||||||
|
ls
|
||||||
|
yarn install
|
||||||
|
yarn build
|
||||||
|
|
||||||
|
- name: Build with xgo
|
||||||
|
uses: crazy-max/ghaction-xgo@v1
|
||||||
|
with:
|
||||||
|
working_dir: /workdir/casa
|
||||||
|
xgo_version: latest
|
||||||
|
go_version: ${{ matrix.go_version }}
|
||||||
|
dest: build
|
||||||
|
prefix: casa
|
||||||
|
targets: linux/amd64,linux/arm64
|
||||||
|
v: true
|
||||||
|
x: false
|
||||||
|
race: false
|
||||||
|
ldflags: -s -w
|
||||||
|
buildmode: default
|
||||||
|
|
||||||
|
- name: List Files
|
||||||
|
run: |
|
||||||
|
ls
|
||||||
|
cd casa/build
|
||||||
|
ls
|
||||||
|
echo "::set-output name=status::success"
|
||||||
|
|
||||||
|
- name: Pack builds
|
||||||
|
run: |
|
||||||
|
cd /workdir
|
||||||
|
wget $PACK_SH_URL
|
||||||
|
chmod +x $PACK_SH
|
||||||
|
./$PACK_SH
|
||||||
|
echo "::set-output name=status::success"
|
||||||
|
|
||||||
|
- name: Upload linux-amd64-casaos.tar.gz
|
||||||
|
id: upload_assets_amd64
|
||||||
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||||
|
asset_path: /workdir/casa/upload/linux-amd64-casaos.tar.gz
|
||||||
|
|
||||||
|
- name: Upload linux-arm64-casaos.tar.gz
|
||||||
|
id: upload_assets_arm64
|
||||||
|
uses: shogo82148/actions-upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ steps.get_release.outputs.upload_url }}
|
||||||
|
asset_path: /workdir/casa/upload/linux-arm64-casaos.tar.gz
|
||||||
5
.gitmodules
vendored
@@ -1,3 +1,4 @@
|
|||||||
[submodule "CasaOS-UI"]
|
[submodule "UI"]
|
||||||
path = CasaOS-UI
|
path = UI
|
||||||
url = https://github.com/IceWhaleTech/CasaOS-UI.git
|
url = https://github.com/IceWhaleTech/CasaOS-UI.git
|
||||||
|
branch = main
|
||||||
@@ -13,18 +13,17 @@ CasaOS is an open-source home server system based on the Docker ecosystem and de
|
|||||||
IceWhale team believes that through community-driven collaborative innovation and open communication with global developers, we can reshape the digital home experience like never before.
|
IceWhale team believes that through community-driven collaborative innovation and open communication with global developers, we can reshape the digital home experience like never before.
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Key Features
|
||||||
|
|
||||||
- UI designed for home scenarios - simple, elegant, and easy-to-use
|
- UI designed for home scenarios - simple, elegant, and easy-to-use
|
||||||
- Quick Docker app installation with only three steps
|
- Quick Docker app installation with only three steps, plus automatic management
|
||||||
- Automatic Docker application management
|
|
||||||
- App Store for private cloud 🚧
|
- App Store for private cloud 🚧
|
||||||
- Home data/digital asset management 🚧
|
- Home data/digital asset management 🚧
|
||||||
- Smart home manager 🚧
|
- Smart home manager 🚧
|
||||||
|
|
||||||
🚧 is under development.
|
🚧 is under development.
|
||||||
|
|
||||||
We are actively moving forward with development, and you are more than welcome to share any idea in the [Discord server](https://discord.gg/Gx4BCEtHjx)!
|
We are actively moving forward with development, and you are more than welcome to share any idea with us!
|
||||||
|
|
||||||
|
|
||||||
## Community
|
## Community
|
||||||
@@ -84,4 +83,4 @@ curl -fsSL https://get.icewhale.io/casaos.sh | bash
|
|||||||
- Ober Zhang
|
- Ober Zhang
|
||||||
- Zyaire Ann
|
- Zyaire Ann
|
||||||
- John Guan
|
- John Guan
|
||||||
- More seats vacant for the right person
|
- Right here, waiting for YOU!
|
||||||
1
UI
Submodule
@@ -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
|
||||||
|
|
||||||
4
main.go
@@ -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)
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
@@ -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>
|
|
||||||
BIN
web/favicon.ico
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 693 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -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 |
@@ -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 |
|
Before Width: | Height: | Size: 26 KiB |
@@ -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>
|
|
||||||
1297
web/js/app.js
@@ -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"
|
|
||||||
}
|
|
||||||