Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Package Request] Autorun script on external Storage connect (USB, eSATA) #5577

Open
schmidhorst opened this issue Jan 23, 2023 · 6 comments · May be fixed by #5659
Open

[Package Request] Autorun script on external Storage connect (USB, eSATA) #5577

schmidhorst opened this issue Jan 23, 2023 · 6 comments · May be fixed by #5659
Labels
request request for new package

Comments

@schmidhorst
Copy link

Software Name

Autorun

Brief Description

Executes a script when connecting external storages (USB / eSATA) on a Synology NAS with DSM 7.x. Typical use is to copy or backup some files. In Synology's Task Scheduler there is the possibility to create triggered tasks. But for the trigger event there are only Boot-up and Shutdown available. There are no events 'External storage mounted' available. This deficit is compensated by this tool.

Website

https://github.com/schmidhorst/synology-autorun

Documentation

https://github.com/schmidhorst/synology-autorun#autorun-package-v110-for-synology-nas

Build/Installation documentation

https://github.com/schmidhorst/synology-autorun#build-and-installation

Source code

https://github.com/schmidhorst/synology-autorun

OpenSource License

other (please specify below)

Other License

bsd-3-clause

@schmidhorst schmidhorst added the request request for new package label Jan 23, 2023
@hgy59
Copy link
Contributor

hgy59 commented Mar 11, 2023

@schmidhorst as far as I understand (AFAIU) you want us to host the autorun package that you forked from https://github.com/reidemei/synology-autorun?

This is ok, as @reidemei does no further development (declared in https://github.com/reidemei/synology-autorun/blob/main/README.md).

To host packages on https://synocommunity.com those must be created by our dev. environment.

I see two options

  1. mirgration of all synology-autorun code into a new package spksrc/spk/synology-autorun (or shorter spksrc/spk/autorun, with further development in synocommunity repo.
  2. create a new package spksrc/spk/autorun that will download the source code from synology-aurorun and add/adjust the installer/spk generation.

both variants will need some investigations...

@hgy59
Copy link
Contributor

hgy59 commented Mar 11, 2023

@schmidhorst I started to create a package and found, that the icons (*.png) in the provided source archive (https://github.com/schmidhorst/synology-autorun/archive/refs/tags/V1.10.0.tar.gz) are corrupt (invalid png files)

As some 0x0d bytes (followed by 0x0a) are missing in the corrupt files, it seems that the png content is translated with text eol=lf. To fix this, you have to add the following line to the .gitattributes file

*.png binary

@hgy59
Copy link
Contributor

hgy59 commented Mar 11, 2023

@schmidhorst I have a second issue:
The file package/ui/helptoc.conf and the whole folder package/ui/help is missing in the source archive.

Except the icons and the help files I have a working PoC.

@schmidhorst
Copy link
Author

Hello,
thank you very much for your response.

  • I will try to investigate your dev. environment. That investigation will need some time, possibly some weeks … How do I create the mentioned spksrc/spk/autorun package on github?

  • Thank you very much about the hint with the corrupted png icon files. I have fixed this now.

  • About my helptoc.conf:
    I have tried to integrate some Application help to my package and therefore created that helptoc.conf and some more files. But up to now I didn’t manage to get it really integrated to Synology’s DSM help. I struggled with that part up to now.
    Possibly your dev. environment helps me to get this really working.
    Or is there somewhere the source code for an example package with working DSM help?

Best regards
Horst Schmid

@hgy59 hgy59 linked a pull request Mar 12, 2023 that will close this issue
12 tasks
@hgy59
Copy link
Contributor

hgy59 commented Mar 12, 2023

@schmidhorst hi Horst, just pushed my work in progress.

As you can see in #5659 I have created the src/service-setup.sh file containing the code from the installation steps files.
Furthermore I took all the files downloaded from the release of your repository.
I special handling was needed to bring the langage dependent package descriptions into variables for our INFO file creation rule.

Everything installs so far, except that the config file ist not created (var/config).
This is caused by the empty items variable: items="$(env | grep "^config_")" - I have not a clue, where the "config_*" variables are put to the environment (did not find any related code in the wizard files).

Some other findings:

  • it is obsolete to check against the os_min_ver in service preinst, as the DSM package installer validates this requirement.

  • the installers of synocommunity use the shell of /bin/sh (and your scripts use /bin/bash). I temp. changed this to /bin/bash but could not see any difference.

  • at uninstall, there is a checkbox to remove all related files, but this does not remove the following files

    • /var/tmp/autorun.log
    • /volume1/@appdata/autorun/autorun.log
    • /volume1/@appdata/autorun/config
    • /volume1/@appdata/autorun/detailLog (link to /var/tmp/autorun.log)
    • /volume1/@appdata/autorun/execLog
    • /volume1/@apphome/autorun/.wget-hsts
  • as you mentioned alread, the package update does not work (on DSM 7: invalid package format).

@schmidhorst
Copy link
Author

schmidhorst commented Mar 18, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request request for new package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants