arichika / RotativaCore

for ASP.NET Core on Azure Web Apps (by Windows). Support .NETStandard 2.0
https://www.nuget.org/packages/RotativaCore/
MIT License
14 stars 6 forks source link

Support linux #10

Open arichika opened 5 years ago

arichika commented 5 years ago

9 Running on Linux

One, Generating url for internal action methods with port num.

For example, In the time that ActionAsPdf method calls self hosted action method using IUrlHelper.Action(), library will generated for internal refalencing url with additional ports number.

In the container like docker, the port number is explicitly disclosed, There is a problem here.

The program IUrlHelper.Action() generates a URL on port SomeDebugginPortNumber or SomeIntrnalPortNumer in container, but at that number, the container is not waiting for an external connection.

Since the started WkhtmlToPdf process is started by a process different from Container, it must be accessed with the published port number.

But unfortunately, the program doesn't know which port number will be started and which port number will be EXPOSE.

In short, we will need the following improvements:

Information about the host to connect to must be given as an external configuration value under the general Linux Container environment, even if it is your own action method.

Two, The Problems arounds WkHtmlToPdf Binaries

The latest WkHtmlToPdf has separate installation packages for each Linux distribution. It seems that the prerequisite packages required to work vary depending on the environment. I think that it is difficult to ensure proper operation between the test environment (eg Docker for Windows) and the execution environment (eg AzureWebApps for Linux) simply by placing the Wk binary in the project.

Also, since the procedure for installing dependent programs with Dockerfile is a common method, the WlHtmlToPdf binary should not be included in the Web project, and should be controlled by the execution environment administrator.

Solutions / Tasks