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

Matomo archive processing service #47747

Merged

Conversation

florianjacob
Copy link
Contributor

Automatically sets up periodic archiving, allowing to disable browser-based archive processing.
Depends on merging #47691 first.

Motivation for this change

Reliable archive processing allows to regularily delete old visitor logs wile keeping the aggregated reports, which is helpful when implementing GDPR while stil having some history. Also reduces your database size.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

@florianjacob
Copy link
Contributor Author

Seems like I had a bad English day. o.0 @c0bw3b thank you for not letting that slip through! 👍
Should be all corrected / improved now, and Matomo is now capitalized consistently instead of about 50% of the time.

nixos/modules/services/web-apps/matomo.nix Outdated Show resolved Hide resolved
nixos/modules/services/web-apps/matomo.nix Outdated Show resolved Hide resolved
systemd.timers."matomo-archive-processing" = mkIf cfg.periodicArchiveProcessing {
description = "Automatically archive Matomo reports every hour";

wantedBy = [ "timers.target" ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always thought a partOf = [ "matomo-archive-processing.service" ]; was needed too, but I guess not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for the basic connection of timer and service, if there is a service of the same name as the timer, it will activate it automatically.

For each timer file, a matching unit file must exist, describing the unit to activate when the timer elapses. By default, a service by the same name as the timer (except for the suffix) is activated.

man systemd.timer

I can only guess that a partOf is used when a manual activation of the service should count as an activation in the timer's schedule or something like that. But as the service is fine with being startet at arbitrary intervals, that's fine in this case. Is there any other reason for partOf with timers? 🤔

@florianjacob florianjacob force-pushed the matomo-archive-processing-service branch 3 times, most recently from 7f7a5bc to 82436f8 Compare December 4, 2018 11:38
to make it consistent with other NixOS systemd services and `matomo-archive-processing.service`.
Also, consistently spell Matomo with capital M.
@florianjacob florianjacob force-pushed the matomo-archive-processing-service branch from 82436f8 to 959ba6f Compare December 9, 2018 13:42
@florianjacob
Copy link
Contributor Author

Just noticed this is still lying around,
@infinisil friendly reminder, could I address your concerns?
Do you have time to look at this again, or should I search for another reviewer?

@infinisil infinisil merged commit c844883 into NixOS:master Feb 14, 2019
@infinisil
Copy link
Member

All good, thanks for the PR :)

@florianjacob florianjacob deleted the matomo-archive-processing-service branch February 14, 2019 20:07
@florianjacob
Copy link
Contributor Author

@infinisil thanks for your time! :)

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

Successfully merging this pull request may close these issues.

None yet

4 participants