add protected room mount type.

This commit is contained in:
Miroslav Šedivý
2022-01-17 22:35:41 +01:00
parent 332261a889
commit f140f9bc89
6 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -320,7 +320,7 @@ components:
properties:
type:
type: string
enum: [ private, template, public ]
enum: [ private, template, protected, public ]
example: private
host_path:
type: string
+1
View File
@@ -337,6 +337,7 @@ export interface RoomMount {
export enum RoomMountTypeEnum {
private = 'private',
template = 'template',
protected = 'protected',
public = 'public'
}
+6 -1
View File
@@ -273,7 +273,8 @@
<v-row align="center" no-gutters v-if="data.mounts.length > 0">
<p>
<strong>Private</strong>: Host path is relative to <code class="mx-1">&lt;storage path&gt;/rooms/&lt;room name&gt;/</code>. <br />
<strong>Template</strong>: Host path is relative to <code class="mx-1">&lt;storage path&gt;/templates/</code> and is readonly. <br />
<strong>Template</strong>: Host path is relative to <code class="mx-1">&lt;storage path&gt;/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.
</p>
</v-row>
@@ -503,6 +504,10 @@ export default class RoomsCreate extends Vue {
text: 'Template',
value: 'template',
},
{
text: 'Protected',
value: 'protected',
},
{
text: 'Public',
value: 'public',
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 30 KiB

+4 -1
View File
@@ -336,7 +336,10 @@ func (manager *RoomManagerCtx) Create(settings types.RoomSettings) (string, erro
// prefix host path
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
var isAllowed = false
for _, path := range manager.config.MountsWhitelist {
+4 -3
View File
@@ -44,9 +44,10 @@ type RoomEntry struct {
type MountType string
const (
MountPrivate MountType = "private"
MountTemplate MountType = "template"
MountPublic MountType = "public"
MountPrivate MountType = "private"
MountTemplate MountType = "template"
MountProtected MountType = "protected"
MountPublic MountType = "public"
)
type RoomMount struct {