mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
mount update api.
This commit is contained in:
+14
@@ -243,6 +243,16 @@ components:
|
||||
format: datetime
|
||||
example: "2021-03-07T21:56:34Z"
|
||||
|
||||
RoomMount:
|
||||
type: object
|
||||
properties:
|
||||
host_path:
|
||||
type: string
|
||||
example: /profile
|
||||
container_path:
|
||||
type: string
|
||||
example: /home/neko/.config/chromium
|
||||
|
||||
RoomSettings:
|
||||
type: object
|
||||
properties:
|
||||
@@ -291,6 +301,10 @@ components:
|
||||
type: string
|
||||
example:
|
||||
CUSTOM_ENV: custom value
|
||||
mounts:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/RoomMount'
|
||||
|
||||
RoomStats:
|
||||
type: object
|
||||
|
||||
@@ -1 +1 @@
|
||||
5.1.1-SNAPSHOT
|
||||
5.2.0-SNAPSHOT
|
||||
@@ -107,6 +107,25 @@ export interface RoomMember {
|
||||
*/
|
||||
muted?: boolean;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RoomMount
|
||||
*/
|
||||
export interface RoomMount {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomMount
|
||||
*/
|
||||
host_path?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomMount
|
||||
*/
|
||||
container_path?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -203,6 +222,12 @@ export interface RoomSettings {
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
envs?: { [key: string]: string; };
|
||||
/**
|
||||
*
|
||||
* @type {Array<RoomMount>}
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
mounts?: Array<RoomMount>;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -179,11 +179,11 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
}
|
||||
|
||||
binds := []string{}
|
||||
for hostPath, containerPath := range settings.Mounts {
|
||||
for _, mount := range settings.Mounts {
|
||||
binds = append(
|
||||
binds,
|
||||
// TODO: Check for invalid paths.
|
||||
path.Join(manager.config.InstanceData, roomName, hostPath)+":"+containerPath,
|
||||
path.Join(manager.config.InstanceData, roomName, mount.HostPath)+":"+mount.ContainerPath,
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,11 @@ type RoomEntry struct {
|
||||
Created time.Time `json:"created"`
|
||||
}
|
||||
|
||||
type RoomMount struct {
|
||||
HostPath string `json:"host_path"`
|
||||
ContainerPath string `json:"container_path"`
|
||||
}
|
||||
|
||||
type RoomSettings struct {
|
||||
Name string `json:"name"`
|
||||
NekoImage string `json:"neko_image"`
|
||||
@@ -60,7 +65,7 @@ type RoomSettings struct {
|
||||
BroadcastPipeline string `json:"broadcast_pipeline,omitempty"`
|
||||
|
||||
Envs map[string]string `json:"envs"`
|
||||
Mounts map[string]string `json:"mounts"`
|
||||
Mounts []RoomMount `json:"mounts"`
|
||||
}
|
||||
|
||||
func (settings *RoomSettings) ToEnv() []string {
|
||||
|
||||
Reference in New Issue
Block a user