fix deployment targets

This commit is contained in:
John Smith 2023-05-17 17:26:21 -04:00
parent 909b86a04d
commit b1bbeb392b
12 changed files with 37 additions and 35 deletions

View File

@ -31,7 +31,7 @@ core:
protected_store:
allow_insecure_fallback: true
always_use_insecure_storage: true
insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%'
directory: '%DIRECTORY%'
delete: false
table_store:
directory: '%TABLE_STORE_DIRECTORY%'

View File

@ -155,7 +155,7 @@ testing:
protected_store:
allow_insecure_fallback: true
always_use_insecure_storage: true
insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%'
directory: '%DIRECTORY%'
delete: false
```

View File

@ -14,7 +14,7 @@ logging:
enabled: false
core:
protected_store:
insecure_fallback_directory: '/var/db/veilid-server/protected_store'
directory: '/var/db/veilid-server/protected_store'
table_store:
directory: '/var/db/veilid-server/table_store'
block_store:

View File

@ -57,7 +57,7 @@ do
HOMEBREW_DIR=$(dirname `which brew`)
fi
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" IPHONEOS_DEPLOYMENT_TARGET="$IPHONEOS_DEPLOYMENT_TARGET" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
LIPOS="$LIPOS $TARGET_PATH/$CARGO_TARGET/$BUILD_MODE/lib$PACKAGE_NAME.a"

View File

@ -47,7 +47,7 @@ do
HOMEBREW_DIR=$(dirname `which brew`)
fi
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
env -i PATH=/usr/bin:/bin:$HOMEBREW_DIR:$CARGO_DIR HOME="$HOME" USER="$USER" MACOSX_DEPLOYMENT_TARGET="$MACOSX_DEPLOYMENT_TARGET" cargo $CARGO_TOOLCHAIN build $EXTRA_CARGO_OPTIONS --target $CARGO_TARGET --manifest-path $CARGO_MANIFEST_PATH
LIPOS="$LIPOS $TARGET_PATH/$CARGO_TARGET/$BUILD_MODE/lib$PACKAGE_NAME.dylib"

View File

@ -64,9 +64,8 @@ impl ProtectedStore {
|| c.protected_store.allow_insecure_fallback)
&& inner.keyring_manager.is_none()
{
let insecure_fallback_directory =
Path::new(&c.protected_store.insecure_fallback_directory);
let insecure_keyring_file = insecure_fallback_directory.to_owned().join(format!(
let directory = Path::new(&c.protected_store.directory);
let insecure_keyring_file = directory.to_owned().join(format!(
"insecure_keyring{}",
if c.namespace.is_empty() {
"".to_owned()

View File

@ -130,13 +130,22 @@ impl RoutingTable {
for e in filtered_entries {
let state = e.1.with(inner, |_rti, e| e.state(cur_ts));
out += &format!(
" {} [{}]\n",
" {} [{}] {}\n",
e.0.encode(),
match state {
BucketEntryState::Reliable => "R",
BucketEntryState::Unreliable => "U",
BucketEntryState::Dead => "D",
}
},
e.1.with(inner, |_rti, e| {
e.peer_stats()
.latency
.as_ref()
.map(|l| {
format!("{:.2}ms", timestamp_to_secs(l.average.as_u64()))
})
.unwrap_or_else(|| "???.??ms".to_string())
})
);
}
}

View File

@ -181,7 +181,7 @@ fn config_callback(key: String) -> ConfigCallbackReturn {
"block_store.delete" => Ok(Box::new(false)),
"protected_store.allow_insecure_fallback" => Ok(Box::new(true)),
"protected_store.always_use_insecure_storage" => Ok(Box::new(false)),
"protected_store.insecure_fallback_directory" => Ok(Box::new(get_protected_store_path())),
"protected_store.directory" => Ok(Box::new(get_protected_store_path())),
"protected_store.delete" => Ok(Box::new(false)),
"network.connection_initial_timeout_ms" => Ok(Box::new(2_000u32)),
"network.connection_inactivity_timeout_ms" => Ok(Box::new(60_000u32)),
@ -307,10 +307,7 @@ pub async fn test_config() {
assert_eq!(inner.block_store.delete, false);
assert_eq!(inner.protected_store.allow_insecure_fallback, true);
assert_eq!(inner.protected_store.always_use_insecure_storage, false);
assert_eq!(
inner.protected_store.insecure_fallback_directory,
get_protected_store_path()
);
assert_eq!(inner.protected_store.directory, get_protected_store_path());
assert_eq!(inner.protected_store.delete, false);
assert_eq!(inner.network.connection_initial_timeout_ms, 2_000u32);
assert_eq!(inner.network.connection_inactivity_timeout_ms, 60_000u32);

View File

@ -429,7 +429,7 @@ pub struct VeilidConfigBlockStore {
pub struct VeilidConfigProtectedStore {
pub allow_insecure_fallback: bool,
pub always_use_insecure_storage: bool,
pub insecure_fallback_directory: String,
pub directory: String,
pub delete: bool,
}
@ -634,7 +634,7 @@ impl VeilidConfig {
get_config!(inner.block_store.delete);
get_config!(inner.protected_store.allow_insecure_fallback);
get_config!(inner.protected_store.always_use_insecure_storage);
get_config!(inner.protected_store.insecure_fallback_directory);
get_config!(inner.protected_store.directory);
get_config!(inner.protected_store.delete);
get_config!(inner.network.connection_initial_timeout_ms);
get_config!(inner.network.connection_inactivity_timeout_ms);

View File

@ -64,7 +64,7 @@ Future<VeilidConfig> getDefaultVeilidConfig(String programName) async {
protectedStore: VeilidConfigProtectedStore(
allowInsecureFallback: false,
alwaysUseInsecureStorage: false,
insecureFallbackDirectory: "",
directory: "",
delete: false,
),
tableStore: VeilidConfigTableStore(

View File

@ -826,13 +826,13 @@ class VeilidConfigBlockStore {
class VeilidConfigProtectedStore {
bool allowInsecureFallback;
bool alwaysUseInsecureStorage;
String insecureFallbackDirectory;
String directory;
bool delete;
VeilidConfigProtectedStore({
required this.allowInsecureFallback,
required this.alwaysUseInsecureStorage,
required this.insecureFallbackDirectory,
required this.directory,
required this.delete,
});
@ -840,7 +840,7 @@ class VeilidConfigProtectedStore {
return {
'allow_insecure_fallback': allowInsecureFallback,
'always_use_insecure_storage': alwaysUseInsecureStorage,
'insecure_fallback_directory': insecureFallbackDirectory,
'directory': directory,
'delete': delete,
};
}
@ -848,7 +848,7 @@ class VeilidConfigProtectedStore {
VeilidConfigProtectedStore.fromJson(dynamic json)
: allowInsecureFallback = json['allow_insecure_fallback'],
alwaysUseInsecureStorage = json['always_use_insecure_storage'],
insecureFallbackDirectory = json['insecure_fallback_directory'],
directory = json['directory'],
delete = json['delete'];
}

View File

@ -47,7 +47,7 @@ core:
protected_store:
allow_insecure_fallback: true
always_use_insecure_storage: true
insecure_fallback_directory: '%INSECURE_FALLBACK_DIRECTORY%'
directory: '%DIRECTORY%'
delete: false
table_store:
directory: '%TABLE_STORE_DIRECTORY%'
@ -157,8 +157,8 @@ core:
&Settings::get_default_block_store_path().to_string_lossy(),
)
.replace(
"%INSECURE_FALLBACK_DIRECTORY%",
&Settings::get_default_protected_store_insecure_fallback_directory().to_string_lossy(),
"%DIRECTORY%",
&Settings::get_default_protected_store_directory().to_string_lossy(),
)
.replace(
"%CERTIFICATE_PATH%",
@ -586,7 +586,7 @@ pub struct BlockStore {
pub struct ProtectedStore {
pub allow_insecure_fallback: bool,
pub always_use_insecure_storage: bool,
pub insecure_fallback_directory: PathBuf,
pub directory: PathBuf,
pub delete: bool,
}
@ -795,7 +795,7 @@ impl Settings {
bs_path
}
pub fn get_default_protected_store_insecure_fallback_directory() -> PathBuf {
pub fn get_default_protected_store_directory() -> PathBuf {
#[cfg(unix)]
{
let globalpath = PathBuf::from("/var/db/veilid-server/protected_store");
@ -935,10 +935,7 @@ impl Settings {
inner.core.protected_store.always_use_insecure_storage,
value
);
set_config_value!(
inner.core.protected_store.insecure_fallback_directory,
value
);
set_config_value!(inner.core.protected_store.directory, value);
set_config_value!(inner.core.protected_store.delete, value);
set_config_value!(inner.core.table_store.directory, value);
set_config_value!(inner.core.table_store.delete, value);
@ -1065,11 +1062,11 @@ impl Settings {
"protected_store.always_use_insecure_storage" => Ok(Box::new(
inner.core.protected_store.always_use_insecure_storage,
)),
"protected_store.insecure_fallback_directory" => Ok(Box::new(
"protected_store.directory" => Ok(Box::new(
inner
.core
.protected_store
.insecure_fallback_directory
.directory
.to_string_lossy()
.to_string(),
)),
@ -1504,8 +1501,8 @@ mod tests {
assert_eq!(s.core.protected_store.allow_insecure_fallback, true);
assert_eq!(s.core.protected_store.always_use_insecure_storage, true);
assert_eq!(
s.core.protected_store.insecure_fallback_directory,
Settings::get_default_protected_store_insecure_fallback_directory()
s.core.protected_store.directory,
Settings::get_default_protected_store_directory()
);
assert_eq!(s.core.protected_store.delete, false);