Skip to content
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: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ Kindly avoid using this feature for write while we investigate and resolve it.
`docker run -it --rm --cap-add=SYS_ADMIN --device=/dev/fuse --security-opt
apparmor:unconfined <environment variables> <docker image>`

### Syslog security warning

By default, Cloudfuse will log to syslog. The default settings will, in some
cases, log relevant file paths to syslog. If this is sensitive information, turn
off logging or set log-level to LOG_ERR.

## License

The Cloudfuse project is licensed under MIT.
Expand Down
2 changes: 1 addition & 1 deletion cmd/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ func init() {
mountCmd.PersistentFlags().StringVar(&options.PassPhrase, "passphrase", "",
"Base64 encoded key to decrypt config file. Can also be specified by env-variable CLOUDFUSE_SECURE_CONFIG_PASSPHRASE.\n Decoded key length shall be 16 (AES-128), 24 (AES-192), or 32 (AES-256) bytes in length.")

mountCmd.PersistentFlags().String("log-type", "syslog", "Type of logger to be used by the system. Set to syslog by default. Allowed values are silent|syslog|base.")
mountCmd.PersistentFlags().String("log-type", "base", "Type of logger to be used by the system. Set to base by default. Allowed values are silent|syslog|base.")
config.BindPFlag("logging.type", mountCmd.PersistentFlags().Lookup("log-type"))
_ = mountCmd.RegisterFlagCompletionFunc("log-type", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return []string{"silent", "base", "syslog"}, cobra.ShellCompDirectiveNoFileComp
Expand Down
6 changes: 0 additions & 6 deletions common/log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ func LogRotate() error {
return logObj.LogRotate()
}

func init() {
logObj, _ = NewLogger("syslog", common.LogConfig{
Level: common.ELogLevel.LOG_DEBUG(),
})
}

// TimeTracker : Dump time taken by a call
func TimeTrack(start time.Time, location string, name string) {
if timeTracker {
Expand Down
30 changes: 15 additions & 15 deletions common/log/logger_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,21 @@ func NewLogger(name string, config common.LogConfig) (Logger, error) {
}

switch name {
case "base":
case "syslog":
sysLogger, err := newSysLogger(config.Level, config.Tag)
if err != nil {
if err == ErrNoSyslogService {
// Syslog service does not exists on this system
// fallback to file based logging.
return NewLogger("base", config)
}
return nil, err
}
return sysLogger, nil
case "silent":
silentLogger := &SilentLogger{}
return silentLogger, nil
case "", "default", "base":
baseLogger, err := newBaseLogger(LogFileConfig{
LogFile: config.FilePath,
LogLevel: config.Level,
Expand All @@ -55,20 +69,6 @@ func NewLogger(name string, config common.LogConfig) (Logger, error) {
return nil, err
}
return baseLogger, nil
case "silent":
silentLogger := &SilentLogger{}
return silentLogger, nil
case "", "default", "syslog":
sysLogger, err := newSysLogger(config.Level, config.Tag)
if err != nil {
if err == ErrNoSyslogService {
// Syslog service does not exists on this system
// fallback to file based logging.
return NewLogger("base", config)
}
return nil, err
}
return sysLogger, nil
}
return nil, errors.New("invalid logger type")
}
22 changes: 11 additions & 11 deletions common/log/logger_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@ func NewLogger(name string, config common.LogConfig) (Logger, error) {
config.Tag = common.FileSystemName
}

if name == "base" {
if name == "syslog" {
sysLogger, err := newSysLogger(config.Level, config.Tag)
if err != nil {
//NoSyslogService
return NewLogger("base", config)
}
return sysLogger, nil
} else if name == "silent" {
silentLogger := &SilentLogger{}
return silentLogger, nil
} else if name == "" || name == "default" || name == "base" {
baseLogger, err := newBaseLogger(LogFileConfig{
LogFile: config.FilePath,
LogLevel: config.Level,
Expand All @@ -54,16 +64,6 @@ func NewLogger(name string, config common.LogConfig) (Logger, error) {
return nil, err
}
return baseLogger, nil
} else if name == "silent" {
silentLogger := &SilentLogger{}
return silentLogger, nil
} else if name == "" || name == "default" || name == "syslog" {
sysLogger, err := newSysLogger(config.Level, config.Tag)
if err != nil {
//NoSyslogService
return NewLogger("base", config)
}
return sysLogger, nil
}
return nil, errors.New("invalid logger type")
}
2 changes: 1 addition & 1 deletion common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const (
MbToBytes = 1024 * 1024
GbToBytes = 1024 * 1024 * 1024
TbToBytes = 1024 * 1024 * 1024 * 1024
DefaultCapacityMb = TbToBytes / MbToBytes
DefaultCapacityMb = 1024 * TbToBytes / MbToBytes // 1 PB
CfuseStats = "cloudfuse_stats"

FuseAllowedFlags = "invalid FUSE options. Allowed FUSE configurations are: `-o attr_timeout=TIMEOUT`, `-o negative_timeout=TIMEOUT`, `-o entry_timeout=TIMEOUT` `-o allow_other`, `-o allow_root`, `-o umask=PERMISSIONS -o default_permissions`, `-o ro`"
Expand Down
2 changes: 1 addition & 1 deletion component/file_cache/file_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const (
defaultMaxEviction = 5000
defaultMaxThreshold = 80
defaultMinThreshold = 60
defaultFileCacheTimeout = 120
defaultFileCacheTimeout = 216000
minimumFileCacheTimeout = 1
defaultCacheUpdateCount = 100
MB = 1024 * 1024
Expand Down
2 changes: 1 addition & 1 deletion component/file_cache/file_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func (suite *fileCacheTestSuite) TestEmpty() {

suite.assert.False(suite.fileCache.createEmptyFile)
suite.assert.False(suite.fileCache.allowNonEmpty)
suite.assert.EqualValues(suite.fileCache.cacheTimeout, 120)
suite.assert.EqualValues(suite.fileCache.cacheTimeout, 216000)
suite.assert.False(suite.fileCache.cleanupOnStart)
suite.assert.True(suite.fileCache.syncToFlush)
}
Expand Down
4 changes: 2 additions & 2 deletions component/libfuse/libfuse_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (suite *libfuseTestSuite) TestDefault() {
suite.assert.Equal(uint32(120), suite.libfuse.entryExpiration)
suite.assert.Equal(uint32(120), suite.libfuse.attributeExpiration)
suite.assert.Equal(uint32(120), suite.libfuse.negativeTimeout)
suite.assert.Equal(uint64(1024*1024), suite.libfuse.displayCapacityMb)
suite.assert.Equal(uint64(1024*1024*1024), suite.libfuse.displayCapacityMb)
suite.assert.False(suite.libfuse.disableWritebackCache)
suite.assert.True(suite.libfuse.ignoreOpenFlags)
suite.assert.False(suite.libfuse.directIO)
Expand Down Expand Up @@ -97,7 +97,7 @@ func (suite *libfuseTestSuite) TestConfigZero() {
suite.assert.Equal(uint32(0), suite.libfuse.entryExpiration)
suite.assert.Equal(uint32(0), suite.libfuse.attributeExpiration)
suite.assert.Equal(uint32(0), suite.libfuse.negativeTimeout)
suite.assert.Equal(uint64(1024*1024), suite.libfuse.displayCapacityMb)
suite.assert.Equal(uint64(1024*1024*1024), suite.libfuse.displayCapacityMb)
suite.assert.False(suite.libfuse.directIO)
}

Expand Down
8 changes: 7 additions & 1 deletion component/loopback/loopback_fs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"testing"

"github.com/Seagate/cloudfuse/common"
"github.com/Seagate/cloudfuse/common/log"
"github.com/Seagate/cloudfuse/internal"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -75,7 +76,12 @@ func (suite *LoopbackFSTestSuite) SetupTest() {
suite.lfs = lfs.(*LoopbackFS)
suite.lfs.path = testPath

err := os.MkdirAll(testPath, os.FileMode(0777))
err := log.SetDefaultLogger("silent", common.LogConfig{})
if err != nil {
panic(fmt.Sprintf("Unable to set silent logger as default: %v", err))
}

err = os.MkdirAll(testPath, os.FileMode(0777))
panicIfNotNil(err, "Failed to setup test directories")
err = os.MkdirAll(filepath.Join(testPath, dirOne), os.FileMode(0777))
panicIfNotNil(err, "Failed to setup test directories")
Expand Down
10 changes: 5 additions & 5 deletions doc/cloudfuse_mount.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cloudfuse mount <mount path> [flags]
--cpk-enabled Enable client provided key.
--disable-compression Disable transport layer compression.
--disable-writeback-cache Disallow libfuse to buffer write requests if you must strictly open files in O_WRONLY or O_APPEND mode.
--display-capacity-mb uint Storage capacity to display. (default 1048576)
--display-capacity-mb uint Storage capacity to display. (default 1073741824)
--dry-run Test mount configuration, credentials, etc., but don't make any changes to the container or the local file system. Implies foreground.
--enable-symlinks whether or not symlinks should be supported
--entry-timeout uint32 The entry timeout in seconds.
Expand All @@ -45,7 +45,7 @@ cloudfuse mount <mount path> [flags]
--lazy-write Async write to storage container after file handle is closed.
--log-file-path string Configures the path for log files. Default is $HOME/.cloudfuse/cloudfuse.log (default "$HOME/.cloudfuse/cloudfuse.log")
--log-level string Enables logs written to syslog. Set to LOG_WARNING by default. Allowed values are LOG_OFF|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_INFO|LOG_DEBUG (default "LOG_WARNING")
--log-type string Type of logger to be used by the system. Set to syslog by default. Allowed values are silent|syslog|base. (default "syslog")
--log-type string Type of logger to be used by the system. Set to base by default. Allowed values are silent|syslog|base. (default "base")
--low-disk-threshold uint32 percentage of cache utilization which stops early eviction started by high-disk-threshold (default 80)
--negative-timeout uint32 The negative entry timeout in seconds.
--network-share Run as a network share. Only supported on Windows.
Expand All @@ -70,8 +70,8 @@ cloudfuse mount <mount path> [flags]

### SEE ALSO

* [cloudfuse](cloudfuse.md) - Cloudfuse is an open source project developed to provide a virtual filesystem backed by cloud storage.
* [cloudfuse mount all](cloudfuse_mount_all.md) - Mounts all containers for a given cloud account as a filesystem
* [cloudfuse mount list](cloudfuse_mount_list.md) - List all cloudfuse mountpoints
* [cloudfuse](cloudfuse.md) - Cloudfuse is an open source project developed to provide a virtual filesystem backed by cloud storage.
* [cloudfuse mount all](cloudfuse_mount_all.md) - Mounts all containers for a given cloud account as a filesystem
* [cloudfuse mount list](cloudfuse_mount_list.md) - List all cloudfuse mountpoints

###### Auto generated by spf13/cobra on 1-Nov-2024
6 changes: 3 additions & 3 deletions doc/cloudfuse_mount_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cloudfuse mount all <mount path> [flags]
--disable-compression Disable transport layer compression.
--disable-version-check To disable version check that is performed automatically
--disable-writeback-cache Disallow libfuse to buffer write requests if you must strictly open files in O_WRONLY or O_APPEND mode.
--display-capacity-mb uint Storage capacity to display. (default 1048576)
--display-capacity-mb uint Storage capacity to display. (default 1073741824)
--enable-symlinks whether or not symlinks should be supported
--entry-timeout uint32 The entry timeout in seconds.
--file-cache-timeout uint32 file cache timeout (default 120)
Expand All @@ -50,7 +50,7 @@ cloudfuse mount all <mount path> [flags]
--lazy-write Async write to storage container after file handle is closed.
--log-file-path string Configures the path for log files. Default is /$HOME/.cloudfuse/cloudfuse.log (default "$HOME/.cloudfuse/cloudfuse.log")
--log-level string Enables logs written to syslog. Set to LOG_WARNING by default. Allowed values are LOG_OFF|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_INFO|LOG_DEBUG (default "LOG_WARNING")
--log-type string Type of logger to be used by the system. Set to syslog by default. Allowed values are silent|syslog|base. (default "syslog")
--log-type string Type of logger to be used by the system. Set to base by default. Allowed values are silent|syslog|base. (default "base")
--low-disk-threshold uint32 percentage of cache utilization which stops early eviction started by high-disk-threshold (default 80)
--negative-timeout uint32 The negative entry timeout in seconds.
--network-share Run as a network share. Only supported on Windows.
Expand All @@ -69,6 +69,6 @@ cloudfuse mount all <mount path> [flags]

### SEE ALSO

* [cloudfuse mount](cloudfuse_mount.md) - Mount the container as a filesystem
* [cloudfuse mount](cloudfuse_mount.md) - Mount the container as a filesystem

###### Auto generated by spf13/cobra on 1-Nov-2024
6 changes: 3 additions & 3 deletions doc/cloudfuse_mount_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cloudfuse mount list
--disable-compression Disable transport layer compression.
--disable-version-check To disable version check that is performed automatically
--disable-writeback-cache Disallow libfuse to buffer write requests if you must strictly open files in O_WRONLY or O_APPEND mode.
--display-capacity-mb uint Storage capacity to display. (default 1048576)
--display-capacity-mb uint Storage capacity to display. (default 1073741824)
--enable-symlinks whether or not symlinks should be supported
--entry-timeout uint32 The entry timeout in seconds.
--file-cache-timeout uint32 file cache timeout (default 120)
Expand All @@ -56,7 +56,7 @@ cloudfuse mount list
--lazy-write Async write to storage container after file handle is closed.
--log-file-path string Configures the path for log files. Default is $HOME/.cloudfuse/cloudfuse.log (default "$HOME/.cloudfuse/cloudfuse.log")
--log-level string Enables logs written to syslog. Set to LOG_WARNING by default. Allowed values are LOG_OFF|LOG_CRIT|LOG_ERR|LOG_WARNING|LOG_INFO|LOG_DEBUG (default "LOG_WARNING")
--log-type string Type of logger to be used by the system. Set to syslog by default. Allowed values are silent|syslog|base. (default "syslog")
--log-type string Type of logger to be used by the system. Set to base by default. Allowed values are silent|syslog|base. (default "base")
--low-disk-threshold uint32 percentage of cache utilization which stops early eviction started by high-disk-threshold (default 80)
--negative-timeout uint32 The negative entry timeout in seconds.
--network-share Run as a network share. Only supported on Windows.
Expand All @@ -75,6 +75,6 @@ cloudfuse mount list

### SEE ALSO

* [cloudfuse mount](cloudfuse_mount.md) - Mount the container as a filesystem
* [cloudfuse mount](cloudfuse_mount.md) - Mount the container as a filesystem

###### Auto generated by spf13/cobra on 1-Nov-2024
2 changes: 0 additions & 2 deletions gui/azure_config_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from ui_azure_config_advanced import Ui_Form
from common_qt_functions import widgetCustomFunctions

file_cache_eviction_choices = ['lru','lfu']
Comment thread
Ferelith-maker marked this conversation as resolved.
az_blob_tier = ['none','hot','cool','archive']

class azureAdvancedSettingsWidget(widgetCustomFunctions, Ui_Form):
Expand Down Expand Up @@ -99,7 +98,6 @@ def populateOptions(self):
self.lineEdit_azure_authResource.setText(azStorage['auth-resource'])

self.dropDown_azure_blobTier.setCurrentIndex(az_blob_tier.index(azStorage['tier']))
self.dropDown_fileCache_evictionPolicy.setCurrentIndex(file_cache_eviction_choices.index(fileCache['policy']))

if platform == 'win32':
self.checkBox_libfuse_networkshare.setToolTip('Runs as a network share - may improve performance when latency to cloud is high.')
Expand Down
10 changes: 0 additions & 10 deletions gui/azure_config_advanced.ui
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,6 @@
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QLabel" name="label_14">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Eviction policy to be engaged for cache eviction:&lt;/p&gt;&lt;p&gt;LRU = Clear the &lt;span style=&quot; text-decoration: underline;&quot;&gt;L&lt;/span&gt;east &lt;span style=&quot; text-decoration: underline;&quot;&gt;R&lt;/span&gt;ecently &lt;span style=&quot; text-decoration: underline;&quot;&gt;U&lt;/span&gt;sed file next&lt;/p&gt;&lt;p&gt;LFU = Cear the &lt;span style=&quot; text-decoration: underline;&quot;&gt;L&lt;/span&gt;east &lt;span style=&quot; text-decoration: underline;&quot;&gt;F&lt;/span&gt;requently &lt;span style=&quot; text-decoration: underline;&quot;&gt;U&lt;/span&gt;sed file next&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Eviction Policy</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="toolTip">
Expand Down
Loading
Loading