Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e72e7b7
Added initial configuration for poetry and the venv. Also added the .…
Eric-Butcher Sep 29, 2024
4208a73
Basic Django Structure App + Skeleton Template PR (#2)
sumanyuj Sep 29, 2024
433f4ef
added index.html & CSS (#6)
rancescolon Oct 4, 2024
f5c4625
Feature/docker (#3)
giagermain Oct 4, 2024
f7adef5
Add some real simple JavaScript (#4)
WeirdAlex03 Oct 7, 2024
8cc2a91
This pull request is going to be the last one for objective 1 so hope…
sumanyuj Oct 12, 2024
08adecc
Added poetry to docker (merging Gia's poetry docker stuff) (#14)
sumanyuj Oct 12, 2024
2858658
Create email & password validators w/ tests (#12)
WeirdAlex03 Oct 12, 2024
0590672
removed req.txt and added email-validator to poetry (#15)
sumanyuj Oct 12, 2024
b77312e
Feature/jslogin -> Created JS functionality for LOGIN validation, an …
sumanyuj Oct 24, 2024
107a2f7
Got the database container setup done. (#26)
Eric-Butcher Oct 24, 2024
7ab557d
Fixed the ducplicated div for the register and login, and renamed the…
Eric-Butcher Oct 25, 2024
476ca05
regenerated poetry lock (#31)
Eric-Butcher Oct 25, 2024
f8a833f
Authentication methods & database backend (#33)
WeirdAlex03 Oct 26, 2024
842bdb2
Rework docker to auto run migrations on start (#35)
WeirdAlex03 Oct 26, 2024
d923c4b
README now reflects migrations happening during container build (#36)
Eric-Butcher Oct 27, 2024
ba28c84
Feature/path3 (#28)
rancescolon Oct 27, 2024
8d38f2e
Feature/logged in homepage (#41)
giagermain Oct 27, 2024
04962e1
Chat functionality (#34)
giagermain Oct 27, 2024
013283c
(feature/likebutton) OBJ3: BRIDGING THE ENLIGHENTED BACKEND WITH THE …
sumanyuj Oct 28, 2024
7b239e9
Add comments for TA grading & cleanup imports (#39)
WeirdAlex03 Oct 28, 2024
d9995a3
Hotfix README (#44)
WeirdAlex03 Oct 29, 2024
f6baa5b
Got codeql analysis from github (#45)
Eric-Butcher Nov 4, 2024
b2b32dc
Exclude Django library files from CodeQL scanning (#48)
WeirdAlex03 Nov 5, 2024
70c866b
Updated READMe (#46)
Eric-Butcher Nov 5, 2024
216f586
Added autopep8 formatting (#42)
Eric-Butcher Nov 5, 2024
8ca5039
Clean up flagged problems/vulns (#49)
WeirdAlex03 Nov 8, 2024
96e3fe0
initial attempt at github actions workflow for formatting and testin…
Eric-Butcher Nov 12, 2024
f0df09d
Feature/nginx (#51)
giagermain Nov 24, 2024
a8c9744
Rework Docker & nginx configs for w/ & w/o SSL (#53)
WeirdAlex03 Dec 1, 2024
fe7d533
Project Part 2: Web Sockets: WEB SOCKET SUPREMACY (#50)
sumanyuj Dec 2, 2024
c020e0c
fixed escaping (#54)
sumanyuj Dec 2, 2024
0209682
Nuke @csrf_exempt: fix problem instead of symptom (#56)
WeirdAlex03 Dec 2, 2024
a2913c1
Hotfix/redirect (#57)
giagermain Dec 2, 2024
412727f
Add media folder to gitignore (#58)
WeirdAlex03 Dec 2, 2024
f26174a
updated readme for env (#59)
sumanyuj Dec 2, 2024
3232fb2
Demo Fix: Catch Socket Frames Before They Inflict Maximum Damage (#61)
sumanyuj Dec 6, 2024
6e77d31
fixed nontransparent background (#64)
giagermain Dec 6, 2024
a8e0a7f
Rate limiting for demo (#60)
WeirdAlex03 Dec 6, 2024
6018644
Feature/camera relay (#62)
Eric-Butcher Dec 6, 2024
fea26d8
Hotfix/redirect (#65)
giagermain Dec 9, 2024
058c4c0
Feature/camera relay (#66)
Eric-Butcher Dec 9, 2024
241e66a
Drop breaking line from nginx config (#67)
WeirdAlex03 Dec 9, 2024
b9ae9e7
flake8 complexity check and ammend validation logic on reigster and l…
Eric-Butcher Dec 24, 2024
5f5107b
Feature/pep8 naming (#68)
Eric-Butcher Dec 29, 2024
45efa04
Bump django from 5.1.3 to 5.1.5 in /evergreen (#80)
dependabot[bot] Jan 17, 2025
a39eb03
Fixed the settings to be secure (#84)
Eric-Butcher Jan 24, 2025
8bdb7c7
BSD-3 Clause License (#86)
Eric-Butcher Jun 2, 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
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POSTGRES_DB: postgres
POSTGRES_USER: username123 # this is insecure - needs to be changed
POSTGRES_PASSWORD: password123 # this is insecure - needs to be changed
WAIT_HOSTS: database:5432
69 changes: 69 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: "CodeQL Advanced"

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]
schedule:
- cron: '21 9 * * 6'

jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ${{ 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-and-quality
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
284 changes: 284 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/


.DS_Store


# Created by https://www.toptal.com/developers/gitignore/api/pycharm
# Edit at https://www.toptal.com/developers/gitignore?templates=pycharm

### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PyCharm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

# Azure Toolkit for IntelliJ plugin
# https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij
.idea/**/azureSettings.xml

# End of https://www.toptal.com/developers/gitignore/api/pycharm
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.typeCheckingMode": "basic"
}
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
Hello, World!
# Project Evergreen

Project Evergreen is a group project for the class CSE312: Web Applications at the University at Buffalo in the Fall 2024 semester. This project is intended to become the web application for the UB IEEE student chapter automated greenhouse chapter.


## Managing the Local Environment

The development environment is being managed using [Poetry](https://python-poetry.org/). Please make sure that you have Poetry installed:
```shell
pip install poetry
```

The virtual environment can be created locally by using the `poetry install` command from the `evergreen` directory. The environment can then be activated using the `poetry shell` command. This venv can then be deactivated by using the `exit` command.

New package dependencies for the project can be added using the `poetry add <package-name-from-pip>` command.


## Setting up the Docker Environment

In the root directory of the project, type `docker compose up --build --force-recreate` to spin up the containers. The poetry environment does not need to be activated for this.

The database migrations should be automatically applied by Docker when it spins up the containers. If you are receiving errors during this step, it is best to delete any old containers and volumes you have lying around to ensure that Docker creates the setup form a clean state.

You can use the command `docker compose exec django python manage.py createsuperuser` to make your admin user from a separate terminal. You can then go to the `/admin` panel and login with those credentials that you used to create the super user.
Loading