Skip to content

tschaefer/ruby-adguardhome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ruby-adguardhome

Ruby AdGuardHome client library.

Introduction

AdGuardHome is a Ruby client for the Network-wide ads & trackers blocking DNS server AdGuardHome.

Installation

 $ gem install --file --without development,test
 $ gem build
 $ VERSION=$(ruby -Ilib -e 'require "adguardhome/version"; puts AdGuardHome::VERSION')
 $ gem install --local adguardhome-${VERSION}.gem

Usage

The required step is to set up a connection to a AdGuardHome service.

require 'adguardhome'

AdGuardHome.configure do |config|
  config.username   = 'admin',
  config.password   = 'admin',
  config.base_url   = 'http://localhost'
end

Following example gets the current DNS server status and general settings.

AdGuardHome.common.status

{"version"=>"v0.107.41",
 "language"=>"en",
 "dns_addresses"=>["127.0.0.1"],
 "dns_port"=>53,
 "http_port"=>80,
 "protection_disabled_duration"=>0,
 "protection_enabled"=>true,
 "dhcp_available"=>true,
 "running"=>true}

For further usage use ri or rake doc to create HTML documentation files.

License

MIT License

Is it any good?

Yes.

About

💥 AdGuardHome Ruby client.

Resources

License

Stars

Watchers

Forks

Languages