srobo / ansible

Ansible configuration for Student Robotics' pet machines
MIT License
0 stars 4 forks source link

Make the competition homepage mode configurable #14

Closed PeterJCLaw closed 2 years ago

PeterJCLaw commented 2 years ago

Summary

Replaces the previous approach of un/commenting the code to change the behaviour with a configuration switch.

Code review

Compare for example https://github.com/srobo/website/pull/271 as the way we used to do this.

Testing

TASK [srobo-nginx : Copy our configuration] ***********************************
--- before: /etc/nginx/nginx.conf
+++ after: /tmp/ansible-local-.../nginx.conf
@@ -109,20 +109,8 @@
     }

     # During the competition we un-comment this block to override the homepage
-    # with the comeptition-specific one
-    # location = / {
-    #   proxy_pass       https://srobo.github.io/competition-website/comp/;
-    #   proxy_set_header Host srobo.github.io;
-    #
-    #   sub_filter "/competition-website/comp/" "/comp/";
-    #   sub_filter_once off;
-    #   sub_filter_last_modified on;
-    #   # Tell GitHub that we want these pages to be sent to us uncompressed
-    #   # otherwise the sub_filter above doesn't work. We'll compress it on the
-    #   # way out anyway, so clients don't lose anything by us doing this.
-    #   proxy_set_header Accept-Encoding "";
-    # }
-    # Provide access to the competition pages under the normal prefix
+    # with the competition-specific one
+        # Provide access to the competition pages under the normal prefix
     location /comp/ {
       proxy_pass       https://srobo.github.io/competition-website/comp/;
       proxy_set_header Host srobo.github.io;

changed: [monty.studentrobotics.org]

(yes there's some odd whitespace here, I tried fixing but it's not trivial and seems unlikely to be worth spending much time on)

Links

Relates to https://github.com/srobo/tasks/issues/792.