in Synology

If you have a Synology DiskStation and you have shared your public NAS link on any app or service that retrieves the URL metadata for building a link with metadata descriptors, you’ll probably have wondered if it’s possible to change the information displayed.

Modifying this information directly in the UI is currently not possible with DSM versions up to 7.1 but you can still use the UI to get it done. Here’s how.

Open DSM and open the Control Panel. Select Task Scheduler.

What we’re going to do is to create a Task that is triggered when DSM boots (or when ran manually) that will delete the existing Site Description and Site Keywords entries and replace those with new ones.

Press Create and select Triggered Task and after User-defined script. This will open a new popup as in the image below where you will need to fill in a description for the task, select user root and event as Boot-up.

Then press the Task Settings tab and find there a multiline text field for Run command. This is where we will place our script.

To customize the script, you need to modify the strings below with your own text. Warning: if you use non-ASCII text here you may run into problems. I recommend you use an online tool to escape bash shell characters for your string before pasting it in (link to external tool here).

First line comments out the existing site_description line and adds a new one after (modify MYDESCRIPTIONTEXTHERE):

sudo sed -E -i 's/^(dsm_site_description.*)$/\#\1\ndsm_site_description=\"MYDESCRIPTIONTEXTHERE\"/g' /usr/syno/synoman/webman/texts/enu/strings;

Second line comments out the existing site_keywords line and adds a new one after (modify MYKEYWORD1,MYKEYWORD2 with command separated values):

sudo sed -E -i 's/^(dsm_site_keywords.*)$/\#\1\ndsm_site_keywords=\"MYKEYWORD1,MYKEYWORD2\"/g' /usr/syno/synoman/webman/texts/enu/strings;

Third line deletes the previously commented out lines:

sudo sed -E -i '/^#dsm_site/d' /usr/syno/synoman/webman/texts/enu/strings;

So you should have something like this:

Ideally with should test this script beforehand using SSH, but if you followed these pointers exactly it should be fine. In my case, I’m now running the TaskScheduler Script manually and then using SSH to verify if it’s done it’s job.

To run the script manually select it in the Task Scheduler list and press the Run button in the menu above.