-
Notifications
You must be signed in to change notification settings - Fork 635
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(clash)!: add default core secret and impl port checker before cl…
…ash start (#533) * feat(clash): add default core secret to secure the communication * fix(renovate): disable github auto merge for rust crates * chore: wip * chore: wip
- Loading branch information
1 parent
6ad5149
commit 29c1d9c
Showing
20 changed files
with
203 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
mod clash; | ||
mod core; | ||
mod draft; | ||
mod nyanpasu; | ||
pub mod nyanpasu; | ||
mod prfitem; | ||
mod profiles; | ||
mod runtime; | ||
|
||
pub use self::{clash::*, core::*, draft::*, nyanpasu::*, prfitem::*, profiles::*, runtime::*}; | ||
pub use self::{clash::*, core::*, draft::*, prfitem::*, profiles::*, runtime::*}; | ||
|
||
pub use self::nyanpasu::IVerge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Default, Debug, Clone, Deserialize, Serialize)] | ||
pub struct ClashStrategy { | ||
pub external_controller_port_strategy: ExternalControllerPortStrategy, | ||
} | ||
|
||
#[derive(Default, Debug, Clone, Deserialize, Serialize, PartialEq, Eq)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum ExternalControllerPortStrategy { | ||
Fixed, | ||
Random, | ||
#[default] | ||
AllowFallback, | ||
} | ||
|
||
impl super::IVerge { | ||
pub fn get_external_controller_port_strategy(&self) -> ExternalControllerPortStrategy { | ||
self.clash_strategy | ||
.as_ref() | ||
.unwrap_or(&ClashStrategy::default()) | ||
.external_controller_port_strategy | ||
.to_owned() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.