Skip to content
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
54a9514
has been annoying me for a while
mroley1 Apr 14, 2024
76f193c
Added line to major project form
Mobmaker55 Aug 31, 2024
a20bfe3
Added rows to the form so I'm testing it
Mobmaker55 Sep 2, 2024
7aae71e
More parts of form
Mobmaker55 Sep 2, 2024
fbfbbb9
Make text larger hopefully
Mobmaker55 Sep 4, 2024
eb8531f
changed font size
Mobmaker55 Sep 4, 2024
7a6d743
push styles
Mobmaker55 Sep 4, 2024
342578d
fixed build issue
Mobmaker55 Sep 4, 2024
3ded9cf
run npm install
Mobmaker55 Sep 4, 2024
bbd97e9
Added dropzone (but it isnt functioning yet)
Mobmaker55 Sep 4, 2024
d0b566a
edited upload form
Mobmaker55 Sep 4, 2024
d736f2f
edited photo
Mobmaker55 Sep 4, 2024
5a1bac7
form stylistically done
Mobmaker55 Sep 4, 2024
d14312f
dropzone should work
Mobmaker55 Sep 5, 2024
fbfc959
Dropzone.js
Mobmaker55 Sep 5, 2024
9adfbd8
dropzone doesn't like me
Mobmaker55 Sep 5, 2024
adf5e5d
conditional/templates/major_project_submission.html
Mobmaker55 Sep 5, 2024
1aefd4c
I don't know what commands do what
Mobmaker55 Sep 5, 2024
d5f968b
S3 support added
Mobmaker55 Sep 6, 2024
73d0449
debug
Mobmaker55 Sep 6, 2024
7a69ff7
ImmutableMultiDict is not a dict. changed accordingly?
Mobmaker55 Sep 6, 2024
921b8b4
You need to wrap keys in a list to read its length
Mobmaker55 Sep 6, 2024
c0b9c48
You need to wrap keys in a list to read its length
Mobmaker55 Sep 6, 2024
d6daa64
debug 2
Mobmaker55 Sep 6, 2024
29e1fcd
more debug
Mobmaker55 Sep 6, 2024
fc12aa2
should be able to obtain files now
Mobmaker55 Sep 6, 2024
2f42078
whoever designed this confuses me immensely
Mobmaker55 Sep 6, 2024
b9a2f33
s3 endpoint added
Mobmaker55 Sep 6, 2024
b73a8b9
os file debug
Mobmaker55 Sep 6, 2024
b78f86a
99% sure it will upload to the bucket now
Mobmaker55 Sep 6, 2024
788b8f1
remove files from tmp
Mobmaker55 Sep 6, 2024
d497097
Semantic rewording
Mobmaker55 Sep 8, 2024
9d87795
Start of tag skills, more backend updates
Mobmaker55 Sep 14, 2024
02d8a5d
db migration 1
Mobmaker55 Sep 15, 2024
94ee197
added v1 skill tagger
Mobmaker55 Sep 15, 2024
f2825ee
fixed? issue
Mobmaker55 Sep 15, 2024
60074cf
javascript before is odd
Mobmaker55 Sep 15, 2024
62d6d48
styling
Mobmaker55 Sep 15, 2024
7c9f8cf
css fixes and js fixes to tags
Mobmaker55 Sep 15, 2024
180d658
no border radius
Mobmaker55 Sep 15, 2024
b9402cb
fix more tags bugs
Mobmaker55 Sep 15, 2024
8ad332c
keypress instead of keydown
Mobmaker55 Sep 15, 2024
00c4445
added a how-to-use
Mobmaker55 Sep 15, 2024
74e0511
make delete tag work
Mobmaker55 Sep 15, 2024
860b50f
test skills
Mobmaker55 Sep 15, 2024
4a6c291
debug
Mobmaker55 Sep 15, 2024
7713bb5
debug 2
Mobmaker55 Sep 15, 2024
d41f64d
javascript HTMLElement collection confusing
Mobmaker55 Sep 15, 2024
8fea3ca
Update requirements.txt
Qelxiros Sep 21, 2024
1529cf0
Revert "Update requirements.txt"
cecilialau6776 Nov 18, 2024
fbdd139
Update dependency versions (#393)
pikachu0542 Mar 31, 2025
d3a0280
Updated wrapt, downgraded ddtrace, fixed the ddtrace problems (#395)
pikachu0542 Apr 4, 2025
c54f351
packet glue
Qelxiros Sep 9, 2025
f936afd
Merge pull request #396 from Qelxiros/packet-glue
costowell Sep 9, 2025
baf42df
packet glue but again (#397)
Qelxiros Sep 9, 2025
e12ddb8
packet glue but even more
Qelxiros Sep 9, 2025
416bc10
Merge pull request #398 from Qelxiros/packet-glue
costowell Sep 9, 2025
55ea7f8
packet glue but even more (#399)
Qelxiros Sep 9, 2025
49c7bab
packet glue but again (navbar yippee) (#400)
Qelxiros Sep 9, 2025
4fe950f
glue (#401)
Qelxiros Sep 10, 2025
e59a839
glue
Qelxiros Sep 10, 2025
0fc55d5
Merge pull request #402 from Qelxiros/packet-glue
costowell Sep 10, 2025
736d203
migration, url fixes (#403)
Qelxiros Sep 13, 2025
ee6fc41
packet glue (#404)
Qelxiros Sep 16, 2025
a904044
chom (#405)
Qelxiros Sep 16, 2025
8a6b501
chom (#406)
Qelxiros Sep 16, 2025
2b4bc44
packet glue (#407)
Qelxiros Sep 16, 2025
25d43f2
gatekeep
shaeespring Oct 6, 2025
b9cb4fc
voting status on dashboard
shaeespring Oct 11, 2025
e7617e8
adding more return information for vote to use
shaeespring Oct 12, 2025
da6c87d
revert Jeremy's attempt to merge packet into conditional (#409)
costowell Oct 12, 2025
70110fb
Merge pull request #389 from mroley1/develop
pikachu0542 Oct 14, 2025
5dc992c
fix readability in dashboard
shaeespring Oct 14, 2025
2e140fe
account for semesters
shaeespring Oct 15, 2025
af307ee
remove frosh from voting lists if they don't have requirements after …
shaeespring Oct 15, 2025
b8fd20c
Revert @tallen42's work on the major project form (#410)
Qelxiros Oct 18, 2025
8342957
Merge pull request #408 from shaeespring/feature/vote_role
goosenotduck Oct 20, 2025
17b0773
Fix errors missed in #408 (#411)
goosenotduck Oct 20, 2025
e636482
move status for gatekeep response to route
BigSpaceships Oct 21, 2025
888b082
fix me being dumb :)
BigSpaceships Oct 21, 2025
b48db4f
fix 500 error when requesting gatekeep for a user that doesn't exist
BigSpaceships Oct 21, 2025
46ea5d2
Merge pull request #419 from ComputerScienceHouse/refactor-for-418
BigSpaceships Oct 21, 2025
81660ee
Fixed merge conflict
pikachu0542 Oct 21, 2025
66bceec
Merge pull request #420 from ComputerScienceHouse/fix-merge-conflict
goosenotduck Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
python-version: [3.8, 3.9]
python-version: [3.12]

steps:
- name: Install ldap dependencies
Expand Down
8 changes: 1 addition & 7 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ disable =
duplicate-code,
no-member,
parse-error,
bad-continuation,
too-few-public-methods,
global-statement,
cyclic-import,
Expand All @@ -18,14 +17,11 @@ disable =

[REPORTS]
output-format = text
files-output = no
reports = no

[FORMAT]
max-line-length = 120
max-statement-lines = 75
single-line-if-stmt = no
no-space-check = trailing-comma,dict-separator
max-module-lines = 1000
indent-string = ' '

Expand Down Expand Up @@ -73,8 +69,6 @@ good-names=logger,id,ID
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata

# List of builtins function names that should not be used, separated by a comma
bad-functions=apply,input


[DESIGN]
Expand All @@ -90,4 +84,4 @@ min-public-methods = 2
max-public-methods = 20

[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = builtins.Exception
24 changes: 14 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM docker.io/python:3.8-buster
MAINTAINER Devin Matte <matted@csh.rit.edu>
FROM docker.io/python:3.12-bookworm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.12-bookworm is a pretty big image has has a lot of vulns, could a slim image be used here(10x smaller)?
https://hub.docker.com/_/python/tags?name=3.12

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is a good idea, but I feel like that change is out of scope of this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 definitely out of scope

MAINTAINER Computer Science House <webmaster@csh.rit.edu>

RUN mkdir /opt/conditional

Expand All @@ -8,19 +8,23 @@ ADD requirements.txt /opt/conditional
WORKDIR /opt/conditional

RUN apt-get -yq update && \
apt-get -yq install libsasl2-dev libldap2-dev libssl-dev gcc g++ make && \
apt-get -yq install libsasl2-dev libldap2-dev libldap-common libssl-dev gcc g++ make && \
pip install -r requirements.txt && \
apt-get -yq clean all

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION v10.24.1
RUN mkdir -p $NVM_DIR

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION"

ADD . /opt/conditional

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - && \
apt-get -yq update && \
apt-get -yq install nodejs && \
npm install && \
npm run production && \
rm -rf node_modules && \
apt-get -yq remove nodejs npm && \
RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm use --delete-prefix $NODE_VERSION && npm install && npm run production"

RUN rm -rf node_modules && \
apt-get -yq clean all

RUN ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
Expand Down
30 changes: 23 additions & 7 deletions conditional/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

import structlog
from csh_ldap import CSHLDAP
from flask import Flask, redirect, render_template, g
from flask import Flask, redirect, render_template, request, g
from flask_migrate import Migrate
from flask_gzip import Gzip
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
from flask_sqlalchemy import SQLAlchemy

import sentry_sdk
Expand Down Expand Up @@ -39,8 +40,10 @@
app.config['LDAP_BIND_PW'],
ro=app.config['LDAP_RO'])

auth = OIDCAuthentication(app, issuer=app.config["OIDC_ISSUER"],
client_registration_info=app.config["OIDC_CLIENT_CONFIG"])
client_metadata = ClientMetadata(app.config["OIDC_CLIENT_CONFIG"])
provider_config = ProviderConfiguration(issuer=app.config["OIDC_ISSUER"], client_registration_info=client_metadata)

auth = OIDCAuthentication({'default': provider_config}, app)

app.secret_key = app.config["SECRET_KEY"]

Expand All @@ -55,7 +58,6 @@ def start_of_year():
# pylint: disable=C0413
from .models.models import UserLog


# Configure Logging
def request_processor(logger, log_method, event_dict): # pylint: disable=unused-argument, redefined-outer-name
if 'request' in event_dict:
Expand Down Expand Up @@ -99,6 +101,7 @@ def database_processor(logger, log_method, event_dict): # pylint: disable=unuse
# pylint: disable=wrong-import-order
from conditional.util import context_processors
from conditional.util.auth import get_user
from conditional.util.member import gatekeep_status
from .blueprints.dashboard import dashboard_bp # pylint: disable=ungrouped-imports
from .blueprints.attendance import attendance_bp
from .blueprints.major_project_submission import major_project_bp
Expand Down Expand Up @@ -137,7 +140,7 @@ def static_proxy(path):


@app.route('/')
@auth.oidc_auth
@auth.oidc_auth("default")
def default_route():
return redirect('/dashboard')

Expand All @@ -156,12 +159,25 @@ def health():
return {'status': 'ok'}


@app.route("/gatekeep/<username>")
def gatekeep(username):
token = request.headers.get("X-VOTE-TOKEN", "")
if token != app.config["VOTE_TOKEN"]:
return "Users cannot access this page", 403
try:
gatekeep_data = gatekeep_status(username)
except KeyError:
return "", 404

return gatekeep_data, 200


@app.errorhandler(404)
@app.errorhandler(500)
@auth.oidc_auth
@auth.oidc_auth("default")
@get_user
def route_errors(error, user_dict=None):
data = dict()
data = {}

# Handle the case where the header isn't present
if user_dict['username'] is not None:
Expand Down
Loading