unRAID-Web - complete web server w/ php for unRAID


Recommended Posts

Version 0.01.03 is posted.  Link is in OP.

 

In this version:

=================

 

  - changed home to /boot/custom

  - deleted users file from AjaXplorer so it will not overwrite users you create.

  - now includes unMenu

  - new extension "SysInfo" (small now, but will be expanded soon).  I'm testing a new menu interface in this one too.

 

As always, comments and suggestions are invited.

 

If you have modified any config files, you may want to move them from /boot/config/lighttpd to /boot/custom/lighttpd,.

 

Then you can delete /boot/config/lighttpd

Link to comment
  • Replies 280
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

rTorrent requires a number of slackware packages, and you have to compile it yourself.  To get it to work properly with scgi, you will need to use the beta.

 

If you create your own package for rTorrent with all dependencies, you could also include an extension that would set up wTorrent.

 

In the stock setup of lighttpd, I includes the scgi.server on port 5000 for rTorrent.

 

A new version of BubbaRaid won't be posted until the next beta of unRAID is out.

Link to comment

I've discovered two items (bugs) in how unMENU plug-ins are being processed.  One I've fixed, the other I'm investigating.

 

Apparently, "php" does not allow periods in variable names.  It silently converts them to underscores. Unfortunately, the buttons in the unMENU Package-Manager are named for their affiliated packages, which almost always contain periods as part of their name.

 

A quote I found on the web describes how it affects us:

> As some of you are probably aware, PHP converts "external variables"

> (i.e., web request keys) so that their names are "valid variable

> names."  For example,

>

http://.../my.php?foo.bar=baz

>

> yields $_GET['foo_bar'] == 'baz'.  If you have register_globals turned

> on, that kinda makes sense.  (Except register_globals is off by

> default, starting with PHP 4.2.0.  And nobody uses it.)

>

> However, according to

>

http://us2.php.net/variables.external

>

> the dot-to-underscore conversion still applies in all cases.  In

> particular, anything from $_GET, $_POST, or $_COOKIE will be

> converted, and the result of parse_str() undergoes the same

> transformation.

 

When you press a button to install, enable or disable a package it is sent to unMENU plug-in, but no matching plug-in is found to enable.

 

I've found a fix for that inconsistency in how "php" handles the querystring variables.... 

 

I'm now working on a second issue.  I think it involves quoting special characters... It affects the ability to use the Config-view/edit unMENU plugin.  It works on some files, but not others.  When you go to open up some files to edit them, the page comes up blank.

On other pages, it works perfectly fine.  As I said, it will probably have to do with specific content characters.

 

Once I figure out what is needed for this second problem I'll post a version .3 of the unMENU extension that has fixes for both issues.

 

In the interim, if anyone else finds something new, let me know.

 

Joe L.

Link to comment

I've now fixed the two items I had described in my prior post.   

 

The basic issue was the same in both cases... "php" trying to help me by decoding some values.

 

The first was "php" silently renaming variable names that are apparently legal names in HTML, but would result in a syntax error under "php" when evaluated.

 

The second was "php" decoding the POST variables being sent from the browser.  I needed the un-decoded HEX values to be sent to the awk plug-ins.  Otherwise, the decoded quote marks really confused the passing of parameters, and the plug-in just did not get the POST values it was expecting.

 

One other change is that the syslog upload is now named with the date as part of its name.  The first two versions it was only syslog.txt.  Now it will be syslog-2009-03-16.txt  (as an example)

 

My OP will have the updated attachment of the unMENU extension for unRAID-Web.  I'm up to version 0.3 now.

 

Joe L.

 

 

Link to comment

Hi,

 

at first sorry for my bad English.  :-\

I have a problem with the "Webserver Setup" Page. It seems that the ./setup/index.php try to create the file

/boot/config/lighttpd/lighttpd.conf.include, but at my system this does not work. After pressing the "save configuration" button, there is no

file in this directory. The lighttpd.conf.include in the /boot/custom/lighttpd was empty.....

Ok, now i have change every /boot/config/ with /boot/custom/ at he index.php file and restart the server.

Now it seems to work....but after pressing the "restart web server"

button i got a "Error 500" for every page  :o

Only after a manual restart everything works, but i see sometimes a

lighttpd-angel.c.135: child (pid=2543) exited normally with exitcode: 0, after this i get again the "500 Error".

 

thanks

Link to comment

Thanks.  Yes, that is a bug caused by relocating the home to /boot/custom from /boot/config.

 

I'll take care of it in the next version.

I found a new "bug" introduced (I think) in the new 4.5-beta3 version of unRAID in the unMENU plug-in extension.

 

I think it is related to the way the $PATH variable is now defined.  In any case, I was unable to see any of the "buttons" defined on the unMENU "User-Scripts" plug-in.

 

I traced it to the fact that the "cgi" plug-in itself was not being executed because the current directory was not in the search path.  (All .cgi scripts were broken, but it is the only one I have, so it was the only one affected)

 

I was able to fix it by changing one line to explicitly state "./plug-in"  at line 292. (Note the added "./")

Old line 292:

fwrite($fil, "\$cmd .= ' " . $a->add_on . "';\n");

New:

fwrite($fil, "\$cmd .= ' ./" . $a->add_on . "';\n");

     

Here it is in context:

} else { // this is a "cgi" script.  It should be execuitable. It can be shell, etc.

     fwrite($fil, "\$cmd .=\"ConfigFile='".$unmenu_conf."' MyHost=".$MyHost." ScriptDirectory='". $unmenu_dir."'\";\n");

     if ( $unmenu_local_conf != "" ) {

         fwrite($fil, "\$cmd .= \" LocalConfigFile='" . $unmenu_local_conf. "'\";\n");

     }

     fwrite($fil, "\$cmd .= ' ./" . $a->add_on . "';\n");

     if ( $plugin_options != "" ) {

         fwrite($fil,   "\$cmd .= '" . $plugin_options . "';\n");

     }

     fwrite($fil, "\$cmd .= \" \$array_state  \" . \$arg1 . \" '\" . \$form_field_string . \"' '" . $top_menu . "'\";\n");

}

 

Joe L.

Link to comment

Up until now, the ability to manage disks was missing from BubbaQ's unRAID-Web. 

 

I've nearly got a new unMENU plug-in written to perform the Disk-Management functions built into the "unmenu.awk" version of unMENU.   

Everything works except for one tiny feature.  The ability to share a sdrive outside of the protected array.  I am at the point where I discovered Tom's recent change to the smb config file names in unRAID 4.5-beta3 has broken the ability to "Share" a disk that is not part of the array in my existing unMENU.

(The plug-in is still using the old file name he used to use, not the new name he is using in 4.5-beta3)

 

Once I add code to deal with either file name, we'll be ready to go..   It will need to also deal with the new smb config file he allows on the flash drive.

 

The new "Disk Management" unMENU plug-in will override the built-in function in unmenu.awk (making it compatible with the old and new versions of unRAID) and supply the missing functions in the unRAID-Web unMENU extension.

 

Joe L.

Link to comment

The new and improved unMENU "Disk-Management" plug-in I described is now available.  It will work under both unRAID-Web and unmenu.awk.

 

It supplies to unRAID-Web functions previously available only when using unmenu.awk.

 

It is described and attached here

 

Install in the same folder as all the other unMENU plug-ins.

If you do not see it in the list of links at the top of unRAID-Web's unMENU extension, click on unMENU  in the left-hand "Extensions Menu" to re-scan the plug-ins folder and have the new "Disk-Management" link included as a unRAID-Web option under unMENU.

 

Have Fun... Let me know if you find anything that does not work as expected.

 

Joe L.

Link to comment
  • 2 weeks later...

I am obviously having a blonde moment..  What is OP?  I have figured out how to get bubbaRiad but I am curious to what OP really stands for....  Nice work by the way..  I am  new to the unRaid family..  Still testing before I spend countless hours archiving my DVD and Photo Collection.

Link to comment

I am obviously having a blonde moment..  What is OP?  I have figured out how to get bubbaRiad but I am curious to what OP really stands for....  Nice work by the way..  I am  new to the unRaid family..  Still testing before I spend countless hours archiving my DVD and Photo Collection.

OP = "Original Post" = "First post in this thread"

 

Joe L.

Link to comment

Joe,

 

Is there a way to mount an NTFS drive in this unRaid Web version of unmenu?  If so I don't know how to do it - or is this something that is going to be added later?  I see in the status section that the drives say UN.  I am able to mount the drive in your original unmenu add-on.

 

Thanks,

 

Dan

Link to comment

Joe,

 

Is there a way to mount an NTFS drive in this unRaid Web version of unmenu?  If so I don't know how to do it - or is this something that is going to be added later?  I see in the status section that the drives say UN.  I am able to mount the drive in your original unmenu add-on.

 

Thanks,

 

Dan

Dan,

 

In the original unmenu.awk, array and disk management were built into the unmenu.awk web-server, and not in plug-ins.   The "extension" I wrote for unRAID-Web is only able to invoke the unMENU plug-ins, so the built-in functions were initially missing.

 

To fix that, I wrote a plug-in that duplicates the original "built-in" Disk-Management function of unmenu.awk.   It was described a few posts back in this thread http://lime-technology.com/forum/index.php?topic=3354.msg30516#msg30516

This plug-in is usable under unRAID-Web.  Once you install it in unMENU, you can then mount and share your NTFS/other file-system disks as usual under unRAID-Web as seen here:

v6oyue.jpg

 

The post in this thread in turn points to a post in the unmenu thread where you can find my new "Disk-Management"  plug-in file attached: http://lime-technology.com/forum/index.php?topic=2595.msg30513#msg30513 

 

Just download the plug-in, unzip it in the same folder as your other unMENU plug-ins, and then, in unRAID-Web, click on the left-nav menu extension for unMENU to have the new plug-in for disk management included on the top menu. (unRAID-Web's unMENU extension re-scans the unMENU folder when you click on that left nav-menu).

 

Also note that to complete the original functionality I've also been testing a new plug-in I've written that mimics the Array management functions (and adds a new one)...

I've not yet published it, but it too will be available under unRAID-Web soon, as seen here:

kd5y8i.jpg

 

Joe L.

Link to comment

Thanks.  Yes, that is a bug caused by relocating the home to /boot/custom from /boot/config.

 

I'll take care of it in the next version.

 

Any news on new version?  I had that problem after installing it when i went to save the path it would not do it for the web server and port number nothing happens when i push the save button.

 

Keep up the good work and looking forward to getting this package running!

 

Jm2005

Link to comment
  • 4 weeks later...
  • 1 month later...

On the Custom Interface/Overview screen there is a "Monitoring Status" box, the system portions reads "no sensor packages" but I believe lmsensors is available.  What do I need to do to get it to display?

 

I hate to bump, but does anyone have an answer for this?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.