1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-10 22:14:45 +08:00
parent 3bfac6e81e
commit 763f0d43d9
5 changed files with 24 additions and 101 deletions

View File

@ -1,22 +1,22 @@
export CGO_ENABLED=0 publish = usr/publish
binarys = bin/ice.bin binarys = bin/ice.bin
version = src/version.go
binpack = src/binpack.go
all: def all: def
@date +"%Y-%m-%d %H:%M:%S" @date +"%Y-%m-%d %H:%M:%S"
go build -v -o ${binarys} src/main.go src/version.go src/binpack.go && ./${binarys} forever restart &>/dev/null go build -v -o ${binarys} src/main.go ${version} ${binpack} && ./${binarys} forever restart &>/dev/null
app: def app: def
CGO_ENABLED=1 go build -v -o usr/publish/contexts.app/Contents/MacOS/contexts src/webview.go src/version.go src/binpack.go && ./${binarys} forever restart &>/dev/null CGO_ENABLED=1 go build -v -o ${publish}/contexts.app/Contents/MacOS/contexts src/webview.go ${version} ${binpack} && ./${binarys} forever restart &>/dev/null
# hdiutil create usr/publish/tmp.dmg -ov -volname "ContextsInstall" -fs HFS+ -srcfolder "usr/publish/contexts.app" # hdiutil create ${publish}/tmp.dmg -ov -volname "ContextsInstall" -fs HFS+ -srcfolder "${publish}/contexts.app"
# rm -f usr/publish/ContextsInstall.dmg # rm -f ${publish}/ContextsInstall.dmg
# hdiutil convert usr/publish/tmp.dmg -format UDZO -o usr/publish/ContextsInstall.dmg # hdiutil convert ${publish}/tmp.dmg -format UDZO -o ${publish}/ContextsInstall.dmg
%: src/%.go def %: src/%.go def
@date +"%Y-%m-%d %H:%M:%S" @date +"%Y-%m-%d %H:%M:%S"
go build -v -o usr/publish/$@ src/$@.go src/version.go && chmod u+x usr/publish/$@ go build -v -o ${publish}/$@ src/$@.go ${version} && chmod u+x ${publish}/$@
def: def:
@ [ -f src/version.go ] || echo "package main" > src/version.go @[ -f ${version} ] || echo "package main">${version}
@ [ -f src/binpack.go ] || echo "package main" > src/binpack.go @[ -f ${binpack} ] || echo "package main">${binpack}

View File

@ -1,14 +1,7 @@
# contexts # contexts
contexts 通过集群化、模块化、自动化的方式,用一个 20M 的程序文件,就可以在各种设备上,一键搭起完整的云计算与云研发服务。 contexts 通过集群化、模块化、自动化的方式,用一个 20M 的程序文件,就可以在各种设备上,一键搭起完整的云计算与云研发服务。
## 安装项目 ## 安装项目
```sh ```sh
ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL https://shylinux.com; source $ctx_temp binary port 9020 temp=$(mktemp); if curl -h &>/dev/null; then curl -o $temp -fsSL https://shylinux.com; else wget -O $temp -q https://shylinux.com; fi; source $temp binary
``` ```
## 使用项目
如果是本地启动直接免登录打开网页http://localhost:9020
如果是远程或容器启动,输入相应地址后,输入默认的 username: root password: root 即可登录

View File

@ -1,7 +0,0 @@
~web.chat
favor export
~aaa
sess export
user export
~cli
daemon export

View File

@ -1,73 +1,24 @@
~cli
daemon import
~aaa
user import
sess import
~web.chat
favor import
~aaa
role white void web.code.git.spide
role white void web.code.git.trend
role white void web.code.input.find
role white void web.wiki.alpha.find
role white void require/src
~web.code
alpine mirrors
alpine tzone
~web.code ~web.code
webpack insert xterm webpack insert xterm
webpack insert xterm-addon-fit webpack insert xterm-addon-fit
webpack insert xterm-addon-web-links webpack insert xterm-addon-web-links
webpack insert xterm/css/xterm.css webpack insert xterm/css/xterm.css
favor remove zone _system_app
favor insert zone _system_app type "open -a 'System Preferences'" text "System Preferences.png"
favor insert zone _system_app type "open -a 'Launchpad'" text "Launchpad.png"
favor insert zone _system_app type "open -a 'Mission Control'" text "Mission Control.png"
favor insert zone _system_app type "open -a 'Activity Monitor'" text "Activity Monitor.png"
favor insert zone _system_app type "open -a 'Google Chrome'" text "Google Chrome.png"
favor insert zone _system_app type "open -a 'QuickTime Player'" text "QuickTime Player.png"
favor insert zone _system_app type "open -a 'Preview'" text "Preview.png"
favor insert zone _system_app type "open -a 'Finder'" text "Finder.png"
favor insert zone _system_app type "open -a 'Docker'" text "Docker.png"
favor insert zone _system_app type "open -a 'Safari'" text "Safari.png"
favor insert zone _system_app type "open -a 'Terminal'" text "Terminal.png"
favor insert zone _system_app type "open -a 'Contexts'" text "Contexts.png"
favor insert zone _system_app type "open 'http://localhost:9020'" name localhost text "Google Chrome.png"
favor insert zone _system_app type "open 'https://shylinux.com'" name shylinux text "Google Chrome.png"
favor remove zone _system_term
favor insert zone _system_term type "docker run -w /root -it alpine"
favor insert zone _system_term type "docker run -it contexts"
favor insert zone _system_term type "ice.bin source stdio"
favor insert zone _system_term type "tmux attach -t miss"
favor insert zone _system_term type "vim src/main.go"
favor insert zone _system_term type "python"
favor insert zone _system_term type "node"
~web.code
config inner meta.show.tabs ""
config inner meta.show.plug ""
config vimer meta.show.tabs ""
config vimer meta.show.plug "web.code.xterm,web.chat.iframe"
~web.code.input ~web.code.input
# wubi load file usr/wubi-dict/wubi86 # wubi load file usr/wubi-dict/wubi86
# wubi load file usr/wubi-dict/person zone person # wubi load file usr/wubi-dict/person zone person
~aaa
role white void web.code.git.spide
role white void web.code.git.trend
role white void web.code.input.find
role white void web.wiki.alpha.find
~gdb ~gdb
# config timer meta.enable true # config timer meta.enable true
event listen event dream.create cmd web.code.tmux.session
# event listen event serve.start cmd web.code.publish # event listen event serve.start cmd web.code.publish
event listen event sess.create cmd aaa.sess event listen event dream.create cmd web.code.tmux.session
event listen event user.create cmd aaa.sess
~ssh ~ssh
target web.code target web.code
source local.shy source local.shy

View File

@ -2,31 +2,17 @@ package main
import ( import (
"os" "os"
"time"
"shylinux.com/x/ice" "shylinux.com/x/ice"
"shylinux.com/x/icebergs/base/cli"
"shylinux.com/x/icebergs/base/tcp" "shylinux.com/x/icebergs/base/tcp"
"shylinux.com/x/icebergs/base/web" "shylinux.com/x/icebergs/base/web"
"shylinux.com/x/icebergs/misc/webview" "shylinux.com/x/icebergs/misc/webview"
kit "shylinux.com/x/toolkits" kit "shylinux.com/x/toolkits"
_ "shylinux.com/x/contexts/src/h2"
) )
type view struct{ *webview.WebView }
func main() { func main() {
if os.Chdir(kit.HomePath(ice.CONTEXTS)); len(os.Args) == 1 { os.Chdir(kit.HomePath(ice.CONTEXTS))
for {
if ice.Run(cli.SYSTEM, os.Args[0], "webview"); cli.IsSuccess(ice.Pulse) {
break
}
time.Sleep(time.Second)
}
} else {
go ice.Run(web.SERVE, tcp.START) go ice.Run(web.SERVE, tcp.START)
defer ice.Pulse.Cmd("exit") defer ice.Pulse.Cmd("exit")
webview.Run(func(w *webview.WebView) ice.Any { return view{w} }) webview.Run(nil)
}
} }