Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
39c0e0d7fb
|
|||
|
1b9fb6d551
|
|||
|
caf17a7254
|
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -588,7 +588,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "dns-comunications"
|
||||
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?rev=ddcd867dced9546687e1d82a3fbc81db5edc04d8#ddcd867dced9546687e1d82a3fbc81db5edc04d8"
|
||||
dependencies = [
|
||||
"base64 0.21.7",
|
||||
"dns-config",
|
||||
@@ -598,7 +598,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "dns-config"
|
||||
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?rev=ddcd867dced9546687e1d82a3fbc81db5edc04d8#ddcd867dced9546687e1d82a3fbc81db5edc04d8"
|
||||
dependencies = [
|
||||
"toml",
|
||||
]
|
||||
@@ -606,7 +606,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "dns-update"
|
||||
version = "0.1.6"
|
||||
source = "git+ssh://git@github.com/stalwartlabs/dns-update.git#3a0985996dc8119c4adf1d25c6924ea6b981438e"
|
||||
source = "git+https://github.com/stalwartlabs/dns-update.git#3a0985996dc8119c4adf1d25c6924ea6b981438e"
|
||||
dependencies = [
|
||||
"hickory-client",
|
||||
"reqwest",
|
||||
@@ -620,7 +620,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "dns_manager"
|
||||
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?rev=ddcd867dced9546687e1d82a3fbc81db5edc04d8#ddcd867dced9546687e1d82a3fbc81db5edc04d8"
|
||||
dependencies = [
|
||||
"dns-comunications",
|
||||
"dns-config",
|
||||
|
||||
@@ -16,7 +16,7 @@ serde = "*"
|
||||
serde_json = "*"
|
||||
fallible-iterator = "*"
|
||||
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", rev = "ddcd867dced9546687e1d82a3fbc81db5edc04d8"}
|
||||
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
rustflags = [
|
||||
|
||||
@@ -3,4 +3,8 @@ pub mod mrproxy;
|
||||
pub mod server;
|
||||
pub(in crate::config) mod utils;
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
pub const CONFIG_PATH: &str = "/etc/mrdeploy/config.toml";
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
pub const CONFIG_PATH: &str = "config/config.toml";
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
use crate::controller::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?;
|
||||
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?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
};
|
||||
|
||||
impl Controller {
|
||||
pub async fn load_container(
|
||||
pub(in crate::controller) async fn load_container(
|
||||
&self,
|
||||
docker_id: Option<String>,
|
||||
domain: String,
|
||||
@@ -31,7 +31,7 @@ impl Controller {
|
||||
self.started
|
||||
}
|
||||
|
||||
pub async fn prune_given_container(
|
||||
pub(in crate::controller) async fn prune_given_container(
|
||||
&self,
|
||||
container: Container,
|
||||
) -> 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,
|
||||
container: Container,
|
||||
) -> Result<String, bollard::errors::Error> {
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::{
|
||||
use log::error;
|
||||
|
||||
impl Controller {
|
||||
pub async fn load_container_and_bind(
|
||||
pub(in crate::controller) async fn load_container_and_bind(
|
||||
&self,
|
||||
docker_id: Option<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
|
||||
.storage
|
||||
.lock()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{controller::Controller, mcproxy_client};
|
||||
|
||||
impl Controller {
|
||||
pub async fn bind_container_in_proxy(
|
||||
pub(in crate::controller) async fn bind_container_in_proxy(
|
||||
&self,
|
||||
domain: &str,
|
||||
ip: &str,
|
||||
@@ -12,7 +12,7 @@ impl Controller {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn unbind_container_in_proxy(
|
||||
pub(in crate::controller) async fn unbind_container_in_proxy(
|
||||
&self,
|
||||
domain: &str,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
Reference in New Issue
Block a user