Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change default path for thumbnails #1892

Merged
merged 1 commit into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/unreleased/change-default-path-for-thumbnails.md
Original file line number Diff line number Diff line change
@@ -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
5 changes: 1 addition & 4 deletions thumbnails/pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package flagset

import (
"os"
"path/filepath"

"github.com/owncloud/ocis/ocis-pkg/flags"

"github.com/micro/cli/v2"
Expand Down Expand Up @@ -140,7 +137,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag {
},
&cli.StringFlag{
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",
EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"},
Destination: &cfg.Thumbnail.FileSystemStorage.RootDirectory,
Expand Down
2 changes: 1 addition & 1 deletion thumbnails/pkg/thumbnail/storage/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (s *FileSystem) createUserDir(username string) (string, error) {
}

// 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 {
imgRootDir := s.rootDir(key)

Expand Down