Overlay Resource

How to overwrite files that are compiled into fylr

Example 1: resource filesystem

Assume that you want to increase the timeout for re-sizing video assets form one hour to two hours.

This is done in the compiled-in file baseconfig/fas/cookbooks/video.yml.

Extract original file

For a recommended Linux installation, the command would be:

docker exec fylr /fylr/bin/fylr resources --fs=fylr.resources --copy=- baseconfig/fas/cookbooks/video.yml>video.yml

This command will extract the compiled-in file video.yml even if that is already overlayed via fylr.yml. Because the command does not even specify the configuration file (would be done with -c /fylr/config/fylr.yml), it will not be read and thus a resources: setting there will not be seen.

Prepare replacement

Find timeoutSec: 3600 in the extracted file video.yml and and change it to 7200.

Create the directory structure: (in /srv/fylr, taken from the recommended Linux installation)

mkdir -p /srv/fylr/config/fylr/resources/baseconfig/fas/cookbooks

Move the file to the correct position:

mv video.yml /srv/fylr/config/fylr/resources/baseconfig/fas/cookbooks/

Overlay

  1. Configure fylr to overlay, in fylr.yml:

  1. Restart fylr to run it with the new configuration.

Check that overlay is being done

For a recommended Linux installation, the command would be:

In the SOURCE column, overlay is now shown, instead of embed.

Please not that in this case, the configuration file has to be specified with -c /fylr/config/fylr.yml, because this is the path in the fylr container. Otherwise fylr will start with defaults and thus ignore your resources: setting in fylr.yml. And -c has to be specified after the resources command.

To extract the overlayed file:

(... with this example command, the file contents is shown as output, due to --copy=-, and not saved anywhere)

Example 2: web filesystem

Let us assume that the file robots.txt needs to be changed:

Extract original file

For a recommended Linux installation, the command to show this, would be:

Prepare the replacement

Change the extracted robots.txt.

Create the directory structure of the overlay:

Move the file to the correct position:

Overlay

  1. Configure fylr to overlay, in fylr.yml:

  1. Restart fylr to run it with the new configuration.

Test by showing the overlayed file

More info

Command syntax

How to show the command syntax and options of your fylr version.

For a recommended Linux installation, the command to show this, would be:

Show all resources that can be overlayed

To list all resources, let fylr give you a list of each overlay-able filesystem. Currently (fylr v6.9.3), there are two such filesystems. For a recommended Linux installation, the commands to list both, would be:

Last updated