This is work in progress.
This is designed to be run with QNAP QDK locally available, i.e. on a QNAP NAS. Possibly this will work on a different Linux distribution with QDK available, but for now it hasn't been tested.
Example to build for syncthing version 1.23.5
wget https://github.com/bmachek/syncthing-qnap/raw/master/build.sh -O - | bash -s - 1.23.5
Based on the work of @Catfriend1 :-)