Use https in network checks

Move from icanhasip.com to icanhazip.com (Cloudflare)
Use https in network checks using the `-k` flag
This commit is contained in:
Jonathan Cousins
2023-07-05 15:15:39 +01:00
parent 79df4af6b7
commit 912ca120dc
2 changed files with 3 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ Then reopen the app and things should work. If not, [open an issue](https://gith
This tool calls a number of urls, blocking all of them will only break auto-updates.
1. `unidentifiedanalytics.web.app` is a self-made app that tracks app installations, I use it to see if enough people use the app to justify spending time on it. It tracks only how many unique ip addresses open the app.
1. `icanhasip.com` is used to see if there is an internet connection
1. `icanhazip.com` is used to see if there is an internet connection
1. `github.com` is used both as a liveness check and as the source of updates for the underlying command-line utility
1. `electronjs.org` hosts the update server for the GUI

View File

@@ -120,8 +120,8 @@ const initialize_battery = async () => {
// Check for network
const online = await Promise.race( [
exec_async( `${ path_fix } curl icanhasip.com &> /dev/null` ).then( () => true ).catch( () => false ),
exec_async( `${ path_fix } curl github.com &> /dev/null` ).then( () => true ).catch( () => false )
exec_async( `${ path_fix } curl -k https://icanhazip.com &> /dev/null` ).then( () => true ).catch( () => false ),
exec_async( `${ path_fix } curl -k https://github.com &> /dev/null` ).then( () => true ).catch( () => false )
] )
log( `Internet online: ${ online }` )