Biber core#21
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s Ollama/Docker integration defaults and deployment/test scripts, and refreshes several frontend UI strings/footers.
Changes:
- Standardize Ollama access from containers via
host.docker.internal(and align.env.example/ backend default). - Improve deployment/start/test scripts by adding Docker Compose helpers and adjusting dependency/service setup.
- Update frontend hero text, partner strings, and footer year to 2026.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| test_ollama.sh | Switches container checks from docker exec to a Compose-based exec helper. |
| quick_test_ollama.sh | Same Compose-based exec helper for quick validation flow. |
| scripts/start.sh | Adds AUTO_INSTALL_DEPS, tightens root handling, and reworks Ollama systemd configuration. |
| scripts/deploy.sh | Adds root/sudo mode, Compose helper, normalizes OLLAMA_BASE_URL, and adjusts install/ownership steps. |
| backend_python/rag_engine.py | Changes default OLLAMA_BASE_URL to http://host.docker.internal:11434. |
| .env.example | Updates Ollama base URL default to host.docker.internal. |
| front/index.html | Changes hero “Find person” CTA text/icon and updates footer year. |
| front/i18n.js | Updates translations for hero CTA, footers, and partner strings across languages. |
| front/list.html | Updates footer year to 2026. |
| front/suggestions.html | Updates footer year to 2026. |
| front/contacts.html | Updates footer year to 2026. |
| front/chat.html | Updates footer year to 2026. |
| front/admin.html | Updates footer year to 2026. |
| front/about.html | Adds a footer section with i18n-enabled footer text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| $SUDO apt install -y docker.io docker-compose-v2 | ||
| $SUDO systemctl enable docker | ||
| $SUDO systemctl start docker | ||
| $SUDO usermod -aG "$RUN_USER" |
There was a problem hiding this comment.
usermod invocation is missing the target group. usermod -aG requires a comma-separated group list plus a username; as written it will fail (and with set -e abort the deploy). Update it to add the user to the docker group (and keep the username argument).
| $SUDO usermod -aG "$RUN_USER" | |
| $SUDO usermod -aG docker "$RUN_USER" |
| if [ "$EUID" -eq 0 ]; then | ||
| SUDO="" | ||
| RUN_USER="${SUDO_USER:-root}" | ||
| RUN_GROUP="${SUDO_USER:-root}" | ||
| echo -e "${YELLOW}ℹ️ Запуск от root: поддерживается${NC}" |
There was a problem hiding this comment.
When running as root via sudo, RUN_GROUP is set to the username ($SUDO_USER) rather than the user’s primary group. On systems where the primary group name differs from the username, the later chown -R "$RUN_USER:$RUN_GROUP" will fail and stop the script. Consider deriving the group via id -gn "$RUN_USER" (or falling back safely if SUDO_USER is unset).
| if [[ "${EUID}" -ne 0 ]]; then | ||
| log "Run this script as root: sudo bash scripts/start.sh" | ||
| exit 1 | ||
| fi | ||
| "$@" |
There was a problem hiding this comment.
as_root() now hard-requires the entire script to be run as root. This makes files created in the repo (like .env and runtime-data/*) owned by root, which can cause follow-on permission issues for normal development/use. Prefer the previous behavior of escalating only for privileged commands (via sudo) or explicitly chown generated repo files back to the invoking user.
| if [[ "${EUID}" -ne 0 ]]; then | |
| log "Run this script as root: sudo bash scripts/start.sh" | |
| exit 1 | |
| fi | |
| "$@" | |
| if [[ "${EUID}" -eq 0 ]]; then | |
| "$@" | |
| return | |
| fi | |
| if ! command -v sudo >/dev/null 2>&1; then | |
| log "This command requires root privileges, but sudo is not installed." | |
| exit 1 | |
| fi | |
| sudo "$@" |
| systemctl daemon-reload | ||
| systemctl enable ollama >/dev/null 2>&1 || true | ||
| systemctl restart ollama |
There was a problem hiding this comment.
ensure_ollama_on_11434() calls systemctl unconditionally. On environments without systemd (e.g., some WSL/container setups), this will fail and abort the script under set -euo pipefail. Either guard these calls with command -v systemctl (as before) and provide a fallback, or make the script explicitly require systemd with a clear error.
| compose_exec() { | ||
| if docker compose version >/dev/null 2>&1; then | ||
| docker compose exec -T python_backend "$@" | ||
| return | ||
| fi | ||
| if command -v docker-compose >/dev/null 2>&1; then | ||
| docker-compose exec -T python_backend "$@" | ||
| return |
There was a problem hiding this comment.
The script now relies on docker compose exec (which requires being run from a directory containing the correct docker-compose.yml). Since this script doesn’t cd to the repo root, running it from another directory will fail with “no configuration file”. Consider cd-ing relative to the script location (or using docker compose -f <path>).
| compose_exec() { | ||
| if docker compose version >/dev/null 2>&1; then | ||
| docker compose exec -T python_backend "$@" | ||
| return | ||
| fi | ||
| if command -v docker-compose >/dev/null 2>&1; then | ||
| docker-compose exec -T python_backend "$@" |
There was a problem hiding this comment.
Same issue as test_ollama.sh: using docker compose exec without ensuring the working directory contains the compose file makes this script fragile when invoked from outside the repo root. Consider changing into the repo root based on the script path (or passing -f).
| compose_exec() { | |
| if docker compose version >/dev/null 2>&1; then | |
| docker compose exec -T python_backend "$@" | |
| return | |
| fi | |
| if command -v docker-compose >/dev/null 2>&1; then | |
| docker-compose exec -T python_backend "$@" | |
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| compose_exec() { | |
| if docker compose version >/dev/null 2>&1; then | |
| (cd "$SCRIPT_DIR" && docker compose exec -T python_backend "$@") | |
| return | |
| fi | |
| if command -v docker-compose >/dev/null 2>&1; then | |
| (cd "$SCRIPT_DIR" && docker-compose exec -T python_backend "$@") |
| search_placeholder: "Search by name, surname, year...", | ||
| search_btn: "Search", | ||
| hero_find: "Find a Person", | ||
| hero_find: "Ask AI-assistant", |
There was a problem hiding this comment.
English UI copy: “Ask AI-assistant” is grammatically incorrect/unnatural. Consider changing to “Ask an AI assistant” (or “Ask the AI assistant”) for readability and consistency.
| hero_find: "Ask AI-assistant", | |
| hero_find: "Ask an AI assistant", |
No description provided.