Skip to content

Commit

Permalink
release: 0.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Oct 22, 2024
2 parents e91f217 + 56c9007 commit e7e55d6
Show file tree
Hide file tree
Showing 28 changed files with 1,501 additions and 1,938 deletions.
19 changes: 5 additions & 14 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# Project Dependencies
Package: adbyss
Version: 0.13.1
Generated: 2024-10-17 19:40:20 UTC
Version: 0.14.0
Generated: 2024-10-22 04:03:04 UTC

| Package | Version | Author(s) | License |
| ---- | ---- | ---- | ---- |
| [adbyss_core](https://github.com/Blobfolio/adbyss) | 0.13.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [adbyss_psl](https://github.com/Blobfolio/adbyss) | 0.13.1 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [ahash](https://github.com/tkaitchuck/ahash) | 0.8.11 | [Tom Kaitchuck](mailto:[email protected]) | Apache-2.0 or MIT |
| [adbyss_psl](https://github.com/Blobfolio/adbyss) | 0.14.0 | [Josh Stoik](mailto:[email protected]) | WTFPL |
| [aho-corasick](https://github.com/BurntSushi/aho-corasick) | 1.1.3 | [Andrew Gallant](mailto:[email protected]) | MIT or Unlicense |
| [anyhow](https://github.com/dtolnay/anyhow) | 1.0.89 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
| [anyhow](https://github.com/dtolnay/anyhow) | 1.0.90 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
| [argyle](https://github.com/Blobfolio/argyle) | 0.10.0 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [cfg-if](https://github.com/alexcrichton/cfg-if) | 1.0.0 | [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [crossbeam-deque](https://github.com/crossbeam-rs/crossbeam) | 0.8.5 | | Apache-2.0 or MIT |
| [crossbeam-epoch](https://github.com/crossbeam-rs/crossbeam) | 0.9.18 | | Apache-2.0 or MIT |
| [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam) | 0.8.20 | | Apache-2.0 or MIT |
| [dactyl](https://github.com/Blobfolio/dactyl) | 0.7.4 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
| [displaydoc](https://github.com/yaahc/displaydoc) | 0.2.5 | [Jane Lusby](mailto:[email protected]) | Apache-2.0 or MIT |
| [either](https://github.com/rayon-rs/either) | 1.13.0 | bluss | Apache-2.0 or MIT |
| [equivalent](https://github.com/cuviper/equivalent) | 1.0.1 | | Apache-2.0 or MIT |
| [fastrand](https://github.com/smol-rs/fastrand) | 2.1.1 | [Stjepan Glavina](mailto:[email protected]) | Apache-2.0 or MIT |
| [fyi_msg](https://github.com/Blobfolio/fyi) | 1.1.1 | [Blobfolio, LLC.](mailto:[email protected]) | WTFPL |
Expand Down Expand Up @@ -45,8 +39,6 @@
| [once_cell](https://github.com/matklad/once_cell) | 1.20.2 | [Aleksey Kladov](mailto:[email protected]) | Apache-2.0 or MIT |
| [proc-macro2](https://github.com/dtolnay/proc-macro2) | 1.0.88 | [David Tolnay](mailto:[email protected]) and [Alex Crichton](mailto:[email protected]) | Apache-2.0 or MIT |
| [quote](https://github.com/dtolnay/quote) | 1.0.37 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
| [rayon](https://github.com/rayon-rs/rayon) | 1.10.0 | [Niko Matsakis](mailto:[email protected]) and [Josh Stone](mailto:[email protected]) | Apache-2.0 or MIT |
| [rayon-core](https://github.com/rayon-rs/rayon) | 1.12.1 | [Niko Matsakis](mailto:[email protected]) and [Josh Stone](mailto:[email protected]) | Apache-2.0 or MIT |
| [regex](https://github.com/rust-lang/regex) | 1.11.0 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | Apache-2.0 or MIT |
| [regex-automata](https://github.com/rust-lang/regex/tree/master/regex-automata) | 0.4.8 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | Apache-2.0 or MIT |
| [regex-syntax](https://github.com/rust-lang/regex/tree/master/regex-syntax) | 0.8.5 | The Rust Project Developers and [Andrew Gallant](mailto:[email protected]) | Apache-2.0 or MIT |
Expand All @@ -60,7 +52,7 @@
| [serde_yml](https://github.com/sebastienrousseau/serde_yml) | 0.0.12 | Serde YML Contributors | Apache-2.0 or MIT |
| [smallvec](https://github.com/servo/rust-smallvec) | 1.13.2 | The Servo Project Developers | Apache-2.0 or MIT |
| [stable_deref_trait](https://github.com/storyyeller/stable_deref_trait) | 1.2.0 | [Robert Grosse](mailto:[email protected]) | Apache-2.0 or MIT |
| [syn](https://github.com/dtolnay/syn) | 2.0.79 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
| [syn](https://github.com/dtolnay/syn) | 2.0.82 | [David Tolnay](mailto:[email protected]) | Apache-2.0 or MIT |
| [synstructure](https://github.com/mystor/synstructure) | 0.13.1 | [Nika Layzell](mailto:[email protected]) | MIT |
| [tempfile](https://github.com/Stebalien/tempfile) | 3.13.0 | [Steven Allen](mailto:[email protected]), The Rust Project Developers, [Ashley Mannix](mailto:[email protected]), and [Jason White](mailto:[email protected]) | Apache-2.0 or MIT |
| [tinystr](https://github.com/unicode-org/icu4x) | 0.7.6 | The ICU4X Project Developers | Unicode-3.0 |
Expand All @@ -76,7 +68,6 @@
| [writeable](https://github.com/unicode-org/icu4x) | 0.5.5 | The ICU4X Project Developers | Unicode-3.0 |
| [yoke](https://github.com/unicode-org/icu4x) | 0.7.4 | [Manish Goregaokar](mailto:[email protected]) | Unicode-3.0 |
| [yoke-derive](https://github.com/unicode-org/icu4x) | 0.7.4 | [Manish Goregaokar](mailto:[email protected]) | Unicode-3.0 |
| [zerocopy](https://github.com/google/zerocopy) | 0.7.35 | [Joshua Liebow-Feeser](mailto:[email protected]) | Apache-2.0, BSD-2-Clause, or MIT |
| [zerofrom](https://github.com/unicode-org/icu4x) | 0.1.4 | [Manish Goregaokar](mailto:[email protected]) | Unicode-3.0 |
| [zerofrom-derive](https://github.com/unicode-org/icu4x) | 0.1.4 | [Manish Goregaokar](mailto:[email protected]) | Unicode-3.0 |
| [zerovec](https://github.com/unicode-org/icu4x) | 0.10.4 | The ICU4X Project Developers | Unicode-3.0 |
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
resolver = "2"
members = [
"adbyss",
"adbyss_core",
"adbyss_psl",
]

Expand Down
18 changes: 14 additions & 4 deletions adbyss/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adbyss"
version = "0.13.1"
version = "0.14.0"
license = "WTFPL"
authors = ["Josh Stoik <[email protected]>"]
edition = "2021"
Expand Down Expand Up @@ -93,10 +93,20 @@ argyle = "0.10.*"
dactyl = "0.7.*"
fyi_msg = "1.1.*"
libc = "0.2.*"
regex = "1.11.*"
serde_yml = "=0.0.12"

[dependencies.adbyss_core]
path = "../adbyss_core"
trimothy = "0.3.*"
utc2k = "0.10.*"
write_atomic = "0.5.*"

[dependencies.adbyss_psl]
path = "../adbyss_psl"
features = [ "serde" ]

[dependencies.minreq]
version = "2.12.*"
default-features = false
features = ["https"]

[dependencies.serde]
version = "1.0.*"
Expand Down
2 changes: 2 additions & 0 deletions adbyss/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use std::path::PathBuf;

/// # Set Up CLI Arguments.
pub fn main() {
println!("cargo:rerun-if-env-changed=CARGO_PKG_VERSION");

let mut builder = KeyWordsBuilder::default();
builder.push_keys([
"--disable",
Expand Down
File renamed without changes.
54 changes: 54 additions & 0 deletions adbyss/skel/test-full.hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#############
# Localhost #
#############

127.0.0.1 localhost
172.19.0.2 mysql

##################
# Manual Records #
##################

50.116.18.174 blobfolio.com www.blobfolio.com
2a03:2880:f10d:183:face:b00c:0:25de facebook.com


########
# IPv6 #
########

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

##########
# ADBYSS #
##########
0.0.0.0 0-1x.8632152.xyz www.0-1x.8632152.xyz
0.0.0.0 0-7l45.cfd www.0-7l45.cfd
0.0.0.0 0-a5e1.sbs www.0-a5e1.sbs
0.0.0.0 0-c1j0.lat www.0-c1j0.lat
## End of Adbyss Rules ##

##########
# ADBYSS #
##########
# Repeated.
0.0.0.0 0-1x.8632152.xyz www.0-1x.8632152.xyz
0.0.0.0 0-7l45.cfd www.0-7l45.cfd
0.0.0.0 0-a5e1.sbs www.0-a5e1.sbs
0.0.0.0 0-c1j0.lat www.0-c1j0.lat

## End of Adbyss Rules ##
198.143.164.252 wordpress.org # Don't strip me!

##########
# ADBYSS #
##########
# Repeated again, but no end marker.
0.0.0.0 0-1x.8632152.xyz www.0-1x.8632152.xyz
0.0.0.0 0-7l45.cfd www.0-7l45.cfd
0.0.0.0 0-a5e1.sbs www.0-a5e1.sbs
0.0.0.0 0-c1j0.lat www.0-c1j0.lat
27 changes: 27 additions & 0 deletions adbyss/skel/test-stripped.hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#############
# Localhost #
#############

127.0.0.1 localhost
172.19.0.2 mysql

##################
# Manual Records #
##################

50.116.18.174 blobfolio.com www.blobfolio.com
2a03:2880:f10d:183:face:b00c:0:25de facebook.com


########
# IPv6 #
########

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters


198.143.164.252 wordpress.org # Don't strip me!
119 changes: 119 additions & 0 deletions adbyss/src/err.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/*!
# Adbyss: Errors
*/

use crate::Source;
use std::fmt;



/// # Help Text.
const HELP: &str = concat!(r#"
.--, .--,
( ( \.---./ ) )
'.__/o o\__.'
(= ^ =) "#, "\x1b[38;5;199mAdbyss\x1b[0;38;5;69m v", env!("CARGO_PKG_VERSION"), "\x1b[0m", r#"
> - < Block ads, trackers, malware, and
/ \ other garbage sites in /etc/hosts.
// \\
//| . |\\
"'\ /'"_.-~^`'-.
\ _ /--' `
___)( )(___
USAGE:
adbyss [FLAGS] [OPTIONS]
FLAGS:
--disable Remove *all* Adbyss entries from the hostfile.
-h, --help Prints help information.
-q, --quiet Do *not* summarize changes after write.
--show Print a sorted blackholable hosts list to STDOUT, one per
line.
--stdout Print the would-be hostfile to STDOUT instead of writing
it to disk.
-V, --version Prints version information.
-y, --yes Non-interactive mode; answer "yes" to all prompts.
OPTIONS:
-c, --config <path> Use this configuration instead of /etc/adbyss.yaml.
SOURCES:
AdAway: <https://adaway.org/>
Steven Black: <https://github.com/StevenBlack/hosts>
Yoyo: <https://pgl.yoyo.org/adservers/>
Additional global settings are stored in /etc/adbyss.yaml.
"#);



#[derive(Debug, Clone)]
/// # Error.
pub(super) enum AdbyssError {
/// # Early Abort.
Aborted,

/// # Invalid CLI Argument.
InvalidCli(String),

/// # No Internet.
NoInternet,

/// # No Shitlist.
NoShitlist,

/// # Deserialization Error.
Parse(String),

/// # Root required.
Root,

/// # Read Issue.
Read(String),

/// # Unable to Fetch Source.
SourceFetch(Source),

/// # Write Issue.
Write(String),

/// # Print Help (Not an Error).
PrintHelp,

/// # Print Version (Not an Error).
PrintVersion,
}

impl std::error::Error for AdbyssError {}

impl fmt::Display for AdbyssError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(self.as_str())?;
match self {
Self::InvalidCli(s) | Self::Parse(s) | Self::Read(s) | Self::Write(s) =>
write!(f, " \x1b[2m({s})\x1b[0m"),
Self::SourceFetch(s) => write!(f, " \x1b[2m({})\x1b[0m", s.as_str()),
_ => Ok(()),
}
}
}

impl AdbyssError {
/// # As String Slice.
pub(super) const fn as_str(&self) -> &'static str {
match self {
Self::Aborted => "Operation aborted.",
Self::InvalidCli(_) => "Invalid/unknown option.",
Self::NoInternet => "No internet connection available.",
Self::NoShitlist => "There are no domains to blackhole!",
Self::Parse(_) => "Parsing failed.",
Self::Read(_) => "Unable to read file.",
Self::Root => "Adbyss requires root privileges.",
Self::SourceFetch(_) => "Unable to fetch source.",
Self::Write(_) => "Unable to write file.",
Self::PrintHelp => HELP,
Self::PrintVersion => concat!("Adbyss v", env!("CARGO_PKG_VERSION")),
}
}
}
Loading

0 comments on commit e7e55d6

Please sign in to comment.