magfest-archive / guests

Magfest band management plugin for ubersystem
GNU Affero General Public License v3.0
1 stars 1 forks source link

Need to alias all the "guests" URLs to the old "bands" URLs #100

Closed RobRuana closed 7 years ago

RobRuana commented 7 years ago

At the very least we need to set up aliases or redirects for any URLs we've disseminated publicly BEFORE we push the guests plugin changes to production super2017.

We could do this in NGINX or in the guests plugin itself. My preference would be to set up aliases in the uber code (just because I don't really like futzing with the NGINX config 😅).

thaeli commented 7 years ago

Please do this in NGINX. Events that didn't send out emails with the band URLs don't need the redirects, and the redirects certainly don't need to be a quasi-permanent fixture in the codebase.

binary1230 commented 7 years ago

You could probably implement this pretty easily with something like the following:

Setup a global variable in https://github.com/magfest/ubersystem/blob/master/uber/server.py called something like static_view_aliases = {}

In the guests plugin, set that var before we startup Cherrypy (i.e. just in the global scope in the plugin's config.py or something) something like this:

static_view_aliases['/bands/'] = '/guests/'

Then in here before we search for the template, try to pattern match the incoming requested URL, and if there's a match, just replace the string before we try and access the template file on disk https://github.com/magfest/ubersystem/blob/master/uber/server.py#L65

RobRuana commented 7 years ago

Okay, I just did this using NGINX: https://github.com/magfest/ubersystem-puppet/pull/173