|
1 | | -CSH Web Packet |
2 | | -============== |
| 1 | +# CSH Web Packet |
3 | 2 |
|
4 | 3 | [](https://www.python.org/downloads/release/python-360/) |
5 | 4 | [](https://travis-ci.org/ComputerScienceHouse/packet) |
6 | 5 |
|
7 | | -Web Packet is used by CSH to facilitate the evaluations of our members and keep track of packet signatures on the web |
| 6 | +Packet is used by CSH to facilitate the freshmen packet portion of our introductory member evaluation process. This is |
| 7 | +the second major iteration of packet on the web. The first was [Tal packet](https://github.com/TalCohen/CSHWebPacket). |
| 8 | + |
| 9 | +## Setup |
| 10 | +**Requires Python 3.6 or newer.** |
| 11 | + |
| 12 | +To get the server working you'll just need the Python dependencies and some secrets. There will be some UI issues due |
| 13 | +to missing assets though. To solve that you'll want to set up the front end dependencies or download a copy of the |
| 14 | +current assets from prod. |
| 15 | + |
| 16 | +Alternatively, you can set up a Docker container using `Dockerfile`. This is what's used in prod so it's the most |
| 17 | +reliable method. |
| 18 | + |
| 19 | +### Python dependencies |
| 20 | +Use `pip3 install -r requirements.txt` to install the required python dependencies. A |
| 21 | +[venv](https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments) is *highly* |
| 22 | +recommended. |
| 23 | + |
| 24 | +If 1 or more of the packages fail to install the likely issue is missing header files for the libraries with native C |
| 25 | +components. See the contents of `Dockerfile` for the Linux packages that you'll need. On windows it's a bit more of a |
| 26 | +pain. Try using [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) or finding a pre-compiled wheel from a |
| 27 | +trustworthy source. |
| 28 | + |
| 29 | +### Frontend dependencies |
| 30 | +*Devin please help.* |
| 31 | + |
| 32 | +### Secrets and configuration |
| 33 | +Packet supports 2 primary configuration methods: |
| 34 | +1. Environment variables - See `config.env.py` for the expected names and default values. |
| 35 | +2. Pyfile config - Create a `config.py` file in the root directory of the project and set variables to override the |
| 36 | +values in `config.env.py`. |
| 37 | + |
| 38 | +Both methods can be used at the same time, though Pyfile config will take priority over environment variables. |
| 39 | + |
| 40 | +**Required configuration values:** |
| 41 | +* `SQLALCHEMY_DATABASE_URI` - Must be set to a valid [SQLAlchemy DB URI](http://flask-sqlalchemy.pocoo.org/2.3/config/#connection-uri-format). |
| 42 | +A dev database for the project is hosted by CSH. Contact a current maintainer of packet for the details. |
| 43 | +* `LDAP_BIND_DN` - Must point to a valid CSH account on LDAP. Use the form |
| 44 | +`uid={username},cn=users,cn=accounts,dc=csh,dc=rit,dc=edu`. |
| 45 | +* `LDAP_BIND_PASS` - The password for that CSH account. |
| 46 | +* `SECRET_KEY` - Use a sufficiently long random string here. The `flask create-secret` command can generate a good one |
| 47 | +for you. |
| 48 | +* `OIDC_CLIENT_SECRET` - Required to use CSH auth. Contact a current maintainer of packet for the details. |
| 49 | + |
| 50 | +To switch between OIDC realms you'll need to set the modify the following values: |
| 51 | +* `OIDC_CLIENT_SECRET` - Unique to each realm. Again, contact a current maintainer of packet for the details. |
| 52 | +* `OIDC_ISSUER` - The OIDC issuer URL. |
| 53 | +* `REALM` - Set to `"csh"` or `"intro"` depending on the realm you want. |
| 54 | + |
| 55 | +By default `OIDC_ISSUER` and `REALM` are configured for the CSH members realm. |
8 | 56 |
|
9 | 57 | Authorization |
10 | 58 | ------------- |
|
0 commit comments