From b736875510f8f7416a7ae9b550da2f3a22fc4062 Mon Sep 17 00:00:00 2001 From: midefos Date: Tue, 31 Dec 2024 13:17:58 +0100 Subject: [PATCH] removing ban service (moving to another project) --- .gitignore | 1 - Cargo.lock | 402 ------------------------------------------- Cargo.toml | 8 +- Dockerfile | 14 -- build.sh | 2 - docker-compose.yml | 13 -- src/cli.rs | 7 +- src/lib.rs | 2 - src/login_attempt.rs | 27 --- src/main.rs | 98 +---------- upgrade_mm.sh | 3 - upload.sh | 3 - 12 files changed, 7 insertions(+), 573 deletions(-) delete mode 100644 Dockerfile delete mode 100644 build.sh delete mode 100644 docker-compose.yml delete mode 100644 src/login_attempt.rs delete mode 100644 upgrade_mm.sh delete mode 100644 upload.sh diff --git a/.gitignore b/.gitignore index 90fcc0c..ea8c4bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ /target -*.env diff --git a/Cargo.lock b/Cargo.lock index fe3ef50..a32183a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,21 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - [[package]] name = "aho-corasick" version = "1.1.3" @@ -35,55 +20,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anstream" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" -dependencies = [ - "anstyle", - "windows-sys 0.59.0", -] - [[package]] name = "atty" version = "0.2.14" @@ -95,21 +31,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -122,15 +43,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -[[package]] -name = "cc" -version = "1.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" -dependencies = [ - "shlex", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -158,56 +70,6 @@ dependencies = [ "vec_map", ] -[[package]] -name = "colorchoice" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" - -[[package]] -name = "env_filter" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "heck" version = "0.3.3" @@ -226,12 +88,6 @@ dependencies = [ "libc", ] -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "iptables" version = "0.5.2" @@ -243,12 +99,6 @@ dependencies = [ "regex", ] -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - [[package]] name = "itoa" version = "1.0.14" @@ -267,25 +117,15 @@ version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - [[package]] name = "martillo_maldito" version = "0.1.2" dependencies = [ - "env_logger", "iptables", - "log", - "openssl", "regex", "serde", "serde_json", "structopt", - "tokio", ] [[package]] @@ -294,26 +134,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "miniz_oxide" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.52.0", -] - [[package]] name = "nix" version = "0.29.0" @@ -326,81 +146,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.36.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "openssl" -version = "0.10.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.93", -] - -[[package]] -name = "openssl-src" -version = "300.4.1+3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -472,12 +217,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - [[package]] name = "ryu" version = "1.0.18" @@ -516,21 +255,6 @@ dependencies = [ "serde", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - [[package]] name = "strsim" version = "0.8.0" @@ -592,32 +316,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "tokio" -version = "1.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" -dependencies = [ - "backtrace", - "libc", - "mio", - "pin-project-lite", - "signal-hook-registry", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.93", -] - [[package]] name = "unicode-ident" version = "1.0.14" @@ -636,18 +334,6 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vec_map" version = "0.8.2" @@ -660,12 +346,6 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - [[package]] name = "winapi" version = "0.3.9" @@ -687,85 +367,3 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/Cargo.toml b/Cargo.toml index c649733..5212634 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,17 +6,11 @@ edition = "2021" [dependencies] structopt = "0.3.26" iptables = "0.5.2" -regex = "1.11.1" - -tokio = { version = "1.42.0", features = ["macros", "rt", "rt-multi-thread", "signal"]} serde = {version = "1.0.217", features = ["derive"]} serde_json = "1.0.134" -log = {version = "0.4.22", features = ["kv"]} -env_logger = {version = "0.11.6", features = ["unstable-kv"]} - -openssl = { version = "0.10.68", features = ["vendored"] } +regex = "1.11.1" [lib] name = "martillo_maldito" diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index ce15b3e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM rust:latest as builder - -COPY . . -RUN cargo build --release - -FROM ubuntu:latest - -RUN apt update \ - && apt upgrade -y \ - && apt install iptables iptables-persistent systemd -y - -COPY --from=builder /target/release/martillo-maldito ./ - -CMD [ "/martillo-maldito", "ban-service" ] diff --git a/build.sh b/build.sh deleted file mode 100644 index 9355ee3..0000000 --- a/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -cargo b --release --quiet --target=x86_64-unknown-linux-musl -echo "Build done, now you can upload to https://git.midefos.com/midefos/martillo-maldito-releases/releases" diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index a443d2a..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - martillo-maldito: - image: git.midefos.com/midefos/martillo-maldito:latest - restart: always - network_mode: "host" - - cap_add: - - NET_ADMIN - - NET_RAW - - volumes: - - /var/log/journal:/var/log/journal - - /etc/iptables/rules.v4:/etc/iptables/rules.v4 diff --git a/src/cli.rs b/src/cli.rs index ef0842b..fd07169 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -1,13 +1,8 @@ use structopt::StructOpt; #[derive(Debug, StructOpt)] -#[structopt( - name = "martillo_maldito", - about = "A IPTables wrapper, including a ban service" -)] +#[structopt(name = "martillo_maldito", about = "A IPTables wrapper")] pub enum Cli { - #[structopt(about = "Initialize ban service, monitoring SSH logs for login attempts")] - BanService, #[structopt(about = "List all banned ips")] GetBannedIps { #[structopt(name = "Docker", short = "d", long = "docker")] diff --git a/src/lib.rs b/src/lib.rs index 9946416..2316816 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1 @@ -pub mod cli; -pub mod login_attempt; pub mod martillo_maldito; diff --git a/src/login_attempt.rs b/src/login_attempt.rs deleted file mode 100644 index 6c7672b..0000000 --- a/src/login_attempt.rs +++ /dev/null @@ -1,27 +0,0 @@ -use regex::Regex; - -pub struct LoginAttempt { - pub ip: String, - pub user: String, - pub port: String, -} - -impl LoginAttempt { - pub fn new(ip: &str, user: &str, port: &str) -> Self { - Self { - ip: ip.to_string(), - user: user.to_string(), - port: port.to_string(), - } - } - - pub fn capture(line: &str) -> Option { - let regex = Regex::new(r#"Failed password for (?:invalid user )?(?P\S+) from (?P\S+) port (?P\d+)"#).unwrap(); - let captured = regex.captures(line)?; - Some(Self::new( - captured.name("ip").unwrap().as_str(), - captured.name("user").unwrap().as_str(), - captured.name("port").unwrap().as_str(), - )) - } -} diff --git a/src/main.rs b/src/main.rs index 0bb18aa..a9fb82b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,27 +1,11 @@ -use env_logger::Builder; -use log::{error, info}; -use martillo_maldito::{cli::Cli, login_attempt::LoginAttempt, martillo_maldito::MartilloMaldito}; -use std::{ - collections::HashMap, - io::BufRead, - process::{Child, Command, Stdio}, - thread::{sleep, spawn}, - time::Duration, -}; +mod cli; + +use cli::Cli; +use martillo_maldito::martillo_maldito::MartilloMaldito; use structopt::StructOpt; -#[tokio::main] -async fn main() { +fn main() { match Cli::from_args() { - Cli::BanService => { - start_logger(); - - if let Err(err) = start_ban_service().await { - error!(err = err.to_string().as_str(); - "Ban service" - ); - } - } Cli::GetBannedIps { docker } => { let banned_ips = MartilloMaldito::ipv4(docker).get_banned_ips(); println!("{}", serde_json::to_string(&banned_ips).unwrap()); @@ -73,75 +57,3 @@ async fn main() { } } } - -async fn start_ban_service() -> std::io::Result<()> { - let seconds_iptables = Duration::from_secs(60); - info!(every_seconds = seconds_iptables.as_secs(); - "Saving IPTables" - ); - - spawn(move || loop { - sleep(seconds_iptables); - MartilloMaldito::save_rules().expect("Failed to save rules"); - }); - - let child: Child = Command::new("journalctl") - .arg("-D") - .arg("/var/log/journal") - .arg("-u") - .arg("ssh") - .arg("-f") - .stdout(Stdio::piped()) - .spawn() - .expect("Failed to start journalctl"); - - let stdout = child.stdout.expect("Failed to capture stdout"); - let mut reader = std::io::BufReader::new(stdout); - - let martillo_maldito = MartilloMaldito::ipv4(false); - let mut login_attempts: HashMap = HashMap::new(); - - loop { - let mut line = String::new(); - if let Err(err) = reader.read_line(&mut line) { - error!(err = err.to_string().as_str(); - "Reading line" - ); - continue; - } - - if line.is_empty() { - continue; - } - - if let Some(login_attempt) = LoginAttempt::capture(&line) { - info!(ip = login_attempt.ip.as_str(), - user = login_attempt.user.as_str(); - "Login attempt", - ); - - match login_attempts.get_mut(&login_attempt.ip) { - Some(count) => { - *count += 1; - - if *count == 3 { - if martillo_maldito.ban_ip(&login_attempt.ip).is_ok() { - info!(ip = login_attempt.ip.as_str(); - "Banned IP" - ); - } - - login_attempts.remove(&login_attempt.ip); - } - } - None => { - login_attempts.insert(login_attempt.ip, 1); - } - } - } - } -} - -fn start_logger() { - Builder::from_default_env().init(); -} diff --git a/upgrade_mm.sh b/upgrade_mm.sh deleted file mode 100644 index 7d0a100..0000000 --- a/upgrade_mm.sh +++ /dev/null @@ -1,3 +0,0 @@ -sudo rm -rf martillo-maldito -sudo wget https://git.midefos.com/midefos/martillo-maldito-releases/releases/download/latest/martillo-maldito -sudo chmod +x martillo-maldito diff --git a/upload.sh b/upload.sh deleted file mode 100644 index 59a80cd..0000000 --- a/upload.sh +++ /dev/null @@ -1,3 +0,0 @@ -sudo docker build -f Dockerfile -t martillo-maldito . -sudo docker tag martillo-maldito:latest git.midefos.com/midefos/martillo-maldito:latest -sudo docker push git.midefos.com/midefos/martillo-maldito:latest