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

nixos/matomo: point path.geoip2 outside of the nix store. #100617

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@OlivierMarty
Copy link

@OlivierMarty OlivierMarty commented Oct 15, 2020

path.geoip2 pointed to the nix store which is read only. Matomo fails to
download geoip database. See #64759.

Motivation for this change

By default matomo config path.geoip2 points to the nix store. One can setup geolocalisation from the UI, but the download would fail because the nix store is read-only. See #64759.
This PR changes the path to point to the matomo state directory, allowing one to enable the matomo service and then configure the geolocalisation from the matomo UI without pain.

Note that there are already some efforts to build a geoip database (e.g. #73767), but matomo can also handle it for simpler set-ups.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@OlivierMarty OlivierMarty force-pushed the matomo branch 3 times, most recently from fb2e35d to eb28ca2 Oct 15, 2020
@ofborg ofborg bot requested review from florianjacob and Kiwi Oct 15, 2020
@OlivierMarty OlivierMarty changed the title nixos/matomo: point geoip outside of the nix store. nixos/matomo: point path.geoip2 outside of the nix store. Oct 15, 2020
sorki
sorki approved these changes Dec 29, 2020
Copy link
Member

@sorki sorki left a comment

I've tested this and it fixes the issue, downloads DBIP file correctly and can be enabled right after.

CC @Kiwi @florianjacob

@robertoschwald robertoschwald mentioned this pull request Feb 19, 2021
10 tasks
path.geoip2 pointed to the nix store which is read-only. Matomo was
failing to download a geoip2 database. See NixOS#64759.
@OlivierMarty
Copy link
Author

@OlivierMarty OlivierMarty commented Apr 28, 2021

@Kiwi @florianjacob could you maybe take a look? Thank you!

Copy link
Member

@ThibautMarty ThibautMarty left a comment

LGTM

This is needed when setting up geolocation from the UI, but also if one downloads GeoIP2 databases in /var/lib/matomo/misc (I do that with a custom systemd service but #121145 can certainly work too now).

@@ -164,6 +164,7 @@ in {
# Copy config folder
chmod g+s "${dataDir}"
cp -r "${cfg.package}/share/config" "${dataDir}/"
mkdir -p "${dataDir}/misc"
Copy link
Member

@ThibautMarty ThibautMarty Jun 16, 2021

Is this line needed ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants