An interactive catalog of accessibility devices on RIT's campus by maintenance status
This is a fork of TunnelVision
(Reach out to a maintainer of this repo for credentials for the dev database)
- Fork the repo and run the following commands in that directory:
- Install
uv(if you dont already have it installed) cp sample.env compose.env[podman or docker] compose up(this starts up the database and minio for S3)uv run python3 app.py(this runs the app in development mode)
- Create an auth0 tenant
- create an application (type: Regular Web Application)
- ensure the domain, client ID, and client secret are in the environment variables (see
sample.envfor the names to store these in) - generate a random secret value and store it in the
CPACCESS_SECRET_KEYvariable - Set up your callback and logout urls in the application settings of auth0 (default endpoints are
<your domain>/callbackand<your domain>/logout) - on the "API's" tab enable the auth0 management API
- drop down the management API and ensure at least
read:usersandread:rolesare selected - Run the app
- visit the
/loginpage. When prompted, sign up with whatever method you choose
This app optionally makes use of an OpenAI API key to provide admins with suggested first-pass alt-text for uploaded images.
To make this work:
- register for an API key from OpenAI (requires funding the account with at least $5).
- generate an API key. The minimal permissions you need if you choose a restricted key are
- list models: Read
- model capabilities: Request (this will set everything under this section. Making anything under here more granular breaks things)
- Files: read
- Provide the API key in the environment variables as
OPENAI_API_KEY - the "generate alt text" button on the edit page should now appear (note this replaces anything that was there before. Its recommended to only use it when theres no existing alt text)
This feature is designed to be very economical, In development, it took 9-10 queries to cost one cent in API credits.
This project uses SQLAlchemy to access a PostgresQL database. The DB schema is defined in db.py
This project also uses flask-migrate to allow for database schema revisions
to create a new revision:
uv run flask db revision --autogenerate -m "[message]"
to upgrade your schema:
uv run flask db upgrade
The docker compose config in this repository is intended to provide a small/simple suite of services for TunnelVision to rely on. This is for development and testing purposes.
To use this suite:
- create a file called
compose.envin the root of the repository. Use the following template to get started:
MINIO_ROOT_USER=
MINIO_ROOT_PASSWORD=
POSTGRES_USER=
POSTGRES_PASSWORD=
- fill in appropriate values
docker compose up- navigate to http://localhost:9001, log in with the root credentials for minio specified above, add create a bucket for TunnelVision
- while still in the minio console, navigate to "access keys" on the left and create an access key and secret for tunnelvision to use.
- Provide the the information to TunnelVision
- S3 url:
http://localhost:9000 - the s3 secret and key you generated
- S3 bucket name: whatever you created
- database host:
localhost - DB user and password: whatever you set in
compose.envfor postgres - DB name: should match the db user by default
- S3 url:
The app will assume you are using a proxy or some other tool to ensure the application is accessible via HTTPS (https urls are provided as callback and logout urls to auth0)