Closed RobRuana closed 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.
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
Okay, I just did this using NGINX: https://github.com/magfest/ubersystem-puppet/pull/173
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 😅).