Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Biber core#21

Merged
dastanmedetbekov merged 6 commits into
mainfrom
biber-core
Apr 4, 2026
Merged

Biber core#21
dastanmedetbekov merged 6 commits into
mainfrom
biber-core

Conversation

@dastanmedetbekov
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 07:25
@dastanmedetbekov dastanmedetbekov merged commit dac4b35 into main Apr 4, 2026
7 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/deploy.sh
$SUDO apt install -y docker.io docker-compose-v2
$SUDO systemctl enable docker
$SUDO systemctl start docker
$SUDO usermod -aG "$RUN_USER"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
$SUDO usermod -aG "$RUN_USER"
$SUDO usermod -aG docker "$RUN_USER"

Copilot uses AI. Check for mistakes.
Comment thread scripts/deploy.sh
Comment on lines +22 to +26
if [ "$EUID" -eq 0 ]; then
SUDO=""
RUN_USER="${SUDO_USER:-root}"
RUN_GROUP="${SUDO_USER:-root}"
echo -e "${YELLOW}ℹ️ Запуск от root: поддерживается${NC}"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment thread scripts/start.sh
Comment on lines +23 to +27
if [[ "${EUID}" -ne 0 ]]; then
log "Run this script as root: sudo bash scripts/start.sh"
exit 1
fi
"$@"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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 "$@"

Copilot uses AI. Check for mistakes.
Comment thread scripts/start.sh
Comment on lines +380 to +382
systemctl daemon-reload
systemctl enable ollama >/dev/null 2>&1 || true
systemctl restart ollama
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread test_ollama.sh
Comment on lines +6 to +13
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
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>).

Copilot uses AI. Check for mistakes.
Comment thread quick_test_ollama.sh
Comment on lines +6 to +12
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 "$@"
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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 "$@")

Copilot uses AI. Check for mistakes.
Comment thread front/i18n.js
search_placeholder: "Search by name, surname, year...",
search_btn: "Search",
hero_find: "Find a Person",
hero_find: "Ask AI-assistant",
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
hero_find: "Ask AI-assistant",
hero_find: "Ask an AI assistant",

Copilot uses AI. Check for mistakes.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants