This script enables CORS in Synology's WebDAV Server package (https://www.synology.com/en-global/dsm/packages/WebDAVServer). This is necessary for hosting KeePass (https://keepass.info/) files that you want to use with KeeWeb (https://keeweb.info/).
All credits go to Vincent Lamouroux (@skad). You can find his original posting here keeweb/keeweb#703 (comment).
- KeeWeb doesn't like self-signed certificates when using HTTPS.
- The script is able to automatically update itself using
git
.
- Install the package
WebDAV Server
using thePackage Center
in the WebGUI
- install the package
Git Server
on your Synology NAS, make sure it is running (requires sometimes extra action inPackage Center
andSSH
running) - alternatively add SynoCommunity to
Package Center
and install theGit
package (https://synocommunity.com/) - you can also use
entware-ng
(https://github.com/Entware/Entware-ng)
- create a shared folder e. g.
sysadmin
(you want to restrict access to administrators and hide it in the network) - connect via
ssh
to the NAS and execute the following commands
# navigate to the shared folder
cd /volume1/sysadmin
# clone the following repo
git clone https://github.com/alexanderharm/syno-webdav-keeweb
# to enable autoupdate
touch syno-webdav-keeweb/autoupdate
- create a shared folder e. g.
sysadmin
(you want to restrict access to administrators and hide it in the network) - copy your
synoWebdavKeeweb.sh
tosysadmin
using e. g.File Station
orscp
- make the script executable by connecting via
ssh
to the NAS and executing the following command
chmod 755 /volume1/sysadmin/synoWebdavKeeweb.sh
-
configure the
WebDAV Server
, e. g. enable HTTPS and set a non-standard port -
create a task in the
Task Scheduler
via WebGUI
# Type
Scheduled task > User-defined script
# General
Task: SynoWebdavKeepass
User: root
Enabled: yes
# Schedule
Run on the following days: Daily
First run time: 00:00
Frequency: Every 1 hour(s)
Last run time: 23:00
# Task Settings
User-defined script: /volume1/sysadmin/syno-webdav-keeweb/synoWebdavKeeweb.sh"