remove community registry from FE defaults (#1988)

* remove community registry from FE defaults

* fix: Changes requested from matt (#1989)

* fix: Changes requested from matt

* chore: Remove more of the migration for the community

Co-authored-by: J M <2364004+Blu-J@users.noreply.github.com>
This commit is contained in:
Matt Hill
2022-11-28 19:20:07 -07:00
committed by Aiden McClelland
parent 3fe43a5b57
commit c52cf1fc3f
5 changed files with 3 additions and 43 deletions

View File

@@ -8,21 +8,6 @@ use crate::{COMMUNITY_MARKETPLACE, DEFAULT_MARKETPLACE};
const V0_3_3: emver::Version = emver::Version::new(0, 3, 3, 0);
lazy_static::lazy_static! {
static ref COMMUNITY_PACKAGES: Vec<&'static str> = vec![
"robosats",
"syncthing",
"balanceofsatoshis",
"lightning-jet",
"mastodon",
"sphinx-relay",
"agora",
"lndg",
"synapse",
"thunderhub",
];
}
#[derive(Clone, Debug)]
pub struct Version;
@@ -68,7 +53,6 @@ impl VersionT for Version {
}
ui["marketplace"]["known-hosts"]["https://registry.start9.com/"] = json!({});
ui["marketplace"]["known-hosts"]["https://community-registry.start9.com/"] = json!({});
if let Some(Value::Object(ref mut obj)) = ui.get_mut("marketplace") {
obj.remove("selected-id");
@@ -78,28 +62,6 @@ impl VersionT for Version {
}
ui.save(db).await?;
for package_id in crate::db::DatabaseModel::new()
.package_data()
.keys(db)
.await?
.iter()
{
let id: &str = &**package_id;
if COMMUNITY_PACKAGES.iter().find(|x| x == &&id).is_none() {
continue;
}
let mut package = crate::db::DatabaseModel::new()
.package_data()
.idx_model(package_id)
.and_then(|x| x.installed())
.get_mut(db)
.await?;
if let Some(ref mut package) = *package {
package.marketplace_url = Some(MarketPlaceUrls::Community.url().parse().unwrap());
}
package.save(db).await?;
}
Ok(())
}
async fn down<Db: DbHandle>(&self, db: &mut Db) -> Result<(), Error> {