SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.02k stars 1.23k forks source link

DSM Shortcut and Icon #3426

Closed joseph-henry closed 5 years ago

joseph-henry commented 6 years ago

Hello again everyone,

My package is nearly complete however I am having difficulty settingurl in the config file. Everything else is set correctly. But for url I just get /. I've tried setting the following:

ADMIN_PORT = 9993
ADMIN_URL = /zerotier/
ADMIN_PROTOCOL = https
#SERVICE_PORT_PROTOCOL = https
#SERVICE_PORT_URL = /zerotier/
SERVICE_PORT = 9993

And from the descriptions in the Makefile variables page it isn't exactly clear to me whether I should be setting ADMIN_ or SERVICE_ variables in order to expose a simple application UI available in DSM.

I have a UI working by my own means, but I'm just not sure how to set it using the spksrc system.

Any help would be greatly appreciated. Thanks.

BenjV commented 6 years ago

As far as I know it should be ADMIN_URL, because according to the developer guide there is no such thing as a SERVICE_URL. And also remove the two "/". From the developers guide:

Field Name: adminurl Description: If a package is installed and has a webpage, a link will be opened when the package is started. Note: adminprotocol, adminportand adminurl keys are combined to adminprotocol://ip:adminport/adminurl link Value: String Default Value: (Empty) Example: adminurl="web"

ymartin59 commented 6 years ago

Makefile variables are documented at https://github.com/SynoCommunity/spksrc/wiki/Makefile-variables In case of doubt, you may check for their usage in framework: https://github.com/SynoCommunity/spksrc/blob/master/mk/spksrc.spk.mk#L182 Regards

joseph-henry commented 5 years ago

Thanks guys, one final issue before I close this: My package's core service and UI works, but for some reason I don't see any icon/shortcut for the installed app in the main menu (only the Package Center). Is there any thing special I need to do in order to get this to show up?

For reference: I've created a pull request for the package with a working CLI/UI, but I've omitted the SERVICE_ ADMIN_ definitions from the makefiles for now: https://github.com/SynoCommunity/spksrc/pull/3458

joseph-henry commented 5 years ago

Solved (sloppy hack?):

After no success using the makefile variables I stubbed upon the following solution: In my spk/zerotier/src/ui directory I created a config file and populated it with:

{
        ".url": {
                "com.synocommunity.zerotier": {
                        "type": "legacy",
                        "title": "ZeroTier",
                        "icon": "images/icon_{0}.png",
                        "url": "/webman/3rdparty/zerotier/index.html"
                }
        }
}

This created the desired DSM menu shortcut to my application.

Thanks again for your help, everyone.