-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Initial release
- Loading branch information
LIAUD Corentin
committed
Nov 6, 2022
1 parent
0d01019
commit 6f81358
Showing
9 changed files
with
72 additions
and
35 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=Highly configurable Rust local DNS adblocker. | ||
After=network.target | ||
|
||
[Service] | ||
User=root | ||
ExecStart=/usr/bin/rhole --config config.yml | ||
Environment="RUST_LOG=rhole=info" | ||
WorkingDirectory=/etc/rhole | ||
Restart=on-failure | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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,5 +1,12 @@ | ||
use std::env; | ||
|
||
pub fn set_log_level(debug: bool) { | ||
let level = if debug { "debug" } else { "info" }; | ||
std::env::set_var("RUST_LOG", level); | ||
// Setting RUST_LOG from env if it exists | ||
// If it does not exist, creates special one | ||
if let Err(_) = env::var("RUST_LOG") { | ||
let level = if debug { "debug" } else { "info" }; | ||
std::env::set_var("RUST_LOG", level); | ||
} | ||
|
||
env_logger::init(); | ||
} |