Skip to content

Commit c40805b

Browse files
committed
feat: Implement loading of extensions from config files....
1 parent 3213d09 commit c40805b

15 files changed

Lines changed: 905 additions & 107 deletions

File tree

api/schema/v1.json

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,118 @@
105105
}
106106
}
107107
},
108+
"LlCliFilesystemEntry": {
109+
"title": "LlCliFilesystemEntry",
110+
"description": "filesystem entry used by ll-cli configuration",
111+
"type": "object",
112+
"required": [
113+
"host",
114+
"target"
115+
],
116+
"properties": {
117+
"host": {
118+
"type": "string",
119+
"description": "source path on host"
120+
},
121+
"target": {
122+
"type": "string",
123+
"description": "mount target path inside container"
124+
},
125+
"mode": {
126+
"type": "string",
127+
"description": "mount mode, either ro or rw"
128+
},
129+
"persist": {
130+
"type": "boolean",
131+
"description": "whether this mount should persist in sandbox storage"
132+
}
133+
}
134+
},
135+
"LlCliCommandConfig": {
136+
"title": "LlCliCommandConfig",
137+
"description": "per-command overrides for ll-cli configuration",
138+
"type": "object",
139+
"properties": {
140+
"env": {
141+
"type": "object",
142+
"description": "environment variables applied to command",
143+
"additionalProperties": {
144+
"type": "string"
145+
}
146+
},
147+
"filesystem": {
148+
"type": "array",
149+
"description": "filesystem entries applied to command",
150+
"items": {
151+
"$ref": "#/$defs/LlCliFilesystemEntry"
152+
}
153+
},
154+
"args_prefix": {
155+
"type": "array",
156+
"description": "arguments prepended before command",
157+
"items": {
158+
"type": "string"
159+
}
160+
},
161+
"args_suffix": {
162+
"type": "array",
163+
"description": "arguments appended after command",
164+
"items": {
165+
"type": "string"
166+
}
167+
},
168+
"entrypoint": {
169+
"type": "string",
170+
"description": "override entrypoint for command"
171+
},
172+
"cwd": {
173+
"type": "string",
174+
"description": "working directory for command"
175+
}
176+
}
177+
},
178+
"LlCliConfig": {
179+
"title": "LlCliConfig",
180+
"description": "default ll-cli configuration provided by package",
181+
"type": "object",
182+
"properties": {
183+
"filesystem_allow_only": {
184+
"type": "array",
185+
"description": "explicit mount allowlist; when present only these mounts are permitted",
186+
"items": {
187+
"$ref": "#/$defs/LlCliFilesystemEntry"
188+
}
189+
},
190+
"filesystem": {
191+
"type": "array",
192+
"description": "additional filesystem mounts appended to defaults",
193+
"items": {
194+
"$ref": "#/$defs/LlCliFilesystemEntry"
195+
}
196+
},
197+
"env": {
198+
"type": "object",
199+
"description": "default environment variables",
200+
"additionalProperties": {
201+
"type": "string"
202+
}
203+
},
204+
"commands": {
205+
"type": "object",
206+
"description": "command specific overrides",
207+
"additionalProperties": {
208+
"$ref": "#/$defs/LlCliCommandConfig"
209+
}
210+
},
211+
"extensions": {
212+
"type": "array",
213+
"description": "default extensions applied when launching app",
214+
"items": {
215+
"type": "string"
216+
}
217+
}
218+
}
219+
},
108220
"ContainerProcessStateInfo": {
109221
"description": "information about process which in container that start by ll-cli, all content\nwill write to /run/linglong/UID/PID\n",
110222
"type": "object",
@@ -379,6 +491,10 @@
379491
"permissions": {
380492
"$ref": "#/$defs/ApplicationConfigurationPermissions"
381493
},
494+
"cli_config": {
495+
"$ref": "#/$defs/LlCliConfig",
496+
"description": "default ll-cli configuration delivered with package"
497+
},
382498
"runtime": {
383499
"type": "string",
384500
"description": "used runtime of package"
@@ -773,6 +889,10 @@
773889
"$ref": "#/$defs/ExtensionDefine"
774890
}
775891
},
892+
"cli_config": {
893+
"$ref": "#/$defs/LlCliConfig",
894+
"description": "default ll-cli configuration provided by package"
895+
},
776896
"ext_impl": {
777897
"$ref": "#/$defs/ExtensionImpl"
778898
}
@@ -1414,6 +1534,15 @@
14141534
"ApplicationConfigurationPermissions": {
14151535
"$ref": "#/$defs/ApplicationConfigurationPermissions"
14161536
},
1537+
"LlCliFilesystemEntry": {
1538+
"$ref": "#/$defs/LlCliFilesystemEntry"
1539+
},
1540+
"LlCliCommandConfig": {
1541+
"$ref": "#/$defs/LlCliCommandConfig"
1542+
},
1543+
"LlCliConfig": {
1544+
"$ref": "#/$defs/LlCliConfig"
1545+
},
14171546
"ContainerProcessStateInfo": {
14181547
"$ref": "#/$defs/ContainerProcessStateInfo"
14191548
},

api/schema/v1.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,87 @@ $defs:
9595
destination:
9696
type: string
9797
description: mount source file to the another position of container
98+
LlCliFilesystemEntry:
99+
title: LlCliFilesystemEntry
100+
description: filesystem entry used by ll-cli configuration
101+
type: object
102+
required:
103+
- host
104+
- target
105+
properties:
106+
host:
107+
type: string
108+
description: source path on host
109+
target:
110+
type: string
111+
description: mount target path inside container
112+
mode:
113+
type: string
114+
description: mount mode, either ro or rw
115+
persist:
116+
type: boolean
117+
description: whether this mount should persist in sandbox storage
118+
LlCliCommandConfig:
119+
title: LlCliCommandConfig
120+
description: per-command overrides for ll-cli configuration
121+
type: object
122+
properties:
123+
env:
124+
type: object
125+
description: environment variables applied to command
126+
additionalProperties:
127+
type: string
128+
filesystem:
129+
type: array
130+
description: filesystem entries applied to command
131+
items:
132+
$ref: '#/$defs/LlCliFilesystemEntry'
133+
args_prefix:
134+
type: array
135+
description: arguments prepended before command
136+
items:
137+
type: string
138+
args_suffix:
139+
type: array
140+
description: arguments appended after command
141+
items:
142+
type: string
143+
entrypoint:
144+
type: string
145+
description: override entrypoint for command
146+
cwd:
147+
type: string
148+
description: working directory for command
149+
LlCliConfig:
150+
title: LlCliConfig
151+
description: default ll-cli configuration provided by package
152+
type: object
153+
properties:
154+
filesystem_allow_only:
155+
type: array
156+
description: explicit mount allowlist; when present only these mounts are permitted
157+
items:
158+
$ref: '#/$defs/LlCliFilesystemEntry'
159+
filesystem:
160+
type: array
161+
description: additional filesystem mounts appended to defaults
162+
items:
163+
$ref: '#/$defs/LlCliFilesystemEntry'
164+
env:
165+
type: object
166+
description: default environment variables
167+
additionalProperties:
168+
type: string
169+
commands:
170+
type: object
171+
description: command specific overrides
172+
additionalProperties:
173+
$ref: '#/$defs/LlCliCommandConfig'
174+
extensions:
175+
type: array
176+
description: default extensions applied when launching app
177+
items:
178+
type: string
98179
ContainerProcessStateInfo:
99180
description: |
100181
information about process which in container that start by ll-cli, all content
@@ -312,6 +393,9 @@ $defs:
312393
type: string
313394
permissions:
314395
$ref: '#/$defs/ApplicationConfigurationPermissions'
396+
cli_config:
397+
$ref: '#/$defs/LlCliConfig'
398+
description: default ll-cli configuration delivered with package
315399
runtime:
316400
type: string
317401
description: used runtime of package
@@ -604,6 +688,9 @@ $defs:
604688
description: description of extension
605689
items:
606690
$ref: '#/$defs/ExtensionDefine'
691+
cli_config:
692+
$ref: '#/$defs/LlCliConfig'
693+
description: default ll-cli configuration provided by package
607694
ext_impl:
608695
$ref: '#/$defs/ExtensionImpl'
609696
PackageInfo:

0 commit comments

Comments
 (0)