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 "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 
291 void SettingsRepository::SetUrl(const std::string &url) {
292  // TODO(jblomer): sanitiation, check availability
293  url_ = url;
294 }
295 
296 
297 void SettingsRepository::SetProxy(const std::string &proxy) {
298  proxy_ = proxy;
299 }
300 
301 
302 void SettingsRepository::SetTmpDir(const std::string &tmp_dir) {
303  tmp_dir_ = tmp_dir;
304 }
305 
306 
307 void SettingsRepository::SetCertBundle(const std::string &cert_bundle) {
309 }
310 
311 
312 //------------------------------------------------------------------------------
313 
314 
316 
317 
319  const SettingsRepository &settings_repository)
320  : fqrn_(settings_repository.fqrn())
321  , url_(settings_repository.url())
322  , proxy_(settings_repository.proxy())
323  , owner_uid_(0)
324  , owner_gid_(0)
325  , whitelist_validity_days_(kDefaultWhitelistValidity)
326  , is_silent_(false)
327  , is_managed_(false)
328  , storage_(fqrn_())
329  , transaction_(fqrn_())
330  , keychain_(fqrn_())
331 {
332  keychain_.SetKeychainDir(settings_repository.keychain().keychain_dir());
333 }
334 
335 
336 void SettingsPublisher::SetUrl(const std::string &url) {
337  // TODO(jblomer): sanitiation, check availability
338  url_ = url;
339 }
340 
341 
342 void SettingsPublisher::SetProxy(const std::string &proxy) {
343  proxy_ = proxy;
344 }
345 
346 
347 void SettingsPublisher::SetOwner(const std::string &user_name) {
348  bool retval = GetUidOf(user_name, owner_uid_.GetPtr(), owner_gid_.GetPtr());
349  if (!retval) {
350  throw EPublish("unknown user name for repository owner: " + user_name);
351  }
352 }
353 
354 void SettingsPublisher::SetOwner(uid_t uid, gid_t gid) {
355  owner_uid_ = uid;
356  owner_gid_ = gid;
357 }
358 
360  is_silent_ = value;
361 }
362 
364  is_managed_ = value;
365 }
366 
367 
368 //------------------------------------------------------------------------------
369 
370 
372  delete options_mgr_;
373 }
374 
375 
376 std::map<std::string, std::string> SettingsBuilder::GetSessionEnvironment() {
377  std::map<std::string, std::string> result;
378  std::string session_dir = Env::GetEnterSessionDir();
379  if (session_dir.empty())
380  return result;
381 
382  // Get the repository name from the ephemeral writable shell
383  BashOptionsManager omgr;
384  omgr.set_taint_environment(false);
385  omgr.ParsePath(session_dir + "/env.conf", false /* external */);
386 
387  // We require at least CVMFS_FQRN to be set
388  std::string fqrn;
389  if (!omgr.GetValue("CVMFS_FQRN", &fqrn)) {
390  throw EPublish("no repositories found in ephemeral writable shell",
392  }
393 
394  std::vector<std::string> keys = omgr.GetAllKeys();
395  for (unsigned i = 0; i < keys.size(); ++i) {
396  result[keys[i]] = omgr.GetValueOrDie(keys[i]);
397  }
398  return result;
399 }
400 
401 
403  std::map<std::string, std::string> session_env = GetSessionEnvironment();
404  if (!session_env.empty())
405  return session_env["CVMFS_FQRN"];
406 
407  std::vector<std::string> repositories = FindDirectories(config_path_);
408  if (repositories.empty()) {
409  throw EPublish("no repositories available in " + config_path_,
411  }
412 
413  for (unsigned i = 0; i < repositories.size(); ++i) {
414  repositories[i] = GetFileName(repositories[i]);
415  }
416  if (repositories.size() > 1) {
417  throw EPublish("multiple repositories available in " + config_path_ +
418  ":\n " + JoinStrings(repositories, "\n "),
420  }
421  return repositories[0];
422 }
423 
424 
426  const std::string &ident)
427 {
428  if (HasPrefix(ident, "http://", true /* ignore case */) ||
429  HasPrefix(ident, "https://", true /* ignore case */) ||
430  HasPrefix(ident, "file://", true /* ignore case */))
431  {
432  std::string fqrn = Repository::GetFqrnFromUrl(ident);
434  if (!sanitizer.IsValid(fqrn)) {
435  throw EPublish("malformed repository name: " + fqrn);
436  }
438  settings.SetUrl(ident);
439  return settings;
440  }
441 
442  std::string alias = ident.empty() ? GetSingleAlias() : ident;
443  std::string repo_path = config_path_ + "/" + alias;
444  std::string server_path = repo_path + "/server.conf";
445  std::string replica_path = repo_path + "/replica.conf";
446  std::string fqrn = alias;
447 
448  delete options_mgr_;
450  std::string arg;
452  options_mgr_->ParsePath("/etc/cvmfs/server.local", false /* external */);
453  options_mgr_->ParsePath(server_path, false /* external */);
454  options_mgr_->ParsePath(replica_path, false /* external */);
455  if (options_mgr_->GetValue("CVMFS_REPOSITORY_NAME", &arg))
456  fqrn = arg;
458 
459  if (options_mgr_->GetValue("CVMFS_PUBLIC_KEY", &arg))
460  settings.GetKeychain()->SetKeychainDir(arg);
461  if (options_mgr_->GetValue("CVMFS_STRATUM0", &arg))
462  settings.SetUrl(arg);
463  if (options_mgr_->GetValue("CVMFS_SERVER_PROXY", &arg))
464  settings.SetProxy(arg);
465  // For a replica, the stratum 1 url is the "local" location, hence it takes
466  // precedence over the stratum 0 url
467  if (options_mgr_->GetValue("CVMFS_STRATUM1", &arg))
468  settings.SetUrl(arg);
469  if (options_mgr_->GetValue("CVMFS_SPOOL_DIR", &arg))
470  settings.SetTmpDir(arg + "/tmp");
471  if (options_mgr_->GetValue("X509_CERT_BUNDLE", &arg))
472  settings.SetCertBundle(arg);
473 
474  return settings;
475 }
476 
477 std::string SettingsPublisher::GetReadOnlyXAttr(const std::string &attr) {
478  std::string value;
479  bool rvb = platform_getxattr(this->transaction().spool_area().readonly_mnt(),
480  attr, &value);
481  if (!rvb) {
482  throw EPublish("cannot get extended attribute " + attr);
483  }
484  return value;
485 }
486 
488  std::string session_dir = Env::GetEnterSessionDir();
489  std::map<std::string, std::string> session_env = GetSessionEnvironment();
490  std::string fqrn = session_env["CVMFS_FQRN"];
491 
492  UniquePtr<SettingsPublisher> settings_publisher(
494  // TODO(jblomer): work in progress
495  settings_publisher->GetTransaction()->SetInEnterSession(true);
496  settings_publisher->GetTransaction()->GetSpoolArea()->SetSpoolArea(
497  session_dir);
498 
499  std::string base_hash =
500  settings_publisher->GetReadOnlyXAttr("user.root_hash");
501 
502  BashOptionsManager omgr;
503  omgr.set_taint_environment(false);
504  omgr.ParsePath(settings_publisher->transaction().spool_area().client_config(),
505  false /* external */);
506 
507  std::string arg;
508  settings_publisher->SetUrl(settings_publisher->GetReadOnlyXAttr("user.host"));
509  settings_publisher->SetProxy(
510  settings_publisher->GetReadOnlyXAttr("user.proxy"));
511  if (omgr.GetValue("CVMFS_KEYS_DIR", &arg))
512  settings_publisher->GetKeychain()->SetKeychainDir(arg);
513  settings_publisher->GetTransaction()->SetLayoutRevision(
515  settings_publisher->GetTransaction()->SetBaseHash(shash::MkFromHexPtr(
516  shash::HexPtr(base_hash), shash::kSuffixCatalog));
517  settings_publisher->GetTransaction()->SetUnionFsType("overlayfs");
518  settings_publisher->SetOwner(geteuid(), getegid());
519 
520  return settings_publisher.Release();
521 }
522 
525  SettingsPublisher* settings_publisher) {
526  std::string arg;
527  if (options_mgr_.GetValue("CVMFS_CREATOR_VERSION", &arg)) {
528  settings_publisher->GetTransaction()->SetLayoutRevision(String2Uint64(arg));
529  }
530  if (options_mgr_.GetValue("CVMFS_UNION_FS_TYPE", &arg)) {
531  settings_publisher->GetTransaction()->SetUnionFsType(arg);
532  }
533  if (options_mgr_.GetValue("CVMFS_HASH_ALGORITHM", &arg)) {
534  settings_publisher->GetTransaction()->SetHashAlgorithm(arg);
535  }
536  if (options_mgr_.GetValue("CVMFS_UPSTREAM_STORAGE", &arg)) {
537  settings_publisher->GetStorage()->SetLocator(arg);
538  }
539  if (options_mgr_.GetValue("CVMFS_KEYS_DIR", &arg)) {
540  settings_publisher->GetKeychain()->SetKeychainDir(arg);
541  }
542  if (options_mgr_.GetValue("CVMFS_COMPRESSION_ALGORITHM", &arg)) {
543  settings_publisher->GetTransaction()->SetCompressionAlgorithm(arg);
544  }
545  if (options_mgr_.GetValue("CVMFS_ENFORCE_LIMITS", &arg)) {
546  settings_publisher->GetTransaction()->SetEnforceLimits(
547  options_mgr_.IsOn(arg));
548  }
549  if (options_mgr_.GetValue("CVMFS_NESTED_KCATALOG_LIMIT", &arg)) {
550  settings_publisher->GetTransaction()->SetLimitNestedCatalogKentries(
551  String2Uint64(arg));
552  }
553  if (options_mgr_.GetValue("CVMFS_ROOT_KCATALOG_LIMIT", &arg)) {
554  settings_publisher->GetTransaction()->SetLimitRootCatalogKentries(
555  String2Uint64(arg));
556  }
557  if (options_mgr_.GetValue("CVMFS_FILE_MBYTE_LIMIT", &arg)) {
558  settings_publisher->GetTransaction()->SetLimitFileSizeMb(
559  String2Uint64(arg));
560  }
561  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS", &arg)) {
562  settings_publisher->GetTransaction()->SetUseCatalogAutobalance(
563  options_mgr_.IsOn(arg));
564  }
565  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS_MAX_WEIGHT", &arg)) {
566  settings_publisher->GetTransaction()->SetAutobalanceMaxWeight(
567  String2Uint64(arg));
568  }
569  if (options_mgr_.GetValue("CVMFS_AUTOCATALOGS_MIN_WEIGHT", &arg)) {
570  settings_publisher->GetTransaction()->SetAutobalanceMinWeight(
571  String2Uint64(arg));
572  }
573  if (options_mgr_.GetValue("CVMFS_AUTO_REPAIR_MOUNTPOINT", &arg)) {
574  if (!options_mgr_.IsOn(arg)) {
575  settings_publisher->GetTransaction()->GetSpoolArea()->SetRepairMode(
577  }
578  }
579 }
580 
582  const std::string &ident, bool needs_managed)
583 {
584  // we are creating a publisher, it need to have the `server.conf` file
585  // present, otherwise something is wrong and we should exit early
586  const std::string alias(ident.empty() ? GetSingleAlias() : ident);
587 
588  std::map<std::string, std::string> session_env = GetSessionEnvironment();
589  // We can be in an ephemeral writable shell but interested in a different
590  // repository
591 
592  const std::string server_path = config_path_ + "/" + alias + "/server.conf";
593 
594  // Instead of returning the Settings from session, we need more processing
595  if (!session_env.empty() && (session_env["CVMFS_FQRN"] == alias)) {
596  SettingsPublisher *settings_publisher =
598  if (FileExists(server_path)) {
599  delete options_mgr_;
602  options_mgr_->ParsePath(server_path, false /* external */);
603  ApplyOptionsFromServerPath(*options_mgr_, settings_publisher);
604  }
605  return settings_publisher;
606  }
607 
608  if (FileExists(server_path) == false) {
609  throw EPublish(
610  "Unable to find the configuration file `server.conf` for the cvmfs "
611  "publisher: " + alias,
613  }
614 
615  SettingsRepository settings_repository = CreateSettingsRepository(alias);
616  if (needs_managed && !IsManagedRepository())
617  throw EPublish("remote repositories are not supported in this context");
618 
619  if (options_mgr_->GetValueOrDie("CVMFS_REPOSITORY_TYPE") != "stratum0") {
620  throw EPublish("Repository " + alias + " is not a stratum 0 repository",
622  }
623 
624  UniquePtr<SettingsPublisher> settings_publisher(
625  new SettingsPublisher(settings_repository));
626 
627  try {
628  std::string xattr = settings_publisher->GetReadOnlyXAttr("user.root_hash");
629  settings_publisher->GetTransaction()->SetBaseHash(
631  } catch (const EPublish& e) {
632  // We ignore the exception.
633  // In case of exception, the base hash remains unset.
634  }
635 
636  settings_publisher->SetIsManaged(IsManagedRepository());
637  settings_publisher->SetOwner(options_mgr_->GetValueOrDie("CVMFS_USER"));
638  settings_publisher->GetStorage()->SetLocator(
639  options_mgr_->GetValueOrDie("CVMFS_UPSTREAM_STORAGE"));
640 
641  ApplyOptionsFromServerPath(*options_mgr_, &*settings_publisher);
642 
643  // TODO(jblomer): process other parameters
644  return settings_publisher.Release();
645 }
646 
647 } // namespace publish
void SetUnionFsType(const std::string &union_fs)
Definition: settings.cc:122
SettingsKeychain * GetKeychain()
Definition: settings.h:375
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:530
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:581
SettingsTransaction * GetTransaction()
Definition: settings.h:436
void SetUrl(const std::string &url)
Definition: settings.cc:291
std::string GetFileName(const std::string &path)
Definition: posix.cc:162
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
Setting< bool > is_managed_
Definition: settings.h:447
void SetTimeout(unsigned seconds)
Definition: settings.cc:154
SettingsKeychain * GetKeychain()
Definition: settings.h:437
vector< string > SplitString(const string &str, const char delim, const unsigned max_chunks)
Definition: string.cc:288
void SetKeychainDir(const std::string &keychain_dir)
Definition: settings.cc:235
Setting< gid_t > owner_gid_
Definition: settings.h:444
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:318
void SetIsSilent(bool value)
Definition: settings.cc:359
void set_taint_environment(bool value)
Definition: options.h:185
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:314
Setting< bool > enforce_limits_
Definition: settings.h:247
std::string GetSingleAlias()
Definition: settings.cc:402
Setting< std::string > union_mnt_
Definition: settings.h:125
SettingsRepository(const std::string &fqrn)
Definition: settings.h:354
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:381
static const char * kDriverNames[]
corresponds to DriverType
std::string cert_bundle() const
Definition: settings.h:372
std::vector< std::string > FindDirectories(const std::string &parent_dir)
Definition: posix.cc:1204
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:397
OptionsManager * options_mgr_
Definition: settings.h:536
Setting< bool > is_silent_
Definition: settings.h:446
bool HasMasterKeys() const
Definition: settings.cc:253
void ApplyOptionsFromServerPath(const OptionsManager &options_mgr_, SettingsPublisher *settings_publisher)
Definition: settings.cc:523
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:816
std::string cache_dir() const
Definition: settings.h:108
bool HasRepositoryKeys() const
Definition: settings.cc:267
std::string proxy() const
Definition: settings.h:370
const SettingsKeychain & keychain() const
Definition: settings.h:434
void SetTmpDir(const std::string &tmp_dir)
Definition: settings.cc:302
bool IsManagedRepository() const
Definition: settings.h:513
Setting< bool > in_enter_session_
Definition: settings.h:233
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:443
Setting< bool > use_catalog_autobalance_
Definition: settings.h:251
void SetProxy(const std::string &proxy)
Definition: settings.cc:342
const char kSuffixCatalog
Definition: hash.h:53
std::string GetReadOnlyXAttr(const std::string &attr)
Definition: settings.cc:477
void SetUrl(const std::string &url)
Definition: settings.cc:336
std::vector< std::string > GetAllKeys()
Definition: options.cc:416
std::string ovl_work_dir() const
Definition: settings.h:109
SettingsRepository CreateSettingsRepository(const std::string &ident)
Definition: settings.cc:425
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:871
void SetIsManaged(bool value)
Definition: settings.cc:363
Setting< std::string > workspace_
Definition: settings.h:123
const SettingsTransaction & transaction() const
Definition: settings.h:433
Any MkFromHexPtr(const HexPtr hex, const char suffix)
Definition: hash.cc:83
SettingsPublisher * CreateSettingsPublisherFromSession()
Definition: settings.cc:487
SettingsKeychain keychain_
Definition: settings.h:451
bool is_default() const
Definition: settings.h:51
std::string proxy() const
Definition: settings.h:423
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:307
Setting< bool > print_changeset_
Definition: settings.h:254
SettingsStorage * GetStorage()
Definition: settings.h:435
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:145
Setting< std::string > fqrn_
Definition: settings.h:337
bool DirectoryExists(const std::string &path)
Definition: posix.cc:838
Setting< std::string > cert_bundle_
Definition: settings.h:384
void SetLimitFileSizeMb(unsigned value)
Definition: settings.cc:98
Setting< std::string > url_
Definition: settings.h:441
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:297
Setting< std::string > master_private_key_path_
Definition: settings.h:339
const SettingsKeychain & keychain() const
Definition: settings.h:374
static const unsigned kDefaultWhitelistValidity
Definition: settings.h:395
std::string tmp_dir() const
Definition: settings.h:94
Setting< std::string > proxy_
Definition: settings.h:442
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:1369
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:376
SettingsSpoolArea * GetSpoolArea()
Definition: settings.h:218
bool HasDanglingRepositoryKeys() const
Definition: settings.cc:259
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:347
void SetRepairMode(const EUnionMountRepairMode val)
Definition: settings.cc:41
Setting< unsigned > limit_nested_catalog_kentries_
Definition: settings.h:248
SettingsKeychain keychain_
Definition: settings.h:386
Setting< bool > dry_run_
Definition: settings.h:255
Setting< std::string > certificate_path_
Definition: settings.h:342
std::string url() const
Definition: settings.h:369
Setting< std::string > proxy_
Definition: settings.h:380
void MakeS3(const std::string &s3_config, const std::string &tmp_dir)
Definition: settings.cc:188
std::string url() const
Definition: settings.h:422
Setting< std::string > tmp_dir_
Definition: settings.h:124
std::string GetLocator() const
Definition: settings.cc:182
Setting< std::string > url_
Definition: settings.h:379
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:371
static const unsigned kRequiredLayoutRevision
Definition: repository.h:276
class static __attribute__((visibility("default"))) Repository std::string GetFqrnFromUrl(const std::string &url)
Definition: repository.cc:241
bool HasDanglingMasterKeys() const
Definition: settings.cc:245