mirror of
https://github.com/mudler/LocalAI.git
synced 2026-01-06 18:49:55 -06:00
chore: InTrustedRoot -> VerifyPath
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
@@ -158,7 +158,7 @@ func EditModelEndpoint(cl *config.ModelConfigLoader, appConfig *config.Applicati
|
||||
|
||||
// Load the existing configuration
|
||||
configPath := filepath.Join(appConfig.SystemState.Model.ModelsPath, modelName+".yaml")
|
||||
if err := utils.InTrustedRoot(configPath, appConfig.SystemState.Model.ModelsPath); err != nil {
|
||||
if err := utils.VerifyPath(modelName+".yaml", appConfig.SystemState.Model.ModelsPath); err != nil {
|
||||
response := ModelResponse{
|
||||
Success: false,
|
||||
Error: "Model configuration not trusted: " + err.Error(),
|
||||
|
||||
@@ -94,7 +94,7 @@ func ImportModelEndpoint(cl *config.ModelConfigLoader, appConfig *config.Applica
|
||||
|
||||
// Create the configuration file
|
||||
configPath := filepath.Join(appConfig.SystemState.Model.ModelsPath, modelConfig.Name+".yaml")
|
||||
if err := utils.InTrustedRoot(configPath, appConfig.SystemState.Model.ModelsPath); err != nil {
|
||||
if err := utils.VerifyPath(modelConfig.Name+".yaml", appConfig.SystemState.Model.ModelsPath); err != nil {
|
||||
response := ModelResponse{
|
||||
Success: false,
|
||||
Error: "Model path not trusted: " + err.Error(),
|
||||
|
||||
Reference in New Issue
Block a user