A Flask server for implementing temporary and permanent redirects of various MoFo hostnames.
Перейти к файлу
Rob DiVincenzo 2ad6119047
Merge pull request #53 from mozilla/aidatabase-redirect
Redirect for aidatabase
2024-10-02 08:42:18 -04:00
.github/workflows
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
Procfile
README.md
app.py
config.py do not preserve path and query 2024-10-01 17:26:41 -04:00
default.env
dev-requirements.in
dev-requirements.txt
requirements.in
requirements.txt
runtime.txt
test_app.py
tox.ini

README.md

MoFo-Redirector

Build Status

The MoFo-Redirector is a small Flask application that serves to redirect deprecated and unused MoFo Domains.

The domains served by the redirect are defined as Tuples in config.py:

('example.com', 'https://foundation.mozilla.org', 301)

The first value is the Host header value to match in an incoming request. The second is the target of the redirect. The third value is the redirect code to use.

How to setup local dev

  • Create a virtualenv: python -m venv venv. Activate it.
  • Install pip-tools: pip install pip-tools.
  • Install python dependencies by running pip-sync requirements.txt dev-requirements.txt.
  • Run the tests with pytest.

How to add a new redirect

  • Create a PR (instructions in config.py),
  • Wait for review and merge,
  • Detach the domain from current heroku app, attach it to mofo-redirector,
  • in Route53 update the Hosted Zone record for redirected domain to point to the redirector heroku app.