Files
Key-service-Server/Inventarsystem-Lizenz-Verwaltung/run.sh
T
Maximilian G. d00c4e2cb9 Add admin management features and MongoDB setup scripts
- Created .vscode/settings.json for Python environment configuration.
- Added run.sh script for MongoDB installation and project setup.
- Implemented admin chat interface in admin_chats.html.
- Developed invoice management interface in admin_invoices.html.
- Created license management interface in admin_licenses.html.
- Added support ticket management interface in admin_tickets.html.
- Implemented user management interface in admin_users.html.
- Developed user chat interface in chat.html.
- Created user invoice overview in my_invoices.html.
- Developed user license overview in my_licenses.html.
- Added support ticket creation and tracking in tickets.html.
- Created test.sh script for MongoDB setup.
2026-03-23 22:10:13 +00:00

49 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
if [[ -n "${CONDA_DEFAULT_ENV:-}" ]] && command -v conda >/dev/null 2>&1; then
conda deactivate || true
fi
source .venv/bin/activate
# Do not run apt here because third-party repos in dev containers can fail.
# We only check and provide the install hint if patchelf is missing.
if ! command -v patchelf >/dev/null 2>&1; then
echo "Error: patchelf is required for Nuitka standalone builds on Linux."
echo "Install with: sudo apt update && sudo apt install -y patchelf"
exit 1
fi
pip install -U nuitka ordered-set zstandard flask flask-jwt-extended cryptography pyotp qrcode
python - <<'PY'
from pathlib import Path
import json
root = Path.cwd()
settings_path = root / "settings.json"
version_file = root / "version.txt"
version = "0.1.0"
if settings_path.is_file():
raw = settings_path.read_text(encoding="utf-8").strip()
if raw:
data = json.loads(raw)
if isinstance(data, dict):
version = str(data.get("version", version)).strip() or version
elif isinstance(data, list):
for item in data:
if isinstance(item, dict) and "version" in item:
version = str(item.get("version", version)).strip() or version
break
version_file.write_text(f"{version}\n", encoding="utf-8")
print(f"Prepared {version_file} with version: {version}")
PY
python -m nuitka --standalone --follow-imports --include-data-dir=templates=templates --include-data-dir=static=static --include-data-file=licenses.json=licenses.json --assume-yes-for-downloads --output-dir=build --remove-output main.py
if [[ -x "./build/main.bin" ]]; then
./build/main.bin
else
echo "Build step finished but executable not found at ./build/main.bin"
exit 1
fi