AQTRONIX WebKnight 4.5 - iis

I have downloaded AQTRONIX WebKnight 4.5 to test it out before purchasing the latest version.
I had a number of errors that I managed to fix, but I cannot work out how to fix the error where it's blocking some images
Below is a snippet of the log file showing the error, does anyone know what in the configuration I need to change to allow the images to show.
09:59:13 ; W3SVC8 ; OnUrlMap ; **.**.**.** ; ; *****.com ; /app_data/cache/d/c/7/a/a/b/dc7aab408fbc0d0e6e0ebb1afb88c54ff5445725.webp ; BLOCKED: '/c/' not allowed in URL ; BLOCKED: '/d/' not allowed in URL ; *:\**\**\app_data\cache\d\c\7\a\a\b\dc7aab408fbc0d0e6e0ebb1afb88c54ff5445725.webp ; mode=max&width=2000&height=700&format=webp&quality=80&rnd=132685046925500000

as the error line tells you:
BLOCKED: '/c/' not allowed in URL ; BLOCKED: '/d/' not allowed in URL
;
you have to change the path of the image without using '/ c /' and '/ d /' for example use a real name or more than one character: '/ c1 /'
or go to the Webknight configurator section "URL Scanning" subsection "Denied URL sequences" and delete the values from the table.

Related

Compare 'installed-version'versus 'to-be-installed-version'

Have been working with NSIS (v3.05) for a few weeks. Does what it needs to do. I have been chasing the following problem for a few days and have not been able to comprehend it completely.
Problem statement:
Compare two (2) versions with each other. Many ways to implement. I chose the following:
1st 'version' (string) is retrieved from the currently installed versions .txt file via (function) LineRead (!include TextFunc.nsh) like this:
IfFileExists "C:\$PROGRAMFILES64\...\VERSION.txt" 0 +31 # Open the file and perform N FileRead
DetailPrint "VERSION.txt found!"
${LineRead} "C:\$PROGRAMFILES64\...\VERSION.txt" "7" $4 # $4 = '1.x.y.z' (for example)
2nd 'version' is retrieved with following code:
!getdllversion "C:\...\application_name.exe" expversion_
StrCpy $7 ${expversion_} # pass the define string 'expversion' to $7
As last part I use following code for comparison of $4 and $7:
${VersionCompare} $4 $7 $R0
This can only work as I know for sure that '$4' (version string #1) and '$7' (version string #2) are correct inputs for VersionCompare (output: $R0)
Question: Is there a way to display (for test/check) the content of $4 (# compile time) in order to know for sure var $4 contains the correct string to be passed to function 'VersionCompare'? (tried 'DetailPrint $4'; does not resolve into the expected string (retrieved by function 'LineRead'). (I know that 'DetailPrint' only displays during executing the installation '.exe. file So is makes sense not seeing that # compile time.)
Output from MakeNSIS:
IfFileExists: "C:\$PROGRAMFILES64\...\VERSION.txt" ? 0 : +31
DetailPrint: "VERSION.txt found!"
!insertmacro: LineReadCall
!insertmacro: end of LineReadCall
DetailPrint: "The version number of the currently installed app: $4"
How-To get $4 resolve into the version string (for testing purposes) during compile time)?
Question number 2:
I use the preprocessor command '!GetDLLVersion' in a function to retrieve version number of the to be installed version of the 'app' (via The NSIS Installer...). MakeNSIS displays resolving the version correctly:
Function: "VersionRetrievalBinary"
!getdllversion: C:\1_SW_dev\...\app.exe (1.8.47.5)->(expversion_<1..4>)
Question: What exactly is 'expverion_'?; a var or a define? If a define (which I read here => Reference/!getdllversion), do I need to define it in my script as follow?:
!define expverion_1 " " # Major; single digit
!define expverion_2 " " # Minor; 2-digit
!define expverion_3 " " # Build; 3-digit
!define expverion_4 " "# Revision; 3-digit
Being unsure what 'expversion_' exactly is and operates/works MakeNSIS throws following warning that -I think- indicates clearly something is incorrect:
warning 6000: unknown variable/constant "{expversion_}" detected, ignoring (C:\1_SW_dev\...\app_client.nsi:295)
The worrying part is the word 'ignoring' in the MakeNSIS compiling message. Can I conclude from above mentioned warning message that assigning the string derived from the (define?) with name "expversion_" is not passed to var $7 by means of command:
StrCpy $7 ${expversion_}
Following MakeNSIS message (# compile time) appears to confirm this:
StrCpy $7 "${expversion_}" () ()
It appears to resolve empty (unsure if I read this MakeNSIS message correctly).
Although having learned a lot wrt NSIS (and liking it) and gone through most of the relevant documentation I do not get my head around this one.
Thnx in advance for solving this specific piece of the puzzle.
Have solved the puzzle myself.
The solution to a version comparison is rather 'simple'. The essential parts herewith: (add to .onInit)
Create a function (e.g. name 'VersionComparison')
Read local version from registry
'Read' installation version from binary (e.g. .DLL or .exe)
Use VersionCompare (!include WordFunc.nsh) to perform the actual comparison.
I'll tackle the !getdllversion issue first. It extracts the 4 16-bit numbers from the start of the version info block and stores them in 4 defines. It simply uses the name you pass in plus a number when naming the defines.
!getdllversion "$%windir%\explorer.exe" foo
!warning ${foo2} ; This prints the minor version
There is no specific number of digits as expected by your comments. Each of the 4 numbers go from 0 to 65535.
You can do basic verification of these numbers at compile time:
!if ${foo1} < 1
!error "Major version must at least be 1, we don't ship beta software :) "
!endif
The 2nd problem is harder to solve. Variables can only be expanded when the installer is running. The only option is to actually generate and run a "installer" from inside your main .nsi:
!makensis vertest.nsi = 0
!execute '"$%temp%\vertest.exe" /S' = 0
!defile "$%temp%\vertest.exe"
where vertest.nsi would look something like
OutFile "$%temp%\vertest.exe"
RequestExecutionLevel user
SilentInstall silent
Section
Do version test here and Goto..
fail:
Abort
success:
SectionEnd

BASH_REMATCH not outputting a match

Context
I'm trying to use regex to pull out the repository name from a github https clone link, and I can't seem to get the BASH_REMATCH to work.
For context, I'm writing this as a .sh file and running it in Git Bash.
Code Logic
As you'll see below, I basically feed in a clone https link, and also provide the regex pattern. I tried this on https://regex101.com/ and the regex correctly pulls out the final bit of the string:
/liam_test_3.git
With it also pulling out the specific capture group of just the repository name:
liam_test_3
But the code I've tried to test below is defaulting to the "else" statement and outputting "no match".
Code
#!/bin/bash
# $1 = SSH Clone Link
# $2 = Github Organisation
CLONE="https://github.cloud.companyname.com/Organisation/liam_test_3.git";
re="\/(?!.*\/)(.*).git";
echo "$CLONE"
echo "$re"
if [[ $CLONE =~ $re ]]
then
repo_dir=${BASH_REMATCH[1]}
echo "Your repo name is $repo_dir"
else
echo "No Match"
fi;
Try re="([^/]*)\.git"; This will match the final part of the url (everything after the last /), and capture the repository name.
Note that you need to escape the . before the git otherwise this would match the first occurrence of git in the url, as the . would match the 2nd / of https://github

Media is not importing correctly when importing using import script

I need to create one import script along with media folder which will create necessary banners in db.
I have created a zip file which contains importscript.impex file and media folder with required jsp files.
When I am importing zip file though import script, it starts complaining about media path issue.
Sample Impex -
INSERT_UPDATE Media ; $contentCV[unique=true] ; code[unique=true] ; mediaFormat(qualifier) ; realfilename ; #media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator] ; mime[default='image/jpeg'] ; folder(qualifier)[default='images'] ; altText
; ; /images/banners/site/Default/abc.jpg ; Default ; abc.jpg ; /media/abc.jpg ; ; ; ""
How can i give my folder media reference in script ?
Just try using only media name (abc.jpg) without any path in the import script and upload your media zip folder while running your import script.
Go to HMC/Backoffice import tools then upload importsript.impex or *.csv which has the data to import
Import file looks like:
INSERT_UPDATE Media ; &Item ; #media[translator=de.hybris.platform.impex.jalo.media.MediaDataTranslator] ; catalog(id)[allownull=true] ; catalogVersion(catalog(id),version)[unique=true,allownull=true] ; code[unique=true,allownull=true] ; folder(qualifier)[forceWrite=true] ; mediaContainer(catalogVersion(catalog(id),version),qualifier) ; mediaFormat(qualifier) ; realFileName
; Item0 ; 8797897457694.gif ; testContentCatalog ; testContentCatalog:Staged ; ContentPageModel__function_preview ; root ; ; ; ContentPageModel__function_preview.gif
Now in the next screen, you can see the option to upload the associated media folder. There you need to upload a zip file containing the media with the same name you have mentioned in the script.
Click on Start to trigger the job and check it's status from cronJob.

Alert!: Unsupported URL scheme! error when sending bulk sms using lynx

Team kindly help on the error Alert!: Unsupported URL scheme! when snding bulk sms in linux bash script. the lynx command works fine for static URL. This is what i have got below
#!/bin/bash
a="lynx -dump 'http://localhost:13013/cgi-bin/sendsms?from=8005&to="
b="&username=tester&password=foobar&smsc=smsc1&text=Test+mt+update'"
for i in cat numbers.txt;do $a$i$b;echo sent $i; done;
numbers
258909908780
256789123456
676675234789
The problem is the single quote before http:. Quotes are not processed after expanding variables, so it's being sent literally to lynx. There's no 'http URL scheme, hence the error message.
Remove the quotes before http: and after +update.
#!/bin/bash
a="lynx -dump http://localhost:13013/cgi-bin/sendsms?from=8005&to="
b="&username=tester&password=foobar&smsc=smsc1&text=Test+mt+update"
for i in $(cat numbers.txt);do $a$i$b;echo sent $i; done;
For more information about this, see
Setting an argument with bash

wget: don't follow redirects if it points to location X, otherwise do

As I read here redirection can be easily turned of by --max-redirect 0. But what in case when there is two kinds of redirection: good one and the bad one.
In my case good redirection is:
http://someaddres.com/888.html -> http://someaddres.com/some-string-in-url-describing-page.html
where bad redirection is:
http://someaddres.com/555.html -> http://someaddres.com/
What can I do to fallow only good redirections?
The only way I can think of off the top of my head would be to turn off redirects as you've said, then parse the response (I suggest using sed or grep, but I'm sure there are other options) looking for a redirect request. You may need the parameter --server-response to get the headers depending on the method used for redirecting. If you find one, do a new wget to the redirect target (unless it's one you don't want to redirect to).
As #Thor84no said, one solution can parse response. This is mine:
REDIRECTED_TO=`wget --max-redirect 0 $ADDRESS 2>&1 | grep "Location" | sed 's|.*\(http://.*/.*\) .*|\1|'`
if [ "$REDIRECTED_TO" != "$BAD_REDIRECTION" ]; then wget $REDIRECTED_TO; fi

Resources