github.com/cs3org/reva/v2@v2.27.7/pkg/storage/utils/eosfs/config.go (about)

     1  // Copyright 2018-2021 CERN
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  //
    15  // In applying this license, CERN does not waive the privileges and immunities
    16  // granted to it by virtue of its status as an Intergovernmental Organization
    17  // or submit itself to any jurisdiction.
    18  
    19  package eosfs
    20  
    21  // Config holds the configuration details for the EOS fs.
    22  type Config struct {
    23  	// Namespace for metadata operations
    24  	Namespace string `mapstructure:"namespace"`
    25  
    26  	// The root at which the file system is mounted
    27  	MountPath string `mapstructure:"mount_path"`
    28  
    29  	// QuotaNode for storing quota information
    30  	QuotaNode string `mapstructure:"quota_node"`
    31  
    32  	// DefaultQuotaBytes sets the default maximum bytes available for a user
    33  	DefaultQuotaBytes uint64 `mapstructure:"default_quota_bytes"`
    34  
    35  	// DefaultQuotaFiles sets the default maximum files available for a user
    36  	DefaultQuotaFiles uint64 `mapstructure:"default_quota_files"`
    37  
    38  	// ShadowNamespace for storing shadow data
    39  	ShadowNamespace string `mapstructure:"shadow_namespace"`
    40  
    41  	// UploadsNamespace for storing upload data
    42  	UploadsNamespace string `mapstructure:"uploads_namespace"`
    43  
    44  	// ShareFolder defines the name of the folder in the
    45  	// shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares
    46  	ShareFolder string `mapstructure:"share_folder"`
    47  
    48  	// Location of the eos binary.
    49  	// Default is /usr/bin/eos.
    50  	EosBinary string `mapstructure:"eos_binary"`
    51  
    52  	// Location of the xrdcopy binary.
    53  	// Default is /opt/eos/xrootd/bin/xrdcopy.
    54  	XrdcopyBinary string `mapstructure:"xrdcopy_binary"`
    55  
    56  	// URL of the Master EOS MGM.
    57  	// Default is root://eos-example.org
    58  	MasterURL string `mapstructure:"master_url"`
    59  
    60  	// URL of the Slave EOS MGM.
    61  	// Default is root://eos-example.org
    62  	SlaveURL string `mapstructure:"slave_url"`
    63  
    64  	// Location on the local fs where to store reads.
    65  	// Defaults to os.TempDir()
    66  	CacheDirectory string `mapstructure:"cache_directory"`
    67  
    68  	// SecProtocol specifies the xrootd security protocol to use between the server and EOS.
    69  	SecProtocol string `mapstructure:"sec_protocol"`
    70  
    71  	// Keytab specifies the location of the keytab to use to authenticate to EOS.
    72  	Keytab string `mapstructure:"keytab"`
    73  
    74  	// SingleUsername is the username to use when SingleUserMode is enabled
    75  	SingleUsername string `mapstructure:"single_username"`
    76  
    77  	// UserLayout wraps the internal path with user information.
    78  	// Example: if conf.Namespace is /eos/user and received path is /docs
    79  	// and the UserLayout is {{.Username}} the internal path will be:
    80  	// /eos/user/<username>/docs
    81  	UserLayout string `mapstructure:"user_layout"`
    82  
    83  	// Enables logging of the commands executed
    84  	// Defaults to false
    85  	EnableLogging bool `mapstructure:"enable_logging"`
    86  
    87  	// ShowHiddenSysFiles shows internal EOS files like
    88  	// .sys.v# and .sys.a# files.
    89  	ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files"`
    90  
    91  	// ForceSingleUserMode will force connections to EOS to use SingleUsername
    92  	ForceSingleUserMode bool `mapstructure:"force_single_user_mode"`
    93  
    94  	// UseKeyTabAuth changes will authenticate requests by using an EOS keytab.
    95  	UseKeytab bool `mapstructure:"use_keytab"`
    96  
    97  	// EnableHome enables the creation of home directories.
    98  	EnableHome bool `mapstructure:"enable_home"`
    99  
   100  	// Whether to maintain the same inode across various versions of a file.
   101  	// Requires extra metadata operations if set to true
   102  	VersionInvariant bool `mapstructure:"version_invariant"`
   103  
   104  	// UseGRPC controls whether we spawn eosclient processes or use GRPC to connect to EOS.
   105  	UseGRPC bool `mapstructure:"use_grpc"`
   106  
   107  	// GatewaySvc stores the endpoint at which the GRPC gateway is exposed.
   108  	GatewaySvc string `mapstructure:"gatewaysvc"`
   109  
   110  	// GRPCAuthkey is the key that authorizes this client to connect to the GRPC service
   111  	// It's unclear whether this will be the final solution
   112  	GRPCAuthkey string `mapstructure:"grpc_auth_key"`
   113  
   114  	// URI of the EOS MGM grpc server
   115  	// Default is empty
   116  	GrpcURI string `mapstructure:"master_grpc_uri"`
   117  
   118  	// Size of the cache used to store user ID and UID resolution.
   119  	// Default value is 1000000.
   120  	UserIDCacheSize int `mapstructure:"user_id_cache_size"`
   121  
   122  	// The depth, starting from root, that we'll parse directories to lookup the
   123  	// owner and warm up the cache. For example, for a layout of {{substr 0 1 .Username}}/{{.Username}}
   124  	// and a depth of 2, we'll lookup each user's home directory.
   125  	// Default value is 2.
   126  	UserIDCacheWarmupDepth int `mapstructure:"user_id_cache_warmup_depth"`
   127  
   128  	// Normally the eosgrpc plugin streams data on the fly.
   129  	// Setting this to true will make reva use the temp cachedirectory
   130  	// as intermediate step for read operations
   131  	ReadUsesLocalTemp bool `mapstructure:"read_uses_local_temp"`
   132  
   133  	// Normally the eosgrpc plugin streams data on the fly.
   134  	// Setting this to true will make reva use the temp cachedirectory
   135  	// as intermediate step for write operations
   136  	// Beware: in pure streaming mode the FST must support
   137  	// the HTTP chunked encoding
   138  	WriteUsesLocalTemp bool `mapstructure:"write_uses_local_temp"`
   139  
   140  	// Whether to allow recycle operations on base paths.
   141  	// If set to true, we'll look up the owner of the passed path and perform
   142  	// operations on that user's recycle bin.
   143  	// Only considered when EnableHome is false.
   144  	AllowPathRecycleOperations bool `mapstructure:"allow_path_recycle_operations"`
   145  
   146  	// Whether we should impersonate the owner of a resource when trying to perform
   147  	// revisions-related operations.
   148  	ImpersonateOwnerforRevisions bool `mapstructure:"impersonate_owner_for_revisions"`
   149  
   150  	// HTTP connections to EOS: max number of idle conns
   151  	MaxIdleConns int `mapstructure:"max_idle_conns"`
   152  
   153  	// HTTP connections to EOS: max number of conns per host
   154  	MaxConnsPerHost int `mapstructure:"max_conns_per_host"`
   155  
   156  	// HTTP connections to EOS: max number of idle conns per host
   157  	MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host"`
   158  
   159  	// HTTP connections to EOS: idle conections TTL
   160  	IdleConnTimeout int `mapstructure:"idle_conn_timeout"`
   161  
   162  	// HTTP connections to EOS: client certificate (usually a X509 host certificate)
   163  	ClientCertFile string `mapstructure:"http_client_certfile"`
   164  	// HTTP connections to EOS: client certificate key (usually a X509 host certificate)
   165  	ClientKeyFile string `mapstructure:"http_client_keyfile"`
   166  	// HTTP connections to EOS: CA directories
   167  	ClientCADirs string `mapstructure:"http_client_cadirs"`
   168  	// HTTP connections to EOS: CA files
   169  	ClientCAFiles string `mapstructure:"http_client_cafiles"`
   170  
   171  	// TokenExpiry stores in seconds the time after which generated tokens will expire
   172  	// Default is 3600
   173  	TokenExpiry int `mapstructure:"token_expiry"`
   174  
   175  	SpacesConfig SpacesConfig `mapstructure:"spaces_config"`
   176  }