Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Automatic location retrieval using geoclue2 #141

Merged
merged 6 commits into from
Jan 21, 2025
Merged

feat: Automatic location retrieval using geoclue2 #141

merged 6 commits into from
Jan 21, 2025

Conversation

bcyran
Copy link
Owner

@bcyran bcyran commented Jan 19, 2025

No description provided.

Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 21.78218% with 79 lines in your changes missing coverage. Please review.

Project coverage is 82.46%. Comparing base (0672c9e) to head (672a00c).
Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/geoclue.rs 0.00% 47 Missing ⚠️
src/actions.rs 29.03% 22 Missing ⚠️
src/config.rs 54.54% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #141      +/-   ##
==========================================
- Coverage   88.36%   82.46%   -5.91%     
==========================================
  Files          18       19       +1     
  Lines        1006     1089      +83     
==========================================
+ Hits          889      898       +9     
- Misses        117      191      +74     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bcyran bcyran linked an issue Jan 19, 2025 that may be closed by this pull request
@bcyran bcyran mentioned this pull request Jan 19, 2025
@RyanGibb
Copy link
Contributor

RyanGibb commented Jan 19, 2025

I can confirm that it works!

Geoclue wasn't working due to NixOS/nixpkgs#321121 (fixed by using https://beacondb.net/). I wasn't getting any error message explicitly saying geoclue had failed about this (with debug logs on) but maybe I should have with this bail? I also think it might be worth mentioning that you need to configure geoclue to allow timewall to connect with the id defined here. E.g. on NixOS I think it's:

    services.geoclue2.appConfig.timewall = {
      isAllowed = true;
      isSystem = false;
    };

@bcyran
Copy link
Owner Author

bcyran commented Jan 20, 2025

I wasn't getting any error message explicitly saying geoclue had failed

Did you use geoclue.preferred = true setting? I think that's the only case were this was silenced. Anyway, I overhauled both logs and errors related to that part. If fallback is successful then error is only debug logged. Otherwise the error message explicitly mentions that location couldn't be retrieved from both sources and includes the GeoClue failure reason.

it might be worth mentioning that you need to configure geoclue to allow timewall to connect

This is interesting because I actually didn't have to configure this (I'm on NixOS too). Still, I added this to the README, I guess this might depend on the environment.

@bcyran bcyran merged commit 0b1901a into master Jan 21, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic location
2 participants