CernVM-FS  2.9.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  , tmp_dir_(settings_publisher.transaction().spool_area().tmp_dir())
284  , keychain_(settings_publisher.fqrn())
285 {
286  keychain_.SetKeychainDir(settings_publisher.keychain().keychain_dir());
287 }
288 
289 
290 void SettingsRepository::SetUrl(const std::string &url) {
291  // TODO(jblomer): sanitiation, check availability
292  url_ = url;
293 }
294 
295 
296 void SettingsRepository::SetTmpDir(const std::string &tmp_dir) {
297  tmp_dir_ = tmp_dir;
298 }
299 
300 
301 //------------------------------------------------------------------------------
302 
303 
305 
306 
308  const SettingsRepository &settings_repository)
309  : fqrn_(settings_repository.fqrn())
310  , url_(settings_repository.url())
311  , owner_uid_(0)
312  , owner_gid_(0)
313  , whitelist_validity_days_(kDefaultWhitelistValidity)
314  , is_silent_(false)
315  , is_managed_(false)
316  , storage_(fqrn_)
317  , transaction_(fqrn_)
318  , keychain_(fqrn_)
319 {
320  keychain_.SetKeychainDir(settings_repository.keychain().keychain_dir());
321 }
322 
323 
324 void SettingsPublisher::SetUrl(const std::string &url) {
325  // TODO(jblomer): sanitiation, check availability
326  url_ = url;
327 }
328 
329 
330 void SettingsPublisher::SetOwner(const std::string &user_name) {
331  bool retval = GetUidOf(user_name, owner_uid_.GetPtr(), owner_gid_.GetPtr());
332  if (!retval) {
333  throw EPublish("unknown user name for repository owner: " + user_name);
334  }
335 }
336 
337 void SettingsPublisher::SetOwner(uid_t uid, gid_t gid) {
338  owner_uid_ = uid;
339  owner_gid_ = gid;
340 }
341 
343  is_silent_ = value;
344 }
345 
347  is_managed_ = value;
348 }
349 
350 
351 //------------------------------------------------------------------------------
352 
353 
355  delete options_mgr_;
356 }
357 
358 
359 std::map<std::string, std::string> SettingsBuilder::GetSessionEnvironment() {
360  std::map<std::string, std::string> result;
361  std::string session_dir = Env::GetEnterSessionDir();
362  if (session_dir.empty())
363  return result;
364 
365  // Get the repository name from the ephemeral writable shell
366  BashOptionsManager omgr;
367  omgr.set_taint_environment(false);
368  omgr.ParsePath(session_dir + "/env.conf", false /* external */);
369 
370  // We require at least CVMFS_FQRN to be set
371  std::string fqrn;
372  if (!omgr.GetValue("CVMFS_FQRN", &fqrn)) {
373  throw EPublish("no repositories found in ephemeral writable shell",
375  }
376 
377  std::vector<std::string> keys = omgr.GetAllKeys();
378  for (unsigned i = 0; i < keys.size(); ++i) {
379  result[keys[i]] = omgr.GetValueOrDie(keys[i]);
380  }
381  return result;
382 }
383 
384 
386  std::map<std::string, std::string> session_env = GetSessionEnvironment();
387  if (!session_env.empty())
388  return session_env["CVMFS_FQRN"];
389 
390  std::vector<std::string> repositories = FindDirectories(config_path_);
391  if (repositories.empty()) {
392  throw EPublish("no repositories available in " + config_path_,
394  }
395 
396  for (unsigned i = 0; i < repositories.size(); ++i) {
397  repositories[i] = GetFileName(repositories[i]);
398  }
399  if (repositories.size() > 1) {
400  throw EPublish("multiple repositories available in " + config_path_ +
401  ":\n " + JoinStrings(repositories, "\n "),
403  }
404  return repositories[0];
405 }
406 
407 
409  const std::string &ident)
410 {
411  if (HasPrefix(ident, "http://", true /* ignore case */) ||
412  HasPrefix(ident, "https://", true /* ignore case */) ||
413  HasPrefix(ident, "file://", true /* ignore case */))
414  {
415  std::string fqrn = Repository::GetFqrnFromUrl(ident);
417  if (!sanitizer.IsValid(fqrn)) {
418  throw EPublish("malformed repository name: " + fqrn);
419  }
421  settings.SetUrl(ident);
422  return settings;
423  }
424 
425  std::string alias = ident.empty() ? GetSingleAlias() : ident;
426  std::string repo_path = config_path_ + "/" + alias;
427  std::string server_path = repo_path + "/server.conf";
428  std::string replica_path = repo_path + "/replica.conf";
429  std::string fqrn = alias;
430 
431  delete options_mgr_;
433  std::string arg;
435  options_mgr_->ParsePath(server_path, false /* external */);
436  options_mgr_->ParsePath(replica_path, false /* external */);
437  if (options_mgr_->GetValue("CVMFS_REPOSITORY_NAME", &arg))
438  fqrn = arg;
440 
441  if (options_mgr_->GetValue("CVMFS_PUBLIC_KEY", &arg))
442  settings.GetKeychain()->SetKeychainDir(arg);
443  if (options_mgr_->GetValue("CVMFS_STRATUM0", &arg))
444  settings.SetUrl(arg);
445  // For a replica, the stratum 1 url is the "local" location, hence it takes
446  // precedence over the stratum 0 url
447  if (options_mgr_->GetValue("CVMFS_STRATUM1", &arg))
448  settings.SetUrl(arg);
449  if (options_mgr_->GetValue("CVMFS_SPOOL_DIR", &arg))
450  settings.SetTmpDir(arg + "/tmp");
451 
452  return settings;
453 }
454 
455 std::string SettingsPublisher::GetReadOnlyXAttr(const std::string &attr) {
456  std::string value;
457  bool rvb = platform_getxattr(this->transaction().spool_area().readonly_mnt(),
458  attr, &value);
459  if (!rvb) {
460  throw EPublish("cannot get extended attribute " + attr);
461  }
462  return value;
463 }
464 
466  std::string session_dir = Env::GetEnterSessionDir();
467  std::map<std::string, std::string> session_env = GetSessionEnvironment();
468  std::string fqrn = session_env["CVMFS_FQRN"];
469 
470  UniquePtr<SettingsPublisher> settings_publisher(
472  // TODO(jblomer): work in progress
473  settings_publisher->GetTransaction()->SetInEnterSession(true);
474  settings_publisher->GetTransaction()->GetSpoolArea()->SetSpoolArea(
475  session_dir);
476 
477  std::string base_hash =
478  settings_publisher->GetReadOnlyXAttr("user.root_hash");
479 
480  BashOptionsManager omgr;
481  omgr.set_taint_environment(false);
482  omgr.ParsePath(settings_publisher->transaction().spool_area().client_config(),
483  false /* external */);
484 
485  std::string arg;
486  settings_publisher->SetUrl(settings_publisher->GetReadOnlyXAttr("user.host"));
487  if (omgr.GetValue("CVMFS_KEYS_DIR", &arg))
488  settings_publisher->GetKeychain()->SetKeychainDir(arg);
489  settings_publisher->GetTransaction()->SetLayoutRevision(
491  settings_publisher->GetTransaction()->SetBaseHash(shash::MkFromHexPtr(
492  shash::HexPtr(base_hash), shash::kSuffixCatalog));
493  settings_publisher->GetTransaction()->SetUnionFsType("overlayfs");
494  settings_publisher->SetOwner(geteuid(), getegid());
495 
496  return settings_publisher.Release();
497 }
498 
499 
501  const std::string &ident, bool needs_managed)
502 {
503  // we are creating a publisher, it need to have the `server.conf` file
504  // present, otherwise something is wrong and we should exit early
505  const std::string alias(ident.empty() ? GetSingleAlias() : ident);
506 
507  std::map<std::string, std::string> session_env = GetSessionEnvironment();
508  // We can be in an ephemeral writable shell but interested in a different
509  // repository
510  if (!session_env.empty() && (session_env["CVMFS_FQRN"] == alias))
512 
513  const std::string server_path = config_path_ + "/" + alias + "/server.conf";
514 
515  if (FileExists(server_path) == false) {
516  throw EPublish(
517  "Unable to find the configuration file `server.conf` for the cvmfs "
518  "publisher: " + alias,
520  }
521 
522  SettingsRepository settings_repository = CreateSettingsRepository(alias);
523  if (needs_managed && !IsManagedRepository())
524  throw EPublish("remote repositories are not supported in this context");
525 
526  if (options_mgr_->GetValueOrDie("CVMFS_REPOSITORY_TYPE") != "stratum0") {
527  throw EPublish("Repository " + alias + " is not a stratum 0 repository",
529  }
530 
531  UniquePtr<SettingsPublisher> settings_publisher(
532  new SettingsPublisher(settings_repository));
533 
534  try {
535  std::string xattr = settings_publisher->GetReadOnlyXAttr("user.root_hash");
536  settings_publisher->GetTransaction()->SetBaseHash(
538  } catch (const EPublish& e) {
539  // We ignore the exception.
540  // In case of exception, the base hash remains unset.
541  }
542 
543  settings_publisher->SetIsManaged(IsManagedRepository());
544  settings_publisher->SetOwner(options_mgr_->GetValueOrDie("CVMFS_USER"));
545  settings_publisher->GetStorage()->SetLocator(
546  options_mgr_->GetValueOrDie("CVMFS_UPSTREAM_STORAGE"));
547 
548  std::string arg;
549  if (options_mgr_->GetValue("CVMFS_CREATOR_VERSION", &arg)) {
550  settings_publisher->GetTransaction()->SetLayoutRevision(String2Uint64(arg));
551  }
552  if (options_mgr_->GetValue("CVMFS_UNION_FS_TYPE", &arg)) {
553  settings_publisher->GetTransaction()->SetUnionFsType(arg);
554  }
555  if (options_mgr_->GetValue("CVMFS_HASH_ALGORITHM", &arg)) {
556  settings_publisher->GetTransaction()->SetHashAlgorithm(arg);
557  }
558  if (options_mgr_->GetValue("CVMFS_COMPRESSION_ALGORITHM", &arg)) {
559  settings_publisher->GetTransaction()->SetCompressionAlgorithm(arg);
560  }
561  if (options_mgr_->GetValue("CVMFS_ENFORCE_LIMITS", &arg)) {
562  settings_publisher->GetTransaction()->SetEnforceLimits(
563  options_mgr_->IsOn(arg));
564  }
565  if (options_mgr_->GetValue("CVMFS_NESTED_KCATALOG_LIMIT", &arg)) {
566  settings_publisher->GetTransaction()->SetLimitNestedCatalogKentries(
567  String2Uint64(arg));
568  }
569  if (options_mgr_->GetValue("CVMFS_ROOT_KCATALOG_LIMIT", &arg)) {
570  settings_publisher->GetTransaction()->SetLimitRootCatalogKentries(
571  String2Uint64(arg));
572  }
573  if (options_mgr_->GetValue("CVMFS_FILE_MBYTE_LIMIT", &arg)) {
574  settings_publisher->GetTransaction()->SetLimitFileSizeMb(
575  String2Uint64(arg));
576  }
577  if (options_mgr_->GetValue("CVMFS_AUTOCATALOGS", &arg)) {
578  settings_publisher->GetTransaction()->SetUseCatalogAutobalance(
579  options_mgr_->IsOn(arg));
580  }
581  if (options_mgr_->GetValue("CVMFS_AUTOCATALOGS_MAX_WEIGHT", &arg)) {
582  settings_publisher->GetTransaction()->SetAutobalanceMaxWeight(
583  String2Uint64(arg));
584  }
585  if (options_mgr_->GetValue("CVMFS_AUTOCATALOGS_MIN_WEIGHT", &arg)) {
586  settings_publisher->GetTransaction()->SetAutobalanceMinWeight(
587  String2Uint64(arg));
588  }
589  if (options_mgr_->GetValue("CVMFS_AUTO_REPAIR_MOUNTPOINT", &arg)) {
590  if (!options_mgr_->IsOn(arg)) {
591  settings_publisher->GetTransaction()->GetSpoolArea()->SetRepairMode(
593  }
594  }
595 
596  // TODO(jblomer): process other parameters
597  return settings_publisher.Release();
598 }
599 
600 } // namespace publish
void SetUnionFsType(const std::string &union_fs)
Definition: settings.cc:122
SettingsKeychain * GetKeychain()
Definition: settings.h:372
std::string GetValueOrDie(const std::string &key)
Definition: options.cc:387
Setting< std::string > keychain_dir_
Definition: settings.h:340
Algorithms ParseCompressionAlgorithm(const std::string &algorithm_option)
Definition: compression.cc:148
std::string config_path_
Definition: settings.h:503
std::string readonly_mnt() const
Definition: settings.h:99
bool HasGatewayKey() const
Definition: settings.cc:272
Setting< unsigned > timeout_s_
Definition: settings.h:265
bool GetValue(const std::string &key, std::string *value)
Definition: options.cc:376
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:500
void SetUrl(const std::string &url)
Definition: settings.cc:290
std::string GetFileName(const std::string &path)
Definition: posix.cc:159
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:434
void SetTimeout(unsigned seconds)
Definition: settings.cc:154
vector< string > SplitString(const string &str, const char delim, const unsigned max_chunks)
Definition: string.cc:287
void SetKeychainDir(const std::string &keychain_dir)
Definition: settings.cc:235
Setting< gid_t > owner_gid_
Definition: settings.h:431
std::string keychain_dir() const
Definition: settings.h:329
void SetLimitNestedCatalogKentries(unsigned value)
Definition: settings.cc:90
EUnionMountRepairMode
Definition: settings.h:68
void SetAutobalanceMaxWeight(unsigned value)
Definition: settings.cc:106
string JoinStrings(const vector< string > &strings, const string &joint)
Definition: string.cc:317
void SetIsSilent(bool value)
Definition: settings.cc:342
void set_taint_environment(bool value)
Definition: options.h:185
Setting< UnionFsType > union_fs_
Definition: settings.h:261
Setting< upload::SpoolerDefinition::DriverType > type_
Definition: settings.h:303
void SetTemplate(const std::string &from, const std::string &to)
Definition: settings.cc:168
const SettingsPublisher & settings() const
Definition: repository.h:306
Setting< bool > enforce_limits_
Definition: settings.h:251
std::string GetSingleAlias()
Definition: settings.cc:385
Setting< std::string > union_mnt_
Definition: settings.h:129
SettingsRepository(const std::string &fqrn)
Definition: settings.h:356
void SetLayoutRevision(const unsigned revision)
Definition: settings.cc:65
std::string log_dir() const
Definition: settings.h:107
void SetLeasePath(const std::string &path)
Definition: settings.cc:164
Setting< std::string > tmp_dir_
Definition: settings.h:377
static const char * kDriverNames[]
corresponds to DriverType
std::vector< std::string > FindDirectories(const std::string &parent_dir)
Definition: posix.cc:1199
Setting< unsigned > layout_revision_
Definition: settings.h:232
void SetAutobalanceMinWeight(unsigned value)
Definition: settings.cc:110
char algorithm
SettingsPublisher(const std::string &fqrn)
Definition: settings.h:390
OptionsManager * options_mgr_
Definition: settings.h:508
Setting< bool > is_silent_
Definition: settings.h:433
bool HasMasterKeys() const
Definition: settings.cc:253
Setting< shash::Any > base_hash_
Definition: settings.h:245
bool IsValid(const std::string &input) const
Definition: sanitizer.cc:114
Setting< unsigned > limit_root_catalog_kentries_
Definition: settings.h:253
bool FileExists(const std::string &path)
Definition: posix.cc:811
std::string cache_dir() const
Definition: settings.h:112
bool HasRepositoryKeys() const
Definition: settings.cc:267
const SettingsKeychain & keychain() const
Definition: settings.h:422
void SetTmpDir(const std::string &tmp_dir)
Definition: settings.cc:296
bool IsManagedRepository() const
Definition: settings.h:500
Setting< bool > in_enter_session_
Definition: settings.h:237
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:271
Setting< uid_t > owner_uid_
Definition: settings.h:430
Setting< bool > use_catalog_autobalance_
Definition: settings.h:255
const char kSuffixCatalog
Definition: hash.h:52
std::string GetReadOnlyXAttr(const std::string &attr)
Definition: settings.cc:455
void SetUrl(const std::string &url)
Definition: settings.cc:324
std::vector< std::string > GetAllKeys()
Definition: options.cc:416
std::string ovl_work_dir() const
Definition: settings.h:113
SettingsRepository CreateSettingsRepository(const std::string &ident)
Definition: settings.cc:408
Setting< unsigned > autobalance_max_weight_
Definition: settings.h:256
void SetLimitRootCatalogKentries(unsigned value)
Definition: settings.cc:94
bool MkdirDeep(const std::string &path, const mode_t mode, bool verify_writable)
Definition: posix.cc:866
void SetIsManaged(bool value)
Definition: settings.cc:346
Setting< std::string > workspace_
Definition: settings.h:127
const SettingsTransaction & transaction() const
Definition: settings.h:421
Any MkFromHexPtr(const HexPtr hex, const char suffix)
Definition: hash.cc:83
SettingsPublisher * CreateSettingsPublisherFromSession()
Definition: settings.cc:465
SettingsKeychain keychain_
Definition: settings.h:438
bool is_default() const
Definition: settings.h:55
void SetHashAlgorithm(const std::string &algorithm)
Definition: settings.cc:77
string StringifyInt(const int64_t value)
Definition: string.cc:77
void SetLocator(const std::string &locator)
Definition: settings.cc:213
Setting< std::string > fqrn_
Definition: settings.h:302
Setting< bool > print_changeset_
Definition: settings.h:258
bool HasPrefix(const string &str, const string &prefix, const bool ignore_case)
Definition: string.cc:264
Setting< zlib::Algorithms > compression_algorithm_
Definition: settings.h:247
Setting< std::string > fqrn_
Definition: settings.h:339
bool DirectoryExists(const std::string &path)
Definition: posix.cc:833
void SetLimitFileSizeMb(unsigned value)
Definition: settings.cc:98
Setting< std::string > url_
Definition: settings.h:429
Setting< std::string > template_to_
Definition: settings.h:272
void SetUseCatalogAutobalance(bool value)
Definition: settings.cc:102
Setting< EUnionMountRepairMode > repair_mode_
Definition: settings.h:133
Setting< unsigned > autobalance_min_weight_
Definition: settings.h:257
void SetCompressionAlgorithm(const std::string &algorithm)
Definition: settings.cc:81
Setting< std::string > private_key_path_
Definition: settings.h:343
void SetSpoolArea(const std::string &path)
Definition: settings.cc:32
Setting< shash::Algorithms > hash_algorithm_
Definition: settings.h:246
void SetEnforceLimits(bool value)
Definition: settings.cc:86
Setting< std::string > tmp_dir_
Definition: settings.h:304
void ParsePath(const std::string &config_file, const bool external)
Definition: options.cc:146
Setting< std::string > master_private_key_path_
Definition: settings.h:341
const SettingsKeychain & keychain() const
Definition: settings.h:371
static const unsigned kDefaultWhitelistValidity
Definition: settings.h:388
std::string tmp_dir() const
Definition: settings.h:98
void SetBaseHash(const shash::Any &hash)
Definition: settings.cc:73
Setting< std::string > endpoint_
Definition: settings.h:305
uint64_t String2Uint64(const string &value)
Definition: string.cc:227
void SetPrintChangeset(bool value)
Definition: settings.cc:114
bool GetUidOf(const std::string &username, uid_t *uid, gid_t *main_gid)
Definition: posix.cc:1364
Algorithms ParseHashAlgorithm(const string &algorithm_option)
Definition: hash.cc:72
std::string scratch_dir() const
Definition: settings.h:105
std::map< std::string, std::string > GetSessionEnvironment()
Definition: settings.cc:359
bool HasDanglingRepositoryKeys() const
Definition: settings.cc:259
Setting< unsigned > limit_file_size_mb_
Definition: settings.h:254
void MakeLocal(const std::string &path)
Definition: settings.cc:197
Setting< std::string > master_public_key_path_
Definition: settings.h:342
void SetOwner(const std::string &user_name)
Definition: settings.cc:330
void SetRepairMode(const EUnionMountRepairMode val)
Definition: settings.cc:41
Setting< unsigned > limit_nested_catalog_kentries_
Definition: settings.h:252
SettingsKeychain keychain_
Definition: settings.h:379
Setting< bool > dry_run_
Definition: settings.h:259
Setting< std::string > certificate_path_
Definition: settings.h:344
std::string url() const
Definition: settings.h:368
void MakeS3(const std::string &s3_config, const std::string &tmp_dir)
Definition: settings.cc:188
std::string url() const
Definition: settings.h:413
Setting< std::string > tmp_dir_
Definition: settings.h:128
std::string GetLocator() const
Definition: settings.cc:182
Setting< std::string > url_
Definition: settings.h:376
void SetInEnterSession(const bool value)
Definition: settings.cc:69
bool IsOn(const std::string &param_value)
Definition: options.cc:409
Setting< std::string > gw_key_path_
Definition: settings.h:345
Setting< std::string > lease_path_
Definition: settings.h:266
std::string tmp_dir() const
Definition: settings.h:369
static const unsigned kRequiredLayoutRevision
Definition: repository.h:276
class static __attribute__((visibility("default"))) Repository std::string GetFqrnFromUrl(const std::string &url)
Definition: repository.cc:228
bool HasDanglingMasterKeys() const
Definition: settings.cc:245