mirror of
https://github.com/navidrome/navidrome.git
synced 2026-03-02 13:56:55 -05:00
* feat(plugins): mount library directories as read-only by default Add an AllowWriteAccess boolean to the plugin model, defaulting to false. When off, library directories are mounted with the extism "ro:" prefix (read-only). Admins can explicitly grant write access via a new toggle in the Library Permission card. * test: add tests to buildAllowedPaths Signed-off-by: Deluan <deluan@navidrome.org> * chore: improve allowed paths logging for library access Signed-off-by: Deluan <deluan@navidrome.org> --------- Signed-off-by: Deluan <deluan@navidrome.org>
32 lines
1.4 KiB
Go
32 lines
1.4 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
type Plugin struct {
|
|
ID string `structs:"id" json:"id"`
|
|
Path string `structs:"path" json:"path"`
|
|
Manifest string `structs:"manifest" json:"manifest"`
|
|
Config string `structs:"config" json:"config,omitempty"`
|
|
Users string `structs:"users" json:"users,omitempty"`
|
|
AllUsers bool `structs:"all_users" json:"allUsers,omitempty"`
|
|
Libraries string `structs:"libraries" json:"libraries,omitempty"`
|
|
AllLibraries bool `structs:"all_libraries" json:"allLibraries,omitempty"`
|
|
AllowWriteAccess bool `structs:"allow_write_access" json:"allowWriteAccess,omitempty"`
|
|
Enabled bool `structs:"enabled" json:"enabled"`
|
|
LastError string `structs:"last_error" json:"lastError,omitempty"`
|
|
SHA256 string `structs:"sha256" json:"sha256"`
|
|
CreatedAt time.Time `structs:"created_at" json:"createdAt"`
|
|
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"`
|
|
}
|
|
|
|
type Plugins []Plugin
|
|
|
|
type PluginRepository interface {
|
|
ResourceRepository
|
|
CountAll(options ...QueryOptions) (int64, error)
|
|
Delete(id string) error
|
|
Get(id string) (*Plugin, error)
|
|
GetAll(options ...QueryOptions) (Plugins, error)
|
|
Put(p *Plugin) error
|
|
}
|