-
Notifications
You must be signed in to change notification settings - Fork 229
Howto Synology
This Howto describes how COPS can be installed on a Synology NAS box. You can use one of the following options:
- Via Synology package
- Via SSH
- Via Docker container
A package is available though http://www.synocommunity.com/ but the package is not actively maintained.
You can install the package repository by following this how to https://synocommunity.com/#easy-install or by downloading the package here : http://www.synocommunity.com/packages.
You may have to change your open_basedir parameter like it's explained afterwards.
If you're using DSM 5 please read the FAQ.
if you're using DSM 6: Install package "Web Station", the settings are there AND give the group http read access to the ebooks shared folder.
From here you can continue with the Common steps as described below
- Log into your NAS via SSH and go to the web folder:
cd /volume1/web
- Become super-user by issueing
sudo -i
- Download the COPS repository, by issueing
wget https://github.com/seblucas/cops/releases/download/1.1.3/cops-1.1.3.zip
. You can change the URL when the release of COPS is upgraded. - Unzip the zip file with
7z x cops-1.1.3.zip -ocops
- Change ownership of the COPS directory by issueing
chown -R http:http cops
- Change rights of the COPS directory by issuing
chmod -R 700 cops
- Start configuring your server
Proceed with the Common steps as described below
1) On Synology, enable Web Station
Control Panel -> Web Services -> Web Applications Tab: "Enable Web Station". Checked the following boxes: "Enable PHP Cache" and "Enable PHP safe mode..." [This option does not exist in DSM 6.0.1-7393_1]
2) Change your open_basedir
I choose to install in a shared folder named "logiciel" and the full path is :
/volume1/logiciel/feedbook
I had to go to Control Panel -> Web Services -> Web Applications and Customise PHP open_basedir to append :
:/volume1/logiciel/feedbook/
You'll have to load your Calibre database to your shared folder and set permission to the new 'http' group if your database is not found
3) If needed, edit the file "config_local.php"
$config['calibre_directory'] = '/volume1/logiciel/feedbook/';
If you use at least DSM 4.1 you can also enable URL rewriting :
$config['cops_use_url_rewriting'] = "1";
4) Avoid default 'public' shared folder
Note that the default 'public' shared folder cannot be used for your Calibre database. It seems to create access issues. Avoid it in order to allow COPS to work fine.
5) Other access issues
When your database is not on level 1 of a shared folder this might create access issues when folder traversing is not enabled for the http group.
Example:
Access errors when trying to use the folder /volume1/Library/CalibreLibrary/
SynoCommunity packages only set permissions on the lowest directory level for the library. This is most likely where the issue lies: the http user tries to access CalibreLibrary, but cannot get past Library because it doesn't have access on that dir.
Set at least traverse folders permissions (under custom, or set the whole read permissions set) for the http user to the folder Library. Alternatively, put your library a directory level higher (i.e. directly in a shared folder)
If you have done all these steps and still get a "metadata.db not found" error, this may be because the Web Station setting for open_basedir is being overridden by another PHP settings file. You can try to fix this by manually appending the library directory to the open_basedir variable in the file /usr/local/etc/php56/conf.d/user-settings.ini
For more info, see the following post:
6) How to set folder traversing for the http user
- File Station
- Select 'YOUR/OWN/SUB/FOLDER/'
- Right mouse click -> Properties
- Permissions tab
- Create
- Group: 'http'
- Copy from: none
- Apply to: All
- Permissions: Check every box under 'READ'
Follow the instructions here: https://hub.docker.com/r/linuxserver/cops/