Mods icon indicating copy to clipboard operation
Mods copied to clipboard

New release

Open xarx00 opened this issue 2 years ago • 12 comments

Could you, please, create a new release. The one from 2018 is quite old and doesn't produce packages compatible with DSM 7. Thank you.

xarx00 avatar Aug 09 '22 00:08 xarx00

The way I was packaging "web applications" does not work anymore on DSM 7 due to security restriction. I would need time to rewrite this part of the packaging.... And I don't have a lot for the moment...

vletroye avatar Aug 19 '22 21:08 vletroye

Ok. I saw this sentence in the README, so I thought that the new version works with DSM 7:

Packages created with Mods are only tested on my DS1815+ with DSM 6.x and my DS214play with DSM 7.x

xarx00 avatar Aug 23 '22 23:08 xarx00

Yes, sorry... I did start to test some basic stuff on my DS214Play but stopped my developement due to lack of time...

vletroye avatar Aug 25 '22 19:08 vletroye

No problem. In case you'll want to fix README, DSP 7 is mentioned at other places as well, e.g.:

MODS can create packages for either DSM 7.x or for DSM 6.x and older.

xarx00 avatar Aug 28 '22 08:08 xarx00

Bonjour Valéry, je suis également preneur d'une nouvelle version compatible DSM 7 :) Si tu as un peu de temps et d'envie, merci à toi 👍

ShonGail avatar Oct 04 '22 16:10 ShonGail

Peut-être durant les congés de Toussaint... :)

vletroye avatar Oct 11 '22 21:10 vletroye

Une bonne action envers les vivants pour cette fête des morts ;)

ShonGail avatar Oct 12 '22 04:10 ShonGail

@vletroye Maybe could we help you in any way to get it working?

Mavyre avatar Jan 30 '23 08:01 Mavyre

Hello @vletroye i am so sorry to pester you about this but i was wondering if you have had anytime to look into this issue again and provide some assistance on how we can get around this issue with DSM 7.x and not being able to install packages created by your awesome app due to installing with root permissions.

Could you please provide us with a update or is there a way we can resolve this by modifying the configs created by your packaging app.

Thanks we appreciate all your hard work this this app.

AUSPhoenix78 avatar Aug 21 '23 05:08 AUSPhoenix78

Hélas, no. I really didn't get time to work on it :(

One dirty trick that I started to investigate a long time ago (but by far too insecure) was (if I remember well) 1: create an account with high privilege into DSM and try to use that account in the "privilege" config file (under /conf folder) image

2: grant access for that user as root on commands like "ln" and "rm" ,... (used by the scripts of my tool) in the file /etc/sudoers (to be edited with command visudo)..

I didn't remember it, but I did post something here about that :)

Another option would be to not run php scripts outside the webstation anymore. Indeed the root access is mainly required to "link" a nginx config into the nginx/conf.d/ folder... This is to run the dummy cgi which execute the php outside the web root.

vletroye avatar Aug 26 '23 21:08 vletroye

I just checked and my package "MODS Sample - Simple CGI 7.x" is working on DSM 7.x with the trick mentioned above (create a sudoer granted root access on ln and unlink. Sources are here

It's running a php website with some ajax... I will adapt MODS to run scripts based on the same trick as soon as I get more time. In the meantime, you could possibly start from "MODS Sample - Simple CGI 7.x",

  1. dropping all files in /package/ui except router.cgi, config, dsm.cgi.conf... and
  2. coding your script in index.php

There is a wizard in the package to explain how to create the sudoer account 'ModsPackager' without password

  1. Connect onto your NAS via SSH (using e.g. the Putty console) as administrator,
  2. Create a sudo file (the name does not matter): sudo vi /etc/sudoers.d/ModsPackager,
  3. Type in this file: ModsPackager ALL=(ALL) NOPASSWD:/bin/ln,/bin/unlink,
  4. Save the file (with :x!)

It's really not safe, because anyone who find the package, and see that account in the privilege file, will know that you have a related sudoer without password.

vletroye avatar Aug 27 '23 19:08 vletroye

Hi @vletroye , great app, but DSM 7 renders it useless due to the problems with root privileges. I can't understand what exactly is requiring root privileges on my simple one line code. Is it the script code itself or something within the packages? I'm using simple WoL command as script: synonet --wake [MAC address] eth0; Can I make it run as my user (the one I log in to DSM with) ? I actually tried that but it made no difference - by changing user from packages to my user in conf/ directory.

EDIT::

Synonet requires SUDO privileges so I suppose the package inherited it from that. Too bad.

madn00b avatar Dec 27 '23 16:12 madn00b