mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
These changes allow to configure the computer vision models through an optional vision.yml configuration file. Note that the API endpoints are not yet functional and require further work. Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -30,7 +30,7 @@ func GetConfigOptions(router *gin.RouterGroup) {
|
||||
s := Auth(c, acl.ResourceConfig, acl.AccessAll)
|
||||
conf := get.Config()
|
||||
|
||||
// Abort if permission was not granted.
|
||||
// Abort if permission is not granted.
|
||||
if s.Invalid() || conf.Public() || conf.DisableSettings() {
|
||||
AbortForbidden(c)
|
||||
return
|
||||
@@ -111,7 +111,7 @@ func SaveConfigOptions(router *gin.RouterGroup) {
|
||||
}
|
||||
|
||||
// Write YAML data to file.
|
||||
if err = fs.WriteFile(fileName, yamlData); err != nil {
|
||||
if err = fs.WriteFile(fileName, yamlData, fs.ModeConfigFile); err != nil {
|
||||
log.Errorf("config: failed writing values to %s (%s)", clean.Log(fileName), err)
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user