From d61b4253dfd310674e0a0e0b9aad79409546df4b Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Tue, 18 Sep 2018 22:09:01 +0200 Subject: [PATCH] Configure MATOMO from the environment We try to be a 12factor app right? :-) --- .gitignore | 1 - config/{piwik.yml.example => piwik.yml} | 25 +++++++++++-------------- dotenv.example | 14 +++++++++++--- 3 files changed, 22 insertions(+), 18 deletions(-) rename config/{piwik.yml.example => piwik.yml} (50%) diff --git a/.gitignore b/.gitignore index a9907eab..7455d57c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ config/application.rb config/config.yml config/secrets.yml -config/piwik.yml /vendor/cache /vendor/cache-old /storage/* diff --git a/config/piwik.yml.example b/config/piwik.yml similarity index 50% rename from config/piwik.yml.example rename to config/piwik.yml index f70e1f1e..9b92a97c 100644 --- a/config/piwik.yml.example +++ b/config/piwik.yml @@ -9,25 +9,22 @@ # id_site # The id of your website inside Piwik # + +default: &default + id_site: <%= ENV['OSEM_PIWIK_ID'] %> + url: <%= ENV['OSEM_PIWIK_URL'] %> + use_async: <%= ENV['OSEM_PIWIK_ASYNC'] || false %> + disabled: <%= ENV['OSEM_PIWIK_DISABLED'] || true %> + hostname: <%= ENV['OSEM_PIWIK_HOSTNAME'] || 'localhost' %> + production: piwik: - id_site: 1 - url: localhost - use_async: false - disabled: false + <<: *default development: piwik: - id_site: 1 - url: localhost - disabled: true - use_async: false - hostname: localhost + <<: *default test: piwik: - id_site: 1 - url: localhost - disabled: true - use_async: false - hostname: localhost + <<: *default diff --git a/dotenv.example b/dotenv.example index 2f98401f..facf09c6 100644 --- a/dotenv.example +++ b/dotenv.example @@ -70,9 +70,12 @@ # STRIPE_PUBLISHABLE_KEY=1234 # STRIPE_SECRET_KEY=5678 -# Disable linting of factories in the test suite. -# Speeds up turn around times of tests -# OSEM_FACTORY_LINT=false +# MATOMO/PIWIK CONFIGURATION +# OSEM_PIWIK_ID=12345 +# OSEM_PIWIK_URL=localhost +# OSEM_PIWIK_ASYNC=false +# OSEM_PIWIK_DISABLED=true +# OSEM_PIWIK_HOSTNAME=localhost # The smtp configuration. See the rails guides for more # http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration @@ -104,3 +107,8 @@ # Your skylight.io keys # SKYLIGHT_AUTHENTICATION=1234 # SKYLIGHT_PUBLIC_DASHBOARD_URL='https://oss.skylight.io/app/applications/xxxxxxxxxxxx' + +# Disable linting of factories in the test suite. +# Speeds up turn around times of tests +# OSEM_FACTORY_LINT=false +