mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
add domainname & dns to API, #11.
This commit is contained in:
@@ -477,6 +477,14 @@ components:
|
||||
$ref: '#/components/schemas/RoomMount'
|
||||
resources:
|
||||
$ref: '#/components/schemas/RoomResources'
|
||||
hostname:
|
||||
type: string
|
||||
example: server.lan
|
||||
dns:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: 1.1.1.1
|
||||
browser_policy:
|
||||
$ref: '#/components/schemas/BrowserPolicy'
|
||||
|
||||
|
||||
@@ -514,6 +514,18 @@ export interface RoomSettings {
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
'resources'?: RoomResources;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
'hostname'?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Array<string>}
|
||||
* @memberof RoomSettings
|
||||
*/
|
||||
'dns'?: Array<string>;
|
||||
/**
|
||||
*
|
||||
* @type {BrowserPolicy}
|
||||
|
||||
@@ -192,6 +192,16 @@
|
||||
</template>
|
||||
</v-simple-table>
|
||||
|
||||
<div class="my-3 headline">Network</div>
|
||||
<v-simple-table>
|
||||
<template v-slot:default>
|
||||
<tbody>
|
||||
<tr><th style="width:50%;"> Hostname </th><td>{{ settings.hostname }}</td></tr>
|
||||
<tr><th> DNS </th><td><span v-if="settings.dns">{{ settings.dns.join(", ") }}</span><i v-else>--system-default--</i></td></tr>
|
||||
</tbody>
|
||||
</template>
|
||||
</v-simple-table>
|
||||
|
||||
<div class="my-3 headline">Browser policy</div>
|
||||
<v-simple-table v-if="settings.browser_policy">
|
||||
<template v-slot:default>
|
||||
|
||||
@@ -401,10 +401,55 @@
|
||||
</v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row align="center" no-gutters class="mt-3">
|
||||
<h2> Network </h2>
|
||||
</v-row>
|
||||
<v-row align="center" class="mt-0">
|
||||
<v-col class="py-0">
|
||||
<v-text-field
|
||||
label="Hostname"
|
||||
v-model="data.hostname"
|
||||
autocomplete="off"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col class="pt-0">
|
||||
<v-combobox class="pt-0"
|
||||
label="DNS"
|
||||
v-model="data.dns"
|
||||
multiple
|
||||
hide-details
|
||||
>
|
||||
<template v-slot:selection="{ attrs, item, parent, selected }">
|
||||
<v-chip
|
||||
v-bind="attrs"
|
||||
:input-value="selected"
|
||||
label
|
||||
small
|
||||
>
|
||||
<span class="pr-2">
|
||||
{{ item }}
|
||||
</span>
|
||||
<v-icon
|
||||
small
|
||||
@click="parent.selectItem(item)"
|
||||
>
|
||||
$delete
|
||||
</v-icon>
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-combobox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row align="center" no-gutters class="mb-3">
|
||||
<v-col>
|
||||
<p> <i> Leave empty to use container name. </i> </p>
|
||||
</v-col>
|
||||
<v-col class="pl-6">
|
||||
<p> <i> Leave empty to use system defaults.</i> </p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<hr />
|
||||
|
||||
<v-row align="center" no-gutters class="mt-3">
|
||||
<h2 class="my-3">
|
||||
Browser policy
|
||||
|
||||
@@ -77,6 +77,11 @@ export const state = {
|
||||
shm_size: 2000000000,
|
||||
devices: [],
|
||||
},
|
||||
|
||||
// eslint-disable-next-line
|
||||
hostname: '',
|
||||
// eslint-disable-next-line
|
||||
dns: [],
|
||||
} as RoomSettings,
|
||||
videoCodecs: [
|
||||
"VP8",
|
||||
|
||||
@@ -561,9 +561,14 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
// Set container configs
|
||||
//
|
||||
|
||||
hostname := containerName
|
||||
if settings.Hostname != "" {
|
||||
hostname = settings.Hostname
|
||||
}
|
||||
|
||||
config := &container.Config{
|
||||
// Hostname
|
||||
Hostname: containerName,
|
||||
Hostname: hostname,
|
||||
// Domainname is preventing from running container on LXC (Proxmox)
|
||||
// https://www.gitmemory.com/issue/docker/for-linux/743/524569376
|
||||
// Domainname: containerName,
|
||||
@@ -605,6 +610,8 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
||||
DeviceRequests: deviceRequests,
|
||||
Devices: devices,
|
||||
},
|
||||
// DNS
|
||||
DNS: settings.DNS,
|
||||
// Privileged
|
||||
Privileged: isPrivilegedImage,
|
||||
}
|
||||
@@ -803,6 +810,8 @@ func (manager *RoomManagerCtx) GetSettings(id string) (*types.RoomSettings, erro
|
||||
Labels: labels.UserDefined,
|
||||
Mounts: mounts,
|
||||
Resources: roomResources,
|
||||
Hostname: container.Config.Hostname,
|
||||
DNS: container.HostConfig.DNS,
|
||||
BrowserPolicy: browserPolicy,
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,9 @@ type RoomSettings struct {
|
||||
Mounts []RoomMount `json:"mounts"`
|
||||
Resources RoomResources `json:"resources"`
|
||||
|
||||
Hostname string `json:"hostname,omitempty"`
|
||||
DNS []string `json:"dns,omitempty"`
|
||||
|
||||
BrowserPolicy *BrowserPolicy `json:"browser_policy,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user