Skip to content

grafana: proxy /api/live/ through using mod_proxy_websocket

apache needs a specific module to allow websockets to go through; enable that

Test Plan

tested in prod™ + octocatalog-diff:

I, [2021-12-16T11:55:33.397760 #934979]  INFO -- : Diffs computed for pergamon.softwareheritage.org
diff origin/production/pergamon.softwareheritage.org current/pergamon.softwareheritage.org
*******************************************
+ Apache::Mod[proxy_wstunnel] =>
   parameters =>
      "lib_path": "/usr/lib/apache2/modules"
      "package_ensure": "present"
*******************************************
  Apache::Vhost[grafana.softwareheritage.org_ssl] =>
   parameters =>
     proxy_pass =>
      - [{"path"=>"/", "url"=>"http://127.0.0.1:3000/"}]
      + [{"path"=>"/api/live/", "url"=>"ws://127.0.0.1:3000/api/live/", "reverse_urls"=>[]}, {"path"=>"/", "url"=>"http://127.0.0.1:3000/"}]
*******************************************
  Concat::Fragment[grafana.softwareheritage.org_ssl-proxy] =>
   parameters =>
     content =>
      @@ -3,4 +3,5 @@
         ProxyRequests Off
         ProxyPreserveHost Off
      +  ProxyPass /api/live/ ws://127.0.0.1:3000/api/live/
         ProxyPass / http://127.0.0.1:3000/
         ProxyPassReverse / http://127.0.0.1:3000/
*******************************************
  Concat_fragment[grafana.softwareheritage.org_ssl-proxy] =>
   parameters =>
     content =>
      @@ -3,4 +3,5 @@
         ProxyRequests Off
         ProxyPreserveHost Off
      +  ProxyPass /api/live/ ws://127.0.0.1:3000/api/live/
         ProxyPass / http://127.0.0.1:3000/
         ProxyPassReverse / http://127.0.0.1:3000/
*******************************************
+ File[/etc/apache2/mods-available/proxy_wstunnel.load] =>
   parameters =>
      "ensure": "file"
      "group": "root"
      "mode": "0644"
      "notify": "Class[Apache::Service]"
      "owner": "root"
      "content": >>>
LoadModule proxy_wstunnel_module /usr/lib/apache2/modules/mod_proxy_wstunnel.so
<<<
*******************************************
+ File[/etc/apache2/mods-enabled/proxy_wstunnel.load] =>
   parameters =>
      "ensure": "link"
      "group": "root"
      "mode": "0644"
      "notify": "Class[Apache::Service]"
      "owner": "root"
      "target": "/etc/apache2/mods-available/proxy_wstunnel.load"
*******************************************
*** End octocatalog-diff on pergamon.softwareheritage.org
*** Running octocatalog-diff on host tate.softwareheritage.org
I, [2021-12-16T11:55:38.448856 #935081]  INFO -- : Catalogs compiled for tate.softwareheritage.org
I, [2021-12-16T11:55:39.024590 #935081]  INFO -- : Diffs computed for tate.softwareheritage.org
I, [2021-12-16T11:55:39.024622 #935081]  INFO -- : No differences
*** End octocatalog-diff on tate.softwareheritage.org

Migrated from D6852 (view on Phabricator)

Merge request reports