Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Upped lair
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed May 6, 2022
1 parent 743420b commit 143728a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ jobs:
- name: setup binaries (Windows only)
if: matrix.platform == 'windows-2019'
run: |
cargo install --git https://github.com/holochain/lair lair_keystore --rev 092f33dcc49e62c253c0c746baec0df65c4e2fb5
cargo install lair_keystore --version 0.1.3
$LkPath = Get-Command lair-keystore | Select-Object -ExpandProperty Definition
Copy-Item $LkPath -Destination src-tauri/bins/lair-keystore-x86_64-pc-windows-msvc.exe
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5b5db5a252ab3a4dab4021a299aef77a6685c807 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 72ec17ea40cb3b4fcbbccc812394a959e47bb097 holochain
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.0.127-x86_64-pc-windows-msvc.exe
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 29b88b418578ba5e86fdb3a89659bb2723d60ada holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 78997dfdcfbdd37c23aae579673ee6e366885b51 holochain
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.0.132-x86_64-pc-windows-msvc.exe
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev d20bb79395985f2c63e19dd544e24412c1ac2212 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5ae2ea8cf58530f5abbc3f99521158a4ce5447d9 holochain
$HcPath = Get-Command holochain | Select-Object -ExpandProperty Definition
Copy-Item $HcPath -Destination src-tauri/bins/holochain-v0.0.136-x86_64-pc-windows-msvc.exe
Expand All @@ -72,19 +72,19 @@ jobs:
- name: setup binaries (macos only)
if: matrix.platform == 'macos-10.15'
run: |
cargo install --git https://github.com/holochain/lair lair_keystore --rev 092f33dcc49e62c253c0c746baec0df65c4e2fb5
cargo install lair_keystore --version 0.1.3
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-x86_64-apple-darwin
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5b5db5a252ab3a4dab4021a299aef77a6685c807 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 72ec17ea40cb3b4fcbbccc812394a959e47bb097 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.127-x86_64-apple-darwin
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 29b88b418578ba5e86fdb3a89659bb2723d60ada holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 78997dfdcfbdd37c23aae579673ee6e366885b51 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.132-x86_64-apple-darwin
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev d20bb79395985f2c63e19dd544e24412c1ac2212 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5ae2ea8cf58530f5abbc3f99521158a4ce5447d9 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.136-x86_64-apple-darwin
Expand Down Expand Up @@ -112,19 +112,19 @@ jobs:
- name: setup binaries (ubuntu only)
if: matrix.platform == 'ubuntu-18.04'
run: |
cargo install --git https://github.com/holochain/lair lair_keystore --rev 092f33dcc49e62c253c0c746baec0df65c4e2fb5
cargo install lair_keystore --version 0.1.3
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5b5db5a252ab3a4dab4021a299aef77a6685c807 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 72ec17ea40cb3b4fcbbccc812394a959e47bb097 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.127-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 29b88b418578ba5e86fdb3a89659bb2723d60ada holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 78997dfdcfbdd37c23aae579673ee6e366885b51 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.132-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev d20bb79395985f2c63e19dd544e24412c1ac2212 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5ae2ea8cf58530f5abbc3f99521158a4ce5447d9 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.136-x86_64-unknown-linux-gnu
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ jobs:
run: |
mkdir src-tauri/bins
cargo install --git https://github.com/holochain/lair lair_keystore --rev 092f33dcc49e62c253c0c746baec0df65c4e2fb5
cargo install lair_keystore --version 0.1.3
LAIR_PATH=$(which lair-keystore)
cp $LAIR_PATH src-tauri/bins/lair-keystore-x86_64-unknown-linux-gnu
CADDY_PATH=$(which caddy)
cp $CADDY_PATH src-tauri/bins/caddy-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5b5db5a252ab3a4dab4021a299aef77a6685c807 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 72ec17ea40cb3b4fcbbccc812394a959e47bb097 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.127-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 29b88b418578ba5e86fdb3a89659bb2723d60ada holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 78997dfdcfbdd37c23aae579673ee6e366885b51 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.132-x86_64-unknown-linux-gnu
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev d20bb79395985f2c63e19dd544e24412c1ac2212 holochain
cargo install --locked --git https://github.com/guillemcordoba/holochain.git --rev 5ae2ea8cf58530f5abbc3f99521158a4ce5447d9 holochain
HOLOCHAIN_PATH=$(which holochain)
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v0.0.136-x86_64-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion crates/holochain_manager/src/versions/version_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub trait VersionManager {

fn lair_keystore_version(&self) -> LairKeystoreVersion {
// For now all holochain versions run the same lair keystore version
LairKeystoreVersion::V0_1_2
LairKeystoreVersion::V0_1_3
}

fn initial_config(
Expand Down
6 changes: 3 additions & 3 deletions crates/lair_keystore_manager/src/versions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use serde_enum_str::{Deserialize_enum_str, Serialize_enum_str};

mod init;
mod launch;
pub mod v0_1_2;
pub mod v0_1_3;

#[derive(Copy, Clone, Debug, PartialEq, Hash, Eq, Deserialize_enum_str, Serialize_enum_str)]
pub enum LairKeystoreVersion {
#[serde(rename = "0.1.2")]
V0_1_2,
#[serde(rename = "0.1.3")]
V0_1_3,
}

impl Into<String> for LairKeystoreVersion {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ use super::{
};
use crate::{error::LairKeystoreError, utils::create_dir_if_necessary, LairKeystoreManager};

pub struct LairKeystoreManagerV0_1_2 {
pub struct LairKeystoreManagerV0_1_3 {
_keystore_path: PathBuf,
connection_url: Url2,
password: String,
}

#[async_trait]
impl LairKeystoreManager for LairKeystoreManagerV0_1_2 {
impl LairKeystoreManager for LairKeystoreManagerV0_1_3 {
fn lair_keystore_version() -> LairKeystoreVersion {
LairKeystoreVersion::V0_1_2
LairKeystoreVersion::V0_1_3
}

fn is_initialized(keystore_path: PathBuf) -> bool {
Expand All @@ -40,7 +40,7 @@ impl LairKeystoreManager for LairKeystoreManagerV0_1_2 {
let connection_url =
launch_lair_keystore_process(log_level, keystore_path.clone(), password.clone()).await?;

Ok(LairKeystoreManagerV0_1_2 {
Ok(LairKeystoreManagerV0_1_3 {
password,
connection_url,
_keystore_path: keystore_path,
Expand Down
14 changes: 7 additions & 7 deletions src-tauri/src/launcher/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use holochain_manager::error::LaunchHolochainError;
use holochain_web_app_manager::error::LaunchWebAppManagerError;
use lair_keystore_manager::error::{LairKeystoreError, LaunchChildError};
use lair_keystore_manager::utils::create_dir_if_necessary;
use lair_keystore_manager::versions::v0_1_2::LairKeystoreManagerV0_1_2;
use lair_keystore_manager::versions::v0_1_3::LairKeystoreManagerV0_1_3;
use lair_keystore_manager::LairKeystoreManager;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
Expand Down Expand Up @@ -60,9 +60,9 @@ impl LauncherManager {
create_dir_if_necessary(&root_holochain_data_path())?;
create_dir_if_necessary(&root_config_path())?;

let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_2::lair_keystore_version());
let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_3::lair_keystore_version());

let is_initialized = LairKeystoreManagerV0_1_2::is_initialized(keystore_path);
let is_initialized = LairKeystoreManagerV0_1_3::is_initialized(keystore_path);

let keystore_status = match is_initialized {
true => KeystoreStatus::PasswordNecessary,
Expand Down Expand Up @@ -98,9 +98,9 @@ impl LauncherManager {
}

pub async fn initialize_and_launch_keystore(&mut self, password: String) -> Result<(), String> {
let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_2::lair_keystore_version());
let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_3::lair_keystore_version());

LairKeystoreManagerV0_1_2::initialize(keystore_path, password.clone())
LairKeystoreManagerV0_1_3::initialize(keystore_path, password.clone())
.await
.map_err(|err| format!("Error initializing the keystore: {:?}", err))?;

Expand All @@ -110,9 +110,9 @@ impl LauncherManager {
}

pub async fn launch_keystore(&mut self, password: String) -> Result<(), String> {
let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_2::lair_keystore_version());
let keystore_path = keystore_data_path(LairKeystoreManagerV0_1_3::lair_keystore_version());
let lair_keystore_manager =
LairKeystoreManagerV0_1_2::launch(self.config.log_level, keystore_path, password.clone())
LairKeystoreManagerV0_1_3::launch(self.config.log_level, keystore_path, password.clone())
.await
.map_err(|err| format!("Error launching the keystore: {:?}", err))?;

Expand Down

0 comments on commit 143728a

Please sign in to comment.