Skip to content

Commit

Permalink
feat: add github rauc source (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrectRoadH authored Sep 25, 2024
1 parent 2e5e380 commit 56525d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions build/sysroot/etc/casaos/installer.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ LogFileExt = log
[server]
CachePath = /var/lib/casaos_data/rauc
mirrors = https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/
mirrors = https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/,https://raw.githubusercontent.com/IceWhaleTech/ZimaOS/refs/heads/main/
18 changes: 15 additions & 3 deletions cmd/channel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"fmt"
"os"
"os/exec"
"strings"

"github.com/IceWhaleTech/CasaOS-Installer/internal/config"
Expand All @@ -26,7 +27,7 @@ func main() {
PrivateTestChannel()
case "stable":
StableChannel()
case "test":
case "internal":
TestChannel()
case "disable":
DisableChannel()
Expand All @@ -52,11 +53,19 @@ func Save() {
if err != nil {
fmt.Printf("Fail to save file: %v", err)
}
// restart casaos installer
err = exec.Command("systemctl", "restart", "casaos-installer").Run()
if err != nil {
fmt.Printf("Fail to restart casaos-installer: %v", err)
}
}

func PublicTestChannel() {
fmt.Println("Public Test Channel")
config.ServerInfo.Mirrors = []string{"https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/public-test/"}
config.ServerInfo.Mirrors = []string{
"https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/public-test/",
"https://raw.githubusercontent.com/IceWhaleTech/ZimaOS/refs/heads/main/public-test/",
}
Save()
}

Expand All @@ -68,7 +77,10 @@ func PrivateTestChannel() {

func StableChannel() {
fmt.Println("Stable Channel")
config.ServerInfo.Mirrors = []string{"https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/"}
config.ServerInfo.Mirrors = []string{
"https://casaos.oss-cn-shanghai.aliyuncs.com/IceWhaleTech/zimaos-rauc/",
"https://raw.githubusercontent.com/IceWhaleTech/ZimaOS/refs/heads/main/",
}
Save()
}

Expand Down

0 comments on commit 56525d4

Please sign in to comment.