Skip to content

Commit

Permalink
feat: define model
Browse files Browse the repository at this point in the history
Signed-off-by: richardli1598 <[email protected]>
  • Loading branch information
richardli1598 committed Sep 26, 2023
1 parent 3310a2d commit 466f0dc
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 80 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
115 changes: 72 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,57 @@

Take you to the land of light, the city of freedom(A unified external service management system for NAS).

对于公网服务暴露,存在如下场景:
无公网:
1.本地安装frpc,本地frpc配置/长期运行
2.服务器安装frps,或者再添加nginx,服务端配置/长期运行
3.域名配置/长期运行


其他本地和服务端的业务配置和安装


有公网:
1.本地ngin反向代理配置
2.无
3.域名配置

对于步骤1,2,3;每个步骤都可以抽象化,定义独立的行为,抽象模型如下:
1.本地配置
2.服务端配置
3.域名配置


# demo
globalConfig demo:
步骤1
```yaml
kind: config
name: globalConfig
name: FrpcServiceUp
description: xxx
data:
ssh-password: xxx
ssh-user: xxx
parameter:
in:
server:
type: string
description: xxx
default: xxx
required: true
ports:
type: array
description: xxx
required: true
items:
localPort:
type: string
remotePort:
type: string
out:
configPath:
type: string
image: xxxx
```
action element demo:
步骤2
```yaml
kind: action
name: remoteInstallNginx
name: FrpsServiceUp
description: xxx
parameter:
in:
Expand All @@ -29,45 +65,38 @@ parameter:
image: xxxx
```
步骤3
```yaml
name: DDNS
parameter:
in:
xxx
out:
xxx
image:xxx
```

full workflow demo:
```yaml
name: exposeLocalService
kind: workflow
kind: ServiceExpose
description: xxx
on: dispatch #dispatch/schedule
schedule: xxx
- use: nginxInstall
name: remoteInstallNginx
with:
- name: ip
value: 192.168.1.6
- name: sshUser
value: root
- name: sshPassword
valueFrom:
kind: config
name: globalConfig
key: ssh-password
- use: configNginx
para:
- name: configPath
valueFrom:
kind: action
name: remoteInstallNginx
key: configPath
- use: action/frpServerInstall
with:
- name: ip
value: 192.168.1.6
- name: sshUser
value: root
- name: sshPassword
value: root
- use: frpClientInstall
LocalConfiguration:
- use: xxx
name: frpInstall
in:
ip: xxx
xxx: xxx
- use: xxx
in: |
ip: frpInstall.out.xxx
RemoteConfiguration:
- use: xxx
name: xxx
with:
- xxx
- use: action/exportLocalService
- xxx: xxx.out.xxx
DNSConfiguration:
use: xxx
with:
- xxx
-name: xxx
```
33 changes: 29 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,53 @@ require (
)

require (
dario.cat/mergo v1.0.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.9.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/invopop/jsonschema v0.9.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/skeema/knownhosts v1.2.0 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 466f0dc

Please sign in to comment.