Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build Android App

on:
push:
branches: [ main, master]
branches: [ deploy ]
pull_request:
branches: [ main, master ]
branches: [ deploy ]
workflow_dispatch:

permissions:
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/build-flatpak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build Flatpak

on:
push:
branches: [ main, master, flatpak-testing ]
branches: [ deploy ]
pull_request:
branches: [ main, master, flatpak-testing ]
branches: [ deploy ]
workflow_dispatch:

permissions:
Expand All @@ -25,17 +25,17 @@ permissions:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgirepository1.0-dev libcairo2-dev pkg-config python3.8 python3.8-dev
# Install WebKit dependencies for Ubuntu 20.04
sudo apt-get install -y gir1.2-webkit2-4.0 libwebkit2gtk-4.0-dev
sudo apt-get install -y libgirepository1.0-dev libgirepository-2.0-dev libcairo2-dev pkg-config python3-dev
# Install WebKit dependencies for Ubuntu 24.04
sudo apt-get install -y gir1.2-webkit2-4.1 libwebkit2gtk-4.1-dev
# Install system PyGobject
sudo apt-get install -y python3-gi python3-gi-cairo
# Install GLib dev (needed for GTK applications)
Expand All @@ -45,28 +45,33 @@ jobs:
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo


- name: Set up Python virtual environment
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12.3'

- name: Install Python dependencies
run: |
# Create a virtual environment with access to system packages
python3 -m venv --system-site-packages venv
source venv/bin/activate
# Upgrade pip within the virtual environment
pip install --upgrade pip setuptools wheel
# Install briefcase in the virtual environment
pip install briefcase
python -m pip install --upgrade pip
python -m pip install briefcase

- name: Create Flatpak package
working-directory: ./standalone
run: |
# Use the virtual environment
source venv/bin/activate
cd standalone
briefcase create linux flatpak --no-input
briefcase build linux flatpak --no-input --update-resources
briefcase package linux flatpak --no-input
python -m briefcase create linux flatpak --no-input -vv
python -m briefcase build linux flatpak --no-input --update-resources -vv
python -m briefcase package linux flatpak --no-input -vv

- name: Upload Flatpak bundle
uses: actions/upload-artifact@v4
with:
name: castle-flatpak-bundle
path: standalone/dist/Castle-*.flatpak
if-no-files-found: warn
if-no-files-found: warn

- name: Upload build log on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: flatpak-build-logs
path: ./standalone/logs/
4 changes: 2 additions & 2 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build iOS App

on:
push:
branches: [ main, master]
branches: [ deploy ]
pull_request:
branches: [ main, master]
branches: [ deploy ]
workflow_dispatch:

permissions:
Expand Down
102 changes: 39 additions & 63 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,68 @@ name: Build Linux App

on:
push:
branches: [ main, master ]
branches: [ deploy ]
pull_request:
branches: [ main, master ]
branches: [ deploy ]
workflow_dispatch:

permissions:
actions: write
checks: write
contents: write
deployments: write
discussions: write
id-token: write
issues: write
packages: write
pages: write
pull-requests: write
repository-projects: write
security-events: write
statuses: write

jobs:
build:
runs-on: ubuntu-20.04
env:
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgirepository1.0-dev libcairo2-dev pkg-config python3-dev
# Install WebKit dependencies for Ubuntu 20.04
sudo apt-get install -y gir1.2-webkit2-4.0 libwebkit2gtk-4.0-dev
# Install system PyGobject
sudo apt-get install -y python3-gi python3-gi-cairo
# Install additional dependencies required for AppImage
sudo apt-get install -y fuse libfuse2 desktop-file-utils libglib2.0-dev
sudo apt-get install -y \
libgirepository1.0-dev \
libgirepository-2.0-dev \
libcairo2-dev \
pkg-config \
python3-dev \
python3-pip \
python3-cairo \
gir1.2-webkit2-4.1 \
libwebkit2gtk-4.1-dev \
python3-gi \
python3-gi-cairo \
libglib2.0-dev \
desktop-file-utils

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
# Install Briefcase with a specific version known to work well with AppImage packaging
python -m pip install briefcase==0.3.15

- name: Prepare custom dependencies
working-directory: ./standalone
run: |
# Create a custom requirements file with pinned versions
cat > briefcase_deps.txt << EOF
# Pinned dependencies for Ubuntu 20.04
toga==0.4.6
toga-gtk==0.4.6
pycairo>=1.17.0
EOF

# Display the custom requirements
cat briefcase_deps.txt
- name: Install Briefcase
run: python3 -m pip install --break-system-packages briefcase

# Build the app for Linux
- name: Build Linux app
- name: Build DEB package
working-directory: ./standalone
env:
PIP_BREAK_SYSTEM_PACKAGES: "1"
run: |
python -m briefcase create
python -m briefcase build --update-resources
python3 -m briefcase create linux system
python3 -m briefcase build linux system
python3 -m briefcase package linux system -p deb

# Create Linux distribution packages
- name: Package for Linux
- name: List build artifacts
working-directory: ./standalone
run: |
# For AppImage, use Docker for proper dependency handling
python -m briefcase package linux appimage --no-docker

# For DEB format:
python -m briefcase package linux system -p deb
echo "Contents of dist directory:"
ls -lah dist/ || echo "No dist directory found"

- name: Upload Linux packages
- name: Upload DEB package
if: success()
uses: actions/upload-artifact@v4
with:
name: castle-deb-package
path: ./standalone/dist/*.deb

- name: Upload logs on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: linux-packages
path: |
./standalone/dist/*.AppImage
./standalone/dist/*.deb
name: build-logs
path: ./standalone/logs/
4 changes: 2 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build macOS App

on:
push:
branches: [ main, master ]
branches: [ deploy ]
pull_request:
branches: [ main, master ]
branches: [ deploy ]
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build Windows App

on:
push:
branches: [ main, master ]
branches: [ deploy ]
pull_request:
branches: [ main, master ]
branches: [ deploy ]
workflow_dispatch:

permissions:
Expand Down
4 changes: 3 additions & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def create_app():
SESSION_COOKIE_SECURE=True,
WTF_CSRF_ENABLED=True,
MONGO_URI=os.getenv("MONGO_URI", "mongodb://localhost:27017/scouting_app"),
RATELIMIT_STORAGE_URI=os.getenv("MONGO_URI", "mongodb://localhost:27017/scouting_app"),
VAPID_PUBLIC_KEY=os.getenv("VAPID_PUBLIC_KEY", ""),
VAPID_PRIVATE_KEY=os.getenv("VAPID_PRIVATE_KEY", ""),
VAPID_CLAIM_EMAIL=os.getenv("VAPID_CLAIM_EMAIL", "team334@gmail.com")
Expand Down Expand Up @@ -140,7 +141,8 @@ def check_team_access():
request.path == '/' or \
request.path == '/service-worker.js' or \
request.path.startswith('/auth/login') or \
request.path.startswith('/auth/register'):
request.path.startswith('/auth/register') or \
request.path.startswith('/auth/forgot-password'):
return

# Block access for non-authenticated users to protected routes
Expand Down
6 changes: 6 additions & 0 deletions app/auth/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ async def login():
return render_template("auth/login.html", form_data={})


@auth_bp.route("/forgot-password")
def forgot_password():
"""Display forgot password page with instructions"""
return render_template("forgot-password.html")


@auth_bp.route("/register", methods=["GET", "POST"])
@limiter.limit("8 per minute")
@async_route
Expand Down
Loading
Loading