Access local PATH from IIS deployment - flask

I have a flask API running pytesseract to extract text from a given image using tesseract.
While running the API from terminal, it works like expected.
But once I deploy it on IIS, I start getting: tesseract is not installed or it's not in your PATH.
Is anything I have to do to allow IIS access my local PATH?
In my case, statically specifying tesseract.exe path (pytesseract.pytesseract.tesseract_cmd = r'C:\Users\USER\AppData\Local\Tesseract-OCR\tesseract.exe') is not a solution.

Related

Apache webserver with app using GDAL not working on windows

I am trying to deploy a django project using POSTGIS on my windows 11 PC with Apache 2.4.
The web page is working as long as I am not using 'django.contrib.gis'.
When I add 'django.contrib.gis' to my INSTALLED_APPS and define GDAL_LIBRARY_PATH to point to my gdal installation things stop working.
Specifically, trying to access the web app ends up in infinitely loading the page. Weird enough there are no errors in the apache error log. The apache service starts fine.
As far as I can see gdal install is correct as the app is working fine on the same machine with the same python environment with the django development server.
Actually, I have the same issue with other python libraries that need some dlls, like opencv.
So my guess is that it is a security related issue, but I do not find any clues on how to solve it.
Any ideas?
I tried also to grant rights to the directory where gdal is install in apache conf. But no luck.

How to run django server from docker in wsl? Error in absolute path

For the first time, I'm trying to set up my project on win 10.
I have set these settings for my Django server, which uses an interpreter from docker running on ubuntu. After the launch, I received an error message.
\\\\wsl$\\Ubuntu\\home\\alexander\\work\\integrationservice:
\"\\\\\\\\wsl$\\\\Ubuntu\\\\home\\\\alexander\\\\work\\\\integrationservice\"
includes invalid characters for a local volume name, only
\"[a-zA-Z0-9][a-zA-Z0-9_.-]\" are allowed. If you intended to pass a
host directory, use absolute path
How to solve this problem?

404 when multiple dots on url

I´m working on a React project.
When I try to load some local route like '/example.2.2/hello.js`im getting 404, if I do the same changing the folder and the path '/example22/hello.js' it is working additionally if I host it https://example.com/example.2.2/hello.ja it is working.
I'm using apache server to virtualhost, windows 10.
Thanks
Node has problems hosting content with dots(periods) on the folder name on windows platform, I just changed package.json

pass zip file from unc to python code running inside docker

I have a python script running inside a docker container. This app does the loading of builds on to external hardware which is connected on the network. The builds are in zip format and are available in the local network share \\path\to\zip.zip. I am running a python script inside the docker container to trigger this loading zip file.
The python script is simple. All it takes is >python load.py IP path_to_zip
The script then unzips the contents and makes an ftp connection to the hardware and erases the existing contents, then loads the contents of the zip file.
At the moment, I see that the docker container is not able to access the unc path. The script runs fine on a normal environment (without docker)
I've tried it in different ways to resolve the issue
1.When I try giving the unc path from inside docker (attaching shell), I see that it cannot find the unc path
I tried building the Docker container with the zip file in it so that it is available. But I do not see the contents getting uploaded
to the hardware. I am not sure why.
can someone suggest what is the best way to perform point 1? which is my preferred option...

GhostScript in Azure

I'm in the process of moving some on-premise app to Azure and struggling with once aspect - GhostScript. We use GhostScript to convert PDF's to multi page TIFF's. At present this is deployed in an Azure VM, but it seems like a WebApp and WebJob would be a better fit - from a management point of view. In all of my testing I've been unable to get a job to run the GhostScript exe.
Has anyone been able to run GhostScript or any third party exe in a WebJob?
I have tried packaging the GhostScript exe, lib and dll into a ZIP file and then unzip to Path.GetTempPath() and then using a new System.Diagnostics.Process to run the exe with the required parameters - this didn't work - the process refused to start with an exit code of -1073741819.
Any help or suggestions would be appreciated.
We got it to work here:
Converting PDFs to Multipage Tiff files Using Azure WebJobs. The key was putting the Ghostscript assemblies in the root of the project and setting "Copy always". This is what allows them to be pushed to the Azure server, and to end up in the correct place, when you publish the project.
Also, we needed to download the file to be processed by Ghostscript to the local Azure WebJob temp directory. This is discovered by using the following code:
Environment.GetEnvironmentVariable("WEBJOBS_PATH");