Working with GRAV on Synology

I have a Synology NAS. I’m running DSM 6. The operating system is a variety of Linux.

$ uname -s -r -v -m -o -u
Linux 3.2.40 #15217 Wed Dec 20 18:16:33 CST 2017 armv7l GNU/Linux synology_armada370_213j  

Synology runs both nginx and apache. I have set it up to run apache 2.4 as the backend for the web, which is the only way I have managed to find to get Grav to work. I have been unable to find a configuration to run Grav directly under nginx. Synology uses mustache files to generate the nginx config files, and I don’t want to break anything.

Synology allows for both php 5.6 and php 7. The issues below occur with both.

There are some problems as Synology is also running nginx and then passing control to apache

I have a Grav site working and I have the admin plugin working.
However, the admin plugin cannot add a new plugin. The error on the admin page after clicking on Add is connection to GPM cannot be established. However, I can use (see below) bin/gpm install plugin.
If I connect to the Synology machine using ssh in order to use the command line, I cannot always get bin/gpm to work, especially after some operations with the admin plugin. I have a bash script (based on the script in the GRAV documentation) that sets all files and directories to have group ‘http’ (the Synology Group for apache) and the permissions as per Grav. After running the script, I can run bin/gpm list and get the correct output.

I have installed the devtools plugin. However,
bin/gpm plugins devtools new-plugin
freezes after the first question (the name of the plugin) is answered. I have tried running the command with sudo, and I have changed the user:group to my name (under Synology, all users have the group ‘users’). The command (… new-plugin) still freezes after the first question.

Any advice on how to proceed?

Would it be possible to a link into the Documentation how to set up a new plugin without devtools? Or perhaps just a blank plugin in the downloads section?

GPM Connection - Solved (Partially)

I am including the comment in case anyone else has the same issue.

There is a comment in the documentation about this issue (somehow I missed it earlier).

The solution - for Synology - is to change an ssl verification key. Hence, in the Admin panel:

Configuration->Advanced->Remote Verify Peer (SSL) toggle to NO

bin/gpm plugins devtools is exceedingly slow on Synology!!!

I have found it is far quicker to create a plugin manually by copying files from an existing plugin and then editing the config files.

After changing the configuration, as above, I tried bin/plugin devtools new-plugin (only CLI version of this is supported at time of writing). After taking minutes (!) to set itself up, and provided that the permissions workaround (see next reply) is followed, the plugin does eventually work!

Synology Permissions Workaround

Synology SAS has one group for all users (viz., users) and the group for the web software is http.

(All the below assumes that the user xxx can use sudo, that is, xxx is a supervisor).

When using the CLI, a number of directories have to belong to xxx:http , but cache directories are created by GRAV running from through apache, so they are owned by http:http .

The workaround to resolve most permissions issues is to use the CLI command in the root directory of GRAV.

sudo bin/grav clear-cache