Compare commits
9 Commits
develop
...
c96039542d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c96039542d | ||
|
|
50c791e242 | ||
|
|
e0ba349862 | ||
|
|
c292854d72 | ||
|
|
ee9dc0eb1c | ||
|
|
aaf6f2b32f | ||
|
|
a84c881e71 | ||
|
|
d264bcdca9 | ||
|
|
af62fa478f |
61
.dockerignore
Normal file
61
.dockerignore
Normal file
@@ -0,0 +1,61 @@
|
||||
# Git files
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# Python cache
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
recticel/
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
logs/
|
||||
|
||||
# Database
|
||||
*.db
|
||||
*.sqlite
|
||||
*.sqlite3
|
||||
|
||||
# Documentation
|
||||
*.md
|
||||
!README.md
|
||||
|
||||
# Backup files
|
||||
backup/
|
||||
*.bak
|
||||
*.backup
|
||||
*.old
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Application specific
|
||||
instance/*.db
|
||||
chrome_extension/
|
||||
VS code/
|
||||
tray/
|
||||
|
||||
# Scripts not needed in container
|
||||
*.sh
|
||||
!docker-entrypoint.sh
|
||||
|
||||
# Service files
|
||||
*.service
|
||||
|
||||
# Config that will be generated
|
||||
instance/external_server.conf
|
||||
13
.env.example
Normal file
13
.env.example
Normal file
@@ -0,0 +1,13 @@
|
||||
# Environment Configuration for Recticel Quality Application
|
||||
# Copy this file to .env and adjust the values as needed
|
||||
|
||||
# Database Configuration
|
||||
MYSQL_ROOT_PASSWORD=rootpassword
|
||||
DB_PORT=3306
|
||||
|
||||
# Application Configuration
|
||||
APP_PORT=8781
|
||||
|
||||
# Initialization Flags (set to "false" after first successful deployment)
|
||||
INIT_DB=true
|
||||
SEED_DB=true
|
||||
15
.gitignore
vendored
15
.gitignore
vendored
@@ -28,4 +28,19 @@ VS code/obj/
|
||||
|
||||
# Backup files
|
||||
*.backup
|
||||
|
||||
# Docker deployment
|
||||
.env
|
||||
*.env
|
||||
!.env.example
|
||||
logs/
|
||||
*.log
|
||||
app.log
|
||||
backup_*.sql
|
||||
instance/external_server.conf
|
||||
*.db
|
||||
*.sqlite
|
||||
*.sqlite3
|
||||
.docker/
|
||||
|
||||
*.backup2
|
||||
|
||||
41
Dockerfile
Normal file
41
Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
# Dockerfile for Recticel Quality Application
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
FLASK_APP=run.py \
|
||||
FLASK_ENV=production
|
||||
|
||||
# Install system dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
default-libmysqlclient-dev \
|
||||
pkg-config \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Create app directory
|
||||
WORKDIR /app
|
||||
|
||||
# Copy requirements and install Python dependencies
|
||||
COPY py_app/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy application code
|
||||
COPY py_app/ .
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /app/instance /srv/quality_recticel/logs
|
||||
|
||||
# Create a script to wait for database and initialize
|
||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
|
||||
# Expose the application port
|
||||
EXPOSE 8781
|
||||
|
||||
# Use the entrypoint script
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
||||
# Run gunicorn
|
||||
CMD ["gunicorn", "--config", "gunicorn.conf.py", "wsgi:application"]
|
||||
93
Makefile
Normal file
93
Makefile
Normal file
@@ -0,0 +1,93 @@
|
||||
.PHONY: help build up down restart logs logs-web logs-db clean reset shell shell-db status health
|
||||
|
||||
help: ## Show this help message
|
||||
@echo "Recticel Quality Application - Docker Commands"
|
||||
@echo ""
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
build: ## Build the Docker images
|
||||
docker-compose build
|
||||
|
||||
up: ## Start all services
|
||||
docker-compose up -d
|
||||
@echo "✅ Services started. Access the app at http://localhost:8781"
|
||||
@echo "Default login: superadmin / superadmin123"
|
||||
|
||||
down: ## Stop all services
|
||||
docker-compose down
|
||||
|
||||
restart: ## Restart all services
|
||||
docker-compose restart
|
||||
|
||||
logs: ## View logs from all services
|
||||
docker-compose logs -f
|
||||
|
||||
logs-web: ## View logs from web application
|
||||
docker-compose logs -f web
|
||||
|
||||
logs-db: ## View logs from database
|
||||
docker-compose logs -f db
|
||||
|
||||
status: ## Show status of all services
|
||||
docker-compose ps
|
||||
|
||||
health: ## Check health of services
|
||||
@echo "=== Service Health Status ==="
|
||||
@docker inspect recticel-app | grep -A 5 '"Health"' || echo "Web app: Running"
|
||||
@docker inspect recticel-db | grep -A 5 '"Health"' || echo "Database: Running"
|
||||
|
||||
shell: ## Open shell in web application container
|
||||
docker-compose exec web bash
|
||||
|
||||
shell-db: ## Open MariaDB console
|
||||
docker-compose exec db mariadb -u trasabilitate -p trasabilitate
|
||||
|
||||
clean: ## Stop services and remove containers (keeps data)
|
||||
docker-compose down
|
||||
|
||||
reset: ## Complete reset - removes all data including database
|
||||
@echo "⚠️ WARNING: This will delete all data!"
|
||||
@read -p "Are you sure? [y/N] " -n 1 -r; \
|
||||
echo; \
|
||||
if [[ $$REPLY =~ ^[Yy]$$ ]]; then \
|
||||
docker-compose down -v; \
|
||||
rm -rf logs/*; \
|
||||
rm -f instance/external_server.conf; \
|
||||
echo "✅ Reset complete"; \
|
||||
fi
|
||||
|
||||
deploy: build up ## Build and deploy (fresh start)
|
||||
@echo "✅ Deployment complete!"
|
||||
@sleep 5
|
||||
@make status
|
||||
|
||||
rebuild: ## Rebuild and restart web application
|
||||
docker-compose up -d --build web
|
||||
|
||||
backup-db: ## Backup database to backup.sql
|
||||
docker-compose exec -T db mariadb-dump -u trasabilitate -pInitial01! trasabilitate > backup_$(shell date +%Y%m%d_%H%M%S).sql
|
||||
@echo "✅ Database backed up"
|
||||
|
||||
restore-db: ## Restore database from backup.sql (provide BACKUP=filename)
|
||||
@if [ -z "$(BACKUP)" ]; then \
|
||||
echo "❌ Usage: make restore-db BACKUP=backup_20231215_120000.sql"; \
|
||||
exit 1; \
|
||||
fi
|
||||
docker-compose exec -T db mariadb -u trasabilitate -pInitial01! trasabilitate < $(BACKUP)
|
||||
@echo "✅ Database restored from $(BACKUP)"
|
||||
|
||||
install: ## Initial installation and setup
|
||||
@echo "=== Installing Recticel Quality Application ==="
|
||||
@if [ ! -f .env ]; then \
|
||||
cp .env.example .env; \
|
||||
echo "✅ Created .env file"; \
|
||||
fi
|
||||
@mkdir -p logs instance
|
||||
@echo "✅ Created directories"
|
||||
@make deploy
|
||||
@echo ""
|
||||
@echo "=== Installation Complete ==="
|
||||
@echo "Access the application at: http://localhost:8781"
|
||||
@echo "Default login: superadmin / superadmin123"
|
||||
@echo ""
|
||||
@echo "⚠️ Remember to change the default passwords!"
|
||||
88
deploy.sh
Executable file
88
deploy.sh
Executable file
@@ -0,0 +1,88 @@
|
||||
#!/bin/bash
|
||||
# Quick deployment script for Recticel Quality Application
|
||||
|
||||
set -e
|
||||
|
||||
echo "================================================"
|
||||
echo " Recticel Quality Application"
|
||||
echo " Docker Deployment"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
|
||||
# Check if Docker is installed
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "❌ Docker is not installed. Please install Docker first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if Docker Compose is installed
|
||||
if ! command -v docker-compose &> /dev/null; then
|
||||
echo "❌ Docker Compose is not installed. Please install Docker Compose first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Docker and Docker Compose are installed"
|
||||
echo ""
|
||||
|
||||
# Create .env if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
echo "Creating .env file from template..."
|
||||
cp .env.example .env
|
||||
echo "✅ Created .env file"
|
||||
echo "⚠️ Please review .env and update passwords before production use"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Create necessary directories
|
||||
echo "Creating necessary directories..."
|
||||
mkdir -p logs instance
|
||||
echo "✅ Directories created"
|
||||
echo ""
|
||||
|
||||
# Stop any existing services
|
||||
echo "Stopping any existing services..."
|
||||
docker-compose down 2>/dev/null || true
|
||||
echo ""
|
||||
|
||||
# Build and start services
|
||||
echo "Building Docker images..."
|
||||
docker-compose build
|
||||
echo ""
|
||||
|
||||
echo "Starting services..."
|
||||
docker-compose up -d
|
||||
echo ""
|
||||
|
||||
# Wait for services to be ready
|
||||
echo "Waiting for services to be ready..."
|
||||
sleep 10
|
||||
|
||||
# Check status
|
||||
echo ""
|
||||
echo "================================================"
|
||||
echo " Deployment Status"
|
||||
echo "================================================"
|
||||
docker-compose ps
|
||||
echo ""
|
||||
|
||||
# Show access information
|
||||
echo "================================================"
|
||||
echo " ✅ Deployment Complete!"
|
||||
echo "================================================"
|
||||
echo ""
|
||||
echo "Application URL: http://localhost:8781"
|
||||
echo ""
|
||||
echo "Default Login Credentials:"
|
||||
echo " Username: superadmin"
|
||||
echo " Password: superadmin123"
|
||||
echo ""
|
||||
echo "⚠️ IMPORTANT: Change the default password after first login!"
|
||||
echo ""
|
||||
echo "Useful Commands:"
|
||||
echo " View logs: docker-compose logs -f"
|
||||
echo " Stop services: docker-compose down"
|
||||
echo " Restart: docker-compose restart"
|
||||
echo " Shell access: docker-compose exec web bash"
|
||||
echo ""
|
||||
echo "For more information, see DOCKER_DEPLOYMENT.md"
|
||||
echo ""
|
||||
77
docker-compose.yml
Normal file
77
docker-compose.yml
Normal file
@@ -0,0 +1,77 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# MariaDB Database Service
|
||||
db:
|
||||
image: mariadb:11.3
|
||||
container_name: recticel-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
|
||||
MYSQL_DATABASE: trasabilitate
|
||||
MYSQL_USER: trasabilitate
|
||||
MYSQL_PASSWORD: Initial01!
|
||||
ports:
|
||||
- "${DB_PORT:-3306}:3306"
|
||||
volumes:
|
||||
- /srv/docker-test/mariadb:/var/lib/mysql
|
||||
- ./init-db.sql:/docker-entrypoint-initdb.d/01-init.sql
|
||||
networks:
|
||||
- recticel-network
|
||||
healthcheck:
|
||||
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 30s
|
||||
|
||||
# Flask Web Application Service
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: recticel-app
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
# Database connection settings
|
||||
DB_HOST: db
|
||||
DB_PORT: 3306
|
||||
DB_NAME: trasabilitate
|
||||
DB_USER: trasabilitate
|
||||
DB_PASSWORD: Initial01!
|
||||
|
||||
# Application settings
|
||||
FLASK_ENV: production
|
||||
FLASK_APP: run.py
|
||||
|
||||
# Initialization flags (set to "false" after first run if needed)
|
||||
INIT_DB: "true"
|
||||
SEED_DB: "true"
|
||||
ports:
|
||||
- "${APP_PORT:-8781}:8781"
|
||||
volumes:
|
||||
# Mount logs directory for persistence
|
||||
- /srv/docker-test/logs:/srv/quality_recticel/logs
|
||||
# Mount instance directory for config persistence
|
||||
- /srv/docker-test/instance:/app/instance
|
||||
# Mount app code for easy updates (DISABLED - causes config issues)
|
||||
# Uncomment only for development, not production
|
||||
# - /srv/docker-test/app:/app
|
||||
networks:
|
||||
- recticel-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8781/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
|
||||
networks:
|
||||
recticel-network:
|
||||
driver: bridge
|
||||
|
||||
# Note: Using bind mounts to /srv/docker-test/ instead of named volumes
|
||||
# This allows easier access and management of persistent data
|
||||
72
docker-entrypoint.sh
Executable file
72
docker-entrypoint.sh
Executable file
@@ -0,0 +1,72 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "==================================="
|
||||
echo "Recticel Quality App - Starting"
|
||||
echo "==================================="
|
||||
|
||||
# Wait for MariaDB to be ready
|
||||
echo "Waiting for MariaDB to be ready..."
|
||||
until python3 << END
|
||||
import mariadb
|
||||
import sys
|
||||
import time
|
||||
|
||||
max_retries = 30
|
||||
retry_count = 0
|
||||
|
||||
while retry_count < max_retries:
|
||||
try:
|
||||
conn = mariadb.connect(
|
||||
user="${DB_USER}",
|
||||
password="${DB_PASSWORD}",
|
||||
host="${DB_HOST}",
|
||||
port=int("${DB_PORT}"),
|
||||
database="${DB_NAME}"
|
||||
)
|
||||
conn.close()
|
||||
print("✅ Database connection successful!")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
retry_count += 1
|
||||
print(f"Database not ready yet (attempt {retry_count}/{max_retries}). Waiting...")
|
||||
time.sleep(2)
|
||||
|
||||
print("❌ Failed to connect to database after 30 attempts")
|
||||
sys.exit(1)
|
||||
END
|
||||
do
|
||||
echo "Retrying database connection..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Create external_server.conf from environment variables
|
||||
echo "Creating database configuration..."
|
||||
cat > /app/instance/external_server.conf << EOF
|
||||
server_domain=${DB_HOST}
|
||||
port=${DB_PORT}
|
||||
database_name=${DB_NAME}
|
||||
username=${DB_USER}
|
||||
password=${DB_PASSWORD}
|
||||
EOF
|
||||
|
||||
echo "✅ Database configuration created"
|
||||
|
||||
# Run database initialization if needed
|
||||
if [ "${INIT_DB}" = "true" ]; then
|
||||
echo "Initializing database schema..."
|
||||
python3 /app/app/db_create_scripts/setup_complete_database.py || echo "⚠️ Database may already be initialized"
|
||||
fi
|
||||
|
||||
# Seed the database with superadmin user
|
||||
if [ "${SEED_DB}" = "true" ]; then
|
||||
echo "Seeding database with superadmin user..."
|
||||
python3 /app/seed.py || echo "⚠️ Database may already be seeded"
|
||||
fi
|
||||
|
||||
echo "==================================="
|
||||
echo "Starting application..."
|
||||
echo "==================================="
|
||||
|
||||
# Execute the CMD
|
||||
exec "$@"
|
||||
20
init-db.sql
Normal file
20
init-db.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- MariaDB Initialization Script for Recticel Quality Application
|
||||
-- This script creates the database and user if they don't exist
|
||||
|
||||
-- Create database if it doesn't exist
|
||||
CREATE DATABASE IF NOT EXISTS trasabilitate CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- Create user if it doesn't exist (MariaDB 10.2+)
|
||||
CREATE USER IF NOT EXISTS 'trasabilitate'@'%' IDENTIFIED BY 'Initial01!';
|
||||
|
||||
-- Grant all privileges on the database to the user
|
||||
GRANT ALL PRIVILEGES ON trasabilitate.* TO 'trasabilitate'@'%';
|
||||
|
||||
-- Flush privileges to ensure they take effect
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
-- Select the database
|
||||
USE trasabilitate;
|
||||
|
||||
-- The actual table creation will be handled by the Python setup script
|
||||
-- This ensures compatibility with the existing setup_complete_database.py
|
||||
154
logs/access.log
Normal file
154
logs/access.log
Normal file
@@ -0,0 +1,154 @@
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:16 +0300] "GET /print_module HTTP/1.1" 200 69964 "https://quality.moto-adv.com/etichete" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 105688
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:17 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2579
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:17 +0300] "GET /get_unprinted_orders HTTP/1.1" 200 3 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 5560
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /dashboard HTTP/1.1" 302 189 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 15566
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 40767
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /static/script.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 12665
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /static/style.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 14360
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /static/logo_login.jpg HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 5758
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /static/css/base.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 26983
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:28 +0300] "GET /static/css/login.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 30870
|
||||
192.168.0.132 - - [15/Oct/2025:00:30:46 +0300] "POST / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 48983
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:01 +0300] "POST / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 7519
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:14 +0300] "POST / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 62448
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:33 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 24735
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:33 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 40939
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:33 +0300] "GET /static/scan_me.jpg HTTP/1.1" 200 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 26109
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:39 +0300] "GET /main_scan HTTP/1.1" 200 1981 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 38217
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:47 +0300] "GET /fg_scan HTTP/1.1" 200 23188 "https://quality.moto-adv.com/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 34772
|
||||
192.168.0.132 - - [15/Oct/2025:00:31:47 +0300] "GET /static/css/scan.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2544
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:14 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 17315
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:15 +0300] "GET /dashboard HTTP/1.1" 302 189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2603
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:15 +0300] "GET / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 40000
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:19 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 9291
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:19 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 9739
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:21 +0300] "GET /quality HTTP/1.1" 200 8292 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 10366
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:24 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2422
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:26 +0300] "GET /main_scan HTTP/1.1" 200 1981 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 6923
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:27 +0300] "GET /fg_scan HTTP/1.1" 200 23188 "https://quality.moto-adv.com/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 30751
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:31 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2426
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:33 +0300] "GET /etichete HTTP/1.1" 200 2420 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 54927
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:35 +0300] "GET /upload_data HTTP/1.1" 200 10558 "https://quality.moto-adv.com/etichete" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 21518
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:38 +0300] "GET /etichete HTTP/1.1" 200 2420 "https://quality.moto-adv.com/upload_data" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2995
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:40 +0300] "GET /print_module HTTP/1.1" 200 70135 "https://quality.moto-adv.com/etichete" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 58228
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:40 +0300] "GET /static/qz-tray.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 16021
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:40 +0300] "GET /static/JsBarcode.all.min.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 28667
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:40 +0300] "GET /static/html2canvas.min.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 35231
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:40 +0300] "GET /get_pairing_keys HTTP/1.1" 200 118 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 3023
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:41 +0300] "GET /get_unprinted_orders HTTP/1.1" 200 3 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 8089
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:45 +0300] "GET /etichete HTTP/1.1" 200 2420 "https://quality.moto-adv.com/print_module" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 40846
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:49 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/etichete" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 9861
|
||||
192.168.0.132 - - [15/Oct/2025:01:29:50 +0300] "GET /settings HTTP/1.1" 200 9105 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 29372
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:41 +0300] "HEAD / HTTP/1.1" 200 0 "-" "-" 51821
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:41 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 1706
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /static/css/login.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 12219
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /static/logo_login.jpg HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 5333
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /static/style.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 13946
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2079
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /static/script.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 27067
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:42 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2104
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:43 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 10666
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:43 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 10094
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:43 +0300] "GET /static/scan_me.jpg HTTP/1.1" 200 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 51915
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:45 +0300] "GET /main_scan HTTP/1.1" 200 1978 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 38423
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:47 +0300] "GET /fg_scan HTTP/1.1" 200 23185 "https://quality.moto-adv.com/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 32657
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:47 +0300] "GET /static/css/scan.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2641
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:52 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 8104
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:53 +0300] "GET /static/script.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 2178
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:53 +0300] "GET /static/style.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 1912
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:53 +0300] "GET /static/css/login.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 2623
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:53 +0300] "GET /static/css/base.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 2380
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:53 +0300] "GET /static/logo_login.jpg HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 32438
|
||||
192.168.0.132 - - [15/Oct/2025:15:39:54 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36" 3180
|
||||
192.168.0.132 - - [15/Oct/2025:15:46:15 +0300] "POST /fg_scan HTTP/1.1" 200 23790 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 41768
|
||||
192.168.0.132 - - [15/Oct/2025:15:46:58 +0300] "POST /fg_scan HTTP/1.1" 200 24394 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 70762
|
||||
192.168.0.132 - - [15/Oct/2025:15:47:44 +0300] "POST /fg_scan HTTP/1.1" 200 24997 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 15544
|
||||
192.168.0.132 - - [15/Oct/2025:15:48:03 +0300] "POST /fg_scan HTTP/1.1" 200 25601 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 41106
|
||||
192.168.0.132 - - [15/Oct/2025:15:48:26 +0300] "POST /fg_scan HTTP/1.1" 200 26205 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 91583
|
||||
192.168.0.132 - - [15/Oct/2025:15:49:21 +0300] "POST /fg_scan HTTP/1.1" 200 26810 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 12878
|
||||
192.168.0.132 - - [15/Oct/2025:15:49:38 +0300] "POST /fg_scan HTTP/1.1" 200 27413 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 76806
|
||||
192.168.0.132 - - [15/Oct/2025:15:49:48 +0300] "POST /fg_scan HTTP/1.1" 200 28017 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 14211
|
||||
192.168.0.132 - - [15/Oct/2025:15:49:56 +0300] "POST /fg_scan HTTP/1.1" 200 28621 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 13928
|
||||
192.168.0.132 - - [15/Oct/2025:15:50:02 +0300] "POST /fg_scan HTTP/1.1" 200 29225 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 13590
|
||||
192.168.0.132 - - [15/Oct/2025:15:50:55 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 10067
|
||||
192.168.0.132 - - [15/Oct/2025:15:50:57 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2988
|
||||
192.168.0.132 - - [15/Oct/2025:15:50:57 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2528
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:06 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 3070
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:06 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 9653
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:07 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 3316
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:07 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2520
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:11 +0300] "GET /main_scan HTTP/1.1" 200 1978 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 6865
|
||||
192.168.0.132 - - [15/Oct/2025:15:51:16 +0300] "GET /fg_scan HTTP/1.1" 200 29225 "https://quality.moto-adv.com/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 5743
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:53 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 41424
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:54 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2982
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:54 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 9731
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:56 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2857
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:56 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 2509
|
||||
192.168.0.132 - - [15/Oct/2025:15:58:57 +0300] "GET /warehouse HTTP/1.1" 200 2421 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 Edg/141.0.0.0" 8579
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:55 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" 1639
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:56 +0300] "GET /sitemap.xml HTTP/1.1" 404 207 "-" "fasthttp" 1943
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:56 +0300] "GET /sitemap.xml HTTP/1.1" 404 207 "-" "fasthttp" 1420
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:56 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "-" "fasthttp" 1322
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:56 +0300] "GET /robots.txt HTTP/1.1" 404 207 "-" "fasthttp" 1374
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:57 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" 2550
|
||||
192.168.0.132 - - [15/Oct/2025:16:46:57 +0300] "GET /sitemap.xml HTTP/1.1" 404 207 "-" "fasthttp" 1346
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 1787
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /static/css/login.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 1981
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /static/script.js HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2223
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /static/style.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2254
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /static/logo_login.jpg HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2182
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2082
|
||||
192.168.0.132 - - [15/Oct/2025:22:42:50 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2049
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:10 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 6531
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:10 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 9664
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:11 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 12203
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:25 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2443
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:25 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2433
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:29 +0300] "GET /quality HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2319
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:29 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2372
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:37 +0300] "GET /logout HTTP/1.1" 302 189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2324
|
||||
192.168.0.132 - - [15/Oct/2025:22:43:37 +0300] "GET / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2029
|
||||
192.168.0.132 - - [15/Oct/2025:22:44:04 +0300] "POST / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 12509
|
||||
192.168.0.132 - - [15/Oct/2025:22:44:22 +0300] "POST / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 7961
|
||||
192.168.0.132 - - [15/Oct/2025:22:44:45 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 6237
|
||||
192.168.0.132 - - [15/Oct/2025:22:44:45 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2471
|
||||
192.168.0.132 - - [15/Oct/2025:22:44:47 +0300] "GET /quality HTTP/1.1" 200 8292 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 10556
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:00 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2462
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:07 +0300] "GET /settings HTTP/1.1" 200 9105 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 26538
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:11 +0300] "GET /settings HTTP/1.1" 302 207 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 2098
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:11 +0300] "GET /dashboard HTTP/1.1" 302 189 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1426
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:11 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1645
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:12 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1632
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:12 +0300] "GET /static/css/login.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 2022
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:12 +0300] "GET /static/css/base.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1980
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:12 +0300] "GET /static/style.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 2032
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:12 +0300] "GET / HTTP/1.1" 200 1189 "-" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1610
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:13 +0300] "GET /static/css/login.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 2004
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:13 +0300] "GET /static/css/base.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1969
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:13 +0300] "GET /static/style.css HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1959
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:13 +0300] "GET /static/script.js HTTP/1.1" 200 0 "https://quality.moto-adv.com/" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Mobile Safari/537.36 (compatible; Google-Read-Aloud; +https://support.google.com/webmasters/answer/1061943)" 1970
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:39 +0300] "POST /delete_user HTTP/1.1" 302 205 "https://quality.moto-adv.com/settings" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 8755
|
||||
192.168.0.132 - - [15/Oct/2025:22:45:39 +0300] "GET /settings HTTP/1.1" 200 8603 "https://quality.moto-adv.com/settings" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 26163
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:05 +0300] "POST /create_user HTTP/1.1" 302 205 "https://quality.moto-adv.com/settings" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 9269
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:05 +0300] "GET /settings HTTP/1.1" 200 9120 "https://quality.moto-adv.com/settings" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 27376
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:16 +0300] "GET /dashboard HTTP/1.1" 200 2527 "https://quality.moto-adv.com/settings" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 2442
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:17 +0300] "GET /quality HTTP/1.1" 200 8292 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 10378
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:20 +0300] "GET /get_report_data?report=1 HTTP/1.1" 200 151 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 5109
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:37 +0300] "GET /generate_report?report=6&date=2025-10-15 HTTP/1.1" 200 260 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 6128
|
||||
192.168.0.132 - - [15/Oct/2025:22:46:50 +0300] "GET /get_report_data?report=5 HTTP/1.1" 200 318 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36" 4085
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:19 +0300] "GET /settings HTTP/1.1" 302 207 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 1978
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:19 +0300] "GET /dashboard HTTP/1.1" 302 189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2113
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:19 +0300] "GET / HTTP/1.1" 200 1189 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 1970
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:19 +0300] "GET /favicon.ico HTTP/1.1" 404 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 1712
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "POST / HTTP/1.1" 302 207 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 5754
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 9594
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "GET /static/css/base.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2385
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "GET /static/script.js HTTP/1.1" 304 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2150
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "GET /static/scan_me.jpg HTTP/1.1" 304 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2539
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:24 +0300] "GET /static/style.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2473
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:28 +0300] "GET /main_scan HTTP/1.1" 200 1978 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 6850
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:29 +0300] "GET /fg_scan HTTP/1.1" 200 29225 "https://quality.moto-adv.com/main_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 5666
|
||||
192.168.0.132 - - [16/Oct/2025:00:04:30 +0300] "GET /static/css/scan.css HTTP/1.1" 304 0 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2455
|
||||
192.168.0.132 - - [16/Oct/2025:00:05:32 +0300] "GET /dashboard HTTP/1.1" 200 2524 "https://quality.moto-adv.com/fg_scan" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 2311
|
||||
192.168.0.132 - - [16/Oct/2025:00:05:34 +0300] "GET /quality HTTP/1.1" 200 8289 "https://quality.moto-adv.com/dashboard" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 10335
|
||||
192.168.0.132 - - [16/Oct/2025:00:05:36 +0300] "GET /get_report_data?report=1 HTTP/1.1" 200 151 "https://quality.moto-adv.com/quality" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36" 4252
|
||||
116
logs/error.log
Normal file
116
logs/error.log
Normal file
@@ -0,0 +1,116 @@
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Starting gunicorn 23.0.0
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Listening at: http://0.0.0.0:8781 (284017)
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Using worker: sync
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Trasabilitate Application server is ready. Listening on: [('0.0.0.0', 8781)]
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:05 +0300] [284040] [INFO] Booting worker with pid: 284040
|
||||
[2025-10-15 00:30:05 +0300] [284040] [INFO] Worker spawned (pid: 284040)
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:05 +0300] [284041] [INFO] Booting worker with pid: 284041
|
||||
[2025-10-15 00:30:05 +0300] [284041] [INFO] Worker spawned (pid: 284041)
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:05 +0300] [284042] [INFO] Booting worker with pid: 284042
|
||||
[2025-10-15 00:30:05 +0300] [284042] [INFO] Worker spawned (pid: 284042)
|
||||
[2025-10-15 00:30:05 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:05 +0300] [284043] [INFO] Booting worker with pid: 284043
|
||||
[2025-10-15 00:30:05 +0300] [284043] [INFO] Worker spawned (pid: 284043)
|
||||
[2025-10-15 00:30:06 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:06 +0300] [284044] [INFO] Booting worker with pid: 284044
|
||||
[2025-10-15 00:30:06 +0300] [284044] [INFO] Worker spawned (pid: 284044)
|
||||
[2025-10-15 00:30:06 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:06 +0300] [284047] [INFO] Booting worker with pid: 284047
|
||||
[2025-10-15 00:30:06 +0300] [284047] [INFO] Worker spawned (pid: 284047)
|
||||
[2025-10-15 00:30:06 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:06 +0300] [284052] [INFO] Booting worker with pid: 284052
|
||||
[2025-10-15 00:30:06 +0300] [284052] [INFO] Worker spawned (pid: 284052)
|
||||
[2025-10-15 00:30:06 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:06 +0300] [284053] [INFO] Booting worker with pid: 284053
|
||||
[2025-10-15 00:30:06 +0300] [284053] [INFO] Worker spawned (pid: 284053)
|
||||
[2025-10-15 00:30:06 +0300] [284017] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 00:30:06 +0300] [284054] [INFO] Booting worker with pid: 284054
|
||||
[2025-10-15 00:30:06 +0300] [284054] [INFO] Worker spawned (pid: 284054)
|
||||
[2025-10-15 01:04:40 +0300] [284041] [INFO] Worker exiting (pid: 284041)
|
||||
[2025-10-15 01:04:40 +0300] [284040] [INFO] Worker exiting (pid: 284040)
|
||||
[2025-10-15 01:04:40 +0300] [284054] [INFO] Worker exiting (pid: 284054)
|
||||
[2025-10-15 01:04:40 +0300] [284017] [INFO] Handling signal: term
|
||||
[2025-10-15 01:04:40 +0300] [284053] [INFO] Worker exiting (pid: 284053)
|
||||
[2025-10-15 01:04:40 +0300] [284042] [INFO] Worker exiting (pid: 284042)
|
||||
[2025-10-15 01:04:40 +0300] [284047] [INFO] Worker exiting (pid: 284047)
|
||||
[2025-10-15 01:04:40 +0300] [284043] [INFO] Worker exiting (pid: 284043)
|
||||
[2025-10-15 01:04:40 +0300] [284044] [INFO] Worker exiting (pid: 284044)
|
||||
[2025-10-15 01:04:40 +0300] [284052] [INFO] Worker exiting (pid: 284052)
|
||||
[2025-10-15 01:04:40 +0300] [284017] [ERROR] Worker (pid:284041) was sent SIGTERM!
|
||||
[2025-10-15 01:04:41 +0300] [284017] [INFO] Shutting down: Master
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Starting gunicorn 23.0.0
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Listening at: http://0.0.0.0:8781 (288316)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Using worker: sync
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Trasabilitate Application server is ready. Listening on: [('0.0.0.0', 8781)]
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288317] [INFO] Booting worker with pid: 288317
|
||||
[2025-10-15 01:28:55 +0300] [288317] [INFO] Worker spawned (pid: 288317)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288318] [INFO] Booting worker with pid: 288318
|
||||
[2025-10-15 01:28:55 +0300] [288318] [INFO] Worker spawned (pid: 288318)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288319] [INFO] Booting worker with pid: 288319
|
||||
[2025-10-15 01:28:55 +0300] [288319] [INFO] Worker spawned (pid: 288319)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288320] [INFO] Booting worker with pid: 288320
|
||||
[2025-10-15 01:28:55 +0300] [288320] [INFO] Worker spawned (pid: 288320)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288321] [INFO] Booting worker with pid: 288321
|
||||
[2025-10-15 01:28:55 +0300] [288321] [INFO] Worker spawned (pid: 288321)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288322] [INFO] Booting worker with pid: 288322
|
||||
[2025-10-15 01:28:55 +0300] [288322] [INFO] Worker spawned (pid: 288322)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288323] [INFO] Booting worker with pid: 288323
|
||||
[2025-10-15 01:28:55 +0300] [288323] [INFO] Worker spawned (pid: 288323)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288324] [INFO] Booting worker with pid: 288324
|
||||
[2025-10-15 01:28:55 +0300] [288324] [INFO] Worker spawned (pid: 288324)
|
||||
[2025-10-15 01:28:55 +0300] [288316] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-15 01:28:55 +0300] [288325] [INFO] Booting worker with pid: 288325
|
||||
[2025-10-15 01:28:55 +0300] [288325] [INFO] Worker spawned (pid: 288325)
|
||||
[2025-10-16 00:06:02 +0300] [288316] [INFO] Handling signal: term
|
||||
[2025-10-16 00:06:02 +0300] [288317] [INFO] Worker exiting (pid: 288317)
|
||||
[2025-10-16 00:06:02 +0300] [288318] [INFO] Worker exiting (pid: 288318)
|
||||
[2025-10-16 00:06:02 +0300] [288319] [INFO] Worker exiting (pid: 288319)
|
||||
[2025-10-16 00:06:02 +0300] [288320] [INFO] Worker exiting (pid: 288320)
|
||||
[2025-10-16 00:06:02 +0300] [288322] [INFO] Worker exiting (pid: 288322)
|
||||
[2025-10-16 00:06:02 +0300] [288321] [INFO] Worker exiting (pid: 288321)
|
||||
[2025-10-16 00:06:02 +0300] [288323] [INFO] Worker exiting (pid: 288323)
|
||||
[2025-10-16 00:06:02 +0300] [288324] [INFO] Worker exiting (pid: 288324)
|
||||
[2025-10-16 00:06:02 +0300] [288325] [INFO] Worker exiting (pid: 288325)
|
||||
[2025-10-16 00:06:03 +0300] [288316] [INFO] Shutting down: Master
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Starting gunicorn 23.0.0
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Listening at: http://0.0.0.0:8781 (299414)
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Using worker: sync
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Trasabilitate Application server is ready. Listening on: [('0.0.0.0', 8781)]
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:31 +0300] [299432] [INFO] Booting worker with pid: 299432
|
||||
[2025-10-16 02:34:31 +0300] [299432] [INFO] Worker spawned (pid: 299432)
|
||||
[2025-10-16 02:34:31 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:31 +0300] [299438] [INFO] Booting worker with pid: 299438
|
||||
[2025-10-16 02:34:31 +0300] [299438] [INFO] Worker spawned (pid: 299438)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299439] [INFO] Booting worker with pid: 299439
|
||||
[2025-10-16 02:34:32 +0300] [299439] [INFO] Worker spawned (pid: 299439)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299440] [INFO] Booting worker with pid: 299440
|
||||
[2025-10-16 02:34:32 +0300] [299440] [INFO] Worker spawned (pid: 299440)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299441] [INFO] Booting worker with pid: 299441
|
||||
[2025-10-16 02:34:32 +0300] [299441] [INFO] Worker spawned (pid: 299441)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299442] [INFO] Booting worker with pid: 299442
|
||||
[2025-10-16 02:34:32 +0300] [299442] [INFO] Worker spawned (pid: 299442)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299443] [INFO] Booting worker with pid: 299443
|
||||
[2025-10-16 02:34:32 +0300] [299443] [INFO] Worker spawned (pid: 299443)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299444] [INFO] Booting worker with pid: 299444
|
||||
[2025-10-16 02:34:32 +0300] [299444] [INFO] Worker spawned (pid: 299444)
|
||||
[2025-10-16 02:34:32 +0300] [299414] [INFO] Worker spawned (pid: [booting])
|
||||
[2025-10-16 02:34:32 +0300] [299445] [INFO] Booting worker with pid: 299445
|
||||
[2025-10-16 02:34:32 +0300] [299445] [INFO] Worker spawned (pid: 299445)
|
||||
133
old code/DATABASE_SETUP_README.md
Normal file
133
old code/DATABASE_SETUP_README.md
Normal file
@@ -0,0 +1,133 @@
|
||||
# Quick Database Setup for Trasabilitate Application
|
||||
|
||||
This script provides a complete one-step database setup for quick deployment of the Trasabilitate application.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before running the setup script, ensure:
|
||||
|
||||
1. **MariaDB is installed and running**
|
||||
2. **Database and user are created**:
|
||||
```sql
|
||||
CREATE DATABASE trasabilitate;
|
||||
CREATE USER 'trasabilitate'@'localhost' IDENTIFIED BY 'Initial01!';
|
||||
GRANT ALL PRIVILEGES ON trasabilitate.* TO 'trasabilitate'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
3. **Python virtual environment is activated**:
|
||||
```bash
|
||||
source ../recticel/bin/activate
|
||||
```
|
||||
4. **Python dependencies are installed**:
|
||||
```bash
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Quick Setup (Recommended)
|
||||
```bash
|
||||
cd /srv/quality_recticel/py_app
|
||||
source ../recticel/bin/activate
|
||||
python3 app/db_create_scripts/setup_complete_database.py
|
||||
```
|
||||
|
||||
### What the script creates:
|
||||
|
||||
#### MariaDB Tables:
|
||||
- `scan1_orders` - Quality scanning data for process 1
|
||||
- `scanfg_orders` - Quality scanning data for finished goods
|
||||
- `order_for_labels` - Label printing orders
|
||||
- `warehouse_locations` - Warehouse location management
|
||||
- `permissions` - System permissions
|
||||
- `role_permissions` - Role-permission mappings
|
||||
- `role_hierarchy` - User role hierarchy
|
||||
- `permission_audit_log` - Permission change audit trail
|
||||
|
||||
#### Database Triggers:
|
||||
- Auto-increment approved/rejected quantities based on quality codes
|
||||
- Triggers for both scan1_orders and scanfg_orders tables
|
||||
|
||||
#### SQLite Tables:
|
||||
- `users` - User authentication (in instance/users.db)
|
||||
- `roles` - User roles (in instance/users.db)
|
||||
|
||||
#### Configuration:
|
||||
- Updates `instance/external_server.conf` with correct database settings
|
||||
- Creates default superadmin user (username: `superadmin`, password: `superadmin123`)
|
||||
|
||||
#### Permission System:
|
||||
- 7 user roles (superadmin, admin, manager, quality_manager, warehouse_manager, quality_worker, warehouse_worker)
|
||||
- 25+ granular permissions for different application areas
|
||||
- Complete role hierarchy with inheritance
|
||||
|
||||
## After Setup
|
||||
|
||||
1. **Start the application**:
|
||||
```bash
|
||||
python3 run.py
|
||||
```
|
||||
|
||||
2. **Access the application**:
|
||||
- Local: http://127.0.0.1:8781
|
||||
- Network: http://192.168.0.205:8781
|
||||
|
||||
3. **Login with superadmin**:
|
||||
- Username: `superadmin`
|
||||
- Password: `superadmin123`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues:
|
||||
|
||||
1. **Database connection failed**:
|
||||
- Check if MariaDB is running: `sudo systemctl status mariadb`
|
||||
- Verify database exists: `sudo mysql -e "SHOW DATABASES;"`
|
||||
- Check user privileges: `sudo mysql -e "SHOW GRANTS FOR 'trasabilitate'@'localhost';"`
|
||||
|
||||
2. **Import errors**:
|
||||
- Ensure virtual environment is activated
|
||||
- Install missing dependencies: `pip install -r requirements.txt`
|
||||
|
||||
3. **Permission denied**:
|
||||
- Make script executable: `chmod +x app/db_create_scripts/setup_complete_database.py`
|
||||
- Check file ownership: `ls -la app/db_create_scripts/`
|
||||
|
||||
### Manual Database Recreation:
|
||||
|
||||
If you need to completely reset the database:
|
||||
|
||||
```bash
|
||||
# Drop and recreate database
|
||||
sudo mysql -e "DROP DATABASE IF EXISTS trasabilitate; CREATE DATABASE trasabilitate; GRANT ALL PRIVILEGES ON trasabilitate.* TO 'trasabilitate'@'localhost'; FLUSH PRIVILEGES;"
|
||||
|
||||
# Remove SQLite database
|
||||
rm -f instance/users.db
|
||||
|
||||
# Run setup script
|
||||
python3 app/db_create_scripts/setup_complete_database.py
|
||||
```
|
||||
|
||||
## Script Features
|
||||
|
||||
- ✅ **Comprehensive**: Creates all necessary database structure
|
||||
- ✅ **Safe**: Uses `IF NOT EXISTS` clauses to prevent conflicts
|
||||
- ✅ **Verified**: Includes verification step to confirm setup
|
||||
- ✅ **Informative**: Detailed output showing each step
|
||||
- ✅ **Error handling**: Clear error messages and troubleshooting hints
|
||||
- ✅ **Idempotent**: Can be run multiple times safely
|
||||
|
||||
## Development Notes
|
||||
|
||||
The script combines functionality from these individual scripts:
|
||||
- `create_scan_1db.py`
|
||||
- `create_scanfg_orders.py`
|
||||
- `create_order_for_labels_table.py`
|
||||
- `create_warehouse_locations_table.py`
|
||||
- `create_permissions_tables.py`
|
||||
- `create_roles_table.py`
|
||||
- `create_triggers.py`
|
||||
- `create_triggers_fg.py`
|
||||
- `populate_permissions.py`
|
||||
|
||||
For development or debugging, you can still run individual scripts if needed.
|
||||
319
old code/DOCKER_DEPLOYMENT.md
Normal file
319
old code/DOCKER_DEPLOYMENT.md
Normal file
@@ -0,0 +1,319 @@
|
||||
# Recticel Quality Application - Docker Deployment Guide
|
||||
|
||||
## 📋 Overview
|
||||
|
||||
This is a complete Docker-based deployment solution for the Recticel Quality Application. It includes:
|
||||
- **Flask Web Application** (Python 3.10)
|
||||
- **MariaDB 11.3 Database** with automatic initialization
|
||||
- **Gunicorn WSGI Server** for production-ready performance
|
||||
- **Automatic database schema setup** using existing setup scripts
|
||||
- **Superadmin user seeding** for immediate access
|
||||
|
||||
## 🚀 Quick Start
|
||||
|
||||
### Prerequisites
|
||||
- Docker Engine 20.10+
|
||||
- Docker Compose 2.0+
|
||||
- At least 2GB free disk space
|
||||
- Ports 8781 and 3306 available (or customize in .env)
|
||||
|
||||
### 1. Clone and Prepare
|
||||
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
```
|
||||
|
||||
### 2. Configure Environment (Optional)
|
||||
|
||||
Create a `.env` file from the example:
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
Edit `.env` to customize settings:
|
||||
```env
|
||||
MYSQL_ROOT_PASSWORD=your_secure_root_password
|
||||
DB_PORT=3306
|
||||
APP_PORT=8781
|
||||
INIT_DB=true
|
||||
SEED_DB=true
|
||||
```
|
||||
|
||||
### 3. Build and Deploy
|
||||
|
||||
Start all services:
|
||||
|
||||
```bash
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
This will:
|
||||
1. ✅ Build the Flask application Docker image
|
||||
2. ✅ Pull MariaDB 11.3 image
|
||||
3. ✅ Create and initialize the database
|
||||
4. ✅ Run all database schema creation scripts
|
||||
5. ✅ Seed the superadmin user
|
||||
6. ✅ Start the web application on port 8781
|
||||
|
||||
### 4. Verify Deployment
|
||||
|
||||
Check service status:
|
||||
```bash
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
View logs:
|
||||
```bash
|
||||
# All services
|
||||
docker-compose logs -f
|
||||
|
||||
# Just the web app
|
||||
docker-compose logs -f web
|
||||
|
||||
# Just the database
|
||||
docker-compose logs -f db
|
||||
```
|
||||
|
||||
### 5. Access the Application
|
||||
|
||||
Open your browser and navigate to:
|
||||
```
|
||||
http://localhost:8781
|
||||
```
|
||||
|
||||
**Default Login:**
|
||||
- Username: `superadmin`
|
||||
- Password: `superadmin123`
|
||||
|
||||
## 🔧 Management Commands
|
||||
|
||||
### Start Services
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Stop Services
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
|
||||
### Stop and Remove All Data (including database)
|
||||
```bash
|
||||
docker-compose down -v
|
||||
```
|
||||
|
||||
### Restart Services
|
||||
```bash
|
||||
docker-compose restart
|
||||
```
|
||||
|
||||
### View Real-time Logs
|
||||
```bash
|
||||
docker-compose logs -f
|
||||
```
|
||||
|
||||
### Rebuild After Code Changes
|
||||
```bash
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
### Access Database Console
|
||||
```bash
|
||||
docker-compose exec db mariadb -u trasabilitate -p trasabilitate
|
||||
# Password: Initial01!
|
||||
```
|
||||
|
||||
### Execute Commands in App Container
|
||||
```bash
|
||||
docker-compose exec web bash
|
||||
```
|
||||
|
||||
## 📁 Data Persistence
|
||||
|
||||
The following data is persisted across container restarts:
|
||||
|
||||
- **Database Data:** Stored in Docker volume `mariadb_data`
|
||||
- **Application Logs:** Mapped to `./logs` directory
|
||||
- **Instance Config:** Mapped to `./instance` directory
|
||||
|
||||
## 🔐 Security Considerations
|
||||
|
||||
### Production Deployment Checklist:
|
||||
|
||||
1. **Change Default Passwords:**
|
||||
- Update `MYSQL_ROOT_PASSWORD` in `.env`
|
||||
- Update database password in `docker-compose.yml`
|
||||
- Change superadmin password after first login
|
||||
|
||||
2. **Use Environment Variables:**
|
||||
- Never commit `.env` file to version control
|
||||
- Use secrets management for production
|
||||
|
||||
3. **Network Security:**
|
||||
- If database access from host is not needed, remove the port mapping:
|
||||
```yaml
|
||||
# Comment out in docker-compose.yml:
|
||||
# ports:
|
||||
# - "3306:3306"
|
||||
```
|
||||
|
||||
4. **SSL/TLS:**
|
||||
- Configure reverse proxy (nginx/traefik) for HTTPS
|
||||
- Update gunicorn SSL configuration if needed
|
||||
|
||||
5. **Firewall:**
|
||||
- Only expose necessary ports
|
||||
- Use firewall rules to restrict access
|
||||
|
||||
## 🐛 Troubleshooting
|
||||
|
||||
### Database Connection Issues
|
||||
|
||||
If the app can't connect to the database:
|
||||
|
||||
```bash
|
||||
# Check database health
|
||||
docker-compose exec db healthcheck.sh --connect
|
||||
|
||||
# Check database logs
|
||||
docker-compose logs db
|
||||
|
||||
# Verify database is accessible
|
||||
docker-compose exec db mariadb -u trasabilitate -p -e "SHOW DATABASES;"
|
||||
```
|
||||
|
||||
### Application Not Starting
|
||||
|
||||
```bash
|
||||
# Check application logs
|
||||
docker-compose logs web
|
||||
|
||||
# Verify database initialization
|
||||
docker-compose exec web python3 -c "import mariadb; print('MariaDB module OK')"
|
||||
|
||||
# Restart with fresh initialization
|
||||
docker-compose down
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Port Already in Use
|
||||
|
||||
If port 8781 or 3306 is already in use, edit `.env`:
|
||||
|
||||
```env
|
||||
APP_PORT=8782
|
||||
DB_PORT=3307
|
||||
```
|
||||
|
||||
Then restart:
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Reset Everything
|
||||
|
||||
To start completely fresh:
|
||||
|
||||
```bash
|
||||
# Stop and remove all containers, networks, and volumes
|
||||
docker-compose down -v
|
||||
|
||||
# Remove any local data
|
||||
rm -rf logs/* instance/external_server.conf
|
||||
|
||||
# Start fresh
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
## 🔄 Updating the Application
|
||||
|
||||
### Update Application Code
|
||||
|
||||
1. Make your code changes
|
||||
2. Rebuild and restart:
|
||||
```bash
|
||||
docker-compose up -d --build web
|
||||
```
|
||||
|
||||
### Update Database Schema
|
||||
|
||||
If you need to run migrations or schema updates:
|
||||
|
||||
```bash
|
||||
docker-compose exec web python3 /app/app/db_create_scripts/setup_complete_database.py
|
||||
```
|
||||
|
||||
## 📊 Monitoring
|
||||
|
||||
### Health Checks
|
||||
|
||||
Both services have health checks configured:
|
||||
|
||||
```bash
|
||||
# Check overall status
|
||||
docker-compose ps
|
||||
|
||||
# Detailed health status
|
||||
docker inspect recticel-app | grep -A 10 Health
|
||||
docker inspect recticel-db | grep -A 10 Health
|
||||
```
|
||||
|
||||
### Resource Usage
|
||||
|
||||
```bash
|
||||
# View resource consumption
|
||||
docker stats recticel-app recticel-db
|
||||
```
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────┐
|
||||
│ Docker Compose Network │
|
||||
│ │
|
||||
│ ┌──────────────┐ ┌─────────────┐ │
|
||||
│ │ MariaDB │ │ Flask App │ │
|
||||
│ │ Container │◄─┤ Container │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ Port: 3306 │ │ Port: 8781 │ │
|
||||
│ └──────┬───────┘ └──────┬──────┘ │
|
||||
│ │ │ │
|
||||
└─────────┼─────────────────┼─────────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
[Volume: [Logs &
|
||||
mariadb_data] Instance]
|
||||
```
|
||||
|
||||
## 📝 Environment Variables
|
||||
|
||||
### Database Configuration
|
||||
- `MYSQL_ROOT_PASSWORD`: MariaDB root password
|
||||
- `DB_HOST`: Database hostname (default: `db`)
|
||||
- `DB_PORT`: Database port (default: `3306`)
|
||||
- `DB_NAME`: Database name (default: `trasabilitate`)
|
||||
- `DB_USER`: Database user (default: `trasabilitate`)
|
||||
- `DB_PASSWORD`: Database password (default: `Initial01!`)
|
||||
|
||||
### Application Configuration
|
||||
- `FLASK_ENV`: Flask environment (default: `production`)
|
||||
- `FLASK_APP`: Flask app entry point (default: `run.py`)
|
||||
- `APP_PORT`: Application port (default: `8781`)
|
||||
|
||||
### Initialization Flags
|
||||
- `INIT_DB`: Run database initialization (default: `true`)
|
||||
- `SEED_DB`: Seed superadmin user (default: `true`)
|
||||
|
||||
## 🆘 Support
|
||||
|
||||
For issues or questions:
|
||||
1. Check the logs: `docker-compose logs -f`
|
||||
2. Verify environment configuration
|
||||
3. Ensure all prerequisites are met
|
||||
4. Review this documentation
|
||||
|
||||
## 📄 License
|
||||
|
||||
[Your License Here]
|
||||
346
old code/DOCKER_SOLUTION_SUMMARY.md
Normal file
346
old code/DOCKER_SOLUTION_SUMMARY.md
Normal file
@@ -0,0 +1,346 @@
|
||||
# Recticel Quality Application - Docker Solution Summary
|
||||
|
||||
## 📦 What Has Been Created
|
||||
|
||||
A complete, production-ready Docker deployment solution for your Recticel Quality Application with the following components:
|
||||
|
||||
### Core Files Created
|
||||
|
||||
1. **`Dockerfile`** - Multi-stage Flask application container
|
||||
- Based on Python 3.10-slim
|
||||
- Installs all dependencies from requirements.txt
|
||||
- Configures Gunicorn WSGI server
|
||||
- Exposes port 8781
|
||||
|
||||
2. **`docker-compose.yml`** - Complete orchestration configuration
|
||||
- MariaDB 11.3 database service
|
||||
- Flask web application service
|
||||
- Automatic networking between services
|
||||
- Health checks for both services
|
||||
- Volume persistence for database and logs
|
||||
|
||||
3. **`docker-entrypoint.sh`** - Smart initialization script
|
||||
- Waits for database to be ready
|
||||
- Creates database configuration file
|
||||
- Runs database schema initialization
|
||||
- Seeds superadmin user
|
||||
- Starts the application
|
||||
|
||||
4. **`init-db.sql`** - MariaDB initialization
|
||||
- Creates database and user
|
||||
- Sets up permissions automatically
|
||||
|
||||
5. **`.env.example`** - Configuration template
|
||||
- Database passwords
|
||||
- Port configurations
|
||||
- Initialization flags
|
||||
|
||||
6. **`.dockerignore`** - Build optimization
|
||||
- Excludes unnecessary files from Docker image
|
||||
- Reduces image size
|
||||
|
||||
7. **`deploy.sh`** - One-command deployment script
|
||||
- Checks prerequisites
|
||||
- Creates configuration
|
||||
- Builds and starts services
|
||||
- Shows deployment status
|
||||
|
||||
8. **`Makefile`** - Convenient management commands
|
||||
- `make install` - First-time installation
|
||||
- `make up` - Start services
|
||||
- `make down` - Stop services
|
||||
- `make logs` - View logs
|
||||
- `make shell` - Access container
|
||||
- `make backup-db` - Backup database
|
||||
- And many more...
|
||||
|
||||
9. **`DOCKER_DEPLOYMENT.md`** - Complete documentation
|
||||
- Quick start guide
|
||||
- Management commands
|
||||
- Troubleshooting
|
||||
- Security considerations
|
||||
- Architecture diagrams
|
||||
|
||||
### Enhanced Files
|
||||
|
||||
10. **`setup_complete_database.py`** - Updated to support Docker
|
||||
- Now reads from environment variables
|
||||
- Fallback to config file for non-Docker deployments
|
||||
- Maintains backward compatibility
|
||||
|
||||
## 🎯 Key Features
|
||||
|
||||
### 1. Single-Command Deployment
|
||||
```bash
|
||||
./deploy.sh
|
||||
```
|
||||
This single command will:
|
||||
- ✅ Build Docker images
|
||||
- ✅ Create MariaDB database
|
||||
- ✅ Initialize all database tables and triggers
|
||||
- ✅ Seed superadmin user
|
||||
- ✅ Start the application
|
||||
|
||||
### 2. Complete Isolation
|
||||
- Application runs in its own container
|
||||
- Database runs in its own container
|
||||
- No system dependencies needed except Docker
|
||||
- No Python/MariaDB installation on host required
|
||||
|
||||
### 3. Data Persistence
|
||||
- Database data persists across restarts (Docker volume)
|
||||
- Application logs accessible on host
|
||||
- Configuration preserved
|
||||
|
||||
### 4. Production Ready
|
||||
- Gunicorn WSGI server (not Flask dev server)
|
||||
- Health checks for monitoring
|
||||
- Automatic restart on failure
|
||||
- Proper logging configuration
|
||||
- Resource isolation
|
||||
|
||||
### 5. Easy Management
|
||||
```bash
|
||||
# Start
|
||||
docker compose up -d
|
||||
|
||||
# Stop
|
||||
docker compose down
|
||||
|
||||
# View logs
|
||||
docker compose logs -f
|
||||
|
||||
# Backup database
|
||||
make backup-db
|
||||
|
||||
# Restore database
|
||||
make restore-db BACKUP=backup_20231215.sql
|
||||
|
||||
# Access shell
|
||||
make shell
|
||||
|
||||
# Complete reset
|
||||
make reset
|
||||
```
|
||||
|
||||
## 🚀 Deployment Options
|
||||
|
||||
### Option 1: Quick Deploy (Recommended for Testing)
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
### Option 2: Using Makefile (Recommended for Management)
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
make install # First time only
|
||||
make up # Start services
|
||||
make logs # Monitor
|
||||
```
|
||||
|
||||
### Option 3: Using Docker Compose Directly
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
cp .env.example .env
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
## 📋 Prerequisites
|
||||
|
||||
The deployment **requires** Docker to be installed on the target system:
|
||||
|
||||
### Installing Docker on Ubuntu/Debian:
|
||||
```bash
|
||||
# Update package index
|
||||
sudo apt-get update
|
||||
|
||||
# Install dependencies
|
||||
sudo apt-get install -y ca-certificates curl gnupg
|
||||
|
||||
# Add Docker's official GPG key
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
|
||||
# Set up the repository
|
||||
echo \
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
|
||||
# Install Docker Engine
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
|
||||
# Add current user to docker group (optional, to run without sudo)
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
After installation, log out and back in for group changes to take effect.
|
||||
|
||||
### Installing Docker on CentOS/RHEL:
|
||||
```bash
|
||||
sudo yum install -y yum-utils
|
||||
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
|
||||
sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||
sudo systemctl start docker
|
||||
sudo systemctl enable docker
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────┐
|
||||
│ Docker Compose Stack │
|
||||
│ │
|
||||
│ ┌────────────────────┐ ┌───────────────────┐ │
|
||||
│ │ MariaDB 11.3 │ │ Flask App │ │
|
||||
│ │ Container │◄─────┤ Container │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ - Port: 3306 │ │ - Port: 8781 │ │
|
||||
│ │ - Volume: DB Data │ │ - Gunicorn WSGI │ │
|
||||
│ │ - Auto Init │ │ - Python 3.10 │ │
|
||||
│ │ - Health Checks │ │ - Health Checks │ │
|
||||
│ └──────────┬─────────┘ └─────────┬─────────┘ │
|
||||
│ │ │ │
|
||||
└─────────────┼──────────────────────────┼─────────────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
[mariadb_data] [logs directory]
|
||||
Docker Volume Host filesystem
|
||||
```
|
||||
|
||||
## 🔐 Security Features
|
||||
|
||||
1. **Database Isolation**: Database not exposed to host by default (can be configured)
|
||||
2. **Password Management**: All passwords in `.env` file (not committed to git)
|
||||
3. **User Permissions**: Proper MariaDB user with limited privileges
|
||||
4. **Network Isolation**: Services communicate on private Docker network
|
||||
5. **Production Mode**: Flask runs in production mode with Gunicorn
|
||||
|
||||
## 📊 What Gets Deployed
|
||||
|
||||
### Database Schema
|
||||
All tables from `setup_complete_database.py`:
|
||||
- `scan1_orders` - First scan orders
|
||||
- `scanfg_orders` - Final goods scan orders
|
||||
- `order_for_labels` - Label orders
|
||||
- `warehouse_locations` - Warehouse locations
|
||||
- `permissions` - Permission system
|
||||
- `role_permissions` - Role-based access
|
||||
- `role_hierarchy` - Role hierarchy
|
||||
- `permission_audit_log` - Audit logging
|
||||
- Plus SQLAlchemy tables: `users`, `roles`
|
||||
|
||||
### Initial Data
|
||||
- Superadmin user: `superadmin` / `superadmin123`
|
||||
|
||||
### Application Features
|
||||
- Complete Flask web application
|
||||
- Gunicorn WSGI server (4-8 workers depending on CPU)
|
||||
- Static file serving
|
||||
- Session management
|
||||
- Database connection pooling
|
||||
|
||||
## 🔄 Migration from Existing Deployment
|
||||
|
||||
If you have an existing non-Docker deployment:
|
||||
|
||||
### 1. Backup Current Data
|
||||
```bash
|
||||
# Backup database
|
||||
mysqldump -u trasabilitate -p trasabilitate > backup.sql
|
||||
|
||||
# Backup any uploaded files or custom data
|
||||
cp -r py_app/instance backup_instance/
|
||||
```
|
||||
|
||||
### 2. Deploy Docker Solution
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
### 3. Restore Data (if needed)
|
||||
```bash
|
||||
# Restore database
|
||||
docker compose exec -T db mariadb -u trasabilitate -pInitial01! trasabilitate < backup.sql
|
||||
```
|
||||
|
||||
### 4. Stop Old Service
|
||||
```bash
|
||||
# Stop systemd service
|
||||
sudo systemctl stop trasabilitate
|
||||
sudo systemctl disable trasabilitate
|
||||
```
|
||||
|
||||
## 🎓 Learning Resources
|
||||
|
||||
- Docker Compose docs: https://docs.docker.com/compose/
|
||||
- Gunicorn configuration: https://docs.gunicorn.org/
|
||||
- MariaDB Docker: https://hub.docker.com/_/mariadb
|
||||
|
||||
## ✅ Testing Checklist
|
||||
|
||||
After deployment, verify:
|
||||
|
||||
- [ ] Services are running: `docker compose ps`
|
||||
- [ ] App is accessible: http://localhost:8781
|
||||
- [ ] Can log in with superadmin
|
||||
- [ ] Database contains tables: `make shell-db` then `SHOW TABLES;`
|
||||
- [ ] Logs are being written: `ls -la logs/`
|
||||
- [ ] Can restart services: `docker compose restart`
|
||||
- [ ] Data persists after restart
|
||||
|
||||
## 🆘 Support Commands
|
||||
|
||||
```bash
|
||||
# View all services
|
||||
docker compose ps
|
||||
|
||||
# View logs
|
||||
docker compose logs -f
|
||||
|
||||
# Restart a specific service
|
||||
docker compose restart web
|
||||
|
||||
# Access web container shell
|
||||
docker compose exec web bash
|
||||
|
||||
# Access database
|
||||
docker compose exec db mariadb -u trasabilitate -p
|
||||
|
||||
# Check resource usage
|
||||
docker stats
|
||||
|
||||
# Remove everything and start fresh
|
||||
docker compose down -v
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 📝 Next Steps
|
||||
|
||||
1. **Install Docker** on the target server (if not already installed)
|
||||
2. **Review and customize** `.env` file after copying from `.env.example`
|
||||
3. **Run deployment**: `./deploy.sh`
|
||||
4. **Change default passwords** after first login
|
||||
5. **Set up reverse proxy** (nginx/traefik) for HTTPS if needed
|
||||
6. **Configure backups** using `make backup-db`
|
||||
7. **Monitor logs** regularly with `make logs`
|
||||
|
||||
## 🎉 Benefits of This Solution
|
||||
|
||||
1. **Portable**: Works on any system with Docker
|
||||
2. **Reproducible**: Same deployment every time
|
||||
3. **Isolated**: No conflicts with system packages
|
||||
4. **Easy Updates**: Just rebuild and restart
|
||||
5. **Scalable**: Can easily add more services
|
||||
6. **Professional**: Production-ready configuration
|
||||
7. **Documented**: Complete documentation included
|
||||
8. **Maintainable**: Simple management commands
|
||||
|
||||
---
|
||||
|
||||
**Your Flask application is now ready for modern, containerized deployment! 🚀**
|
||||
280
old code/FILES_CREATED.md
Normal file
280
old code/FILES_CREATED.md
Normal file
@@ -0,0 +1,280 @@
|
||||
# ✅ Docker Solution - Files Created
|
||||
|
||||
## 📦 Complete Docker Deployment Package
|
||||
|
||||
Your Flask application has been packaged into a complete Docker solution. Here's everything that was created:
|
||||
|
||||
### Core Docker Files
|
||||
|
||||
```
|
||||
/srv/quality_recticel/
|
||||
├── Dockerfile # Flask app container definition
|
||||
├── docker-compose.yml # Multi-container orchestration
|
||||
├── docker-entrypoint.sh # Container initialization script
|
||||
├── init-db.sql # MariaDB initialization
|
||||
├── .dockerignore # Build optimization
|
||||
└── .env.example # Configuration template
|
||||
```
|
||||
|
||||
### Deployment & Management
|
||||
|
||||
```
|
||||
├── deploy.sh # One-command deployment script
|
||||
├── Makefile # Management commands (make up, make down, etc.)
|
||||
├── README-DOCKER.md # Quick start guide
|
||||
├── DOCKER_DEPLOYMENT.md # Complete deployment documentation
|
||||
└── DOCKER_SOLUTION_SUMMARY.md # This comprehensive summary
|
||||
```
|
||||
|
||||
### Modified Files
|
||||
|
||||
```
|
||||
py_app/app/db_create_scripts/
|
||||
└── setup_complete_database.py # Updated to support Docker env vars
|
||||
```
|
||||
|
||||
## 🎯 What This Deployment Includes
|
||||
|
||||
### Services
|
||||
1. **Flask Web Application**
|
||||
- Python 3.10
|
||||
- Gunicorn WSGI server (production-ready)
|
||||
- Auto-generated database configuration
|
||||
- Health checks
|
||||
- Automatic restart on failure
|
||||
|
||||
2. **MariaDB 11.3 Database**
|
||||
- Automatic initialization
|
||||
- User and database creation
|
||||
- Data persistence (Docker volume)
|
||||
- Health checks
|
||||
|
||||
### Features
|
||||
- ✅ Single-command deployment
|
||||
- ✅ Automatic database schema setup
|
||||
- ✅ Superadmin user seeding
|
||||
- ✅ Data persistence across restarts
|
||||
- ✅ Container health monitoring
|
||||
- ✅ Log collection and management
|
||||
- ✅ Production-ready configuration
|
||||
- ✅ Easy backup and restore
|
||||
- ✅ Complete isolation from host system
|
||||
|
||||
## 🚀 How to Deploy
|
||||
|
||||
### Prerequisites
|
||||
**Install Docker first:**
|
||||
```bash
|
||||
# Ubuntu/Debian
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
sudo usermod -aG docker $USER
|
||||
# Log out and back in
|
||||
```
|
||||
|
||||
### Deploy
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
That's it! Your application will be available at http://localhost:8781
|
||||
|
||||
## 📋 Usage Examples
|
||||
|
||||
### Basic Operations
|
||||
```bash
|
||||
# Start services
|
||||
docker compose up -d
|
||||
|
||||
# View logs
|
||||
docker compose logs -f
|
||||
|
||||
# Stop services
|
||||
docker compose down
|
||||
|
||||
# Restart
|
||||
docker compose restart
|
||||
|
||||
# Check status
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
### Using Makefile (Recommended)
|
||||
```bash
|
||||
make install # First-time setup
|
||||
make up # Start services
|
||||
make down # Stop services
|
||||
make logs # View logs
|
||||
make logs-web # View only web logs
|
||||
make logs-db # View only database logs
|
||||
make shell # Access app container
|
||||
make shell-db # Access database console
|
||||
make backup-db # Backup database
|
||||
make status # Show service status
|
||||
make help # Show all commands
|
||||
```
|
||||
|
||||
### Advanced Operations
|
||||
```bash
|
||||
# Rebuild after code changes
|
||||
docker compose up -d --build web
|
||||
|
||||
# Access application shell
|
||||
docker compose exec web bash
|
||||
|
||||
# Run database commands
|
||||
docker compose exec db mariadb -u trasabilitate -p trasabilitate
|
||||
|
||||
# View resource usage
|
||||
docker stats recticel-app recticel-db
|
||||
|
||||
# Complete reset (removes all data!)
|
||||
docker compose down -v
|
||||
```
|
||||
|
||||
## 🗂️ Data Storage
|
||||
|
||||
### Persistent Data
|
||||
- **Database**: Stored in Docker volume `mariadb_data`
|
||||
- **Logs**: Mounted to `./logs` directory
|
||||
- **Config**: Mounted to `./instance` directory
|
||||
|
||||
### Backup Database
|
||||
```bash
|
||||
docker compose exec -T db mariadb-dump -u trasabilitate -pInitial01! trasabilitate > backup.sql
|
||||
```
|
||||
|
||||
### Restore Database
|
||||
```bash
|
||||
docker compose exec -T db mariadb -u trasabilitate -pInitial01! trasabilitate < backup.sql
|
||||
```
|
||||
|
||||
## 🔐 Default Credentials
|
||||
|
||||
### Application
|
||||
- URL: http://localhost:8781
|
||||
- Username: `superadmin`
|
||||
- Password: `superadmin123`
|
||||
- **⚠️ Change after first login!**
|
||||
|
||||
### Database
|
||||
- Host: `localhost:3306` (from host) or `db:3306` (from containers)
|
||||
- Database: `trasabilitate`
|
||||
- User: `trasabilitate`
|
||||
- Password: `Initial01!`
|
||||
- Root Password: Set in `.env` file
|
||||
|
||||
## 📊 Service Architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────────────────┐
|
||||
│ recticel-network (Docker) │
|
||||
│ │
|
||||
│ ┌─────────────────┐ ┌─────────────────┐ │
|
||||
│ │ recticel-db │ │ recticel-app │ │
|
||||
│ │ (MariaDB 11.3) │◄───────┤ (Flask/Python) │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ - Internal DB │ │ - Gunicorn │ │
|
||||
│ │ - Health Check │ │ - Health Check │ │
|
||||
│ │ - Auto Init │ │ - Auto Config │ │
|
||||
│ └────────┬────────┘ └────────┬────────┘ │
|
||||
│ │ │ │
|
||||
│ │ 3306 (optional) 8781 │ │
|
||||
└────────────┼──────────────────────────┼────────────┘
|
||||
│ │
|
||||
▼ ▼
|
||||
[mariadb_data] [Host: 8781]
|
||||
Docker Volume Application Access
|
||||
```
|
||||
|
||||
## 🎓 Quick Reference
|
||||
|
||||
### Environment Variables (.env)
|
||||
```env
|
||||
MYSQL_ROOT_PASSWORD=rootpassword # MariaDB root password
|
||||
DB_PORT=3306 # Database port (external)
|
||||
APP_PORT=8781 # Application port
|
||||
INIT_DB=true # Run DB initialization
|
||||
SEED_DB=true # Seed superadmin user
|
||||
```
|
||||
|
||||
### Important Ports
|
||||
- `8781`: Flask application (web interface)
|
||||
- `3306`: MariaDB database (optional external access)
|
||||
|
||||
### Log Locations
|
||||
- Application logs: `./logs/access.log` and `./logs/error.log`
|
||||
- Container logs: `docker compose logs`
|
||||
|
||||
## 🔧 Troubleshooting
|
||||
|
||||
### Can't connect to application
|
||||
```bash
|
||||
# Check if services are running
|
||||
docker compose ps
|
||||
|
||||
# Check web logs
|
||||
docker compose logs web
|
||||
|
||||
# Verify port not in use
|
||||
netstat -tuln | grep 8781
|
||||
```
|
||||
|
||||
### Database connection issues
|
||||
```bash
|
||||
# Check database health
|
||||
docker compose exec db healthcheck.sh --connect
|
||||
|
||||
# View database logs
|
||||
docker compose logs db
|
||||
|
||||
# Test database connection
|
||||
docker compose exec web python3 -c "import mariadb; print('OK')"
|
||||
```
|
||||
|
||||
### Port already in use
|
||||
Edit `.env` file:
|
||||
```env
|
||||
APP_PORT=8782 # Change to available port
|
||||
DB_PORT=3307 # Change if needed
|
||||
```
|
||||
|
||||
### Start completely fresh
|
||||
```bash
|
||||
docker compose down -v
|
||||
rm -rf logs/* instance/external_server.conf
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
## 📖 Documentation Files
|
||||
|
||||
1. **README-DOCKER.md** - Quick start guide (start here!)
|
||||
2. **DOCKER_DEPLOYMENT.md** - Complete deployment guide
|
||||
3. **DOCKER_SOLUTION_SUMMARY.md** - Comprehensive overview
|
||||
4. **FILES_CREATED.md** - This file
|
||||
|
||||
## ✨ Benefits
|
||||
|
||||
- **No System Dependencies**: Only Docker required
|
||||
- **Portable**: Deploy on any system with Docker
|
||||
- **Reproducible**: Consistent deployments every time
|
||||
- **Isolated**: No conflicts with other applications
|
||||
- **Production-Ready**: Gunicorn, health checks, proper logging
|
||||
- **Easy Management**: Simple commands, one-line deployment
|
||||
- **Persistent**: Data survives container restarts
|
||||
- **Scalable**: Easy to add more services
|
||||
|
||||
## 🎉 Success!
|
||||
|
||||
Your Recticel Quality Application is now containerized and ready for deployment!
|
||||
|
||||
**Next Steps:**
|
||||
1. Install Docker (if not already installed)
|
||||
2. Run `./deploy.sh`
|
||||
3. Access http://localhost:8781
|
||||
4. Log in with superadmin credentials
|
||||
5. Change default passwords
|
||||
6. Enjoy your containerized application!
|
||||
|
||||
For detailed instructions, see **README-DOCKER.md** or **DOCKER_DEPLOYMENT.md**.
|
||||
73
old code/README-DOCKER.md
Normal file
73
old code/README-DOCKER.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# 🚀 Quick Start - Docker Deployment
|
||||
|
||||
## What You Need
|
||||
- A server with Docker installed
|
||||
- 2GB free disk space
|
||||
- Ports 8781 and 3306 available
|
||||
|
||||
## Deploy in 3 Steps
|
||||
|
||||
### 1️⃣ Install Docker (if not already installed)
|
||||
|
||||
**Ubuntu/Debian:**
|
||||
```bash
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sudo sh get-docker.sh
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
Then log out and back in.
|
||||
|
||||
### 2️⃣ Deploy the Application
|
||||
```bash
|
||||
cd /srv/quality_recticel
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
### 3️⃣ Access Your Application
|
||||
Open browser: **http://localhost:8781**
|
||||
|
||||
**Login:**
|
||||
- Username: `superadmin`
|
||||
- Password: `superadmin123`
|
||||
|
||||
## 🎯 Done!
|
||||
|
||||
Your complete application with database is now running in Docker containers.
|
||||
|
||||
## Common Commands
|
||||
|
||||
```bash
|
||||
# View logs
|
||||
docker compose logs -f
|
||||
|
||||
# Stop services
|
||||
docker compose down
|
||||
|
||||
# Restart services
|
||||
docker compose restart
|
||||
|
||||
# Backup database
|
||||
docker compose exec -T db mariadb-dump -u trasabilitate -pInitial01! trasabilitate > backup.sql
|
||||
```
|
||||
|
||||
## 📚 Full Documentation
|
||||
|
||||
See `DOCKER_DEPLOYMENT.md` for complete documentation.
|
||||
|
||||
## 🆘 Problems?
|
||||
|
||||
```bash
|
||||
# Check status
|
||||
docker compose ps
|
||||
|
||||
# View detailed logs
|
||||
docker compose logs -f web
|
||||
|
||||
# Start fresh
|
||||
docker compose down -v
|
||||
./deploy.sh
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
**Note:** This is a production-ready deployment using Gunicorn WSGI server, MariaDB 11.3, and proper health checks.
|
||||
@@ -5,7 +5,7 @@ db_config = {
|
||||
"user": "trasabilitate",
|
||||
"password": "Initial01!",
|
||||
"host": "localhost",
|
||||
"database": "trasabilitate_database"
|
||||
"database": "trasabilitate"
|
||||
}
|
||||
|
||||
# Connect to the database
|
||||
@@ -6,7 +6,7 @@ db_config = {
|
||||
"user": "trasabilitate",
|
||||
"password": "Initial01!",
|
||||
"host": "localhost",
|
||||
"database": "trasabilitate_database"
|
||||
"database": "trasabilitate"
|
||||
}
|
||||
|
||||
try:
|
||||
@@ -5,7 +5,7 @@ db_config = {
|
||||
"user": "trasabilitate",
|
||||
"password": "Initial01!",
|
||||
"host": "localhost",
|
||||
"database": "trasabilitate_database"
|
||||
"database": "trasabilitate"
|
||||
}
|
||||
|
||||
# Connect to the database
|
||||
@@ -5,7 +5,7 @@ db_config = {
|
||||
"user": "trasabilitate",
|
||||
"password": "Initial01!",
|
||||
"host": "localhost",
|
||||
"database": "trasabilitate_database"
|
||||
"database": "trasabilitate"
|
||||
}
|
||||
|
||||
# Connect to the database
|
||||
121
old code/migrate_external_db.py
Normal file
121
old code/migrate_external_db.py
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to add modules column to external database and migrate existing users
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import mariadb
|
||||
|
||||
def migrate_external_database():
|
||||
"""Add modules column to external database and update existing users"""
|
||||
try:
|
||||
# Read external database configuration from instance folder
|
||||
config_file = os.path.join(os.path.dirname(__file__), 'instance/external_server.conf')
|
||||
if not os.path.exists(config_file):
|
||||
print("External database configuration file not found at instance/external_server.conf")
|
||||
return False
|
||||
|
||||
with open(config_file, 'r') as f:
|
||||
lines = f.read().strip().split('\n')
|
||||
|
||||
# Parse the config file format "key=value"
|
||||
config = {}
|
||||
for line in lines:
|
||||
if '=' in line and not line.strip().startswith('#'):
|
||||
key, value = line.split('=', 1)
|
||||
config[key.strip()] = value.strip()
|
||||
|
||||
host = config.get('server_domain', 'localhost')
|
||||
port = int(config.get('port', '3306'))
|
||||
database = config.get('database_name', '')
|
||||
user = config.get('username', '')
|
||||
password = config.get('password', '')
|
||||
|
||||
if not all([host, database, user, password]):
|
||||
print("Missing required database configuration values.")
|
||||
return False
|
||||
|
||||
print(f"Connecting to external database: {host}:{port}/{database}")
|
||||
|
||||
# Connect to external database
|
||||
conn = mariadb.connect(
|
||||
user=user,
|
||||
password=password,
|
||||
host=host,
|
||||
port=port,
|
||||
database=database
|
||||
)
|
||||
cursor = conn.cursor()
|
||||
|
||||
# Check if users table exists
|
||||
cursor.execute("SHOW TABLES LIKE 'users'")
|
||||
if not cursor.fetchone():
|
||||
print("Users table not found in external database.")
|
||||
conn.close()
|
||||
return False
|
||||
|
||||
# Check if modules column already exists
|
||||
cursor.execute("DESCRIBE users")
|
||||
columns = [row[0] for row in cursor.fetchall()]
|
||||
|
||||
if 'modules' not in columns:
|
||||
print("Adding modules column to users table...")
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN modules TEXT")
|
||||
print("Modules column added successfully.")
|
||||
else:
|
||||
print("Modules column already exists.")
|
||||
|
||||
# Get current users and convert their roles
|
||||
cursor.execute("SELECT id, username, role FROM users")
|
||||
users = cursor.fetchall()
|
||||
|
||||
role_mapping = {
|
||||
'superadmin': ('superadmin', None),
|
||||
'administrator': ('admin', None),
|
||||
'admin': ('admin', None),
|
||||
'quality': ('manager', '["quality"]'),
|
||||
'warehouse': ('manager', '["warehouse"]'),
|
||||
'warehouse_manager': ('manager', '["warehouse"]'),
|
||||
'scan': ('worker', '["quality"]'),
|
||||
'etichete': ('manager', '["labels"]'),
|
||||
'quality_manager': ('manager', '["quality"]'),
|
||||
'quality_worker': ('worker', '["quality"]'),
|
||||
}
|
||||
|
||||
print(f"Migrating {len(users)} users...")
|
||||
|
||||
for user_id, username, old_role in users:
|
||||
if old_role in role_mapping:
|
||||
new_role, modules_json = role_mapping[old_role]
|
||||
|
||||
cursor.execute("UPDATE users SET role = ?, modules = ? WHERE id = ?",
|
||||
(new_role, modules_json, user_id))
|
||||
|
||||
print(f" {username}: {old_role} -> {new_role} with modules {modules_json}")
|
||||
else:
|
||||
print(f" {username}: Unknown role '{old_role}', keeping as-is")
|
||||
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
print("External database migration completed successfully!")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error migrating external database: {e}")
|
||||
return False
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("External Database Migration for Simplified 4-Tier Permission System")
|
||||
print("=" * 70)
|
||||
|
||||
success = migrate_external_database()
|
||||
|
||||
if success:
|
||||
print("\n✅ Migration completed successfully!")
|
||||
print("\nUsers can now log in with the new simplified permission system.")
|
||||
print("Role structure: superadmin → admin → manager → worker")
|
||||
print("Modules: quality, warehouse, labels")
|
||||
else:
|
||||
print("\n❌ Migration failed. Please check the error messages above.")
|
||||
172
old code/migrate_permissions.py
Executable file
172
old code/migrate_permissions.py
Executable file
@@ -0,0 +1,172 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Migration script to convert from complex permission system to simplified 4-tier system
|
||||
This script will:
|
||||
1. Add 'modules' column to users table
|
||||
2. Convert existing roles to new 4-tier system
|
||||
3. Assign appropriate modules based on old roles
|
||||
"""
|
||||
|
||||
import sqlite3
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Add the app directory to Python path
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
|
||||
|
||||
def get_db_connections():
|
||||
"""Get both internal SQLite and external database connections"""
|
||||
connections = {}
|
||||
|
||||
# Internal SQLite database
|
||||
internal_db_path = os.path.join(os.path.dirname(__file__), 'instance/users.db')
|
||||
if os.path.exists(internal_db_path):
|
||||
connections['internal'] = sqlite3.connect(internal_db_path)
|
||||
print(f"Connected to internal SQLite database: {internal_db_path}")
|
||||
|
||||
# External database (try to connect using existing method)
|
||||
try:
|
||||
import mariadb
|
||||
|
||||
# Read external database configuration
|
||||
config_file = os.path.join(os.path.dirname(__file__), '../external_database_settings')
|
||||
if os.path.exists(config_file):
|
||||
with open(config_file, 'r') as f:
|
||||
lines = f.read().strip().split('\n')
|
||||
if len(lines) >= 5:
|
||||
host = lines[0].strip()
|
||||
port = int(lines[1].strip())
|
||||
database = lines[2].strip()
|
||||
user = lines[3].strip()
|
||||
password = lines[4].strip()
|
||||
|
||||
conn = mariadb.connect(
|
||||
user=user,
|
||||
password=password,
|
||||
host=host,
|
||||
port=port,
|
||||
database=database
|
||||
)
|
||||
connections['external'] = conn
|
||||
print(f"Connected to external MariaDB database: {host}:{port}/{database}")
|
||||
except Exception as e:
|
||||
print(f"Could not connect to external database: {e}")
|
||||
|
||||
return connections
|
||||
|
||||
def role_mapping():
|
||||
"""Map old roles to new 4-tier system"""
|
||||
return {
|
||||
# Old role -> (new_role, modules)
|
||||
'superadmin': ('superadmin', []), # All modules by default
|
||||
'administrator': ('admin', []), # All modules by default
|
||||
'admin': ('admin', []), # All modules by default
|
||||
'quality': ('manager', ['quality']),
|
||||
'warehouse': ('manager', ['warehouse']),
|
||||
'warehouse_manager': ('manager', ['warehouse']),
|
||||
'scan': ('worker', ['quality']), # Assume scan users are quality workers
|
||||
'etichete': ('manager', ['labels']),
|
||||
'quality_manager': ('manager', ['quality']),
|
||||
'quality_worker': ('worker', ['quality']),
|
||||
}
|
||||
|
||||
def migrate_database(conn, db_type):
|
||||
"""Migrate a specific database"""
|
||||
cursor = conn.cursor()
|
||||
|
||||
print(f"Migrating {db_type} database...")
|
||||
|
||||
# Check if users table exists
|
||||
if db_type == 'internal':
|
||||
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='users'")
|
||||
else: # external/MariaDB
|
||||
cursor.execute("SHOW TABLES LIKE 'users'")
|
||||
|
||||
if not cursor.fetchone():
|
||||
print(f"No users table found in {db_type} database")
|
||||
return
|
||||
|
||||
# Check if modules column already exists
|
||||
try:
|
||||
if db_type == 'internal':
|
||||
cursor.execute("PRAGMA table_info(users)")
|
||||
columns = [row[1] for row in cursor.fetchall()]
|
||||
else: # external/MariaDB
|
||||
cursor.execute("DESCRIBE users")
|
||||
columns = [row[0] for row in cursor.fetchall()]
|
||||
|
||||
if 'modules' not in columns:
|
||||
print(f"Adding modules column to {db_type} database...")
|
||||
if db_type == 'internal':
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN modules TEXT")
|
||||
else: # external/MariaDB
|
||||
cursor.execute("ALTER TABLE users ADD COLUMN modules TEXT")
|
||||
else:
|
||||
print(f"Modules column already exists in {db_type} database")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error checking/adding modules column in {db_type}: {e}")
|
||||
return
|
||||
|
||||
# Get current users
|
||||
cursor.execute("SELECT id, username, role FROM users")
|
||||
users = cursor.fetchall()
|
||||
|
||||
print(f"Found {len(users)} users in {db_type} database")
|
||||
|
||||
# Convert roles and assign modules
|
||||
mapping = role_mapping()
|
||||
updates = []
|
||||
|
||||
for user_id, username, old_role in users:
|
||||
if old_role in mapping:
|
||||
new_role, modules = mapping[old_role]
|
||||
modules_json = json.dumps(modules) if modules else None
|
||||
updates.append((new_role, modules_json, user_id, username))
|
||||
print(f" {username}: {old_role} -> {new_role} with modules {modules}")
|
||||
else:
|
||||
print(f" {username}: Unknown role '{old_role}', keeping as-is")
|
||||
|
||||
# Apply updates
|
||||
for new_role, modules_json, user_id, username in updates:
|
||||
try:
|
||||
cursor.execute("UPDATE users SET role = ?, modules = ? WHERE id = ?",
|
||||
(new_role, modules_json, user_id))
|
||||
print(f" Updated {username} successfully")
|
||||
except Exception as e:
|
||||
print(f" Error updating {username}: {e}")
|
||||
|
||||
conn.commit()
|
||||
print(f"Migration completed for {db_type} database")
|
||||
|
||||
def main():
|
||||
"""Main migration function"""
|
||||
print("Starting migration to simplified 4-tier permission system...")
|
||||
print("="*60)
|
||||
|
||||
connections = get_db_connections()
|
||||
|
||||
if not connections:
|
||||
print("No database connections available. Please check your configuration.")
|
||||
return
|
||||
|
||||
for db_type, conn in connections.items():
|
||||
try:
|
||||
migrate_database(conn, db_type)
|
||||
print()
|
||||
except Exception as e:
|
||||
print(f"Error migrating {db_type} database: {e}")
|
||||
finally:
|
||||
conn.close()
|
||||
|
||||
print("Migration completed!")
|
||||
print("\nNew role structure:")
|
||||
print("- superadmin: Full system access")
|
||||
print("- admin: Full app access (except role_permissions and download_extension)")
|
||||
print("- manager: Module-based access (can have multiple modules)")
|
||||
print("- worker: Limited module access (one module only)")
|
||||
print("\nAvailable modules: quality, warehouse, labels")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
111
old code/test_permissions.py
Normal file
111
old code/test_permissions.py
Normal file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Test script for the new simplified 4-tier permission system
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'app'))
|
||||
|
||||
from permissions_simple import check_access, validate_user_modules, get_user_accessible_pages
|
||||
|
||||
def test_permission_system():
|
||||
"""Test the new permission system with various scenarios"""
|
||||
print("Testing Simplified 4-Tier Permission System")
|
||||
print("=" * 50)
|
||||
|
||||
# Test cases: (role, modules, page, expected_result)
|
||||
test_cases = [
|
||||
# Superadmin tests
|
||||
('superadmin', [], 'dashboard', True),
|
||||
('superadmin', [], 'role_permissions', True),
|
||||
('superadmin', [], 'quality', True),
|
||||
('superadmin', [], 'warehouse', True),
|
||||
|
||||
# Admin tests
|
||||
('admin', [], 'dashboard', True),
|
||||
('admin', [], 'role_permissions', False), # Restricted for admin
|
||||
('admin', [], 'download_extension', False), # Restricted for admin
|
||||
('admin', [], 'quality', True),
|
||||
('admin', [], 'warehouse', True),
|
||||
|
||||
# Manager tests
|
||||
('manager', ['quality'], 'quality', True),
|
||||
('manager', ['quality'], 'quality_reports', True),
|
||||
('manager', ['quality'], 'warehouse', False), # No warehouse module
|
||||
('manager', ['warehouse'], 'warehouse', True),
|
||||
('manager', ['warehouse'], 'quality', False), # No quality module
|
||||
('manager', ['quality', 'warehouse'], 'quality', True), # Multiple modules
|
||||
('manager', ['quality', 'warehouse'], 'warehouse', True),
|
||||
|
||||
# Worker tests
|
||||
('worker', ['quality'], 'quality', True),
|
||||
('worker', ['quality'], 'quality_reports', False), # Workers can't access reports
|
||||
('worker', ['quality'], 'warehouse', False), # No warehouse module
|
||||
('worker', ['warehouse'], 'move_orders', True),
|
||||
('worker', ['warehouse'], 'create_locations', False), # Workers can't create locations
|
||||
|
||||
# Invalid role test
|
||||
('invalid_role', ['quality'], 'quality', False),
|
||||
]
|
||||
|
||||
print("Testing access control:")
|
||||
print("-" * 30)
|
||||
|
||||
passed = 0
|
||||
failed = 0
|
||||
|
||||
for role, modules, page, expected in test_cases:
|
||||
result = check_access(role, modules, page)
|
||||
status = "PASS" if result == expected else "FAIL"
|
||||
print(f"{status}: {role:12} {str(modules):20} {page:18} -> {result} (expected {expected})")
|
||||
|
||||
if result == expected:
|
||||
passed += 1
|
||||
else:
|
||||
failed += 1
|
||||
|
||||
print(f"\nResults: {passed} passed, {failed} failed")
|
||||
|
||||
# Test module validation
|
||||
print("\nTesting module validation:")
|
||||
print("-" * 30)
|
||||
|
||||
validation_tests = [
|
||||
('superadmin', ['quality'], True), # Superadmin can have any modules
|
||||
('admin', ['warehouse'], True), # Admin can have any modules
|
||||
('manager', ['quality'], True), # Manager can have one module
|
||||
('manager', ['quality', 'warehouse'], True), # Manager can have multiple modules
|
||||
('manager', [], False), # Manager must have at least one module
|
||||
('worker', ['quality'], True), # Worker can have one module
|
||||
('worker', ['quality', 'warehouse'], False), # Worker cannot have multiple modules
|
||||
('worker', [], False), # Worker must have exactly one module
|
||||
('invalid_role', ['quality'], False), # Invalid role
|
||||
]
|
||||
|
||||
for role, modules, expected in validation_tests:
|
||||
is_valid, error_msg = validate_user_modules(role, modules)
|
||||
status = "PASS" if is_valid == expected else "FAIL"
|
||||
print(f"{status}: {role:12} {str(modules):20} -> {is_valid} (expected {expected})")
|
||||
if error_msg:
|
||||
print(f" Error: {error_msg}")
|
||||
|
||||
# Test accessible pages for different users
|
||||
print("\nTesting accessible pages:")
|
||||
print("-" * 30)
|
||||
|
||||
user_tests = [
|
||||
('superadmin', []),
|
||||
('admin', []),
|
||||
('manager', ['quality']),
|
||||
('manager', ['warehouse']),
|
||||
('worker', ['quality']),
|
||||
('worker', ['warehouse']),
|
||||
]
|
||||
|
||||
for role, modules in user_tests:
|
||||
accessible_pages = get_user_accessible_pages(role, modules)
|
||||
print(f"{role:12} {str(modules):20} -> {len(accessible_pages)} pages: {', '.join(accessible_pages[:5])}{'...' if len(accessible_pages) > 5 else ''}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_permission_system()
|
||||
@@ -15,7 +15,12 @@
|
||||
sudo apt install -y mariadb-server libmariadb-dev
|
||||
|
||||
5. Create MariaDB database and user:
|
||||
sudo mysql -e "CREATE DATABASE recticel; CREATE USER 'sa'@'localhost' IDENTIFIED BY '12345678'; GRANT ALL PRIVILEGES ON recticel.* TO 'sa'@'localhost'; FLUSH PRIVILEGES;"
|
||||
sudo mysql -e "CREATE DATABASE trasabilitate; CREATE USER 'sa'@'localhost' IDENTIFIED BY 'qasdewrftgbcgfdsrytkmbf\"b'; GRANT ALL PRIVILEGES ON quality.* TO 'sa'@'localhost'; FLUSH PRIVILEGES;"
|
||||
sa
|
||||
qasdewrftgbcgfdsrytkmbf\"b
|
||||
|
||||
trasabilitate
|
||||
Initial01!
|
||||
|
||||
6. Install build tools (for compiling Python packages):
|
||||
sudo apt install -y build-essential
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 110 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user