Merge pull request #153 from evolutionxbox/main

Use https in network checks. Thanks @evolutionxbox!
This commit is contained in:
Mentor Palokaj
2023-08-20 14:05:50 +02:00
committed by GitHub
2 changed files with 4 additions and 4 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 -I https://icanhazip.com &> /dev/null` ).then( () => true ).catch( () => false ),
exec_async( `${ path_fix } curl -I https://github.com &> /dev/null` ).then( () => true ).catch( () => false )
] )
log( `Internet online: ${ online }` )
@@ -221,4 +221,4 @@ module.exports = {
is_limiter_enabled,
get_battery_status,
uninstall_battery
}
}