forked from 1b-agent/opencadstudio-upstream
fix(plugins): trust platform certificates
Use the operating system trust store and Windows proxy settings while keeping TLS verification enabled. Add retryable registry errors with copyable diagnostics.\n\nRefs #563
This commit is contained in:
1 parent
4e25e88c31
commit
a717572d65
15 files changed
+434
-44
No files matched your search
@@ -524,6 +524,14 @@ pub(super) struct OpenCADStudio {
|
||||
loaded_plugin_ids: rustc_hash::FxHashSet<String>,
|
||||
/// Curated plugin registry fetched from the OpenCADStudio repo.
|
||||
plugin_registry: Vec<crate::plugin::external::RegistryEntry>,
|
||||
/// True while the curated registry request is in flight.
|
||||
plugin_registry_loading: bool,
|
||||
/// Last curated-registry request error. Kept separate from general
|
||||
/// marketplace status so the UI can show a friendly retry card and retain
|
||||
/// copyable technical details.
|
||||
plugin_registry_error: Option<String>,
|
||||
/// Whether the registry error card exposes its raw diagnostic text.
|
||||
plugin_registry_error_details_open: bool,
|
||||
/// User-linked plugin source repos (`owner/repo`) beyond the curated list.
|
||||
plugin_repos: Vec<String>,
|
||||
/// Add-repository text field in the Plugin Manager.
|
||||
@@ -2076,6 +2084,12 @@ pub enum Message {
|
||||
PluginRepoRemove(String),
|
||||
/// The curated registry was fetched.
|
||||
PluginRegistryFetched(Result<Vec<crate::plugin::external::RegistryEntry>, String>),
|
||||
/// Retry the curated registry request after a connection failure.
|
||||
PluginRegistryRetry,
|
||||
/// Expand or collapse raw registry error details.
|
||||
PluginRegistryErrorDetailsToggle,
|
||||
/// Copy registry URL, platform, version, and raw error details.
|
||||
PluginRegistryCopyDiagnostics,
|
||||
/// Patreon supporters fetched at boot for the Start page (name, pledge cents).
|
||||
PatronsFetched(Result<Vec<(String, i64)>, String>),
|
||||
/// Tutorial-playlist videos fetched at boot for the Start page.
|
||||
@@ -2609,6 +2623,9 @@ impl OpenCADStudio {
|
||||
external_plugins: Vec::new(),
|
||||
loaded_plugin_ids: rustc_hash::FxHashSet::default(),
|
||||
plugin_registry: Vec::new(),
|
||||
plugin_registry_loading: false,
|
||||
plugin_registry_error: None,
|
||||
plugin_registry_error_details_open: false,
|
||||
plugin_repos: Vec::new(),
|
||||
plugin_repo_input: String::new(),
|
||||
plugin_search_input: String::new(),
|
||||
|
||||
+41
-1
@@ -3956,6 +3956,9 @@ impl OpenCADStudio {
|
||||
// Fetch the curated registry and release lists for linked repos.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
self.plugin_registry_loading = true;
|
||||
self.plugin_registry_error = None;
|
||||
self.plugin_registry_error_details_open = false;
|
||||
let mut tasks = vec![self.fetch_registry_task()];
|
||||
let release_repos: rustc_hash::FxHashSet<String> = self
|
||||
.plugin_repos
|
||||
@@ -4074,6 +4077,9 @@ impl OpenCADStudio {
|
||||
Task::none()
|
||||
}
|
||||
Message::PluginRegistryFetched(Ok(entries)) => {
|
||||
self.plugin_registry_loading = false;
|
||||
self.plugin_registry_error = None;
|
||||
self.plugin_registry_error_details_open = false;
|
||||
// Fetch releases for every curated repo so the dropdowns fill in.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
@@ -4112,7 +4118,41 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
Message::PluginRegistryFetched(Err(e)) => {
|
||||
self.marketplace_status = format!("Registry: {e}");
|
||||
self.plugin_registry_loading = false;
|
||||
self.plugin_registry_error = Some(e);
|
||||
self.plugin_registry_error_details_open = false;
|
||||
Task::none()
|
||||
}
|
||||
Message::PluginRegistryRetry => {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
{
|
||||
self.plugin_registry_loading = true;
|
||||
self.plugin_registry_error = None;
|
||||
self.plugin_registry_error_details_open = false;
|
||||
return self.fetch_registry_task();
|
||||
}
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
Task::none()
|
||||
}
|
||||
Message::PluginRegistryErrorDetailsToggle => {
|
||||
if self.plugin_registry_error.is_some() {
|
||||
self.plugin_registry_error_details_open =
|
||||
!self.plugin_registry_error_details_open;
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::PluginRegistryCopyDiagnostics => {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
if let Some(error) = &self.plugin_registry_error {
|
||||
return iced::clipboard::write(format!(
|
||||
"Open CAD Studio v{}\nOS: {}\nArchitecture: {}\nRegistry: {}\nError: {}",
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
std::env::consts::OS,
|
||||
std::env::consts::ARCH,
|
||||
crate::plugin::marketplace::REGISTRY_URL,
|
||||
error,
|
||||
));
|
||||
}
|
||||
Task::none()
|
||||
}
|
||||
Message::PatronsFetched(Ok(names)) => {
|
||||
|
||||
@@ -78,6 +78,9 @@ impl OpenCADStudio {
|
||||
&self.loaded_plugin_ids,
|
||||
crate::ui::window::plugin_manager::MarketView {
|
||||
registry: &self.plugin_registry,
|
||||
registry_loading: self.plugin_registry_loading,
|
||||
registry_error: self.plugin_registry_error.as_deref(),
|
||||
registry_error_details_open: self.plugin_registry_error_details_open,
|
||||
input: &self.plugin_repo_input,
|
||||
search: &self.plugin_search_input,
|
||||
repos: &self.plugin_repos,
|
||||
|
||||
Reference in new issue
Block a user