ps-core::zapret2 reads nfqws2-keenetic's nfqws2.conf and patches it as upstream's sources.nix does, expands the hostlist markers as zapret2's list.sh does (autohostlist with its detector settings, the configured domains), fills circular's unset detector settings from autoHostlist, merges the extra ports into the profiles that tell traffic by protocol, and gives winws2 WinDivert port filters in place of the queue's rules. The service runs it with the learned list in a directory labelled Low integrity, where winws2 can still write once it drops to Low. winws2 verifies the whole command line under Wine. detect.lua, z2k and the cutoff probe are not there yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
998 B
Rust
23 lines
998 B
Rust
//! For tools/winws-dry-run.sh: winws2's arguments as the service builds them, one per line.
|
|
//! `zapret2_args <component dir> <component dir as Windows sees it> <state dir as Windows sees it>`
|
|
|
|
use ps_core::config::Zapret2;
|
|
use ps_core::zapret2::{Paths, args, keenetic};
|
|
|
|
fn main() {
|
|
let a: Vec<String> = std::env::args().collect();
|
|
let conf = std::fs::read_to_string(std::path::Path::new(&a[1]).join("keenetic").join("nfqws2.conf")).unwrap();
|
|
let (comp, state) = (&a[2], &a[3]);
|
|
let source = keenetic(&conf, &format!("{comp}keenetic\\")).unwrap();
|
|
let paths = Paths {
|
|
lua: format!("{comp}lua\\"),
|
|
user: format!("{state}zapret-hosts-user.txt"),
|
|
exclude: format!("{state}zapret-hosts-user-exclude.txt"),
|
|
auto: format!("{state}learned\\zapret-hosts-auto.txt"),
|
|
};
|
|
let z = Zapret2 { domains: vec!["rutracker.org".into()], ..Default::default() };
|
|
for arg in args(&z, &source, &paths, false).unwrap() {
|
|
println!("{arg}");
|
|
}
|
|
}
|