MODS Sample Basic Urls - vletroye/SynoPackages GitHub Wiki

Description

This is a Basic Package for Synology created with 'Mods Packager'. It illustrates how to add shortcuts in DSM to simply open URLs.

It contains three icons:

  • BeatificaBytes ext!: it opens my blog in a new browser window (SPK's type=url)
  • BeatificaBytes ext!: it opens my blog in a DSM iFrame (SPK's type=legacy). Access to this icon can be granted per user via Control Panel > Privileges > Permission tab.
  • Synology Forum: it opens Synology's Forum in a DSM iframe.

Notice

  • an Url may be opened in a DSM iframe only if you have disabled the option 'Improve security with HTTP Content Security Policy (CSP) header' via the Control Panel > Security Tab.
  • After granting access on an application (here an url), the user has to reload his DSM (CTRL-F5 in the browser) to see the new icon.
  • this Package is flagged as a 'beta'. It will only appear on my SSPKS server if you select the option 'Show Beta Packages'.
  • Embedding an url, i.e. displaying a webpage in a DSM iframe, is not working for all websites. Also, it's quite slower than opening the webpage in a new window (i.E. in a Browser's tab), so please wait while the Browser is displaying "waiting for ..."

Making of

There is no special script used to start-stop/install/upgrade/remove this package.

However, I did add an installation json WIZARD UI to display a notification during the setup. It's a simple Step(0) where you can read some text(1) and have to tick a checkbox(2) in order to proceed with the installation(3)

(0) The json Wizard contains only one step (1) This step as only one item of type 'multiselect' with the notification text to be displayed as a 'desc' field (2) The multiselect item contains only one subitem whose 'defaultvalue' is 'false' (unchecked). This subitem has a javascript 'validator' field to insure that it will be ticked: "{return arguments[0];}" (3) if the cehckbox is not valid, then the Step may not be completed as its 'invalid_next_disabled' is true.

Here is the complete installation json WIZARD UI:

[
  {
    "step_title": "Installation Warning",
    "invalid_next_disabled": true,
    "items": [
      {
        "type": "multiselect",
        "desc": "This package contains icons to open various URLs. Some URLs are opened in an iframe. If you want to test them, you must disable the option 'Improve security with HTTP Content Security Policy (CSP) header' via your DSM's Control Panel > Security.",
        "subitems": [
          {
            "invalidText": "Please select the 'Understood' checkbox...",
            "validator": {
              "fn": "{return arguments[0];}",
              "allowBlank": false
            },
            "key": "warning",
            "defaultValue": "false",
            "desc": "Understood"
          }
        ]
      }
    ]
  }
]

Illustration

Synology Forum in DSM iFrame

Permission configuration on a URL

Installation Wizard UI