Fix Login page not displayed
This commit is contained in:
@@ -6,9 +6,9 @@ services:
|
|||||||
#env_file:
|
#env_file:
|
||||||
#- .env
|
#- .env
|
||||||
environment:
|
environment:
|
||||||
- LOCAL_ONLY=True # set to False to enable OIDC auth (requires configuration in settings.yml)
|
- LOCAL_ONLY=False # set to False to enable OIDC auth (requires configuration in settings.yml)
|
||||||
- SECRET_KEY= # if using auth
|
- SECRET_KEY= # if using auth
|
||||||
- UPLOADS_DIR=/app/uploads
|
- UPLOADS_DIR=/app/uploads # directory structure INSIDE the container, not on host
|
||||||
- PROCESSED_DIR=/app/processed
|
- PROCESSED_DIR=/app/processed
|
||||||
- OMP_NUM_THREADS=1
|
- OMP_NUM_THREADS=1
|
||||||
#user: "1000:1000"
|
#user: "1000:1000"
|
||||||
|
|||||||
10
main.py
10
main.py
@@ -1349,6 +1349,11 @@ def run_pdf_ocr_task(job_id: str, input_path_str: str, output_path_str: str, ocr
|
|||||||
job = get_job(db, job_id)
|
job = get_job(db, job_id)
|
||||||
if not job or job.status == 'cancelled':
|
if not job or job.status == 'cancelled':
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Re-check for cancellation right before starting the heavy work
|
||||||
|
if get_job(db, job_id).status == 'cancelled':
|
||||||
|
logger.info(f"PDF OCR job {job_id} cancelled before starting. Aborting.")
|
||||||
|
return
|
||||||
update_job_status(db, job_id, "processing")
|
update_job_status(db, job_id, "processing")
|
||||||
logger.info(f"Starting PDF OCR for job {job_id}")
|
logger.info(f"Starting PDF OCR for job {job_id}")
|
||||||
ocrmypdf.ocr(str(input_path), str(output_path_str),
|
ocrmypdf.ocr(str(input_path), str(output_path_str),
|
||||||
@@ -1395,6 +1400,11 @@ def run_image_ocr_task(job_id: str, input_path_str: str, output_path_str: str, a
|
|||||||
if not job or job.status == "cancelled":
|
if not job or job.status == "cancelled":
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Re-check for cancellation right before starting the heavy work
|
||||||
|
if get_job(db, job_id).status == 'cancelled':
|
||||||
|
logger.info(f"Image OCR job {job_id} cancelled before starting. Aborting.")
|
||||||
|
return
|
||||||
|
|
||||||
update_job_status(db, job_id, "processing", progress=10)
|
update_job_status(db, job_id, "processing", progress=10)
|
||||||
logger.info(f"Starting Image OCR for job {job_id} - {input_path}")
|
logger.info(f"Starting Image OCR for job {job_id} - {input_path}")
|
||||||
|
|
||||||
|
|||||||
2
run.sh
2
run.sh
@@ -9,7 +9,7 @@ SECRET_KEY=
|
|||||||
UPLOADS_DIR=./uploads
|
UPLOADS_DIR=./uploads
|
||||||
PROCESSED_DIR=./processed
|
PROCESSED_DIR=./processed
|
||||||
# Start Gunicorn in the background
|
# Start Gunicorn in the background
|
||||||
gunicorn -w 4 --threads 2 -k uvicorn.workers.UvicornWorker --forwarded-allow-ips='*' --error-logfile - --access-logfile - main:app -b 0.0.0.0:8008 &
|
gunicorn -w 4 --threads 2 -k uvicorn.workers.UvicornWorker --forwarded-allow-ips='*' --error-logfile - --access-logfile - main:app -b 0.0.0.0:8000 &
|
||||||
echo "Started Gunicorn..."
|
echo "Started Gunicorn..."
|
||||||
# Store the Gunicorn process ID
|
# Store the Gunicorn process ID
|
||||||
GUNICORN_PID=$!
|
GUNICORN_PID=$!
|
||||||
|
|||||||
@@ -109,6 +109,8 @@ academic_settings:
|
|||||||
transcription_settings:
|
transcription_settings:
|
||||||
whisper:
|
whisper:
|
||||||
compute_type: int8
|
compute_type: int8
|
||||||
|
# device: cuda
|
||||||
|
# device_index: 0
|
||||||
allowed_models:
|
allowed_models:
|
||||||
- tiny
|
- tiny
|
||||||
- base
|
- base
|
||||||
|
|||||||
@@ -549,8 +549,8 @@ function initializeSelectors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showLoginView() {
|
function showLoginView() {
|
||||||
if (appContainer) appContainer.style.display = 'block';
|
if (appContainer) appContainer.style.display = 'none';
|
||||||
if (loginContainer) loginContainer.style.display = 'none';
|
if (loginContainer) loginContainer.style.display = 'flex';
|
||||||
if (loginButton) loginButton.addEventListener('click', () => { window.location.href = apiUrl('/login'); });
|
if (loginButton) loginButton.addEventListener('click', () => { window.location.href = apiUrl('/login'); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user