5ecea55f55ab527ba8e0c7c14a45ac26b44c26d6
Les quatre jobs existaient ; aucun ne verifiait ce qu'il annoncait.
security-audit
`pip-audit --require-hashes --no-deps || pip-audit`. L'etape
d'installation ne posait que pip-audit, et aucune des deux formes ne
nommait le fichier d'exigences : le repli auditait l'environnement du
runner, qui ne contenait que pip-audit lui-meme. Le job passait au vert
sans avoir examine une seule dependance de l'application. Remplace par
`pip-audit -r requirements.txt`.
security-scan
Appelait `python security_scan.py`, alors que le fichier se trouve dans
app/supporting_scripts/. En echec a chaque execution depuis le
deplacement du fichier. Trois autres defauts sont apparus en le faisant
tourner :
- la CI passe --skip-http, un argument que l'argparse du script
n'acceptait pas : sortie en erreur 2 meme avec le bon chemin.
- check_dependencies lisait data['dependencies'] comme la liste des
vulnerabilites. Ce tableau liste en realite TOUTES les dependances,
chacune portant un champ vulns vide si le paquet est sain. Les ~45
paquets installes etaient donc signales vulnerables a chaque
execution. Le filtrage se fait desormais sur vulns non vide.
- check_flask_config interceptait son exception et renvoyait quand
meme all_ok : ne pas reussir a charger l'application comptait comme
un controle reussi. La section la plus importante du rapport n'avait
jamais tourne. Elle renvoie desormais False, et l'import fonctionne
grace a l'ajout de la racine du projet dans sys.path.
- la banniere en caracteres semi-graphiques faisait planter le script
sur une console Windows en cp1252, la plateforme meme du projet.
Passee en ASCII.
lint
Ruff n'avait aucun fichier de configuration : le job tournait sur le jeu
de regles par defaut. La configuration vit maintenant dans pyproject.toml.
`ruff format --check` est retire pour l'instant : la base n'ayant jamais
ete formatee, il echouerait sur 62 fichiers sur 64 pour des raisons
etrangeres a la correction. Reformatage puis application : QUA-002.
test
Un `echo` protege par continue-on-error : le job annoncait un succes
sans rien executer. Il lance desormais pytest avec couverture, et bloque.
permissions: contents: read au niveau du workflow, aucune etape n'ecrivant
dans le depot.
Deploiement Gitea
actions/checkout@v7 n'existe pas (derniere majeure : v5) : le workflow
echouait des sa premiere etape. Ramene a v4.
Le miroir lftp poussait l'integralite de l'arbre de travail, dont
clear_db.py -- un script qui vide toutes les tables et recree
admin/password -- vers le noeud de production. Liste d'exclusions ajoutee.
--delete reste volontairement absent : les contrats televerses, les
journaux et le .env du serveur vivent sous la racine de deploiement et
sont absents du depot ; les supprimer detruirait des donnees.
Le workflow de deploiement n'a pas pu etre execute depuis ici : la
syntaxe lftp reste a valider lors du prochain deploiement manuel.
Co-Authored-By: Claude Opus 5 <[email protected]>
Plateforme centralisée de tryouts
Security Configuration
Required Environment Variables
Before deploying, create a .env file which integrates everything in the .env.exemple.
Ensure you follow the comments of the exemple if you are to use this tool in production.
Security Features Implemented
- Rate Limiting: Login endpoint limited to 10 requests per minute to prevent brute-force attacks
- Secure Session Cookies: HTTPSOnly, SameSite=Lax, and Secure flags enabled
- CSRF Protection: Enabled by default on all forms
- HTTPS Enforcement: Automatic redirect to HTTPS in production
- Security Headers: X-Frame-Options, X-Content-Type-Options, Content-Security-Policy, HSTS
- Open Redirect Prevention: URL validation on login redirect
- Authorization Checks: Proper ownership validation on all sensitive operations
- nginx: reverse-proxy and load balancer
- Waitress WSGI: Production ready WSGI
When true in .env:
- Forces HTTPS only
- Forcer secure cookies
App details
Code
- Full python backend using flask
- statics are pure HTML and CSS
- Some js to add logic to styling and showing certain pages/cards
Functionalities
- User base with sign-ins: Forces users to create an account and register pertinent information for tryouts and teams. The admin can attribute them a role.
- User-Role-Based Permissions: admin - full acces, coach/manager - access to team management, player - views what he is registered in (no management), scout - view only
- Tryout Management: manage internal tryout teams, organise internal tryouts matches (3 formats, team vs team, PvP, scrim). Coaches can Evaluate players based on 10 criteria
- Team Management: manage teams for the season, create matches and practices. When planning a practice there will be a calendar showing player availabitlities slots to help chose a time
- Coach and Player Availabilities: Allow better planning for the coaches, and for players to book One on Ones with their coach.
- Player Notes: Coaches can give notes to their players. The players will see them and there is a history which keeps the most recent notes.
- Team Notes: Coaches can give notes to their teams, where all players from that team can see the note.
- One on One: Players can request a One on One meeting with their coach. This sends a discord dm to the coach to accept or refuse. The player is then notified of the response.
- Availabilities: Allow players and coach to enter the moments they are available. Allows for easier practice setup and One on One planning.
Discord Integration
The application supports sending Discord direct messages to coaches when players request One on One sessions, when matches/tryouts/practices are created and a player is in it, and the players get match reminders 24h before a match.
When sending a One on One request, the coach can accept via the platform or react to the discord message to answer the booking request. Same thing with matches and practices, the players can react or answer on the platform.
Setup Instructions
1. Create a Discord Bot (Not needed for UdeS user, the bot already exists)
- Go to the Discord Developer Portal
- Create a new application
- Go to the "Bot" tab and create a bot user
- Copy the bot token - this will be your
DISCORD_BOT_TOKEN - Enable the "Message Content Intent" under Privileged Gateway Intents (required for sending messages)
2. Add Bot to your server
For the bot to send DMs:
- Each user must have the bot added to their Discord server OR be friends with the bot
- Users need to add their Discord User ID to their profile:
- Enable Developer Mode in Discord (User Settings → Advanced → Developer Mode)
- Right-click on their profile → Copy ID
- Enter this numeric ID in the "Discord User ID" field in their profile settings
How It Works
When a player submits a One on One request:
- The system checks if the coach has a Discord User ID configured
- If configured, a direct message is sent to the coach via the Discord bot
Message Format
The Discord DM includes:
- Player name
- Team name
- Requested date and time slot
- Discussion points (if provided)
- Link to the application for approval/rejection
- Two provided reactions to accept or refuse via discord
Languages
Python
67.9%
HTML
27%
CSS
3.5%
JavaScript
1.6%