vletroye / Mods

Mods can be used to Create or Open/Edit and Generate packages for Synology
Microsoft Public License
86 stars 10 forks source link

New release #25

Open xarx00 opened 2 years ago

xarx00 commented 2 years ago

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.

vletroye commented 2 years ago

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...

xarx00 commented 2 years ago

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

vletroye commented 2 years ago

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

xarx00 commented 2 years ago

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.

ShonGail commented 1 year ago

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 👍

vletroye commented 1 year ago

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

ShonGail commented 1 year ago

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

Mavyre commented 1 year ago

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

AUSPhoenix78 commented 1 year ago

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.

vletroye commented 1 year ago

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 commented 1 year ago

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.

madn00b commented 9 months ago

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.