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:
|
||||
type:
|
||||
type: string
|
||||
enum: [ private, template, public ]
|
||||
enum: [ private, template, protected, public ]
|
||||
example: private
|
||||
host_path:
|
||||
type: string
|
||||
|
||||
@@ -337,6 +337,7 @@ export interface RoomMount {
|
||||
export enum RoomMountTypeEnum {
|
||||
private = 'private',
|
||||
template = 'template',
|
||||
protected = 'protected',
|
||||
public = 'public'
|
||||
}
|
||||
|
||||
|
||||
@@ -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"><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.
|
||||
</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',
|
||||
|
||||
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
|
||||
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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user