PIXILAB Blocks makes sure that file permissions and naming conventions are maintained properly during normal use. However, when moving files from one computer to another, problems may arise due to permissions or naming conventions being lost along the way. If you run into problems that appear to be permission related after moving either a complete Blocks root or parts of one between computers, these can often be resolved by following the procedure outlined below. The exact steps vary depending on what platform you're using.
To fix file permissions after copying a complete or partial Root folder to the server, do as follows on that server:
cd Utilities ./fix-blocks-root-public.sh
Press Enter to run the script. Any files that needed to be fixed will be listed as the script runs. You can now start Blocks again and verify correct operation.
To fix file permissions after copying a complete or partial Root folder to the server, do as follows on that server:
systemctl --user stop blocks wget https://pixilab.se/outgoing/blocks/cloud-support/filefixer.jar java -jar filefixer.jar ~/PIXILAB-Blocks-root/public systemctl --user start blocks
The commands above do the following:
This section describes the technical reasons for why there may sometimes be problems transferring files between Blocks servers and what the filefixer.jar program does to remedy such problems. You don't need to read this if you just want to "fix" the problem.
When running Blocks under Linux, it is important that all relevant files are both readable, writable and (for directories) traversable by the relevant users and processes. While this is usually OK for the user under which you run Blocks, it may not be the case when running nginx as a reverse proxy, which is typically the case for Linux based servers. In this case, nginx runs under a separate user (typically www-data). When using nginx in this way, nginx directly serves all files under public in your Blocks root, so those files must be readable and traversable also by that user.
The filefixer.jar program will make sure that all files under the directory to which it is applied are readable by any user, thus letting nginx access those files. Note that nginx doesn't write to those files (this is done by Blocks), so it only needs read access.
All modern operating systems have support for Unicode filenames. Unicode is an international standard that describes how to encode all characters of all languages. Unfortunately, for some characters, there's an ambiguity as to how those can be encoded. This applies to most characters with umlauts or other diacritical marks such as our swedish å, ä and ö, as well as the german ü.
There are two different ways to encode such characters, referred to as NFC ("Normalization Form Canonical Composition") and NFD ("Decomposed Form"). Some operating systems, such as macOS, have standardized how such characters must be encoded on disk (here by enforcing NFD). Windows tends to use NFC, but that's appears not to be enforced by the operating system. Linux is largely "agnostic" and gladly accepts both forms.
Unfortunately, this confusion may result in strange situations – especially when moving files across operating systems or using ZIP files – where you end up with the "wrong" encoding. You can even end up in a situation where there are multiple files with seemingly exactly the same filename in a directory (such as two files both named "Örjan"). Needless to say, this also confuses the programs trying to access those files.
Under Linux, Blocks expects all files to have their names encoded according to the NFC standard. The filefixer.jar program looks for files named in a conflicting way and corrects those files, so they can be found by Blocks and nginx.