CWP-Utilities icon indicating copy to clipboard operation
CWP-Utilities copied to clipboard

Some suggestions

Open oep42 opened this issue 7 months ago • 1 comments

Thank you for making this useful tool available.

Some suggestions, based on my experience with the latest version of "Update Hosts (Standard)":

Add to the documentation, that it is possible to add your own custom hosts file entries, like this:

  • Place your custom hosts file entries in a text file.
  • Name this text file hosts.99.
  • Place this text file in C:\Program Files (x86)\CWPUtilities\cwpumain\bin.
  • In "CWP Utilities SysTray", choose Edit Configs > Hosts (Standard) to open the editor.
  • In the editor, search for this line: busybox cat processing/hosts/hosts.* > processing/hosts/hosts-cat.final.
  • When this line has been found in the editor, insert the following line above the found line: copy hosts.99 processing\hosts.
  • Choose File > Save in the editor to save the change in the script.

Another suggestion: Add the option to the program to use an ignore list, i.e. a user created text file with URLs that are blocked in one or more of the downloaded blocking lists, but which should not be blocked.

Some more suggestions:

For each of the files that are to be downloaded with curl -s -o processing/hosts/hosts.*, check whether this file can be downloaded, and if not, display a warning.

When the file final-hosts.txt has been created, check the size of this file. If this file has a size of zero, abort the script with an error message that says that nothing could be downloaded (or something like that).

When the hosts file in C:\Windows\System32\drivers\etc is a read-only file, at the end of the script, this misleading message appears: Done! Your host file has been updated, while this is not the case. A few lines earlier it says Access is denied. 0 file(s) copied. I guess some people may overlook this earlier message. My suggestion is, to check first whether the hosts file is a read-only file, and if so, abort the script with an error message. (Or, as an alternative, if this is possible: Before trying to write to the hosts file, if needed, the script changes the read-only attribute of the hosts file, so writing to it is possible. When the hosts file was originally a read-only file, after writing to the hosts file, the script makes it a read-only file again.)

With some firewalls or other security programs, it is possible to prevent modifications to the hosts file. When such a prevention has been set, at the end of the script, this misleading message appears: Done! Your host file has been updated, while this is not the case. A few lines earlier it says The process cannot access the file because it is being used by another process. 0 file(s) copied. I guess some people may overlook this earlier message. My suggestion is, to check first whether the hosts file has been blocked by another program, and if so, abort the script with an error message.

You may consider to add https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts to the Defaults Hosts File Sources (and then remove the three sources "MVPS", "PGL Yoyo", and "URL Haus", because they then become duplicates, as they are included in the StevenBlack source).

NOTE: The link in the script to "URL Haus" (https://gitlab.com/curben/urlhaus-filter/raw/master/urlhaus-filter-hosts-online.txt), links to an old version of the "URL Haus" list, while the link in https://github.com/bongochong/CWP-Utilities/blob/master/MoreInfo/DefaultHostsLists.md links to the current version of the "URL Haus" list.

oep42 avatar Nov 17 '23 17:11 oep42