clarin-eric / fcs-sru-aggregator

CLARIN Federated Content Search v3 Aggregator – Augmenting your Search Engine
GNU General Public License v3.0
7 stars 2 forks source link

Make piwik setup configurable #62

Closed WillemElbers closed 1 year ago

WillemElbers commented 1 year ago

Currently piwik integration is always enabled and the siteID is hardcoded into https://github.com/clarin-eric/fcs-sru-aggregator/blob/develop-koerner/src/main/resources/assets/index.html.

It would be better if the piwik configuration is configurable via environment variables or a configuration file.

The folllowing fields should be configurable:

Ideally it should also be possible to "turn off" the piwik configuration as well, but a dirty workaround to set a non existing siteID (e.g. -1), might already achieve this.

An example where the index.html is template via mustache in dropwizard can be found in the SwitchBoard: https://github.com/clarin-eric/switchboard/blob/master/backend/src/main/java/eu/clarin/switchboard/resources/IndexView.java#L24

Querela commented 1 year ago

Should be implemented in https://github.com/clarin-eric/fcs-sru-aggregator/pull/51/commits/812ae0d10868cfac85315a1ff0130dea6dc2d32a. Still need to test variable substitution for configuration but plain YAML works. Required some refactoring of frontend assets (css) and how assets and jersey servlets are connected.

Querela commented 1 year ago

So, it works but is quite fragile (in regards to correctly configuring lists for setDomains). Some documentation now at https://github.com/clarin-eric/fcs-sru-aggregator/blob/develop-koerner/DEPLOYMENT.md#matomo-piwik-statistics-collection for how to correctly set those in a .env file.