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
16 changes: 14 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
LABEL version="1.1.0"
LABEL description="Advanced Telegram bot for managing code snippets"

USER root

Check failure on line 14 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL3002 warning: Last USER should not be root

# משתני סביבה לבילד
ENV PYTHONUNBUFFERED=1 \
Expand All @@ -24,7 +24,12 @@
PATH="/root/.local/bin:$PATH"

# כלים לבניית חבילות heavy (wheels)
RUN apt-get update -y && apt-get upgrade -y && \
RUN set -eux; \

Check failure on line 27 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

SC1091 info: Not following: File not included in mock.

Check failure on line 27 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
. /etc/os-release; \
printf 'deb http://deb.debian.org/debian %s main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" > /etc/apt/sources.list.d/non-free.list; \
printf 'deb http://deb.debian.org/debian %s-updates main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \
printf 'deb http://security.debian.org/debian-security %s-security main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \
apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
python3-dev \
Expand All @@ -42,14 +47,14 @@

# העתקת requirements והתקנת dependencies (Production-only)
COPY requirements/ /app/requirements/
RUN --mount=type=cache,target=/root/.cache/pip \

Check failure on line 50 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
pip install --user -r /app/requirements/production.txt --retries 5 --timeout 60

# יצירת constraints לשחזור צפוי
RUN python -m pip freeze | sort > /app/constraints.txt

Check failure on line 54 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL4006 warning: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check

# אימות התקנה מול constraints
RUN --mount=type=cache,target=/root/.cache/pip \

Check failure on line 57 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`
pip install --user -r /app/requirements/production.txt -c /app/constraints.txt --retries 5 --timeout 60

######################################
Expand All @@ -72,7 +77,12 @@
NODE_VERSION=${NODE_VERSION}

# חבילות Runtime הנדרשות (כולל Playwright deps מלאים)
RUN apt-get update -y && apt-get upgrade -y && \
RUN set -eux; \

Check failure on line 80 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

SC1091 info: Not following: File not included in mock.

Check failure on line 80 in Dockerfile

View workflow job for this annotation

GitHub Actions / Dockerfile lint (hadolint)

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
. /etc/os-release; \
printf 'deb http://deb.debian.org/debian %s main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" > /etc/apt/sources.list.d/non-free.list; \
printf 'deb http://deb.debian.org/debian %s-updates main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \
printf 'deb http://security.debian.org/debian-security %s-security main contrib non-free non-free-firmware\n' "$VERSION_CODENAME" >> /etc/apt/sources.list.d/non-free.list; \
apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
libasound2 \
libatk-bridge2.0-0 \
Expand All @@ -96,6 +106,8 @@
fonts-dejavu \
fonts-jetbrains-mono \
fonts-cascadia-code \
fonts-ubuntu \
Comment thread
amirbiron marked this conversation as resolved.
fonts-unifont \
tzdata \
curl \
ca-certificates \
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,11 @@ docker build -t code-keeper-bot .
docker run -d --env-file .env code-keeper-bot
```

#### פונטים בבניית Docker
- הבילד מתקין את `fonts-unifont` ו-`fonts-ubuntu` (חבילות `fonts-*` העדכניות) כדי להבטיח Fallback מלא ליוניקוד בממשק ה-WebApp.
- אין צורך להתקין עוד את החבילות הישנות `ttf-unifont` / `ttf-ubuntu-font-family`, מאחר שהן הוצאו ממאגרי Debian וההחלפה מתרחשת אוטומטית בבנייה.
- אם אתם מריצים Docker מקומי, ודאו שהבנייה מסתיימת בלי הודעות `has no installation candidate`; אחרת עדכנו את Mirror/Cache המקומי.

## 📚 שימוש

### התחלת עבודה
Expand Down
21 changes: 19 additions & 2 deletions github_menu_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,25 @@ def http_request(method, url, **kwargs):
return requests.get(url, **kwargs)
return _http_sync_request(method, url, **kwargs)

from github import Github, GithubException
from github.InputGitTreeElement import InputGitTreeElement
try:
from github import Github, GithubException
from github.InputGitTreeElement import InputGitTreeElement
except ModuleNotFoundError: # pragma: no cover - optional dependency in minimal/test envs
class GithubException(Exception): # type: ignore
"""Placeholder raised when PyGithub is missing."""

class Github: # type: ignore
def __init__(self, *args, **kwargs):
raise RuntimeError(
"PyGithub is required for GitHub integrations. "
"Install via 'pip install PyGithub' or monkeypatch github_menu_handler.Github in tests."
)

class InputGitTreeElement: # type: ignore
def __init__(self, *args, **kwargs):
raise RuntimeError(
"PyGithub InputGitTreeElement unavailable. Install PyGithub to enable tree operations."
)
from telegram import (
InlineKeyboardButton,
InlineKeyboardMarkup,
Expand Down
13 changes: 12 additions & 1 deletion repo_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@
import json
import logging
from typing import Dict, List, Any, Optional
from github import Github, GithubException
try:
from github import Github, GithubException
except ModuleNotFoundError: # pragma: no cover - optional dependency for tests
class GithubException(Exception): # type: ignore
"""Placeholder when PyGithub is unavailable."""

class Github: # type: ignore
def __init__(self, *args, **kwargs):
raise RuntimeError(
"PyGithub is required for repo analysis. "
"Install via 'pip install PyGithub' to enable this feature."
)
import base64
import re
from datetime import datetime, timedelta
Expand Down
Loading