Closed BatteredBunny closed 3 years ago
Yeah it does
This should not be the first to scrap.**
Ok, can you run ./tuxiqualitytest.sh -r and send the testoutputs file?
How can we test it, actually? Should we add a query in the tests files, even though showing the public IP can be a problem for some?
Huh. Good point. I could program it to show on the users screen and not write to testoutputs.txt, or, even better, I could make it all on the user side by comparing the output of the function to the output of https://api.ipify.org/, and if it fails, it would just output a fail message.
Google Search outputs two different types of public IP, I am getting IPV6 in Google and IPV4 in IPIFY. I think just showing if it got any numbers is enough.
Oh, I forgot I disabled IPV6 on my PC. That could work too. Or we could make sure what google pulled complies with the format of a IP address with some regex.
Well, yes, that will take more work but it's good, too*.
Regex is the best option
Change the priority of this, scrapping of IP should be at least the last one...
I can make a PR for testing the new IP feature
Not sure how to add IP test but here is the regex for matching IPV4/IPV6 that comes out of tuxi input
((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])))
..... wtf. Just what. I got it working for IPV4, but I'm terrible at regex so f*ck this. IPV6 is too complicated "Be sure to write it out in multiline mode and with a pile of comments so whoever is inevitably tasked with figuring out what this means doesn't come after you with a blunt object."
JK, I'm dumb. I made it work 20 dummy ipv4 and ipv6 addresses, should be good to go. @ayes-web I made a PR to ur main branch for the test file, merge it and try it out
#
Not sure how to add IP test but here is the regex for matching IPV4/IPV6 that comes out of tuxi input
((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}|(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])))
Also this wasnt necessary, i just made sure it followed the general syntax of a ipv4/6 addr, because what else could it possibly return
@ayes-web uhhhhhhhhhhhhhhhh can we not log the ip address to testoutputs? We like to send that file in these comments as proof that everything is working, and most of us would not like to leak our ip. I purposefully made it so that it would print out, but not log
@ayes-web uhhhhhhhhhhhhhhhh can we not log the ip address to testoutputs? We like to send that file in these comments as proof that everything is working, and most of us would not like to leak our ip. I purposefully made it so that it would print out, but not log
Ah sorry, thought it was just a mistake
nice, does it pass al the tests?