change default path for thumbnails
This commit is contained in:
3 files changed
+8
-5
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
Enhancement: change default path for thumbnails
|
||||||
|
|
||||||
|
Changes the default path for thumbnails from `<os tmp dir>/ocis-thumbnails` to `/var/tmp/ocis/thumbnails`
|
||||||
|
|
||||||
|
https://github.com/owncloud/ocis/pull/1892
|
||||||
|
https://github.com/owncloud/ocis/issues/1891
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
package flagset
|
package flagset
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
|
|
||||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
"github.com/owncloud/ocis/ocis-pkg/flags"
|
||||||
|
|
||||||
"github.com/micro/cli/v2"
|
"github.com/micro/cli/v2"
|
||||||
@@ -140,7 +137,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
|
|||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "filesystemstorage-root",
|
Name: "filesystemstorage-root",
|
||||||
Value: flags.OverrideDefaultString(cfg.Thumbnail.FileSystemStorage.RootDirectory, filepath.Join(os.TempDir(), "ocis-thumbnails/")),
|
Value: "/var/tmp/ocis/thumbnails",
|
||||||
Usage: "Root path of the filesystem storage directory",
|
Usage: "Root path of the filesystem storage directory",
|
||||||
EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"},
|
EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"},
|
||||||
Destination: &cfg.Thumbnail.FileSystemStorage.RootDirectory,
|
Destination: &cfg.Thumbnail.FileSystemStorage.RootDirectory,
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ func (s *FileSystem) createUserDir(username string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// linkImageToUserDir links the stored images to the user directory.
|
// linkImageToUserDir links the stored images to the user directory.
|
||||||
// The goal is to minimize disk usage by linking to the images if they already exist and avoid file duplicaiton.
|
// The goal is to minimize disk usage by linking to the images if they already exist and avoid file duplication.
|
||||||
func (s *FileSystem) linkImageToUserDir(key string, userDir string) error {
|
func (s *FileSystem) linkImageToUserDir(key string, userDir string) error {
|
||||||
imgRootDir := s.rootDir(key)
|
imgRootDir := s.rootDir(key)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user