Add support for bucket name in Sia provider #16
This commit is contained in:
parent
bc7a74e432
commit
d2ec6f1f10
@ -98,7 +98,7 @@ private:
|
||||
std::string cache_directory_;
|
||||
host_config hc_;
|
||||
s3_config s3_config_;
|
||||
sia_config sia_config_{"default"};
|
||||
sia_config sia_config_{};
|
||||
std::uint64_t version_{REPERTORY_CONFIG_VERSION};
|
||||
std::string log_directory_;
|
||||
mutable std::recursive_mutex read_write_mutex_;
|
||||
|
@ -76,7 +76,11 @@ mount(std::vector<const char *> args, std::string data_directory,
|
||||
config.set_remote_host_name_or_ip(remote_host);
|
||||
config.set_remote_port(remote_port);
|
||||
config.save();
|
||||
} else if (prov == provider_type::sia &&
|
||||
config.get_sia_config().bucket.empty()) {
|
||||
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
||||
}
|
||||
|
||||
std::cout << "Generated " << app_config::get_provider_display_name(prov)
|
||||
<< " Configuration" << std::endl;
|
||||
std::cout << config.get_config_file_path() << std::endl;
|
||||
@ -88,7 +92,7 @@ mount(std::vector<const char *> args, std::string data_directory,
|
||||
if (utils::cli::has_option(args, utils::cli::options::hidden_option)) {
|
||||
::ShowWindow(::GetConsoleWindow(), SW_HIDE);
|
||||
}
|
||||
#endif
|
||||
#endif // defined(_WIN32)
|
||||
const auto drive_args =
|
||||
utils::cli::parse_drive_options(args, prov, data_directory);
|
||||
app_config config(prov, data_directory);
|
||||
@ -112,7 +116,7 @@ mount(std::vector<const char *> args, std::string data_directory,
|
||||
|
||||
return exit_code::mount_result;
|
||||
}
|
||||
#endif
|
||||
#endif // defined(_WIN32)
|
||||
std::cout << "Initializing "
|
||||
<< app_config::get_provider_display_name(prov)
|
||||
<< (unique_id.empty() ? ""
|
||||
@ -152,6 +156,11 @@ mount(std::vector<const char *> args, std::string data_directory,
|
||||
ret = exit_code::startup_exception;
|
||||
}
|
||||
} else {
|
||||
if (prov == provider_type::sia &&
|
||||
config.get_sia_config().bucket.empty()) {
|
||||
config.set_value_by_name("SiaConfig.Bucket", unique_id);
|
||||
}
|
||||
|
||||
config.set_is_remote_mount(false);
|
||||
|
||||
try {
|
||||
|
@ -99,7 +99,7 @@ const auto DEFAULT_SIA_CONFIG = "{\n"
|
||||
" \"RetryReadCount\": 6,\n"
|
||||
" \"RingBufferFileSize\": 512,\n"
|
||||
" \"SiaConfig\": {\n"
|
||||
" \"Bucket\": \"default\"\n"
|
||||
" \"Bucket\": \"\"\n"
|
||||
" },\n"
|
||||
" \"Version\": " +
|
||||
std::to_string(REPERTORY_CONFIG_VERSION) +
|
||||
|
Loading…
x
Reference in New Issue
Block a user