Categories: Synology

Synology – Modify public link metadata (site description and keywords)

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.

sete

Recent Posts

Ubuntu Linux VM on Hyper-V – Expand Virtual disk to full size

Ubuntu initial setup does not do expand the virtual disk image to it's full size.…

4 years ago

Synology DSM 7 Docker error – Container crashes on boot – Solution / Fix

A common issue that appeared with DSM 7 is that some well known containers started…

4 years ago

Windows Sandbox – How to install Windows Store apps

The Windows Sandbox image is useful for many test setups, but it lacks much of…

5 years ago

Windows 10 Snip & Sketch app fails – “Failed to open the file” error fix

If you're used to Snip & Sketch for adding some scribbles placed over desktop screenshots,…

6 years ago

How to solve “Contacting the server for information” in Microsoft / Office 365 apps

On some occasions Microsoft 365 Office applications might open a popup with "Contacting server for…

6 years ago

Here are Chocolatey’s common commands – Windows command line Package Manager

You might have already heard about Chocolatey, a package manager similar to apt-get in linux…

6 years ago