change dependencies to be more sharable

This commit is contained in:
2026-01-14 12:01:09 +00:00
parent 26f2f5dbd0
commit caf17a7254
6 changed files with 19 additions and 13 deletions

6
Cargo.lock generated
View File

@@ -588,7 +588,7 @@ dependencies = [
[[package]] [[package]]
name = "dns-comunications" name = "dns-comunications"
version = "0.1.1" version = "0.1.1"
source = "git+ssh://git@rochegmr.com/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9" source = "git+https://rochegmr.com/git/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9"
dependencies = [ dependencies = [
"base64 0.21.7", "base64 0.21.7",
"dns-config", "dns-config",
@@ -598,7 +598,7 @@ dependencies = [
[[package]] [[package]]
name = "dns-config" name = "dns-config"
version = "0.1.1" version = "0.1.1"
source = "git+ssh://git@rochegmr.com/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9" source = "git+https://rochegmr.com/git/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9"
dependencies = [ dependencies = [
"toml", "toml",
] ]
@@ -620,7 +620,7 @@ dependencies = [
[[package]] [[package]]
name = "dns_manager" name = "dns_manager"
version = "0.1.1" version = "0.1.1"
source = "git+ssh://git@rochegmr.com/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9" source = "git+https://rochegmr.com/git/groche97/dns_manager.git#f2e6d7102d4804568bfa1882bf8eabe9ac0105a9"
dependencies = [ dependencies = [
"dns-comunications", "dns-comunications",
"dns-config", "dns-config",

View File

@@ -16,7 +16,7 @@ serde = "*"
serde_json = "*" serde_json = "*"
fallible-iterator = "*" fallible-iterator = "*"
toml = "0.9" toml = "0.9"
dns_manager = { git = "ssh://git@rochegmr.com/groche97/dns_manager.git"} dns_manager = { git = "https://rochegmr.com/git/groche97/dns_manager.git"}
[target.x86_64-unknown-linux-gnu] [target.x86_64-unknown-linux-gnu]
rustflags = [ rustflags = [

View File

@@ -1,12 +1,18 @@
use crate::controller::Controller; use crate::controller::Controller;
impl Controller { impl Controller {
pub async fn add_domain_to_dns(&self, domain: &str) -> Result<(), Box<dyn std::error::Error>> { pub(in crate::controller) async fn add_domain_to_dns(
&self,
domain: &str,
) -> Result<(), Box<dyn std::error::Error>> {
self.dns_manager.add_domain(domain, self.pub_addr).await?; self.dns_manager.add_domain(domain, self.pub_addr).await?;
Ok(()) Ok(())
} }
pub async fn del_domain_to_dns(&self, domain: &str) -> Result<(), Box<dyn std::error::Error>> { pub(in crate::controller) async fn del_domain_to_dns(
&self,
domain: &str,
) -> Result<(), Box<dyn std::error::Error>> {
self.dns_manager.del_domain(domain).await?; self.dns_manager.del_domain(domain).await?;
Ok(()) Ok(())
} }

View File

@@ -6,7 +6,7 @@ use crate::{
}; };
impl Controller { impl Controller {
pub async fn load_container( pub(in crate::controller) async fn load_container(
&self, &self,
docker_id: Option<String>, docker_id: Option<String>,
domain: String, domain: String,
@@ -31,7 +31,7 @@ impl Controller {
self.started self.started
} }
pub async fn prune_given_container( pub(in crate::controller) async fn prune_given_container(
&self, &self,
container: Container, container: Container,
) -> Result<String, Box<dyn Error>> { ) -> Result<String, Box<dyn Error>> {
@@ -41,7 +41,7 @@ impl Controller {
} }
} }
pub async fn stop_given_container( pub(in crate::controller) async fn stop_given_container(
&self, &self,
container: Container, container: Container,
) -> Result<String, bollard::errors::Error> { ) -> Result<String, bollard::errors::Error> {

View File

@@ -6,7 +6,7 @@ use crate::{
use log::error; use log::error;
impl Controller { impl Controller {
pub async fn load_container_and_bind( pub(in crate::controller) async fn load_container_and_bind(
&self, &self,
docker_id: Option<String>, docker_id: Option<String>,
domain: String, domain: String,
@@ -39,7 +39,7 @@ impl Controller {
} }
} }
pub async fn start_container_from_instance(&self, instance: Instance) { pub(in crate::controller) async fn start_container_from_instance(&self, instance: Instance) {
let image = match self let image = match self
.storage .storage
.lock() .lock()

View File

@@ -1,7 +1,7 @@
use crate::{controller::Controller, mcproxy_client}; use crate::{controller::Controller, mcproxy_client};
impl Controller { impl Controller {
pub async fn bind_container_in_proxy( pub(in crate::controller) async fn bind_container_in_proxy(
&self, &self,
domain: &str, domain: &str,
ip: &str, ip: &str,
@@ -12,7 +12,7 @@ impl Controller {
Ok(()) Ok(())
} }
pub async fn unbind_container_in_proxy( pub(in crate::controller) async fn unbind_container_in_proxy(
&self, &self,
domain: &str, domain: &str,
) -> Result<(), Box<dyn std::error::Error>> { ) -> Result<(), Box<dyn std::error::Error>> {