CernVM-FS  2.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
settings.cc
Go to the documentation of this file.
1 
5 #include "cvmfs_config.h"
6 #include "publish/settings.h"
7 
8 #include <unistd.h>
9 
10 #include <cstdlib>
11 #include <string>
12 #include <vector>
13 
14 #include "crypto/hash.h"
15 #include "options.h"
16 #include "publish/except.h"
17 #include "publish/repository.h"
18 #include "sanitizer.h"
19 #include "util/pointer.h"
20 #include "util/posix.h"
21 #include "util/string.h"
22 
23 namespace publish {
24 
26  if (getenv("TMPDIR") != NULL)
27  tmp_dir_ = getenv("TMPDIR");
28  else
29  tmp_dir_ = "/tmp";
30 }
31 
32 void SettingsSpoolArea::SetSpoolArea(const std::string &path) {
33  workspace_ = path;
34  tmp_dir_ = workspace_() + "/tmp";
35 }
36 
37 void SettingsSpoolArea::SetUnionMount(const std::string &path) {
38  union_mnt_ = path;
39 }
40 
42  repair_mode_ = val;
43 }
44 
46  std::vector<std::string> targets;
47  targets.push_back(tmp_dir());
48  targets.push_back(readonly_mnt());
49  targets.push_back(scratch_dir());
50  targets.push_back(cache_dir());
51  targets.push_back(log_dir());
52  targets.push_back(ovl_work_dir());
53 
54  for (unsigned i = 0; i < targets.size(); ++i) {
55  bool rv = MkdirDeep(targets[i], 0700, true /* veryfy_writable */);
56  if (!rv)
57  throw publish::EPublish("cannot create directory " + targets[i]);
58  }
59 }
60 
61 
62 //------------------------------------------------------------------------------
63 
64 
65 void SettingsTransaction::SetLayoutRevision(const unsigned revision) {
66  layout_revision_ = revision;
67 }
68 
70  in_enter_session_ = value;
71 }
72 
74  base_hash_ = hash;
75 }
76 
79 }
80 
82 {
84 }
85 
87  enforce_limits_ = value;
88 }
89 
92 }
93 
96 }
97 
99  limit_file_size_mb_ = value;
100 }
101 
103  use_catalog_autobalance_ = value;
104 }
105 
107  autobalance_max_weight_ = value;
108 }
109 
111  autobalance_min_weight_ = value;
112 }
113 
115  print_changeset_ = value;
116 }
117 
119  dry_run_ = value;
120 }
121 
122 void SettingsTransaction::SetUnionFsType(const std::string &union_fs) {
123  if (union_fs == "aufs") {
125  } else if ((union_fs == "overlay") || (union_fs == "overlayfs")) {
127  } else if (union_fs == "tarball") {
129  } else {
130  throw EPublish("unsupported union file system: " + union_fs);
131  }
132 }
133 
135  // TODO(jblomer): shall we switch the order?
136  if (DirectoryExists("/sys/fs/aufs")) {
138  return;
139  }
140  // TODO(jblomer): modprobe aufs, try again
141  if (DirectoryExists("/sys/module/overlay")) {
143  return;
144  }
145  // TODO(jblomer): modprobe overlay, try again
146  throw EPublish("neither AUFS nor OverlayFS detected on the system");
147 }
148 
150  // TODO(jblomer)
151  return true;
152 }
153 
154 void SettingsTransaction::SetTimeout(unsigned seconds) {
155  timeout_s_ = seconds;
156 }
157 
159  if (timeout_s_.is_default())
160  return -1;
161  return timeout_s_();
162 }
163 
164 void SettingsTransaction::SetLeasePath(const std::string &path) {
165  lease_path_ = path;
166 }
167 
169  const std::string &from, const std::string &to)
170 {
171  if (from.empty())
172  throw EPublish("template transaction's 'from' path must not be empty");
173  if (to.empty())
174  throw EPublish("template transaction's 'to' path must not be empty");
175  template_from_ = (from[0] == '/') ? from.substr(1) : from;
176  template_to_ = (to[0] == '/') ? to.substr(1) : to;
177 }
178 
179 //------------------------------------------------------------------------------
180 
181 
182 std::string SettingsStorage::GetLocator() const {
183  return std::string(upload::SpoolerDefinition::kDriverNames[type_()]) +
184  "," + tmp_dir_() +
185  "," + endpoint_();
186 }
187 
189  const std::string &s3_config,
190  const std::string &tmp_dir)
191 {
193  tmp_dir_ = tmp_dir;
194  endpoint_ = "cvmfs/" + fqrn_() + "@" + s3_config;
195 }
196 
197 void SettingsStorage::MakeLocal(const std::string &path) {
199  endpoint_ = path;
200  tmp_dir_ = path + "/data/txn";
201 }
202 
204  const std::string &host,
205  unsigned int port,
206  const std::string &tmp_dir)
207 {
209  endpoint_ = "http://" + host + ":" + StringifyInt(port) + "/api/v1";
210  tmp_dir_ = tmp_dir_;
211 }
212 
213 void SettingsStorage::SetLocator(const std::string &locator) {
214  std::vector<std::string> tokens = SplitString(locator, ',');
215  if (tokens.size() != 3) {
216  throw EPublish("malformed storage locator, expected format is "
217  "<type>,<temporary directory>,<endpoint>");
218  }
219  if (tokens[0] == "local") {
221  } else if (tokens[0] == "S3") {
223  } else if (tokens[0] == "gw") {
225  } else {
226  throw EPublish("unsupported storage type: " + tokens[0]);
227  }
228  tmp_dir_ = tokens[1];
229  endpoint_ = tokens[2];
230 }
231 
232 
233 //------------------------------------------------------------------------------
234 
235 void SettingsKeychain::SetKeychainDir(const std::string &keychain_dir) {
237  master_private_key_path_ = keychain_dir + "/" + fqrn_() + ".masterkey";
238  master_public_key_path_ = keychain_dir + "/" + fqrn_() + ".pub";
239  private_key_path_ = keychain_dir + "/" + fqrn_() + ".key";
240  certificate_path_ = keychain_dir + "/" + fqrn_() + ".crt";
241  gw_key_path_ = keychain_dir + "/" + fqrn_() + ".gw";
242 }
243 
244 
250 }
251 
252 
256 }
257 
258 
260  return (FileExists(private_key_path_()) &&
264 }
265 
266 
268  return FileExists(private_key_path_()) &&
270 }
271 
273  return FileExists(gw_key_path_());
274 }
275 
276 //------------------------------------------------------------------------------
277 
278 
280  const SettingsPublisher &settings_publisher)
281  : fqrn_(settings_publisher.fqrn())
282  , url_(settings_publisher.url())
283  , proxy_(settings_publisher.proxy())
284  , tmp_dir_(settings_publisher.transaction().spool_area().tmp_dir())
285  , keychain_(settings_publisher.fqrn())
286 {
287  keychain_.SetKeychainDir(settings_publisher.keychain().keychain_dir());
288 }
289 
290 
292  const SettingsReplica &settings_replica)
293  : fqrn_(settings_replica.fqrn())
294  , url_(settings_replica.url())
295  , keychain_(settings_replica.fqrn())
296 {
297 }
298 
299 
300 void SettingsRepository::SetUrl(const std::string &url) {
301  // TODO(jblomer): sanitiation, check availability
302  url_ = url;
303 }
304 
305 
306 void SettingsRepository::SetProxy(const std::string &proxy) {
307  proxy_ = proxy;
308 }
309 
310 
311 void SettingsRepository::SetTmpDir(const std::string &tmp_dir) {
312  tmp_dir_ = tmp_dir;
313 }
314 
315 
316 void SettingsRepository::SetCertBundle(const std::string &cert_bundle) {
318 }
319 
320 
321 //------------------------------------------------------------------------------
322 
323 
325 
326 
328  const SettingsRepository &settings_repository)
329  : fqrn_(settings_repository.fqrn())
330  , url_(settings_repository.url())
331  , proxy_(settings_repository.proxy())
332  , owner_uid_(0)
333  , owner_gid_(0)
334  , whitelist_validity_days_(kDefaultWhitelistValidity)
335  , is_silent_(false)
336  , is_managed_(false)
337  , storage_(fqrn_())
338  , transaction_(fqrn_())
339  , keychain_(fqrn_())
340 {
341  keychain_.SetKeychainDir(settings_repository.keychain().keychain_dir());
342 }
343 
344 
345 void SettingsPublisher::SetUrl(const std::string &url) {
346  // TODO(jblomer): sanitiation, check availability
347  url_ = url;
348 }
349 
350 
351 void SettingsPublisher::SetProxy(const std::string &proxy) {
352  proxy_ = proxy;
353 }
354 
355 
356 void SettingsPublisher::SetOwner(const std::string &user_name) {
357  bool retval = GetUidOf(user_name, owner_uid_.GetPtr(), owner_gid_.GetPtr());
358  if (!retval) {
359  throw EPublish("unknown user name for repository owner: " + user_name);
360  }
361 }
362 
363 void SettingsPublisher::SetOwner(uid_t uid, gid_t gid) {
364  owner_uid_ = uid;
365  owner_gid_ = gid;
366 }
367 
369  is_silent_ = value;
370 }
371 
373  is_managed_ = value;
374 }
375 
376 
377 //------------------------------------------------------------------------------
378 
379 
381  delete options_mgr_;
382 }
383 
384 
385 std::map<std::string, std::string> SettingsBuilder::GetSessionEnvironment() {
386  std::map<std::string, std::string> result;
387  std::string session_dir = Env::GetEnterSessionDir();
388  if (session_dir.empty())
389  return result;
390 
391  // Get the repository name from the ephemeral writable shell
392  BashOptionsManager omgr;
393  omgr.set_taint_environment(false);
394  omgr.ParsePath(session_dir + "/env.conf", false /* external */);
395 
396  // We require at least CVMFS_FQRN to be set
397  std::string fqrn;
398  if (!omgr.GetValue("CVMFS_FQRN", &fqrn)) {
399  throw EPublish("no repositories found in ephemeral writable shell",
401  }
402 
403  std::vector<std::string> keys = omgr.GetAllKeys();
404  for (unsigned i = 0; i < keys.size(); ++i) {
405  result[keys[i]] = omgr.GetValueOrDie(keys[i]);
406  }
407  return result;
408 }
409 
410 
412  std::map<std::string, std::string> session_env = GetSessionEnvironment();
413  if (!session_env.empty())
414  return session_env["CVMFS_FQRN"];
415 
416  std::vector<std::string> repositories = FindDirectories(config_path_);
417  if (repositories.empty()) {
418  throw EPublish("no repositories available in " + config_path_,
420  }
421 
422  for (unsigned i = 0; i < repositories.size(); ++i) {
423  repositories[i] = GetFileName(repositories[i]);
424  }
425  if (repositories.size() > 1) {
426  throw EPublish("multiple repositories available in " + config_path_ +
427  ":\n " + JoinStrings(repositories, "\n "),
429  }
430  return repositories[0];
431 }
432 
433 
435  const std::string &ident)
436 {
437  if (HasPrefix(ident, "http://", true /* ignore case */) ||
438  HasPrefix(ident, "https://", true /* ignore case */) ||
439  HasPrefix(ident, "file://", true /* ignore case */))
440  {
441  std::string fqrn = Repository::GetFqrnFromUrl(ident);
443  if (!sanitizer.IsValid(fqrn)) {
444  throw EPublish("malformed repository name: " + fqrn);
445  }
447  settings.SetUrl(ident);
448  return settings;
449  }
450 
451  std::string alias = ident.empty() ? GetSingleAlias() : ident;
452  std::string repo_path = config_path_ + "/" + alias;
453  std::string server_path = repo_path + "/server.conf";
454  std::string replica_path = repo_path + "/replica.conf";
455  std::string fqrn = alias;
456 
457  delete options_mgr_;
459  std::string arg;
461  options_mgr_->ParsePath("/etc/cvmfs/server.local", false /* external */);
462  options_mgr_->ParsePath(server_path, false /* external */);
463  options_mgr_->ParsePath(replica_path, false /* external */);
464  if (options_mgr_->GetValue("CVMFS_REPOSITORY_NAME", &arg))
465  fqrn = arg;
467 
468  if (options_mgr_->GetValue("CVMFS_PUBLIC_KEY", &arg))
469  settings.GetKeychain()->SetKeychainDir(arg);
470  if (options_mgr_->GetValue("CVMFS_STRATUM0", &arg))
471  settings.SetUrl(arg);
472  if (options_mgr_->GetValue("CVMFS_SERVER_PROXY", &arg))
473  settings.SetProxy(arg);
474  // For a replica, the stratum 1 url is the "local" location, hence it takes
475  // precedence over the stratum 0 url
476  if (options_mgr_->GetValue("CVMFS_STRATUM1", &arg))
477  settings.SetUrl(arg);
478  if (options_mgr_->GetValue("CVMFS_SPOOL_DIR", &arg))
479  settings.SetTmpDir(arg + "/tmp");
480  if (options_mgr_->GetValue("X509_CERT_BUNDLE", &arg))
481  settings.SetCertBundle(arg);
482 
483  return settings;
484 }
485 
486 std::string SettingsPublisher::GetReadOnlyXAttr(const std::string &attr) {
487  std::string value;
488  bool rvb = platform_getxattr(this->transaction().spool_area().readonly_mnt(),
489  attr, &value);
490  if (!rvb) {
491  throw EPublish("cannot get extended attribute " + attr);
492  }
493  return value;
494 }
495 
497  std::string session_dir = Env::GetEnterSessionDir();
498  std::map<std::string, std::string> session_env = GetSessionEnvironment();
499  std::string fqrn = session_env["CVMFS_FQRN"];
500 
501  UniquePtr<SettingsPublisher> settings_publisher(
503  // TODO(jblomer): work in progress
504  settings_publisher->GetTransaction()->SetInEnterSession(true);
505  settings_publisher->GetTransaction()->GetSpoolArea()->SetSpoolArea(
506  session_dir);
507 
508  std::string base_hash =
509  settings_publisher->GetReadOnlyXAttr("user.root_hash");
510 
511  BashOptionsManager omgr;
512  omgr.set_taint_environment(false);
513  omgr.ParsePath(settings_publisher->transaction().spool_area().client_config(),
514  false /* external */);
515 
516  std::string arg;
517  settings_publisher->SetUrl(settings_publisher->GetReadOnlyXAttr("user.host"));
518  settings_publisher->SetProxy(
519  settings_publisher->GetReadOnlyXAttr("user.proxy"));
520  if (omgr.GetValue("CVMFS_KEYS_DIR", &arg))
521  settings_publisher->GetKeychain()->SetKeychainDir(arg);
522  settings_publisher->GetTransaction()->SetLayoutRevision(
524  settings_publisher->GetTransaction()->SetBaseHash(shash::MkFromHexPtr(
525  shash::HexPtr(base_hash), shash::kSuffixCatalog));
526  settings_publisher->GetTransaction()->SetUnionFsType("overlayfs");
527  settings_publisher->SetOwner(geteuid(), getegid());
528 
529  return settings_publisher.Release();
530 }
531 
534  SettingsPublisher* settings_publisher) {
535  std::string arg;
536  if (options_mgr_.GetValue("CVMFS_CREATOR_VERSION", &arg)) {
537  settings_publisher->GetTransaction()->SetLayoutRevision(String2Uint64(arg));
538  }
539  if (options_mgr_.GetValue("CVMFS_UNION_FS_TYPE", &arg)) {
540  settings_publisher->GetTransaction()->SetUnionFsType(arg);
541  }
542  if (options_mgr_.GetValue("CVMFS_HASH_ALGORITHM", &arg)) {
543  settings_publisher->GetTransaction()->SetHashAlgorithm(arg);
544  }
545  if (options_mgr_.GetValue("CVMFS_UPSTREAM_STORAGE", &arg)) {
546  settings_publisher->GetStorage()->SetLocator(arg);
547  }
548  if (options_mgr_.GetValue("CVMFS_KEYS_DIR", &arg)) {
549  settings_publisher->GetKeychain()->SetKeychainDir(arg);
550  }
551  if (options_mgr_.GetValue("CVMFS_COMPRESSION_ALGORITHM", &arg)) {
552  settings_publisher->GetTransaction()->SetCompressionAlgorithm(arg);
553  }
554  if (options_mgr_.GetValue("CVMFS_ENFORCE_LIMITS", &arg)) {
555  settings_publisher->GetTransaction()->SetEnforceLimits(
556  options_mgr_.IsOn(arg));
557  }
558  if (options_mgr_.GetValue("CVMFS_NESTED_KCATALOG_LIMIT", &arg)) {
559  settings_publisher->GetTransaction()->SetLimitNestedCatalogKentries(
560  String2Uint64(arg));
561  }
562  if (options_mgr_.GetValue("CVMFS_ROOT_KCATALOG_LIMIT", &arg)) {
563  settings_publisher->GetTransaction()->SetLimitRootCatalogKentries(
564  String2Uint64(arg));
565  }
566  if (options_mgr_.GetValue("CVMFS_FILE_MBYTE_LIMIT", &arg)) {
567  settings_publisher->GetTransaction()->SetLimitFileSizeMb(
568  String2Uint64(arg));
569  }
570  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS", &arg)) {
571  settings_publisher->GetTransaction()->SetUseCatalogAutobalance(
572  options_mgr_.IsOn(arg));
573  }
574  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS_MAX_WEIGHT", &arg)) {
575  settings_publisher->GetTransaction()->SetAutobalanceMaxWeight(
576  String2Uint64(arg));
577  }
578  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS_MIN_WEIGHT", &arg)) {
579  settings_publisher->GetTransaction()->SetAutobalanceMinWeight(
580  String2Uint64(arg));
581  }
582  if (options_mgr_.GetValue("CVMFS_AUTO_REPAIR_MOUNTPOINT", &arg)) {
583  if (!options_mgr_.IsOn(arg)) {
584  settings_publisher->GetTransaction()->GetSpoolArea()->SetRepairMode(
586  }
587  }
588 }
589 
591  const std::string &ident, bool needs_managed)
592 {
593  // we are creating a publisher, it need to have the `server.conf` file
594  // present, otherwise something is wrong and we should exit early
595  const std::string alias(ident.empty() ? GetSingleAlias() : ident);
596 
597  std::map<std::string, std::string> session_env = GetSessionEnvironment();
598  // We can be in an ephemeral writable shell but interested in a different
599  // repository
600 
601  const std::string server_path = config_path_ + "/" + alias + "/server.conf";
602 
603  // Instead of returning the Settings from session, we need more processing
604  if (!session_env.empty() && (session_env["CVMFS_FQRN"] == alias)) {
605  SettingsPublisher *settings_publisher =
607  if (FileExists(server_path)) {
608  delete options_mgr_;
611  options_mgr_->ParsePath(server_path, false /* external */);
612  ApplyOptionsFromServerPath(*options_mgr_, settings_publisher);
613  }
614  return settings_publisher;
615  }
616 
617  if (FileExists(server_path) == false) {
618  throw EPublish(
619  "Unable to find the configuration file `server.conf` for the cvmfs "
620  "publisher: " + alias,
622  }
623 
624  SettingsRepository settings_repository = CreateSettingsRepository(alias);
625  if (needs_managed && !IsManagedRepository())
626  throw EPublish("remote repositories are not supported in this context");
627 
628  if (options_mgr_->GetValueOrDie("CVMFS_REPOSITORY_TYPE") != "stratum0") {
629  throw EPublish("Repository " + alias + " is not a stratum 0 repository",
631  }
632 
633  UniquePtr<SettingsPublisher> settings_publisher(
634  new SettingsPublisher(settings_repository));
635 
636  try {
637  std::string xattr = settings_publisher->GetReadOnlyXAttr("user.root_hash");
638  settings_publisher->GetTransaction()->SetBaseHash(
640  } catch (const EPublish& e) {
641  // We ignore the exception.
642  // In case of exception, the base hash remains unset.
643  }
644 
645  settings_publisher->SetIsManaged(IsManagedRepository());
646  settings_publisher->SetOwner(options_mgr_->GetValueOrDie("CVMFS_USER"));
647  settings_publisher->GetStorage()->SetLocator(
648  options_mgr_->GetValueOrDie("CVMFS_UPSTREAM_STORAGE"));
649 
650  ApplyOptionsFromServerPath(*options_mgr_, &*settings_publisher);
651 
652  // TODO(jblomer): process other parameters
653  return settings_publisher.Release();
654 }
655 
656 } // namespace publish
void SetUnionFsType(const std::string &union_fs)
Definition: settings.cc:122
SettingsKeychain * GetKeychain()
Definition: settings.h:377
std::string GetValueOrDie(const std::string &key)
Definition: options.cc:387
Setting< std::string > keychain_dir_
Definition: settings.h:338
Algorithms ParseCompressionAlgorithm(const std::string &algorithm_option)
Definition: compression.cc:148
std::string config_path_
Definition: settings.h:535
std::string readonly_mnt() const
Definition: settings.h:95
bool HasGatewayKey() const
Definition: settings.cc:272
Setting< unsigned > timeout_s_
Definition: settings.h:261
virtual void ParsePath(const std::string &config_file, const bool external)=0
SettingsPublisher * CreateSettingsPublisher(const std::string &ident, bool needs_managed=false)
Definition: settings.cc:590
SettingsTransaction * GetTransaction()
Definition: settings.h:438
void SetUrl(const std::string &url)
Definition: settings.cc:300
void SetUnionMount(const std::string &path)
Definition: settings.cc:37
void MakeGateway(const std::string &host, unsigned port, const std::string &tmp_dir)
Definition: settings.cc:203
NameString GetFileName(const PathString &path)
Definition: shortstring.cc:29
Setting< bool > is_managed_
Definition: settings.h:449
void SetTimeout(unsigned seconds)
Definition: settings.cc:154
SettingsKeychain * GetKeychain()
Definition: settings.h:439
void SetKeychainDir(const std::string &keychain_dir)
Definition: settings.cc:235
Setting< gid_t > owner_gid_
Definition: settings.h:446
std::string keychain_dir() const
Definition: settings.h:325
void SetLimitNestedCatalogKentries(unsigned value)
Definition: settings.cc:90
EUnionMountRepairMode
Definition: settings.h:64
void SetAutobalanceMaxWeight(unsigned value)
Definition: settings.cc:106
string JoinStrings(const vector< string > &strings, const string &joint)
Definition: string.cc:323
void SetIsSilent(bool value)
Definition: settings.cc:368
void set_taint_environment(bool value)
Definition: options.h:193
Setting< UnionFsType > union_fs_
Definition: settings.h:257
bool IsOn(const std::string &param_value) const
Definition: options.cc:409
Setting< upload::SpoolerDefinition::DriverType > type_
Definition: settings.h:299
void SetTemplate(const std::string &from, const std::string &to)
Definition: settings.cc:168
const SettingsPublisher & settings() const
Definition: repository.h:316
Setting< bool > enforce_limits_
Definition: settings.h:247
std::string GetSingleAlias()
Definition: settings.cc:411
Setting< std::string > union_mnt_
Definition: settings.h:125
SettingsRepository(const std::string &fqrn)
Definition: settings.h:355
void SetLayoutRevision(const unsigned revision)
Definition: settings.cc:65
std::string log_dir() const
Definition: settings.h:103
void SetLeasePath(const std::string &path)
Definition: settings.cc:164
Setting< std::string > tmp_dir_
Definition: settings.h:383
static const char * kDriverNames[]
corresponds to DriverType
std::string cert_bundle() const
Definition: settings.h:374
std::vector< std::string > FindDirectories(const std::string &parent_dir)
Definition: posix.cc:1166
Setting< unsigned > layout_revision_
Definition: settings.h:228
void SetAutobalanceMinWeight(unsigned value)
Definition: settings.cc:110
char algorithm
SettingsPublisher(const std::string &fqrn)
Definition: settings.h:399
OptionsManager * options_mgr_
Definition: settings.h:541
Setting< bool > is_silent_
Definition: settings.h:448
bool HasMasterKeys() const
Definition: settings.cc:253
void ApplyOptionsFromServerPath(const OptionsManager &options_mgr_, SettingsPublisher *settings_publisher)
Definition: settings.cc:532
Setting< shash::Any > base_hash_
Definition: settings.h:241
bool IsValid(const std::string &input) const
Definition: sanitizer.cc:114
Setting< unsigned > limit_root_catalog_kentries_
Definition: settings.h:249
bool FileExists(const std::string &path)
Definition: posix.cc:778
std::string cache_dir() const
Definition: settings.h:108
bool HasRepositoryKeys() const
Definition: settings.cc:267
std::string proxy() const
Definition: settings.h:372
const SettingsKeychain & keychain() const
Definition: settings.h:436
void SetTmpDir(const std::string &tmp_dir)
Definition: settings.cc:311
bool IsManagedRepository() const
Definition: settings.h:518
Setting< bool > in_enter_session_
Definition: settings.h:233
vector< string > SplitString(const string &str, char delim)
Definition: string.cc:288
void SetDryRun(bool value)
Definition: settings.cc:118
bool platform_getxattr(const std::string &path, const std::string &name, std::string *value)
Setting< std::string > template_from_
Definition: settings.h:267
Setting< uid_t > owner_uid_
Definition: settings.h:445
Setting< bool > use_catalog_autobalance_
Definition: settings.h:251
void SetProxy(const std::string &proxy)
Definition: settings.cc:351
const char kSuffixCatalog
Definition: hash.h:54
std::string GetReadOnlyXAttr(const std::string &attr)
Definition: settings.cc:486
void SetUrl(const std::string &url)
Definition: settings.cc:345
std::vector< std::string > GetAllKeys()
Definition: options.cc:423
std::string ovl_work_dir() const
Definition: settings.h:109
SettingsRepository CreateSettingsRepository(const std::string &ident)
Definition: settings.cc:434
Setting< unsigned > autobalance_max_weight_
Definition: settings.h:252
void SetLimitRootCatalogKentries(unsigned value)
Definition: settings.cc:94
bool MkdirDeep(const std::string &path, const mode_t mode, bool verify_writable)
Definition: posix.cc:833
void SetIsManaged(bool value)
Definition: settings.cc:372
Setting< std::string > workspace_
Definition: settings.h:123
const SettingsTransaction & transaction() const
Definition: settings.h:435
SettingsPublisher * CreateSettingsPublisherFromSession()
Definition: settings.cc:496
SettingsKeychain keychain_
Definition: settings.h:453
bool is_default() const
Definition: settings.h:51
std::string proxy() const
Definition: settings.h:425
void SetHashAlgorithm(const std::string &algorithm)
Definition: settings.cc:77
string StringifyInt(const int64_t value)
Definition: string.cc:78
void SetLocator(const std::string &locator)
Definition: settings.cc:213
Setting< std::string > fqrn_
Definition: settings.h:298
void SetCertBundle(const std::string &cert_bundle)
Definition: settings.cc:316
Setting< bool > print_changeset_
Definition: settings.h:254
SettingsStorage * GetStorage()
Definition: settings.h:437
bool HasPrefix(const string &str, const string &prefix, const bool ignore_case)
Definition: string.cc:265
Setting< zlib::Algorithms > compression_algorithm_
Definition: settings.h:243
bool GetValue(const std::string &key, std::string *value) const
Definition: options.cc:376
OptionsManager * options_mgr_
Definition: cvmfs.cc:146
Setting< std::string > fqrn_
Definition: settings.h:337
bool DirectoryExists(const std::string &path)
Definition: posix.cc:800
Setting< std::string > cert_bundle_
Definition: settings.h:386
void SetLimitFileSizeMb(unsigned value)
Definition: settings.cc:98
Setting< std::string > url_
Definition: settings.h:443
Setting< std::string > template_to_
Definition: settings.h:268
void SetUseCatalogAutobalance(bool value)
Definition: settings.cc:102
Setting< EUnionMountRepairMode > repair_mode_
Definition: settings.h:129
Setting< unsigned > autobalance_min_weight_
Definition: settings.h:253
void SetCompressionAlgorithm(const std::string &algorithm)
Definition: settings.cc:81
Setting< std::string > private_key_path_
Definition: settings.h:341
void SetSpoolArea(const std::string &path)
Definition: settings.cc:32
Setting< shash::Algorithms > hash_algorithm_
Definition: settings.h:242
void SetEnforceLimits(bool value)
Definition: settings.cc:86
Setting< std::string > tmp_dir_
Definition: settings.h:300
void ParsePath(const std::string &config_file, const bool external)
Definition: options.cc:146
void SetProxy(const std::string &proxy)
Definition: settings.cc:306
Setting< std::string > master_private_key_path_
Definition: settings.h:339
const SettingsKeychain & keychain() const
Definition: settings.h:376
static const unsigned kDefaultWhitelistValidity
Definition: settings.h:397
std::string tmp_dir() const
Definition: settings.h:94
Setting< std::string > proxy_
Definition: settings.h:444
void SetBaseHash(const shash::Any &hash)
Definition: settings.cc:73
Setting< std::string > endpoint_
Definition: settings.h:301
uint64_t String2Uint64(const string &value)
Definition: string.cc:228
void SetPrintChangeset(bool value)
Definition: settings.cc:114
bool GetUidOf(const std::string &username, uid_t *uid, gid_t *main_gid)
Definition: posix.cc:1331
Algorithms ParseHashAlgorithm(const string &algorithm_option)
Definition: hash.cc:72
std::string scratch_dir() const
Definition: settings.h:101
std::map< std::string, std::string > GetSessionEnvironment()
Definition: settings.cc:385
SettingsSpoolArea * GetSpoolArea()
Definition: settings.h:218
bool HasDanglingRepositoryKeys() const
Definition: settings.cc:259
Any MkFromHexPtr(const HexPtr hex, const char suffix)
Definition: hash.cc:83
Setting< unsigned > limit_file_size_mb_
Definition: settings.h:250
void MakeLocal(const std::string &path)
Definition: settings.cc:197
Setting< std::string > master_public_key_path_
Definition: settings.h:340
void SetOwner(const std::string &user_name)
Definition: settings.cc:356
void SetRepairMode(const EUnionMountRepairMode val)
Definition: settings.cc:41
Setting< unsigned > limit_nested_catalog_kentries_
Definition: settings.h:248
SettingsKeychain keychain_
Definition: settings.h:388
Setting< bool > dry_run_
Definition: settings.h:255
Setting< std::string > certificate_path_
Definition: settings.h:342
std::string url() const
Definition: settings.h:371
Setting< std::string > proxy_
Definition: settings.h:382
void MakeS3(const std::string &s3_config, const std::string &tmp_dir)
Definition: settings.cc:188
std::string url() const
Definition: settings.h:424
Setting< std::string > tmp_dir_
Definition: settings.h:124
std::string GetLocator() const
Definition: settings.cc:182
Setting< std::string > url_
Definition: settings.h:381
void SetInEnterSession(const bool value)
Definition: settings.cc:69
Setting< std::string > gw_key_path_
Definition: settings.h:343
Setting< std::string > lease_path_
Definition: settings.h:262
std::string tmp_dir() const
Definition: settings.h:373
static const unsigned kRequiredLayoutRevision
Definition: repository.h:277
class static __attribute__((visibility("default"))) Repository std::string GetFqrnFromUrl(const std::string &url)
Definition: repository.cc:231
bool HasDanglingMasterKeys() const
Definition: settings.cc:245