https://github.com/WIttyJudge/adless
Local domains blocker written in Go
https://github.com/WIttyJudge/adless
ad-blocker ads blocker
Last synced: 7 months ago
JSON representation
Local domains blocker written in Go
- Host: GitHub
- URL: https://github.com/WIttyJudge/adless
- Owner: WIttyJudge
- License: apache-2.0
- Created: 2024-10-08T12:49:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-16T14:50:36.000Z (over 1 year ago)
- Last Synced: 2025-10-12T08:24:04.345Z (9 months ago)
- Topics: ad-blocker, ads, blocker
- Language: Go
- Homepage:
- Size: 2.61 MB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cli-apps-in-a-csv - adless - Local domains blocker written in Go. (<a name="networking"></a>Networking)
- awesome-cli-apps - adless - Local domains blocker written in Go. (<a name="networking"></a>Networking)
README
# adless
[](https://goreportcard.com/report/github.com/WIttyJudge/adless)
Adless is an easy-to-use CLI tool that blocks domains by using your system's hosts file.

## Features
- Works without running any background processes.
- You don't need a browser extensions to block ads.
- Supports whitelist domains.
- Lets you specify multiple blocklists and whitelists.
## Idea
The idea for developing Adless was inspired by two projects: [Maza](https://github.com/tanrax/maza-ad-blocking) and [Pi-hole](https://github.com/pi-hole/pi-hole).
For a long time, I used both of them, but eventually,
I wanted to create a tool that combined the best of both worlds.
I wished to have a tool that, like Pi-hole, would allow users to manage
multiple blocklists and whitelists of domains. At the same time, would work
without running any background processes and rely on use of hosts file, much like Maza.
And that's how Adless was made.
## Installation
### Package manager
On Arch Linux (AUR)
```bash
yay -S adless-bin
```
### Manual Installation
Download the latest tar from the [releases page](https://github.com/WIttyJudge/adless/releases) and decompress.
If you use Linux or MacOS, you can simple run:
```bash
curl -sL https://raw.githubusercontent.com/WIttyJudge/adless/refs/heads/main/scripts/install.sh | bash
```
### Building from source
The [Makefile](https://github.com/WIttyJudge/adless/blob/main/Makefile) has everything you need.
There are different commands to build a binary for different platforms.
Choose one that you need.
```bash
make build-linux
make build-windows
make build-darwnin
```
To run the binary:
```bash
./build/adless
```
## Usage
```
NAME:
adless - Local domains blocker writter in Go
USAGE:
adless [global options] command [command options]
VERSION:
v1.0.0
COMMANDS:
config Manage the configuration file
disable Disable domains blocking
enable Enable domains blocking
restore Restore hosts file from backup to its previous state
status Check if domains blocking enabled or not
update Update the list of domains to be blocked
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--config-file value Path to the configuration file
--quiet, -q Enable quiet mode
--verbose, -v Enable debug mode
--help, -h Show help
--version, -V Print the version
```
## Configuration file
Adless supports reading and writing configuration files.
The default configuration file is located at `$HOME/.config/adless/config.yml`,
but it can be redefined using `--config` flag or the following environment variables:
- ADLESS_CONFIG_PATH - Specifies the full path to the configuration file.
- ADLESS_CONFIG_HOME - Specifies the folder where the `config.yml` file is located.
- XDG_CONFIG_HOME - Specifies the base directory for user-specific configuration files. Adless will look for `adless/config.yml` within this directory.
### Default configuration
```yaml
blocklists:
- target: https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
whitelists:
- target: https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt
```
### Create
To create a local configuration file, run:
```bash
adless config init
```
### Edit
To open the configuration file in your preferred editor, run:
```bash
adless config edit
```
## TODO
1. Options to add path to local blocklists and whitelists