[MediaWiki-commits] [Gerrit] Redirect metrics.wikimedia.org to Wikimetrics - change (operations/puppet)
Hello Ottomata, I'd like you to do a code review. Please visit https://gerrit.wikimedia.org/r/129660 to review the following change. Change subject: Redirect metrics.wikimedia.org to Wikimetrics .. Redirect metrics.wikimedia.org to Wikimetrics While the domain has been removed in 59eab3e4b248405d7a08dc3d7e5a35a7fa21d470, search engines and some old documentation still refer to it. So we redirect any requests to those domains to the replacement service “Wikimetrics”. Since the certificate for metrics.wikimedia.org has not been upgraded since the Heartbleed vulnerability, we cannot reuse the old certificate, and hence only redirect http traffic for now. Bug: 64276 Change-Id: I43f978ad3db8076951523a247a12a06a10a3f73e --- M manifests/misc/statistics.pp M manifests/role/statistics.pp A templates/apache/sites/metrics.wikimedia.org.erb 3 files changed, 79 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/60/129660/1 diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp index ba08915..02416b3 100644 --- a/manifests/misc/statistics.pp +++ b/manifests/misc/statistics.pp @@ -358,6 +358,41 @@ } } +# mertics.wikimedia.org and metrics-api.wikimedia.org +# They should just redirect to Wikimetrics +# +class misc::statistics::sites::metrics { +require misc::statistics::user + +$site_name = "metrics.wikimedia.org" +$redirect_target = "https://metrics.wmflabs.org/"; + +include webserver::apache +webserver::apache::module { "alias": } + +# install metrics.wikimedia.org SSL certificate +install_certificate{ $site_name: } + +# Set up the VirtualHost +file { "/etc/apache2/sites-available/$site_name": +content => template("apache/sites/${site_name}.erb"), +require => [Class["webserver::apache"], Webserver::Apache::Module['alias']], +notify => Class['webserver::apache::service'], +} +file { "/etc/apache2/sites-enabled/$site_name": +ensure => link, +target => "/etc/apache2/sites-available/${site_name}", +require => File["/etc/apache2/sites-available/${site_name}"], +notify => Class['webserver::apache::service'], +} + +# make access and error log for metrics-api readable by wikidev group +file { ["/var/log/apache2/access.metrics.log", "/var/log/apache2/error.metrics.log"]: +group => "wikidev", +require => File["/etc/apache2/sites-enabled/$site_name"], +} +} + # installs MonogDB class misc::statistics::db::mongo { include misc::statistics::base diff --git a/manifests/role/statistics.pp b/manifests/role/statistics.pp index 6f43742..c127434 100644 --- a/manifests/role/statistics.pp +++ b/manifests/role/statistics.pp @@ -42,6 +42,8 @@ misc::statistics::sites::stats, # community-analytics.wikimedia.org misc::statistics::sites::community_analytics, + # metrics.wikimedia,.org and metrics-api.wikimedia.org + misc::statistics::sites::metrics, # reportcard.wikimedia.org misc::statistics::sites::reportcard, # rsync public datasets from stat1003 hourly diff --git a/templates/apache/sites/metrics.wikimedia.org.erb b/templates/apache/sites/metrics.wikimedia.org.erb new file mode 100644 index 000..f1571db --- /dev/null +++ b/templates/apache/sites/metrics.wikimedia.org.erb @@ -0,0 +1,42 @@ +# Note: This file is managed by Puppet. +<% +# ERb template variables: +# +# site_name +# redirect_target +# +-%> + + + # metrics-api.wikimedia.org is deprecated. The services it provided + # are now available through Wikimetrics. + # + # We keep the domain around only because old documentation and + # search engines still refer to it. + + ServerName metrics-api.wikimedia.org + ServerAdmin n...@wikimedia.org + + Redirect permanent / <%= redirect_target %> + + ErrorLog /var/log/apache2/error.metrics.log + LogLevel warn + CustomLog /var/log/apache2/access.metrics.log combined + + + + # <%= site_name %> is deprecated. The services it provided + # are now available through Wikimetrics. + # + # We keep the domain around only because old documentation and + # search engines still refer to it. + + ServerName <%= site_name %> + ServerAdmin n...@wikimedia.org + + Redirect permanent / <%= redirect_target %> + + ErrorLog /var/log/apache2/error.metrics.log + LogLevel warn + CustomLog /var/log/apache2/access.metrics.log combined + -- To view, visit https://gerrit.wikimedia.org/r/129660 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43f978ad3db8076951523a247a12a06a10a3f73e Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: QChris Gerrit-Reviewer: Ottomata ___
[MediaWiki-commits] [Gerrit] Redirect metrics.wikimedia.org to Wikimetrics - change (operations/puppet)
Ottomata has submitted this change and it was merged. Change subject: Redirect metrics.wikimedia.org to Wikimetrics .. Redirect metrics.wikimedia.org to Wikimetrics While the domain has been removed in 59eab3e4b248405d7a08dc3d7e5a35a7fa21d470, search engines and some old documentation still refer to it. So we redirect any requests to those domains to the replacement service “Wikimetrics”. Since the certificate for metrics.wikimedia.org has not been upgraded since the Heartbleed vulnerability, we cannot reuse the old certificate, and hence only redirect http traffic for now. Bug: 64276 Change-Id: I43f978ad3db8076951523a247a12a06a10a3f73e --- M manifests/misc/statistics.pp M manifests/role/statistics.pp A templates/apache/sites/metrics.wikimedia.org.erb 3 files changed, 61 insertions(+), 0 deletions(-) Approvals: Ottomata: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/manifests/misc/statistics.pp b/manifests/misc/statistics.pp index ba08915..4dbe66a 100644 --- a/manifests/misc/statistics.pp +++ b/manifests/misc/statistics.pp @@ -358,6 +358,38 @@ } } +# mertics.wikimedia.org and metrics-api.wikimedia.org +# They should just redirect to Wikimetrics +# +class misc::statistics::sites::metrics { +require misc::statistics::user + +$site_name = "metrics.wikimedia.org" +$redirect_target = "https://metrics.wmflabs.org/"; + +include webserver::apache +webserver::apache::module { "alias": } + +# Set up the VirtualHost +file { "/etc/apache2/sites-available/$site_name": +content => template("apache/sites/${site_name}.erb"), +require => [Class["webserver::apache"], Webserver::Apache::Module['alias']], +notify => Class['webserver::apache::service'], +} +file { "/etc/apache2/sites-enabled/$site_name": +ensure => link, +target => "/etc/apache2/sites-available/${site_name}", +require => File["/etc/apache2/sites-available/${site_name}"], +notify => Class['webserver::apache::service'], +} + +# make access and error log for metrics-api readable by wikidev group +file { ["/var/log/apache2/access.metrics.log", "/var/log/apache2/error.metrics.log"]: +group => "wikidev", +require => File["/etc/apache2/sites-enabled/$site_name"], +} +} + # installs MonogDB class misc::statistics::db::mongo { include misc::statistics::base diff --git a/manifests/role/statistics.pp b/manifests/role/statistics.pp index 6f43742..c127434 100644 --- a/manifests/role/statistics.pp +++ b/manifests/role/statistics.pp @@ -42,6 +42,8 @@ misc::statistics::sites::stats, # community-analytics.wikimedia.org misc::statistics::sites::community_analytics, + # metrics.wikimedia,.org and metrics-api.wikimedia.org + misc::statistics::sites::metrics, # reportcard.wikimedia.org misc::statistics::sites::reportcard, # rsync public datasets from stat1003 hourly diff --git a/templates/apache/sites/metrics.wikimedia.org.erb b/templates/apache/sites/metrics.wikimedia.org.erb new file mode 100644 index 000..9bac6be --- /dev/null +++ b/templates/apache/sites/metrics.wikimedia.org.erb @@ -0,0 +1,27 @@ +# Note: This file is managed by Puppet. +<% +# ERb template variables: +# +# site_name +# redirect_target +# +-%> + + + # <%= @site_name %>, and metrics-api.wikimedia.org are + # deprecated. The services it provided are now available through + # Wikimetrics. + # + # We keep the domain around only because old documentation and + # search engines still refer to it. + + ServerName <%= @site_name %> + ServerAlias metrics-api.wikimedia.org + ServerAdmin n...@wikimedia.org + + Redirect permanent / <%= @redirect_target %> + + ErrorLog /var/log/apache2/error.metrics.log + LogLevel warn + CustomLog /var/log/apache2/access.metrics.log combined + -- To view, visit https://gerrit.wikimedia.org/r/129660 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43f978ad3db8076951523a247a12a06a10a3f73e Gerrit-PatchSet: 2 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: QChris Gerrit-Reviewer: Ottomata Gerrit-Reviewer: QChris Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits