This commit is contained in:
2021-12-07 23:15:50 +00:00
parent 52727923e2
commit 1706b5fb8b
10 changed files with 77 additions and 38 deletions

View File

@@ -21,8 +21,8 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\ayanova DefaultDirName={autopf}\ayanova
DisableProgramGroupPage=yes DisableProgramGroupPage=yes
LicenseFile=C:\data\code\raven\dist\assets\license.rtf LicenseFile=C:\data\code\raven\dist\assets\license.rtf
OutputDir=C:\data\code\raven\dist\install\windows\x64\output OutputDir=C:\data\code\raven\dist\installers
OutputBaseFilename=ayanova-lan-setup OutputBaseFilename=ayanova-windows-x64-lan-setup
SetupIconFile=C:\data\code\raven\dist\assets\logo.ico SetupIconFile=C:\data\code\raven\dist\assets\logo.ico
UninstallDisplayIcon={app}\ayanova-app-logo.ico UninstallDisplayIcon={app}\ayanova-app-logo.ico
Compression=lzma Compression=lzma

View File

@@ -23,8 +23,8 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\ayanova DefaultDirName={autopf}\ayanova
DisableProgramGroupPage=yes DisableProgramGroupPage=yes
LicenseFile=C:\data\code\raven\dist\assets\license.rtf LicenseFile=C:\data\code\raven\dist\assets\license.rtf
OutputDir=C:\data\code\raven\dist\install\windows\x64\output OutputDir=C:\data\code\raven\dist\installers
OutputBaseFilename=ayanova-single-setup OutputBaseFilename=ayanova-windows-x64-single-setup
SetupIconFile=C:\data\code\raven\graphics\logo.ico SetupIconFile=C:\data\code\raven\graphics\logo.ico
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes

View File

@@ -81,6 +81,7 @@ Command line parameters are appended to the command to start the ayanova server,
### REPORTING ### REPORTING
- [AYANOVA_REPORT_RENDER_BROWSER_PATH](ops-config-report-render-browser-path.md)
- [AYANOVA_REPORT_RENDERING_TIMEOUT](ops-config-report-rendering-timeout.md) - [AYANOVA_REPORT_RENDERING_TIMEOUT](ops-config-report-rendering-timeout.md)
- [AYANOVA_REPORT_RENDERING_MAX_INSTANCES](ops-config-report-rendering-max-instances.md) - [AYANOVA_REPORT_RENDERING_MAX_INSTANCES](ops-config-report-rendering-max-instances.md)

View File

@@ -0,0 +1,33 @@
# REPORT RENDER BROWSER PATH SETTING
This optional setting sets the _full_ path to the Chromium web browser executable that is used by AyaNova to render reports.
If not set, AyaNova will attempt to automatically download a copy of Chromium to a `.local-chromium` folder under the AyaNova executable folder on first report rendering.
This setting should be used only in cases where it's more appropriate to use a previously installed Chromium browser installation.
## Default
Default is empty / not set.
## Overriding
AyaNova expects the report rendering browser path to be provided by an environment variable or command line parameter named
`AYANOVA_REPORT_RENDER_BROWSER_PATH`
The value specified should be a string containing a fully qualified file path to the pg_dump utility.
Example command line parameter
`ayanova.exe --AYANOVA_REPORT_RENDER_BROWSER_PATH="/snap/chromium/current/bin/chromium.desktop/chrome.exe"` )
Example environment variable
Windows
`set "AYANOVA_REPORT_RENDER_BROWSER_PATH=o C:\Program Files\Chromium\chrome.exe"`
Linux / MAC
`export AYANOVA_REPORT_RENDER_BROWSER_PATH="/snap/chromium/current/bin/chromium.desktop/chrome.exe"`

View File

@@ -17,6 +17,10 @@ todo: distribute linux distros in zip and versioned, separate for docker and for
rejig the build so it's output to a single folder since the build is the same for docker or baremetal rejig the build so it's output to a single folder since the build is the same for docker or baremetal
then copy the necessary files and archive each into a final ready to upload archive in installs output or wherever but consolidated to single folder for easy upload of all installs then copy the necessary files and archive each into a final ready to upload archive in installs output or wherever but consolidated to single folder for easy upload of all installs
todo: Docker config add path to chromium in env variable:
lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist
single standalone ubuntu desktop single standalone ubuntu desktop
todo: put running on desktop image at top here todo: put running on desktop image at top here
Where it's at: working in all respects except for report rendering need to re-code that shit Where it's at: working in all respects except for report rendering need to re-code that shit
@@ -34,7 +38,7 @@ single standalone ubuntu desktop
- Make AyaNova data folder: ~/.ayanova-data - Make AyaNova data folder: ~/.ayanova-data
- download ayanova linux x64 archive - download ayanova linux x64 archive
https://www.ayanova.com/Downloads/v8/linux-x64-ayanova-server.zip https://www.ayanova.com/Downloads/v8/ayanova-linux-x64-server.zip
- Unzip the archive into an appropriate folder (/usr/bin/ayanova) - Unzip the archive into an appropriate folder (/usr/bin/ayanova)
- edit config.json - edit config.json
set postgres password set postgres password
@@ -55,3 +59,7 @@ server lan ubuntu
//############################################################# //#############################################################
nginx lan ubuntu nginx lan ubuntu
internet internet
//DOCKER
https://www.ayanova.com/Downloads/v8/ayanova-linux-docker-x64-server.zip

View File

@@ -103,7 +103,7 @@ AyaNova is built upon the ASP.NET Core runtime version 6.0 or newer and it shoul
### AyaNova server installation ### AyaNova server installation
Download and run the AyaNova network installer: [https://www.ayanova.com/Downloads/v8/ayanova-lan-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-lan-setup.exe). Follow the prompts to complete installation but **DO NOT** select to start AyaNova with Windows, IIS will be responsible for starting and stopping AyaNova. If you do select start with windows re-run the installer and uncheck it. Download and run the AyaNova network installer: [https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-lan-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-lan-setup.exe). Follow the prompts to complete installation but **DO NOT** select to start AyaNova with Windows, IIS will be responsible for starting and stopping AyaNova. If you do select start with windows re-run the installer and uncheck it.
#### Server configuration #### Server configuration

View File

@@ -40,7 +40,7 @@ AyaNova is built upon the ASP.NET Core runtime version 6.0 or newer and it shoul
### AyaNova server installation ### AyaNova server installation
Once you have ensured the two requirements above are installed and available; download and run the AyaNova network installer: [https://www.ayanova.com/Downloads/v8/ayanova-lan-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-lan-setup.exe). Follow the prompts and complete the installation. Once you have ensured the two requirements above are installed and available; download and run the AyaNova network installer: [https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-lan-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-lan-setup.exe). Follow the prompts and complete the installation.
#### Server configuration #### Server configuration

View File

@@ -33,7 +33,7 @@ The single user installer will use TCP/IP ports 6432 for the Postgres server and
## Installation procedure ## Installation procedure
- Download and run the standalone installer from our web site: [https://www.ayanova.com/Downloads/v8/ayanova-single-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-single-setup.exe). Follow the prompts and accept the defaults. At the end of setup the ayanova-launcher application will start if selected (or you can run it from the desktop icon) and in turn it will start the Postgres server, AyaNova server and then open the default web browser to both the AyaNova server interface and the AyaNova User interface. - Download and run the standalone installer from our web site: [https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-single-setup.exe](https://www.ayanova.com/Downloads/v8/ayanova-windows-x64-single-setup.exe). Follow the prompts and accept the defaults. At the end of setup the ayanova-launcher application will start if selected (or you can run it from the desktop icon) and in turn it will start the Postgres server, AyaNova server and then open the default web browser to both the AyaNova server interface and the AyaNova User interface.
## Starting and stopping AyaNova server ## Starting and stopping AyaNova server
To shut down the AyaNova server press the ctrl-c key combination in the ayanova-launcher window. To shut down the AyaNova server press the ctrl-c key combination in the ayanova-launcher window.

View File

@@ -249,7 +249,7 @@ namespace AyaNova.Biz
{ {
//Let postgres sort the names so that they appear with the emoji symbols last in the list which we use for sample reports to //Let postgres sort the names so that they appear with the emoji symbols last in the list which we use for sample reports to
//not pollute the regular reports //not pollute the regular reports
var rpts = await ct.Report.AsNoTracking().Where(z => z.AType == aType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).OrderBy(z=>z.name).ToListAsync(); var rpts = await ct.Report.AsNoTracking().Where(z => z.AType == aType && z.Active == true).Select(z => new { id = z.Id, name = z.Name, roles = z.Roles }).OrderBy(z => z.name).ToListAsync();
var ret = new List<NameIdItem>(); var ret = new List<NameIdItem>();
foreach (var item in rpts) foreach (var item in rpts)
{ {
@@ -444,36 +444,25 @@ namespace AyaNova.Biz
} }
//initialization //initialization
log.LogDebug("Initializing report system"); log.LogDebug("Initializing report rendering system");
bool AutoDownloadChromium = true;
if (string.IsNullOrWhiteSpace(ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH))
{
log.LogDebug($"Using default Chromium browser (downloaded)");
}
else
{
log.LogDebug($"Using user specified Chromium browser at {ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH}");
AutoDownloadChromium = false;
}
var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt"); var ReportJSFolderPath = Path.Combine(ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH, "resource", "rpt");
// //===================
// //TRY TO FORCE LANGUAGE
// //language - mirror client's language so that pdf footer header stuff like date prints in their desired format, otherwise those items take the server's settings automatically
// var ClientLanguage = reportRequest.ClientMeta["LanguageName"].Value<string>();
// string LaunchParamLanguage = string.Empty;
// if (!string.IsNullOrWhiteSpace(ClientLanguage))
// {
// LaunchParamLanguage = $"--lang={ClientLanguage}";
// }
// //======================
var lo = new LaunchOptions { Headless = true }; var lo = new LaunchOptions { Headless = true };
if (!AutoDownloadChromium)
//TODO: this needs to be changed to a config variable to trigger automatically downloading chromium and in docker distro set it to false
//so maybe what is needed is to specify chromium executable path and if not set then it attempts a download automatically
//that would cover many scenarios beyond docker / linux desktop
bool isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows);
if (!isWindows)
{ {
//LINUX / MAC / NOT WINDOWS lo.ExecutablePath = ServerBootConfig.AYANOVA_REPORT_RENDER_BROWSER_PATH;//"/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely
log.LogDebug($"Not Windows: setting executable path for chrome to expected '/usr/bin/chromium-browser'"); // lo.Args = new string[] { "--no-sandbox" };
lo.ExecutablePath = "/usr/bin/chromium-browser";//this is the default path for docker based alpine dist, but maybe not others, need to make a config setting likely
// lo.Args = new string[] { "--no-sandbox" };
/* /*
troubleshooting links: troubleshooting links:
https://developers.google.com/web/tools/puppeteer/troubleshooting https://developers.google.com/web/tools/puppeteer/troubleshooting

View File

@@ -77,6 +77,9 @@ namespace AyaNova.Util
//BACKUP PG_DUMP PATH (IF NOT IN PATH ALREADY) //BACKUP PG_DUMP PATH (IF NOT IN PATH ALREADY)
internal static string AYANOVA_BACKUP_PG_DUMP_PATH { get; set; } internal static string AYANOVA_BACKUP_PG_DUMP_PATH { get; set; }
//REPORT RENDERING BROWSER PATH (if not set then will attempt to auto-download on first render)
internal static string AYANOVA_REPORT_RENDER_BROWSER_PATH { get; set; }
//LOGGING //LOGGING
internal static string AYANOVA_LOG_PATH { get; set; } internal static string AYANOVA_LOG_PATH { get; set; }
internal static string AYANOVA_LOG_LEVEL { get; set; } internal static string AYANOVA_LOG_LEVEL { get; set; }
@@ -165,7 +168,12 @@ namespace AyaNova.Util
//backdoor back door password superuser reset //backdoor back door password superuser reset
AYANOVA_SET_SUPERUSER_PW = config.GetValue<string>("AYANOVA_SET_SUPERUSER_PW"); AYANOVA_SET_SUPERUSER_PW = config.GetValue<string>("AYANOVA_SET_SUPERUSER_PW");
//REPORT RENDERING PROCESS CONTROL //REPORT RENDERING
//RENDER ENGINE PATH
AYANOVA_REPORT_RENDER_BROWSER_PATH = ActualFullPath(config.GetValue<string>("AYANOVA_REPORT_RENDER_BROWSER_PATH"));
//PROCESS CONTROL
int? nTemp = config.GetValue<int?>("AYANOVA_REPORT_RENDERING_TIMEOUT"); int? nTemp = config.GetValue<int?>("AYANOVA_REPORT_RENDERING_TIMEOUT");
AYANOVA_REPORT_RENDERING_TIMEOUT = (null == nTemp) ? 30000 : (int)nTemp;//default is 30 seconds AYANOVA_REPORT_RENDERING_TIMEOUT = (null == nTemp) ? 30000 : (int)nTemp;//default is 30 seconds
if (AYANOVA_REPORT_RENDERING_TIMEOUT < 1000) AYANOVA_REPORT_RENDERING_TIMEOUT = 1000; //one second minimum timeout if (AYANOVA_REPORT_RENDERING_TIMEOUT < 1000) AYANOVA_REPORT_RENDERING_TIMEOUT = 1000; //one second minimum timeout