From 6e278e5df52a536ba868c6f193f003ddb98254cc Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 12:26:15 +0300 Subject: [PATCH 1/7] config: Remove DEFAULT_WIFI_URL and DEFAULT_WIFI_SUBMIT_URL If wifi URL is not set in config, disable wifi, 3g and cdma sources. If wifi submission URL is not set in config, disable wifi submissions, i.e. set wifi/submit-data to false. Warn about missing WiFi locate and submit URLs only if the source or submission is enabled. --- src/gclue-config.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/gclue-config.c b/src/gclue-config.c index e04d6089..c6e89195 100644 --- a/src/gclue-config.c +++ b/src/gclue-config.c @@ -265,8 +265,6 @@ load_enable_source_config (GClueConfig *config, return enable; } -#define DEFAULT_WIFI_URL "https://location.services.mozilla.com/v1/geolocate?key=" MOZILLA_API_KEY -#define DEFAULT_WIFI_SUBMIT_URL "https://location.services.mozilla.com/v2/geosubmit?key=" MOZILLA_API_KEY #define DEFAULT_WIFI_SUBMIT_NICK "geoclue" static void @@ -291,11 +289,7 @@ load_wifi_config (GClueConfig *config, gboolean initial) if (error == NULL) { g_clear_pointer (&priv->wifi_url, g_free); priv->wifi_url = g_steal_pointer (&wifi_url); - } else if (initial) { - g_debug ("Using the default locate URL: %s", error->message); - g_clear_pointer (&priv->wifi_url, g_free); - priv->wifi_url = g_strdup (DEFAULT_WIFI_URL); - } else + } else if (priv->enable_wifi_source) g_warning ("Failed to get config \"wifi/url\": %s", error->message); g_clear_error (&error); @@ -323,11 +317,7 @@ load_wifi_config (GClueConfig *config, gboolean initial) if (error == NULL) { g_clear_pointer (&priv->wifi_submit_url, g_free); priv->wifi_submit_url = g_steal_pointer (&wifi_submit_url); - } else if (initial) { - g_debug ("Using the default submission URL: %s", error->message); - g_clear_pointer (&priv->wifi_submit_url, g_free); - priv->wifi_submit_url = g_strdup (DEFAULT_WIFI_SUBMIT_URL); - } else + } else if (priv->wifi_submit) g_warning ("Failed to get config \"wifi/submission-url\": %s", error->message); g_clear_error (&error); @@ -595,6 +585,16 @@ gclue_config_init (GClueConfig *config) load_config_file (config, path, FALSE); } out: + if (!config->priv->wifi_url + && (config->priv->enable_wifi_source || config->priv->enable_3g_source)) { + g_warning ("Wifi URL is not set, disabling wifi and 3g sources"); + config->priv->enable_wifi_source = FALSE; + config->priv->enable_3g_source = FALSE; + } + if (!config->priv->wifi_submit_url && config->priv->wifi_submit) { + g_warning ("Wifi submit URL is not set, disabling wifi submissions"); + config->priv->wifi_submit = FALSE; + } gclue_config_print (config); } -- GitLab From a9edf0bebf696e49f57fe412227b91371f42a949 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 15:34:55 +0300 Subject: [PATCH 2/7] config: Improve gclue_config_print() output Indent the sub-configuration of sources. Precede agent whitelist with 'Allowed agents:' instead of 'Agents:'. --- src/gclue-config.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gclue-config.c b/src/gclue-config.c index c6e89195..921ef6e7 100644 --- a/src/gclue-config.c +++ b/src/gclue-config.c @@ -490,14 +490,14 @@ gclue_config_print (GClueConfig *config) g_debug ("GeoClue configuration:"); if (config->priv->num_agents > 0) { - g_debug ("Agents:"); + g_debug ("Allowed agents:"); for (i = 0; i < config->priv->num_agents; i++) g_debug ("\t%s", config->priv->agents[i]); } else - g_debug ("Agents: none"); + g_debug ("Allowed agents: none"); g_debug ("Network NMEA source: %s", config->priv->enable_nmea_source? "enabled": "disabled"); - g_debug ("Network NMEA socket: %s", + g_debug ("\tNetwork NMEA socket: %s", config->priv->nmea_socket == NULL? "none": config->priv->nmea_socket); g_debug ("3G source: %s", config->priv->enable_3g_source? "enabled": "disabled"); @@ -508,14 +508,14 @@ gclue_config_print (GClueConfig *config) g_debug ("WiFi source: %s", config->priv->enable_wifi_source? "enabled": "disabled"); redacted_locate_url = redact_api_key (config->priv->wifi_url); - g_debug ("WiFi locate URL: %s", + g_debug ("\tWiFi locate URL: %s", redacted_locate_url == NULL ? "none" : redacted_locate_url); redacted_submit_url = redact_api_key (config->priv->wifi_submit_url); - g_debug ("WiFi submit URL: %s", + g_debug ("\tWiFi submit URL: %s", redacted_submit_url == NULL ? "none" : redacted_submit_url); - g_debug ("WiFi submit data: %s", + g_debug ("\tWiFi submit data: %s", config->priv->wifi_submit? "enabled": "disabled"); - g_debug ("WiFi submission nickname: %s", + g_debug ("\tWiFi submission nickname: %s", config->priv->wifi_submit_nick == NULL? "none": config->priv->wifi_submit_nick); g_debug ("Static source: %s", config->priv->enable_static_source? "enabled": "disabled"); -- GitLab From 68dd2f75697b330c9b2c80ddebd3b92b3054f143 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 12:30:21 +0300 Subject: [PATCH 3/7] meson: Remove mozilla-api-key option The wifi API key can be set directly in the wifi/url config key. --- meson.build | 1 - meson_options.txt | 3 --- 2 files changed, 4 deletions(-) diff --git a/meson.build b/meson.build index b175096a..086879fa 100644 --- a/meson.build +++ b/meson.build @@ -30,7 +30,6 @@ conf.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/geoclue/geo conf.set_quoted('TEST_SRCDIR', meson.project_source_root() + '/data/') conf.set_quoted('LOCALEDIR', localedir) conf.set_quoted('SYSCONFDIR', sysconfdir) -conf.set_quoted('MOZILLA_API_KEY', get_option('mozilla-api-key')) conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source')) conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source')) conf.set10('GCLUE_USE_MODEM_GPS_SOURCE', get_option('modem-gps-source')) diff --git a/meson_options.txt b/meson_options.txt index 5b8c42d2..946d7ead 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -40,6 +40,3 @@ option('systemd-system-unit-dir', option('dbus-srv-user', type: 'string', value: 'root', description: 'The user (existing) as which the service will run') -option('mozilla-api-key', - type: 'string', value: 'geoclue', - description: 'Your API key for Mozilla Location Service') -- GitLab From d8a344d3aa1989ab1888fc5fac7a46964c6082e4 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 15:03:53 +0300 Subject: [PATCH 4/7] README: Remove trailing whitespace --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index b4831575..5bad1ed7 100644 --- a/README.md +++ b/README.md @@ -25,49 +25,49 @@ your phone. For using phone GPS, you'll need to install the latest version of [GeoclueShare app](https://github.com/ankitstarski/GeoclueShare/releases) on your phone (currently, this is supported only on Android devices). -Geoclue was also used for (reverse-)geocoding but that functionality has -been dropped in favour of the +Geoclue was also used for (reverse-)geocoding but that functionality has +been dropped in favour of the [geocode-glib library](http://ftp.gnome.org/pub/GNOME/sources/geocode-glib/). # History -Geoclue was started during the GNOME Summit 2006 in Boston. At least -Keith Preston and Tuomas Kuosmanen can be blamed. There was a total rewrite +Geoclue was started during the GNOME Summit 2006 in Boston. At least +Keith Preston and Tuomas Kuosmanen can be blamed. There was a total rewrite after version 0.9. -There was yet another rewrite that we call geoclue2. The first version to +There was yet another rewrite that we call geoclue2. The first version to introduce the re-write was version 1.99. # Communication and Contribution -- Discussions take place on the +- Discussions take place on the [GNOME Discourse](https://discourse.gnome.org/c/platform). - The IRC chat for geoclue is on __#gnome-maps__ at irc.gimp.org . -- Issues are tracked on +- Issues are tracked on [Gitlab](https://gitlab.freedesktop.org/geoclue/geoclue/issues). # Get Source Code The source code is available as a tar-ball and in a Git repository. -For latest release tarballs, use the `Download` option of Gitlab on the +For latest release tarballs, use the `Download` option of Gitlab on the [tag of your choice](https://gitlab.freedesktop.org/geoclue/geoclue/tags/). -Older (than 2.4.13) releases are available +Older (than 2.4.13) releases are available [here](http://www.freedesktop.org/software/geoclue/releases/2.4/). Git repository for Geoclue: https://gitlab.freedesktop.org/geoclue/geoclue - + # Building Geoclue -The guidelines for building geoclue have been documented -[here](https://gitlab.freedesktop.org/geoclue/geoclue/blob/master/HACKING.md). +The guidelines for building geoclue have been documented +[here](https://gitlab.freedesktop.org/geoclue/geoclue/blob/master/HACKING.md). # Using Geoclue in an application - -- __D-Bus API__: The documentation for using geoclue with D-Bus API is + +- __D-Bus API__: The documentation for using geoclue with D-Bus API is [here](http://www.freedesktop.org/software/geoclue/docs/). -- __Libgeoclue API documentation__: The documentation is available +- __Libgeoclue API documentation__: The documentation is available [here](https://www.freedesktop.org/software/geoclue/docs/libgeoclue/). -- __C user application__: +- __C user application__: [Here](https://gitlab.freedesktop.org/geoclue/geoclue/blob/master/demo/where-am-i.c) -is an example showing a C application that uses -geoclue to locate its user. +is an example showing a C application that uses +geoclue to locate its user. -- GitLab From 7388e4ef1489b0cdf9c8d83c331ce0c3f6aa76b9 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 15:03:23 +0300 Subject: [PATCH 5/7] README: Add information about MLS retirement --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 5bad1ed7..1d638770 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ Geoclue comprises the following functionalities : - GeoIP (accuracy: city-level) - Static location source (reads location from a system-wide file) -WiFi-based geolocation makes use of -[Mozilla Location Service](https://wiki.mozilla.org/CloudServices/Location). +WiFi and cell tower-based geolocation used to use +[Mozilla Location Service](https://wiki.mozilla.org/CloudServices/Location), +which closed on June 12th, 2024. Geoclue currently does not enable WiFi location +by default, but various commercial services offering a similar location API +exist. -If geoclue is unable to find you, you can easily fix that by installing -and running a -[simple app](https://wiki.mozilla.org/CloudServices/Location#Contributing) on -your phone. For using phone GPS, you'll need to install the latest version of +For using phone GPS, you can install the latest version of [GeoclueShare app](https://github.com/ankitstarski/GeoclueShare/releases) on your phone (currently, this is supported only on Android devices). -- GitLab From e78e475a68e7ea4f6b7cf5a1d84bff9d1ec8f588 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 15:05:34 +0300 Subject: [PATCH 6/7] data: geoclue.conf.in: Remove Mozilla URLs --- data/geoclue.conf.in | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/data/geoclue.conf.in b/data/geoclue.conf.in index 9afb5e08..62ba28ce 100644 --- a/data/geoclue.conf.in +++ b/data/geoclue.conf.in @@ -47,12 +47,12 @@ enable=true # source will be used instead. enable=true -# URL to the WiFi geolocation service. If not set, defaults to Mozilla's -# Location Service with a hardcoded key. To use a custom key, uncomment this URL -# while changing YOUR_KEY to your MLS API key. -#url=https://location.services.mozilla.com/v1/geolocate?key=YOUR_KEY +# URL to a WiFi geolocation service compatible with the Ichnaea API +# (https://ichnaea.readthedocs.io/en/latest/api/geolocate.html). +# An API key can be set by using the 'key' URL parameter. +#url=https://example.com/v1/geolocate?key=YOUR_KEY -# To use the Google geolocation service instead of Mozilla's, uncomment this URL +# To use the Google geolocation service, uncomment this URL # while changing YOUR_KEY to your Google API key. # # WARNING: Please make sure that you are complying with the Google's ToS and @@ -62,8 +62,8 @@ enable=true # #url=https://www.googleapis.com/geolocation/v1/geolocate?key=YOUR_KEY -# Submit data to Mozilla Location Service -# If set to true, geoclue will automatically submit network data to Mozilla +# Submit data to WiFi geolocation service +# If set to true, geoclue will automatically submit network data # each time it gets a GPS lock. # # Currently, only Modem-GPS or Network NMEA sources are supported as providers @@ -74,10 +74,9 @@ enable=true # submit-data=false -# URL to submission API of Mozilla Location Service. If not set, defaults to -# Mozilla's API with a hardcoded key. To use a custom key, uncomment this URL -# while changing YOUR_KEY to your MLS API key. -#submission-url=https://location.services.mozilla.com/v2/geosubmit?key=YOUR_KEY +# URL to submit data to a WiFi geolocation service with an Ichnaea compatible API +# (https://ichnaea.readthedocs.io/en/latest/api/geosubmit2.html). +#submission-url=https://example.com/v2/geosubmit?key=YOUR_KEY # A nickname to submit network data with. A nickname must be 2-32 characters long. submission-nick=geoclue -- GitLab From 4c99cba1c029b9ea1444e529ffae13e1f0a6bd36 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Wed, 19 Jun 2024 15:25:38 +0300 Subject: [PATCH 7/7] data: geoclue.conf.in: Disable WiFi and 3g sources We do not have a replecement for the MLS database, so these sources do not work. --- data/geoclue.conf.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/geoclue.conf.in b/data/geoclue.conf.in index 62ba28ce..c6ecd2e2 100644 --- a/data/geoclue.conf.in +++ b/data/geoclue.conf.in @@ -25,7 +25,7 @@ enable=true [3g] # Enable 3G source -enable=true +enable=false # CDMA source configuration options [cdma] @@ -45,7 +45,7 @@ enable=true # Enable WiFi source # If this source and the static source below are both disabled a GeoIP-only # source will be used instead. -enable=true +enable=false # URL to a WiFi geolocation service compatible with the Ichnaea API # (https://ichnaea.readthedocs.io/en/latest/api/geolocate.html). -- GitLab