Commit Graph

191 Commits

Author SHA1 Message Date
gfyoung
24ab22e139
Refactor out source data updating 2017-08-20 11:52:28 -07:00
Steven Black
68dcf5c125 Remove references to .zip files in the generator programs. 2017-08-20 12:00:19 -04:00
gfyoung
f83a56d317 Refactor out global settings usage in update logic 2017-08-09 08:13:22 -07:00
gfyoung
942069db81 Refactor out global settings usage in exclusions 2017-08-07 08:43:47 -07:00
gfyoung
4b96f3f34a Refactor out global settings usage in user prompt 2017-07-13 08:20:03 -07:00
Steven Black
d945d7bcc0 Merge pull request #341 from indrajitr/hostmatch-fix
Honor whitelist exclusion only for domain or subdomain match
2017-07-09 13:13:57 -04:00
Dylan Armstrong
02a28cd05b Fix the number of unique entries. 2017-07-08 20:20:03 -05:00
gfyoung
415b89a022 Reduce dependency on global settings variable
Global variables make code less modular
and therefore more difficult to test.
2017-07-03 18:42:15 -07:00
gfyoung
dce24af399 Add unittests for updateHostsFile.py 2017-06-28 20:13:01 -07:00
Indrajit Raychaudhuri
fd046bc460 Honor whitelist exclusion only for domain or subdomain match
* Whitelisting `s.youtube.com` should not whitelist `ads.youtube.com`; but
  can whitelist `a.s.youtube.com`
* Whitelisting `twitter.com` should not whitelist `ttwitter.com` or
  `twitter.com.au`; but can whitelist `a.twitter.com`
2017-06-22 01:43:56 -05:00
Indrajit Raychaudhuri
7e1b06ecf9 Tighten regex rule to discard IP address as hostname 2017-06-20 02:06:31 -05:00
Steven Black
96ac61c119 Merge pull request #325 from gfyoung/terminal-color-support
Check if terminal supports color
2017-05-29 23:00:35 -04:00
gfyoung
2d6a8676a4 Check if terminal supports color
Closes gh-151.
2017-05-28 12:40:32 -04:00
gfyoung
3b581ce782 Refactor DNS cache flushing for Linux 2017-05-28 12:40:25 -04:00
gfyoung
51a0ec21bd Document all functions in Python scripts 2017-05-23 21:58:22 -04:00
Steven Black
526a457a38 Merge pull request #322 from gfyoung/kde-neon-dns-cache
Check /usr/lib and /lib for systemd
2017-05-23 10:03:22 -04:00
gfyoung
2aecbf9707 Concatenate str only in os.path.join
Closes gh-316.
2017-05-22 23:31:35 -04:00
gfyoung
8806131c74 Check /usr/lib and /lib for systemd
Closes gh-321.
2017-05-22 21:19:31 -04:00
gfyoung
8f3e71e327 Wrap os.path.join to handle LOCALE issues
Closes gh-81.
Closes gh-318.
2017-05-21 21:51:13 -04:00
Steven Black
d343798ed1 Ref: Issue #312 undo commit 2ff5dc2
cc @gfyoung

Commit 2ff5dc2 is generating errors on macOS.

See Issue #318.
2017-05-21 21:34:54 -04:00
gfyoung
c8e8ddee6c Wrap os.path.join to handle LOCALE issues
Closes gh-81.
2017-05-19 16:27:12 -04:00
Steven Black
f87290eff8 Merge pull request #310 from gfyoung/ubuntu-mint-dns-cache
Add DNS cache flushing calls for Linux
2017-05-19 07:30:54 -04:00
gfyoung
b3838ef2d2 Add DNS cache flushing calls for Linux
1) Add command for Linux Mint
2) Add additional command for NCSD cache

Closes gh-128.
2017-05-18 11:30:23 -04:00
gfyoung
8cb610a757 Don't crash if data source unreachable
Closes gh-26.
2017-05-18 00:17:11 -04:00
gfyoung
26cac85ca3 Patch all style errors in updateHostsFile.py 2017-05-15 15:00:16 -04:00
gfyoung
21dd1d9d56 Standardize underscore names in updateHostsFile.py 2017-05-15 13:32:39 -04:00
gfyoung
0015363385 Condense Python 2-3 compatibility code 2017-05-14 22:30:36 -04:00
gfyoung
190592577d Condense exclusion customization logic 2017-05-14 22:10:19 -04:00
gfyoung
ceb3765d24 Flush DNS cache on Windows 2017-05-14 22:07:43 -04:00
gfyoung
118a8e78a5 Remove unnecessary space between print and parenthesis 2017-05-14 14:54:24 -04:00
Steven Black
83af37862c Merge pull request #292 from gfyoung/remove-unused-imports
Remove unnecessary imports in updateHostsFile.py
2017-05-14 11:03:22 -04:00
gfyoung
5830bb8db0 Have query_yes_no return boolean
Bugs have been found where we assumed
that query_yes_no returned True/False.
Not only is it easier to check booleans
instead of strings, but it also looks
a lot cleaner in the code.
2017-05-14 00:15:58 -04:00
gfyoung
de2e45e8b2 Remove unnecessary imports in updateHostsFile.py 2017-05-13 23:43:00 -04:00
gfyoung
bdce1217bb Patch response checking in promptForFlushDnsCache
Previously, it was checking if query_yes_no returned
False, which does not happen, as the function only
returns "yes" or "no". As a result, the check was
always returning True, even when the user did not
want to flush the DNS cache.
2017-05-08 01:10:40 -04:00
DPTJKKVH
f9e8910ba0 Include 127.0.0.53 <hostname> to fix DNS issues from Ubuntu 17.04 onwards
Ubuntu 17.04 replaces dnsmasq with systemd-resolve which uses a different local IP address for domain name resolution.
By including this simple line of code we basically do the same what Issue #110 requested to fix Issue #109 but this time for systemd-resolve.
2017-04-23 11:20:29 +02:00
Tomasz Przybył
71f2b8ee3f [FIX] traceroute and netstat display anomaly
Based on hosts file generated by Uncheky app
@StevenBlack
2017-04-13 19:21:10 +02:00
Steven Black
590b62111e Trim periods in addition to whitespace. Closes #271. 2017-03-30 12:08:50 -04:00
Steven Black
3ccf4cca0f Issue #243: fix - don’t include domain comments, by default. 2017-02-17 22:29:58 -05:00
Steven Black
85babd9720 Recursively collect files in subfolvers in Python versions below 3.5. This closes Issue #218. 2016-12-18 23:17:01 -05:00
Steven Black
db58b6db95 Allow nesting of base hosts data, and within extension folders. 2016-12-18 19:57:55 -05:00
Steven Black
d39ad733dc ‘hostsFile’ is a better variable name here than ‘dataFile’. 2016-12-18 18:34:41 -05:00
Steven Black
ad2100aaf2 ‘hostsfilename’ is a better variable name than ‘datafilenames’. 2016-12-18 18:32:44 -05:00
Steven Black
ac2a06f74b Updating all sources: add recursive=True to the call to glob() 2016-12-18 17:55:55 -05:00
Steven Black
c022c2b230 Update data regardless fo folder depth using glob.glob(). 2016-12-18 11:02:21 -05:00
Steven Black
d1c3921eb7 Restore updateHostsFile.py to 7119b725e7 because the prior commit’s diff is cluded by space/tab changes. 2016-12-18 10:55:35 -05:00
Steven Black
d3b8cc7339 Refactoring in updateHostsFile.py 2016-12-18 00:34:12 -05:00
Steven Black
7119b725e7 Added metadata to Sinfonietta’s hosts source files. 2016-12-11 13:44:51 -05:00
Steven Black
e22e3dc594 Create a sourcesdata hash for each flavor of hosts file generated. 2016-12-11 12:22:51 -05:00
Steven Black
3f4bfa2d70 Code commenting. 2016-12-11 12:22:02 -05:00
Steven Black
d089583a45 This code is never called. 2016-12-11 12:21:38 -05:00