mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
fix protected mount & export mounts.
This commit is contained in:
@@ -203,8 +203,16 @@ func (manager *RoomManagerCtx) ExportAsDockerCompose(ctx context.Context) ([]byt
|
|||||||
}
|
}
|
||||||
|
|
||||||
// volumes
|
// volumes
|
||||||
if len(containerJson.HostConfig.Binds) > 0 {
|
volumes := []string{}
|
||||||
service["volumes"] = containerJson.HostConfig.Binds
|
for _, mount := range container.Mounts {
|
||||||
|
if !mount.RW {
|
||||||
|
volumes = append(volumes, fmt.Sprintf("%s:%s:ro", mount.Source, mount.Destination))
|
||||||
|
} else {
|
||||||
|
volumes = append(volumes, fmt.Sprintf("%s:%s", mount.Source, mount.Destination))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(volumes) > 0 {
|
||||||
|
service["volumes"] = volumes
|
||||||
}
|
}
|
||||||
|
|
||||||
// devices
|
// devices
|
||||||
@@ -705,6 +713,8 @@ func (manager *RoomManagerCtx) GetSettings(ctx context.Context, id string) (*typ
|
|||||||
} else if strings.HasPrefix(hostPath, templateStorageRoot) {
|
} else if strings.HasPrefix(hostPath, templateStorageRoot) {
|
||||||
mountType = types.MountTemplate
|
mountType = types.MountTemplate
|
||||||
hostPath = strings.TrimPrefix(hostPath, templateStorageRoot)
|
hostPath = strings.TrimPrefix(hostPath, templateStorageRoot)
|
||||||
|
} else if !mount.RW {
|
||||||
|
mountType = types.MountProtected
|
||||||
}
|
}
|
||||||
|
|
||||||
mounts = append(mounts, types.RoomMount{
|
mounts = append(mounts, types.RoomMount{
|
||||||
|
|||||||
Reference in New Issue
Block a user