Synology

Indexing monitoring

psql mediaserver postgres


SELECT COUNT(*) AS video_count FROM video;

SELECT id FROM video WHERE id = (SELECT MAX (id) FROM video);


SELECT COUNT(*) AS music_count FROM music;

SELECT id FROM music WHERE id = (SELECT MAX (id) FROM music);


SELECT COUNT(*) AS photo_count FROM photo;

SELECT id FROM photo WHERE id = (SELECT MAX (id) FROM photo);


SELECT COUNT(*) AS dir_count FROM directory;

SELECT id FROM directory WHERE id = (SELECT MAX (id) FROM directory);

Showing indexed files and folders

select id,path from video where path like '/volume1/video/<DIRECTORY_NAME>%' order by path;

Location of let's encrypt certificates

When certificated are created using the Synology interface they are created in:

/usr/syno/etc/certificate/_archive/<folder>

If you cat the output of /usr/syno/etc/certificate/_archive/DEFAULT you'll get the directory:

cd "/usr/syno/etc/certificate/_archive/$(cat /usr/syno/etc/certificate/_archive/DEFAULT)"

Configure docker API to listen on IP

To configure Docker API on Synology to listen on a specific IP for remote queries follow next steps.

Login to the Synology and switch to root:

ssh <SYNOLOGY_IP>

sudo -i

Edit the "dockerd.json" file (add: '"hosts" : [ "tcp://<SYNOLOGY_IP>:<DESIRED_PORT>", "unix:///var/run/docker.sock" ]':

vi /var/packages/Docker/etc/dockerd.json

File should look similiar to this:

{

"data-root" : "/var/packages/Docker/var/docker",

"log-driver" : "db",

"hosts" : [ "tcp://192.168.1.60:2375", "unix:///var/run/docker.sock" ],

"registry-mirrors" : [],

"storage-driver" : "btrfs"

}

Check the status of the Docker and restart it:

synopkg status Docker

synopkgctl stop Docker

synopkgctl start Docker

synopkg status Docker

Check if Docker API is listening on destired port:

netstat -nap | grep 2375