mirror of
https://github.com/actuallymentor/battery.git
synced 2026-02-03 14:03:24 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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 }` )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user