Commit Graph

89 Commits (ef5fddc323c20350c76e9cbea746467b770b9ae8)

Author SHA1 Message Date
Justin Reichardt ef5fddc323 Added the copyright notice to the program 2022-06-12 20:13:16 -05:00
Justin Reichardt bef73dfbaf Created a Makefile to build and install
Also updated the Readme with instructions
Added a version file so the version can be included in the build
2022-06-12 20:10:47 -05:00
Justin Reichardt 75f393d8bd Checks for rhosts.cfg and parent directory
If the directory doesn't exist it tries to create it. If the config
doesn't exist it fails with a log error explaining.
2022-03-01 21:59:49 -06:00
Justin Reichardt f7b781ea6e Updated the readme to reflect current state 2022-03-01 21:59:02 -06:00
Justin Reichardt 2d19f1692d Removed old placeholders 2022-03-01 13:23:42 -06:00
Justin Reichardt 199c132db2 Whitelisted items are removed
All items are now counted and displayed after processing
2022-03-01 13:14:17 -06:00
Justin Reichardt b3f50d4260 Whitelisted entries are removed from hosts file 2022-03-01 12:36:30 -06:00
Justin Reichardt 901f8c537e Detects whitelist in the options
Passes the addresses of the variables when parsing the config file
Fills out the whitelist string array with config entries
2022-03-01 10:44:46 -06:00
Justin Reichardt c32bed5041 Added ipv6 to the hostfile
Now routes all urls to 0.0.0.0 and ::
2022-02-26 23:42:57 -06:00
Justin Reichardt 006ea0aa11 Enabled Windows
Windows is still not ready fro prime time, but it does function
2022-02-26 21:06:09 -06:00
Justin Reichardt 6a5b2b7363 Filters out duplicates and comments
Creates a list of only the sites that can then be used to remove
duplicates and then set the sending address, currently 0.0.0.0
2022-02-23 21:22:12 -06:00
Justin Reichardt 01584ea27a Removed the uneeded i variable in main
Was originally used since the for loop doesn't have a dowhile, but
breaking when not false made the code simpler to understand
2022-02-23 13:45:43 -06:00
Justin Reichardt 6715716701 Made sure there was a comment for every function 2022-01-26 21:22:54 -06:00
Justin Reichardt fbb39ff8e3 Checks old records if cannot download from online
Before giving up on a download entry, it will check the hosts file for a
previous record to continue using
2021-12-09 20:58:59 -06:00
Justin Reichardt f8a6a284c2 Remove rhosts temp file when completed 2021-12-09 18:09:51 -06:00
Justin Reichardt 17d3abc90a Corrected cfgparse return values
Accidentally changed the return value to not return anything ever
2021-12-09 18:06:23 -06:00
Justin Reichardt 1d3f426beb Gracefully exits on failure 2021-12-09 18:02:18 -06:00
Justin Reichardt 49612063d7 Added minimal support for daemon mode 2021-12-09 17:43:39 -06:00
Justin Reichardt b42829d904 Writes temp file to hosts file 2021-12-09 17:03:00 -06:00
Justin Reichardt f356390104 Adds sites to tmp file 2021-12-09 16:55:14 -06:00
Justin Reichardt 9eb4d9d543 Download saves to the same tmp file as everyone 2021-12-09 16:44:09 -06:00
Justin Reichardt 1f9d3faa8b Add a header and trailing new line to downloads
Header allows the reader to know where the additions came from and the
new line makes sure that 2 entries down get jumbled together
2021-12-09 16:37:55 -06:00
Justin Reichardt 6529fe49fd Copies the original content of hosts
Copies it to the tmp file to be copied back later
2021-12-09 16:28:30 -06:00
Justin Reichardt 99b17d68b0 Performs downloads to tmp directory 2021-12-09 16:08:57 -06:00
Justin Reichardt 12e774a3b4 Pass lists of downloads and sites
Main is now passed 2 arrays or strings: downloads and sites
2021-12-09 15:36:45 -06:00
Justin Reichardt 40c6572a81 Moved setting sys params to sysdetect
Cleans up the main function
2021-12-09 15:21:54 -06:00
Justin Reichardt ad1410410b Moved config parsing to a seperate function
This will allow for easier looping later on when this can be run as a
daemon
2021-12-09 15:12:44 -06:00
Justin Reichardt 154bd3dfe8 Parses config file
Parses the config file using cfgparseline
2021-12-09 15:02:58 -06:00
Justin Reichardt 8bfc224d5b Reads the cfg config file to stdout 2021-12-08 14:29:15 -06:00
Justin Reichardt 66ab1732bc Detects the running OS 2021-12-01 14:25:47 -06:00
Justin Reichardt 2a4c78c152 Changing language to go
It is being changed to go in order to practice the language before I
start another project.
2021-12-01 13:56:41 -06:00
Justin Reichardt a8677c97c9 Changed fgetc variables to int
fgetc used "char c" for all returns. Unfortunately this doesn't work for
all architectures. So an "int b" variable was created to recieve the
return before casting it into c.
2021-09-17 12:53:31 -05:00
Justin Reichardt d125a99347 Removed old makefile instructions from README 2021-09-17 11:59:41 -05:00
Justin Reichardt 5b26e00ae8 Installs program
Does not setup systemd
2021-09-17 11:46:00 -05:00
Justin Reichardt 3ce1982af6 Added config.h.in file
cmake generates a config file. It currently just shows the version.
rhosts now prints the version at start
2021-09-17 11:28:11 -05:00
Justin Reichardt f12ec08a46 Cmake links curl library to project 2021-09-17 11:00:27 -05:00
Justin Reichardt fe7d96e573 Removed openfile and closefile functions
They are not used and so were removed
2021-09-02 16:43:27 -05:00
Justin Reichardt be119d5922 Cleans Download
Currently removes comments and empty lines from downloaded file. Later
will verify contents, convert to ipv4 and ipv6, and remove duplicates
2021-09-02 15:17:49 -05:00
Justin Reichardt cf69948108 Updated requirements
Added gcc and splitrequirements into Linux (and eventually Windows and
Mac)
2021-09-02 14:04:49 -05:00
Justin Reichardt 58f1163623 Included how to use rhosts
This is just editing the config at the moment
2021-09-02 11:21:58 -05:00
Justin Reichardt 3893dc2bd9 Revert "Added libclogs"
libclogs had issues when the program was split into multiple files.
So it is being removed for now and will be readded later.
2021-09-02 10:38:59 -05:00
Justin Reichardt 954aa465d4 Changed -d to --debug
This was done for future daemon implimentation on Windows devices
2021-08-30 11:47:17 -05:00
Justin Reichardt 74c0f189a0 Log level is set to WARNING unless -d flag is used
-d flag now sets logging to debug
2021-08-30 11:46:02 -05:00
Justin Reichardt 0e431bec54 Finished adding every print to clogs 2021-08-30 10:55:24 -05:00
Justin Reichardt c286c78c1f Added libclogs
Added custom logging library
2021-08-30 10:44:18 -05:00
Justin Reichardt 98d1442a41 Removed excessive comments
The functions are fairly self explanatory, no need to comment on every
function
2021-08-28 14:15:44 -05:00
Justin Reichardt 128b20d857 Corrected the license notice
Turns out the program is not called Foobar. Forgot to replace one of the
Foobar entries.
2021-08-28 14:04:45 -05:00
Justin Reichardt a3607e7717 Improved the the Copyright
Changed the Licence file to Copying
Added license notices to the source files
2021-08-28 13:59:33 -05:00
Justin Reichardt 1f6dfc6d90 Changed reallocarray to realloc
Some of my other systems fail to find reallocarray
2021-08-27 15:53:58 -05:00
Justin Reichardt 50cdb303b9 Added download.c
Moved the download functions from rhosts to their own file
2021-08-27 10:10:08 -05:00