diff --git a/Cargo.lock b/Cargo.lock index cccece72..3bfde2fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -22,9 +22,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] @@ -46,18 +46,18 @@ dependencies = [ [[package]] name = "android_system_properties" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] [[package]] name = "anyhow" -version = "1.0.61" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "508b352bb5c066aac251f6daf6b36eccd03e8a88e8081cd44959ea277a3af9a8" +checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" [[package]] name = "arrayvec" @@ -236,9 +236,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "bytes" @@ -278,9 +278,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.17" +version = "3.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" dependencies = [ "atty", "bitflags", @@ -296,9 +296,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.17" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", @@ -324,9 +324,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -439,9 +439,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "email-encoding" @@ -530,9 +530,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", @@ -545,9 +545,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -555,15 +555,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -572,15 +572,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-macro" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -589,21 +589,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-util" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures-channel", "futures-core", @@ -640,9 +640,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -728,9 +728,9 @@ checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -798,13 +798,14 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.46" +version = "0.1.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad2bfd338099682614d3ee3fe0cd72e0b6a41ca6a87f6a74a3bd593c91650501" +checksum = "4c495f162af0bf17656d0014a0eded5f3cd2f365fdd204548c2869db89359dc7" dependencies = [ "android_system_properties", "core-foundation-sys", "js-sys", + "once_cell", "wasm-bindgen", "winapi", ] @@ -911,15 +912,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.131" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c3b4822ccebfa39c02fc03d1534441b22ead323fa0f48bb7ddd8e6ba076a40" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" dependencies = [ "autocfg", "scopeguard", @@ -1015,9 +1016,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -1090,9 +1091,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" [[package]] name = "opaque-debug" @@ -1147,18 +1148,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -1195,9 +1196,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697ae720ee02011f439e0701db107ffe2916d83f718342d65d7f8bf7b8a5fee9" +checksum = "a49e86d2c26a24059894a3afa13fd17d063419b05dfb83f06d9c3566060c3f5a" dependencies = [ "proc-macro2", "syn", @@ -1305,9 +1306,9 @@ dependencies = [ [[package]] name = "protobuf-src" -version = "1.0.5+3.19.3" +version = "1.1.0+21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe57f68bf9767f48f8cbcbceb5da21524e2b1330a821c1c2502c447d8043f078" +checksum = "c7ac8852baeb3cc6fb83b93646fb93c0ffe5d14bf138c945ceb4b9948ee0e3c1" dependencies = [ "autotools", ] @@ -1638,18 +1639,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.143" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.143" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -1658,9 +1659,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa 1.0.3", "ryu", @@ -1733,9 +1734,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -1853,9 +1854,9 @@ checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" [[package]] name = "sysinfo" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08068324641dc7a50f3aa753e730594619ed9c5ba037b1b3920cb683e1a80b1" +checksum = "4ae2421f3e16b3afd4aa692d23b83d0ba42ee9b0081d5deeb7d21428d7195fb1" dependencies = [ "cfg-if", "core-foundation-sys", @@ -1911,18 +1912,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" dependencies = [ "proc-macro2", "quote", @@ -1957,9 +1958,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.1" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" dependencies = [ "autocfg", "bytes", @@ -2250,13 +2251,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", ] @@ -2406,13 +2406,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] diff --git a/client/Cargo.toml b/client/Cargo.toml index 4591e259..a425a1ee 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -19,7 +19,7 @@ repository = "https://github.com/zdz/ServerStatus-Rust" anyhow = "1" bytes = {version = "1", features = ["serde"]} chrono = "0.4" -clap = {version = "3.2", features = ["derive", "unicode"]} +clap = {version = "3.2", features = ["derive", "unicode", "env"]} hyper = {version = "0.14", features = ["full"]} lazy_static = "1.4" log = "0.4" diff --git a/client/src/main.rs b/client/src/main.rs index b42f4a62..09bd3736 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -36,32 +36,56 @@ pub struct ClientConfig { pub static G_CONFIG: Lazy> = Lazy::new(|| Mutex::new(ClientConfig::default())); +// https://docs.rs/clap/latest/clap/_derive/index.html#command-attributes #[derive(Parser, Debug, Clone)] #[clap(author, version = env!("APP_VERSION"), about, long_about = None)] pub struct Args { - #[clap(short, long, value_parser, default_value = "http://127.0.0.1:8080/report")] + #[clap( + short, + long, + value_parser, + env = "SSR_ADDR", + default_value = "http://127.0.0.1:8080/report" + )] addr: String, - #[clap(short, long, value_parser, default_value = "h1", help = "username")] + #[clap(short, long, value_parser, env = "SSR_USER", default_value = "h1", help = "username")] user: String, - #[clap(short, long, value_parser, default_value = "p1", help = "password")] + #[clap(short, long, value_parser, env = "SSR_PASS", default_value = "p1", help = "password")] pass: String, - #[clap(short = 'n', long, value_parser, help = "enable vnstat, default:false")] + #[clap( + short = 'n', + long, + value_parser, + env = "SSR_VNSTAT", + help = "enable vnstat, default:false" + )] vnstat: bool, - #[clap(long = "disable-tupd", value_parser, help = "disable t/u/p/d, default:false")] + #[clap( + long = "disable-tupd", + value_parser, + env = "SSR_DISABLE_TUPD", + help = "disable t/u/p/d, default:false" + )] disable_tupd: bool, - #[clap(long = "disable-ping", value_parser, help = "disable ping, default:false")] + #[clap( + long = "disable-ping", + value_parser, + env = "SSR_DISABLE_PING", + help = "disable ping, default:false" + )] disable_ping: bool, #[clap( long = "disable-extra", value_parser, + env = "SSR_DISABLE_EXTRA", help = "disable extra info report, default:false" )] disable_extra: bool, - #[clap(long = "ct", value_parser, default_value = CT, help = "China Telecom probe addr")] + #[clap(long = "ct", value_parser, env = "SSR_CT_ADDR", default_value = CT, help = "China Telecom probe addr")] ct_addr: String, - #[clap(long = "cm", value_parser, default_value = CM, help = "China Mobile probe addr")] + #[clap(long = "cm", value_parser, env = "SSR_CM_ADDR", default_value = CM, help = "China Mobile probe addr")] cm_addr: String, - #[clap(long = "cu", value_parser, default_value = CU, help = "China Unicom probe addr")] + #[clap(long = "cu", value_parser, env = "SSR_CU_ADDR", default_value = CU, help = "China Unicom probe addr")] cu_addr: String, #[clap(long = "ip-info", value_parser, help = "show ip info, default:false")] ip_info: bool, @@ -70,25 +94,51 @@ pub struct Args { #[clap(short = '6', value_parser, long = "ipv6", help = "ipv6 only, default:false")] ipv6: bool, // for group - #[clap(short, long, value_parser, default_value = "", help = "group id")] + #[clap(short, long, value_parser, env = "SSR_GID", default_value = "", help = "group id")] gid: String, - #[clap(long = "alias", value_parser, default_value = "unknown", help = "alias for host")] + #[clap( + long = "alias", + value_parser, + env = "SSR_ALIAS", + default_value = "unknown", + help = "alias for host" + )] alias: String, - #[clap(short, long, value_parser, default_value = "0", help = "weight for rank")] + #[clap( + short, + long, + value_parser, + env = "SSR_WEIGHT", + default_value = "0", + help = "weight for rank" + )] weight: u64, - #[clap(long = "disable-notify", value_parser, help = "disable notify, default:false")] + #[clap( + long = "disable-notify", + env = "SSR_DISABLE_NOTIFY", + value_parser, + help = "disable notify, default:false" + )] disable_notify: bool, - #[clap(short = 't', long = "type", value_parser, default_value = "", help = "host type")] + #[clap( + short = 't', + long = "type", + value_parser, + env = "SSR_TYPE", + default_value = "", + help = "host type" + )] host_type: String, - #[clap(long, value_parser, default_value = "", help = "location")] + #[clap(long, value_parser, env = "SSR_LOC", default_value = "", help = "location")] location: String, - // #[clap(long = "debug", help = "debug mode, default:false")] - // debug: bool, + #[clap(short = 'd', long = "debug", env = "SSR_DEBUG", help = "debug mode, default:false")] + debug: bool, #[clap( short = 'i', long = "iface", value_parser, - default_value = "", + env = "SSR_IFACE", + default_values_t = Vec::::new(), value_delimiter = ',', require_delimiter = true, help = "iface list, eg: eth0,eth1" @@ -98,6 +148,7 @@ pub struct Args { short = 'e', long = "exclude-iface", value_parser, + env = "SSR_EXCLUDE_IFACE", default_value = "lo,docker,vnet,veth,vmbr,kube,br-", value_delimiter = ',', help = "exclude iface" @@ -249,7 +300,9 @@ async fn main() -> Result<()> { let mut args = Args::parse(); args.iface.retain(|e| !e.trim().is_empty()); args.exclude_iface.retain(|e| !e.trim().is_empty()); - dbg!(&args); + if args.debug { + dbg!(&args); + } if args.ip_info { let info = ip_api::get_ip_info(args.ipv6).await?; diff --git a/example.env b/example.env new file mode 100644 index 00000000..ff7c9df5 --- /dev/null +++ b/example.env @@ -0,0 +1,23 @@ + +# 优先级 cli > .env > default value +# 1. ~$ export $(grep -v '^#' example.env | xargs) +# 2. ~$ ./stat_client -u h1 +# 或 systemd => EnvironmentFile=/opt/ServerStatus/.env + +SSR_DEBUG=true + +SSR_ADDR=http://127.0.0.1:8080/report +# SSR_USER=h1 +SSR_PASS=p1 +SSR_VNSTAT=true +SSR_DISABLE_TUPD=false +SSR_DISABLE_PING=false +SSR_DISABLE_EXTRA=false +SSR_DISABLE_NOTIFY=false +SSR_EXCLUDE_IFACE=lo,docker,vnet,veth,vmbr,kube,br- + +SSR_WEIGHT=0 + +SSR_CM_ADDR=cm.tz.cloudcpp.com:80 +SSR_CT_ADDR=ct.tz.cloudcpp.com:80 +SSR_CU_ADDR=cu.tz.cloudcpp.com:80 diff --git a/systemd/stat_client.service b/systemd/stat_client.service index 4d159265..9a5945a5 100644 --- a/systemd/stat_client.service +++ b/systemd/stat_client.service @@ -7,6 +7,7 @@ User=root Group=root Environment="RUST_BACKTRACE=1" WorkingDirectory=/opt/ServerStatus +# EnvironmentFile=/opt/ServerStatus/.env ExecStart=/opt/ServerStatus/stat_client -a "http://127.0.0.1:8080/report" -u h1 -p p1 ExecReload=/bin/kill -HUP $MAINPID Restart=on-failure @@ -15,3 +16,4 @@ Restart=on-failure WantedBy=multi-user.target # /etc/systemd/system/stat_client.service +# journalctl -u stat_client -f -n 100