mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
add protected room mount type.
This commit is contained in:
+1
-1
@@ -320,7 +320,7 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
type:
|
type:
|
||||||
type: string
|
type: string
|
||||||
enum: [ private, template, public ]
|
enum: [ private, template, protected, public ]
|
||||||
example: private
|
example: private
|
||||||
host_path:
|
host_path:
|
||||||
type: string
|
type: string
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ export interface RoomMount {
|
|||||||
export enum RoomMountTypeEnum {
|
export enum RoomMountTypeEnum {
|
||||||
private = 'private',
|
private = 'private',
|
||||||
template = 'template',
|
template = 'template',
|
||||||
|
protected = 'protected',
|
||||||
public = 'public'
|
public = 'public'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -273,7 +273,8 @@
|
|||||||
<v-row align="center" no-gutters v-if="data.mounts.length > 0">
|
<v-row align="center" no-gutters v-if="data.mounts.length > 0">
|
||||||
<p>
|
<p>
|
||||||
<strong>Private</strong>: Host path is relative to <code class="mx-1"><storage path>/rooms/<room name>/</code>. <br />
|
<strong>Private</strong>: Host path is relative to <code class="mx-1"><storage path>/rooms/<room name>/</code>. <br />
|
||||||
<strong>Template</strong>: Host path is relative to <code class="mx-1"><storage path>/templates/</code> and is readonly. <br />
|
<strong>Template</strong>: Host path is relative to <code class="mx-1"><storage path>/templates/</code>, and will be readonly. <br />
|
||||||
|
<strong>Protected</strong>: Host path must be whitelisted in config and exists on the host, will be readonly. <br />
|
||||||
<strong>Public</strong>: Host path must be whitelisted in config and exists on the host.
|
<strong>Public</strong>: Host path must be whitelisted in config and exists on the host.
|
||||||
</p>
|
</p>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -503,6 +504,10 @@ export default class RoomsCreate extends Vue {
|
|||||||
text: 'Template',
|
text: 'Template',
|
||||||
value: 'template',
|
value: 'template',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'Protected',
|
||||||
|
value: 'protected',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Public',
|
text: 'Public',
|
||||||
value: 'public',
|
value: 'public',
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 30 KiB |
@@ -336,7 +336,10 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
|
|||||||
|
|
||||||
// prefix host path
|
// prefix host path
|
||||||
hostPath = path.Join(manager.config.StorageExternal, templateStoragePath, hostPath)
|
hostPath = path.Join(manager.config.StorageExternal, templateStoragePath, hostPath)
|
||||||
} else if mount.Type == types.MountPublic {
|
} else if mount.Type == types.MountProtected || mount.Type == types.MountPublic {
|
||||||
|
// readonly if mount type is protected
|
||||||
|
readOnly = mount.Type == types.MountProtected
|
||||||
|
|
||||||
// public whitelisted mounts
|
// public whitelisted mounts
|
||||||
var isAllowed = false
|
var isAllowed = false
|
||||||
for _, path := range manager.config.MountsWhitelist {
|
for _, path := range manager.config.MountsWhitelist {
|
||||||
|
|||||||
@@ -44,9 +44,10 @@ type RoomEntry struct {
|
|||||||
type MountType string
|
type MountType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MountPrivate MountType = "private"
|
MountPrivate MountType = "private"
|
||||||
MountTemplate MountType = "template"
|
MountTemplate MountType = "template"
|
||||||
MountPublic MountType = "public"
|
MountProtected MountType = "protected"
|
||||||
|
MountPublic MountType = "public"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RoomMount struct {
|
type RoomMount struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user