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
26 changes: 3 additions & 23 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ updates:
timezone: "Europe/Paris"
open-pull-requests-limit: 5
commit-message:
prefix: "cargo"
prefix: "[BOT] Cargo :"
labels:
- "dependencies"
- "rust"
Expand All @@ -24,26 +24,6 @@ updates:
- "minor"
- "patch"

# --- Python dependencies (requirements.txt at the repository root) ---
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "Europe/Paris"
open-pull-requests-limit: 5
commit-message:
prefix: "pip"
labels:
- "dependencies"
- "python"
groups:
pip-minor-patch:
update-types:
- "minor"
- "patch"

# --- Actions used in .github/workflows/ ---
- package-ecosystem: "github-actions"
directory: "/"
Expand All @@ -54,7 +34,7 @@ updates:
timezone: "Europe/Paris"
open-pull-requests-limit: 5
commit-message:
prefix: "ci"
prefix: "[BOT] CI :"
labels:
- "dependencies"
- "github-actions"
Expand All @@ -73,7 +53,7 @@ updates:
timezone: "Europe/Paris"
open-pull-requests-limit: 3
commit-message:
prefix: "docker"
prefix: "[BOT] Docker :"
labels:
- "dependencies"
- "docker"
6 changes: 2 additions & 4 deletions .github/workflows/Docker CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ on:
branches: [ main ]
paths:
- 'Dockerfile'
- 'requirements.txt'
- 'Filtro_Python/**'
- 'Filtro_Rust/**'
- '.github/workflows/Docker CI.yml'
pull_request:
branches: [ main ]
paths:
- 'Dockerfile'
- 'requirements.txt'
- 'Filtro_Python/**'
- 'Filtro_Rust/**'
- '.github/workflows/Docker CI.yml'
workflow_dispatch:

Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# CodeQL security analysis for both implementations of the project:
# - Python: Filtro_Python/
# - Rust: Filtro_Rust/
# CodeQL security analysis for the Rust crate (Filtro_Rust/).
# Results show up under Security > Code scanning.
name: CodeQL

on:
push:
branches: [ "main" ]
branches: [ "main", "development" ]
pull_request:
branches: [ "main" ]
branches: [ "main", "development" ]
schedule:
- cron: '0 5 * * 0'
workflow_dispatch:
Expand All @@ -35,9 +33,7 @@ jobs:
fail-fast: false
matrix:
include:
# Neither language requires a build step for CodeQL extraction
- language: python
build-mode: none
# Rust does not require a build step for CodeQL extraction
- language: rust
build-mode: none

Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/python-ci.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# ---------------------------------------------------------------
# Python (Filtro_Python)
# ---------------------------------------------------------------
__pycache__/
*.py[cod]
*$py.class
*.so

# Virtual environments
.venv/
venv/
ENV/
env/

# Packaging / build
build/
dist/
*.egg-info/
.eggs/

# Tests & tooling caches
.pytest_cache/
.mypy_cache/
.ruff_cache/
.coverage
.coverage.*
htmlcov/
.tox/

# Flask
instance/
*.log

# Files generated at runtime by the app
Filtro_Python/static/uploads/
Filtro_Python/static/results/

# ---------------------------------------------------------------
# Rust (Filtro_Rust)
# ---------------------------------------------------------------
Expand Down
35 changes: 20 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
# Utilise une image python officielle comme parent
FROM python:3.14-slim
# syntax=docker/dockerfile:1

# Définit le répertoire de travail dans le conteneur
WORKDIR /app
# ---- Build stage : compile the `filtro` binary ------------------------------
FROM rust:1-slim AS build

# Copie les fichiers nécessaires
COPY . /app
WORKDIR /src
# Only the Rust crate is needed to build
COPY Filtro_Rust/ ./Filtro_Rust/

# Installation des dépendances Python
RUN pip install --no-cache-dir -r requirements.txt
WORKDIR /src/Filtro_Rust
RUN cargo build --release --locked

# Expose le port de Flask (par défaut 5000)
EXPOSE 5000
# ---- Runtime stage : minimal image with just the binary --------------------
FROM debian:stable-slim

# L'application Flask vit dans Filtro_Python/ et utilise des chemins relatifs
# (static/uploads, static/results) : on se place donc dans ce dossier
WORKDIR /app/Filtro_Python
# Run as a non-root user
RUN useradd --create-home --uid 10001 filtro
USER filtro
WORKDIR /work

# Commande pour lancer l’application Flask
CMD ["python", "app.py"]
COPY --from=build /src/Filtro_Rust/target/release/filtro /usr/local/bin/filtro

# The container *is* the CLI tool:
# docker run --rm -v "$PWD:/work" filtro photo.jpg -f jaune -o out
ENTRYPOINT ["filtro"]
CMD ["--help"]
80 changes: 0 additions & 80 deletions Filtro_Python/app.py

This file was deleted.

Binary file removed Filtro_Python/static/results/vert_ImageIA2.webp
Binary file not shown.
Loading