Wednesday, 14 June 2017

For some reason most of documentation on Content Security Policy doesn't say anything about ports in directives. I found that CSP treats domains with different ports as absolutely different domains. If you have directive like frame-ancestors 'self' *.your-client.com - it will not work if your client embedding your application from test.your-client.com:1507, your directive should be frame-ancestors 'self' *.your-client.com *.your-client.com:1507 then.

It is also possible to use "star notation" for port: frame-ancestors 'self' *.your-client.com:*

Friday, 21 April 2017

There are a few libraries from non-trustworthy individual developers which do compile LESS style-sheets in java, most of them are not very transparent: some of them download node.js, some of them use rhino. It is possible to do it in clear, obvious way from your ant build, see the example for Windows below.

Properties to be defined:
${your.extensions.dir} - is some dir to put NodeJS to;
${your.web.sources.dir} - is a dir for static web files, to put CSS into.

This config downloads NodeJS, installs LESS locally and compiles styles.
This example has version for Windows and MacOS, Linux version should be similar to MacOs. Node.JS can also be installed with system package manager, `_install_node` task is not needed in this case.05 Jan 2018: updated with MacOS executables

<!-- Build less stylesheets -->
<property name="nodejs.dir" location="${your.extensions.dir}/nodejs"/><!-- maybe these versions should go to the ivysettings.xml, maybe not because they are not from the maven/ivy -->
<property name="nodejs.ver" value="8.9.1"/><property name="less.ver" value="2.7.2"/>

Friday, 7 April 2017

Windows 10 “Creators Update” is finally available to install outside from “insiders programme”, it will soon land on most of windows 10 machine, and those who impatient can install it directly from the website: https://www.microsoft.com/en-us/software-download/windows10Most valuable thing in this update for me is update of linux subsystem to the Ubuntu 16 and compatibility of this subsystem with Windows binaries, so you now can call pretty much any windows binary from the windows bash. (it is available in build Builds above 14951)

Unfortunately the update of subsystem is not 100% smooth, the subsystem has to be installed and re-installed back (hopefully will not be required soon).

Wednesday, 15 February 2017

Entities are normally not eligible for Spring-driven configuration, however it is possible to make them eligible by adding `@org.springframework.beans.factory.annotation.Configurable` annotation.

Unfortunately autowired things are not available in constructor, because they are injected after the object is constructed. Luckely `Configurable` has very useful `boolean preConstruction() default false` option to make autowired fields available in constructor. Here's the example: