Checkpoint 3 is the final submission of your project.

Useful resources:

  1. Required CGI Environment Variables - Minimum you need to support for CGI. Biggest addition is a little parsing of the URI in requests.
  2. WSGI Wrapper for CGI - This is how you should wrap your Flask application that you copy-and-paste from the Flask website.
  3. CGI Example Code - C server-side example, Python client examples; note: it doesn't show sending of content via stdin etc.
  4. SSL Example Code - C server example, Python client example; note: you need to do way more SSL error handling
  5. Daemonizing C Code - helper daemonizing code
  6. Python SSL Prototype - Python web server demoing SSL socket wrapping in Python
  7. Python Certificates Documentation - simple de-magicifying SSL and certificates
  1. Begin with your repository and state of work from Checkpoint 2
  2. Daemonize your code using the provided code, and the passed in lock file commandline parameter. You may wish to disable daemonizing when debugging/developing.
  3. Create a DNS hostname for yourself with a free account at No-IP (or use a domain name you already have...)
  4. Add the 15-441 Carnegie Mellon University Root CA to your browser (import certificate, usually somewhere in preferences)
  5. Obtain your own private key and public certificate from the 15-441 CMU CA.
  6. Implement SSL server-side.
  7. Implement the Common Gateway Interface (CGI RFC, URI RFC)
  8. Implement a Python Flask Blog
  9. Submission is the same as Checkpoint 1. Tag and upload your repo in a tarball to the corresponding lab on autolab by 10/6 (cut off is midnight).

Installing Flask in a non-root environment:

  1. wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.6.4.tar.gz#md5=1072b66d53c24e019a8f1304ac9d9fc5
  2. tar xzf virtualenv-1.6.4.tar.gz
  3. cd virtualenv-1.6.4
  4. python virtualenv.py ~/flask_env
  5. cd ~/flask_env/
  6. source bin/activate.csh
  7. easy_install flask
  8. Make your main Python script include this virtualenv in its path like in this

The ordering of these is from easiest to hardest moving from Checkpoint 2 forward. It should be relatively straightforward to get HTTPS working. You just need to have a notion of a 'type' of socket and keep that straight within your select() loops. CGI is a bit more difficult. You need to learn how to set environment variables according to the CGI RFC 3875, and how to properly parse URIs according to RFC 2396 with passed in arguments. In addition, you need to handle multiple processes at once. Thus, a lot of work will need to be devoted to CGI. You will test your CGI with your Python blog. You are encouraged to add whatever features you'd like to your Python blog, just document them in your readme.txt.

Files we expect to see in your final submission: