New password option fo the tenant adding and heatlth check
Release Inventarsystem / release-docker (push) Successful in 3m9s

This commit is contained in:
2026-08-26 22:55:56 +02:00
parent 4461644cb6
commit d2c21bc519
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -13163,7 +13163,7 @@ def get_optimal_image_quality(img, target_size_kb=80):
@app.route('/health')
def health_check():
return 'OK', 200
return jsonify({"status": "healthy"}), 200
@app.route('/api/push/subscribe', methods=['POST'])
+8 -2
View File
@@ -439,7 +439,8 @@ initialize_tenant_database() {
return 0
fi
docker exec -i "$APP_CONTAINER" python3 - "$tenant_id" "$mode" "$admin_password" <<'PY'
# Fix: We inject the password securely via a temporary environment variable (-e ADMIN_PASS)
docker exec -i -e ADMIN_PASS="$admin_password" "$APP_CONTAINER" python3 - "$tenant_id" "$mode" <<'PY'
import sys, os, re, datetime, hashlib
sys.path.insert(0, "/app")
sys.path.insert(0, "/app/Web")
@@ -450,7 +451,12 @@ import Web.modules.database.user as us
tenant_id = sys.argv[1].lower()
mode = sys.argv[2]
admin_password = sys.argv[3] if len(sys.argv) > 3 else "admin123"
# Fix: Read the password directly from the environment variable instead of sys.argv
admin_password = os.environ.get("ADMIN_PASS", "admin123")
# Failsafe in case of empty string
if not admin_password.strip():
admin_password = "admin123"
sanitized = "".join(c for c in tenant_id if c.isalnum() or c == "_")
db_name = f"inventar_{sanitized}" if sanitized else settings.MONGODB_DB