Tiny Core Linux

Off-Topic => Off-Topic - Tiny Core Lounge => Topic started by: curaga on March 16, 2012, 05:34:17 PM

Title: Anyone interested in testing an aria2 webUI?
Post by: curaga on March 16, 2012, 05:34:17 PM
I've been working on a light webUI for aria2, for remotely controlling downloads.

Anyone interested in testing?

http://a2web.sourceforge.net

Quick install on busybox httpd:
Quote
tce-load -wi compiletc aria2 fcgi fcgi-dev xmlrpc-c-client
make
mkdir -p ~/www
COPYDIR=~/www make copy
cp a2web.conf.sample ~/www/cgi-bin/a2web.conf # set the theme path as "/a2web/crystal", busybox doesn't like regular files under cgi-bin
httpd -f -p 8080 -h ~/www
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: ndrancs on March 17, 2012, 02:31:41 AM
hi curaga
how to setup with lighttpd.tcz ?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on March 17, 2012, 04:12:10 AM
I don't have my test setup at hand right now, but you need to add "mod_cgi" to the server modules, and assign .cgi to nothing:

Quote
$HTTP["url"] =~ "^/cgi-bin" {
    cgi.assign = ( ".cgi" => "" )
}

Note this is the CGI setup, I haven't tested FastCGI with lighttpd.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on March 27, 2012, 08:40:55 AM
a2web.tcz now posted.

Busybox httpd instructions shorten to:
Quote
tce-load -wi a2web
# edit config file as needed
httpd -f -p 8080 -h /usr/local/share/a2web

I also tested lighttpd FastCGI, seems there's a bug in lighttpd's passing of SCRIPT_NAME (it passes it fine in CGI mode) or in libfcgi. Not too interested in tracking that down ATM, so lighttpd users please use the CGI mode.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: ndrancs on March 27, 2012, 08:48:24 AM
Hi Curaga,

I will test the extension and report the result here,
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on April 07, 2012, 05:27:49 AM
I have found the bug in fastcgi. It was in libfcgi's printf. The fixed packages haven't been uploaded yet, I'll ask danielibarnes first.

Here's an example lighttpd conf, in fastcgi mode:
Quote
server.document-root = "/usr/local/share/a2web"
server.port = 80

server.modules = ( "mod_access", "mod_fastcgi" )

server.username = "nobody"
server.groupname = "nogroup"

server.errorlog = "/tmp/light.log"



mimetype.assign = (
         ".css" => "text/css",
         ".js" => "text/javascript",
         ".png" => "image/png" )

fastcgi.server = ( ".cgi" =>
      (( "bin-path" =>
         "/usr/local/share/a2web/cgi-bin/a2web.cgi",
         "socket" => "/tmp/a2.socket"
      ))
      )
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on April 09, 2012, 03:05:56 AM
fcgi.tcz is updated, fastcgi should work with all supporting servers.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: ndrancs on May 01, 2012, 11:06:16 PM
hi curaga,
i have tested a2web.tcz and found no problem so far,
thanks
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 02, 2012, 11:30:53 AM
i tried to run a2web under xampp
Code: [Select]
Firefox can not connect to server localhost:6800i stopped xampp, installed busybox httpd and did as adviced here
Busybox httpd instructions shorten to:
Quote
tce-load -wi a2web
# edit config file as needed
httpd -f -p 8080 -h /usr/local/share/a2web
Code: [Select]
# set a2web.conf
sudo /usr/local/httpd/bin/httpd -f -p 8080 -h /usr/local/share/a2web
firefox http://localhost:6800/rpc
but result is the same
Code: [Select]
Firefox can not connect to server localhost:6800most likely my hands are growing from other side :D
probably it would be easier for me to build something with gui from here
http://sourceforge.net/directory/freshness:recently-updated/?q=aria2
this is reason why i sometimes use fatrat ::)
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 02, 2012, 12:26:41 PM
6800/rpc is where aria2 is running, you should point firefox to 8080, where a2web is running ;)

"firefox localhost:8080"
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 02, 2012, 11:04:26 PM
i made the following
Code: [Select]
sudo cp -f /usr/local/share/a2web/a2web.conf.sample /usr/local/share/a2web/cgi-bin/a2web.conf
sudo cp -f /usr/local/share/a2web/a2web /usr/local/share/a2web/cgi-bin
sudo sed -i "5,6s/^# //" /usr/local/share/a2web/cgi-bin/a2web.conf
su ${TCUSER=`cat /etc/sysconfig/tcuser`} -c "aria2c --enable-rpc"
sudo /usr/local/httpd/sbin/httpd -f -p 8080 -h /usr/local/share/a2web -u $TCUSER:staff
as result i get 404
Code: [Select]
firefox http://localhost:8080http://pastehtml.com/view/c6xeioq1o.html
or desired a2web but without theming
Code: [Select]
firefox http://localhost:8080/cgi-bin/a2web.cgi(http://forum.tinycorelinux.net/index.php?action=dlattach;topic=12831.0;attach=3545)
i again did something wrong?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 03, 2012, 07:24:56 AM
Sorry, I occasionally assume too much. Here's a step by step, for the busybox httpd extension. Note the config file editing is not necessary for other web servers.

Pre-step: Run aria2 --enable-rpc, maybe from a boot script.

1. tce-load -wi a2web busybox-httpd
2. cd /usr/local/share/a2web/cgi-bin
3. sudo cp ../a2web.conf.sample a2web.conf
4. Uncomment the themedir path and add a / (just like in the first post, /a2web/crystal)
5. firefox localhost:8080/cgi-bin/a2web.cgi

edit: Your current setup only misses making the theme path absolute, ie add a / to the theme path's start.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 11, 2012, 04:25:29 PM
here i wrote daemon a2webd for a2web
Code: [Select]
Usage: a2webd [start|status|reload|restart|stop]this script examines configuration files
a2webd.conf, aria2.conf (if exists)
and a2web.conf (or creates it if does not exist)
then starts aria2 if not running another instance
and starts busybox httpd with a2web.cgi
if can't find already running a2web.cgi
on another already configured http server
more details as it works is specified in comments

a2webd has configuration file a2webd.conf
which created with default options
at first start if did not exist before
Code: [Select]
# a2web.conf

# path = /path/to/a2web.cgi
path = /usr/local/share/a2web/cgi-bin/a2web.cgi

# uri = [http://][[password:]user@]server[:port]/path-to/a2web.cgi
uri = http://localhost:8080/cgi-bin/a2web.cgi
options should be changed on your own
(such as user and password for http auth)
to launch busybox httpd with a2web.cgi
or according to already running on other server

i tested and seems it work well
maybe you look how it works
and consider its inclusion to extension a2web.tcz
or maybe also to a2web distribution if it can be applied
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 11, 2012, 05:21:59 PM
a2web.tcz, a2web - sure, I can add it.

I see that you check the aria2 conf file for the dir option, and pass it on the command line too. Why? Is there some bug in aria2 that prevents the dir option in the config file from working?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 11, 2012, 08:56:11 PM
indeed most likely that there i'm reinsured :)
i think that aria2 has no such error
i'll check this and most likely this can be removed

and when i rode to home then i thought
that not very well written search for path to busybox httpd
if this will applied for different linux distributions
i'll work with all this tonight and upload corrected version

i also thought how would better
automatically define prefix variable
rather than set it tough...

also i still can't imagine universal method
to user determining for different linux distributions
and if nothing will come to mind then so far leave it as is
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 11, 2012, 10:53:59 PM
i also thought how would better
automatically define prefix variable
rather than set it tough...
prefix solved simply
Code: [Select]
A2WEB=`find /usr -name a2web.cgi`
PREFIX=${A2WEB%%/share*}
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 12, 2012, 02:24:43 AM
and when i rode to home then i thought
that not very well written search for path to busybox httpd
if this will applied for different linux distributions
i think that this will be better
Code: [Select]
# find busybox httpd if running a2web.cgi not found
for item in `find ${PATH//:/ } /usr -name httpd -type l`; do
    [ -x $item ] && readlink $item | grep -q busybox && HTBIN=$item && break
done
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 12, 2012, 06:34:40 AM
Please upload the complete script instead of snippets ;)
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 13, 2012, 10:19:26 AM
sorry for delay
this took two nights instead one as i imagined

changes:
- removed dir option checking and passing it to aria2 command line
- modified hard assignment of prefix to determination by search
- corrected search for determine path to busybox httpd
- changed user/group for busybox httpd to nobody/nogroup
- added simple option validation for configuration file a2web.conf
- added function for determine user instead of hard assignment
- appointed current a2webd version number to 0.2
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 16, 2012, 10:21:06 AM
Added it to the a2web repo. The extension update will have to wait a bit (ibiblio low on space again).
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 16, 2012, 11:24:27 PM
people say that every idea can be brought to absurd
and i think that i proved it once again in my case :)
i apologize that not warned you but i made a2webd 0.3
i decided to have fun with google code
and watch with what it is eaten
here it is that happened with this
https://code.google.com/p/a2webd/

changes in a2webd 0.3:
- fixed incorrect definition for path to /etc
- corrected function of current user determination
- added creating icon, link a2web->a2debd, desktop entry
- added feature to start a defined, default or found web browser
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 17, 2012, 05:18:16 AM
With a separate project, maybe better to have just a link than a copy?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 17, 2012, 06:19:58 AM
sorry, i do not quite understood what you mean?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 17, 2012, 07:09:54 AM
With your script having its own project page, I think it would be better not to include it in a2web, but rather just link to it.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 17, 2012, 03:13:10 PM
i again don't quite understand why you think so
if you mean that i need work with a2webd within github
i yet don't know how to do it but i can try to cope with this
if you make link to wiki then i can add there a2webd pages
but maybe if you don't have time to engage with this
then i really can keep it as separate project
although a2webd is only supplement to a2web
for convenient use by end users
any variants can be considered

p.s.
i can make separate extension a2webd.tcz
to not make changes to existing a2web.tcz
and also for adding xdg-utils.tcz as deps
what do you think about this?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 17, 2012, 04:30:02 PM
With your own project page at google code, it doesn't make sense to keep a copy in the a2web sources. Such a copy is always likely to be a bit less up to date than the direct source.

Yeah, having a separate extension sounds good too. Then you can easily send updates without having to wait for me to get to it.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 17, 2012, 06:53:32 PM
With your own project page at google code, it doesn't make sense to keep a copy in the a2web sources. Such a copy is always likely to be a bit less up to date than the direct source.
i think it will not be a problem
i could add a2webd files to contrib folder
of course if such a possibility exists on github
project pages would remained as info and help
Yeah, having a separate extension sounds good too. Then you can easily send updates without having to wait for me to get to it.
here before make extension remained to make some fixes
first, i mistakenly changed places for user and password
Quote
uri = [http://][[password:]user@]server[:port]/path-to/a2web.cgi
and maybe can you advise me
how i can determine command line mode when x is running?

and it seems to me that if i fix this
then it will be last that i would make
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 18, 2012, 05:21:16 AM
Quote
how i can determine command line mode when x is running?

Please elaborate? I don't understand the question here.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 18, 2012, 06:51:18 PM
sorry
i use pgrep X for determine that x server is running
in order to choose what kind of browser should run
which works under x server or in command line
but if i switch to cmdline by ctrl+alt+f{n} when x works
then how i can determine that need run cli browser?
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 19, 2012, 05:49:22 AM
The output of "tty" should be useful. Under X it's *pty*, under a real terminal *tty*.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 19, 2012, 06:24:14 AM
sorry, i did not understood what i should do with tty and pty
maybe i should analyze variable $DISPLAY?
in tinycore under x it has value :0.0
under real terminal it is empty
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: curaga on August 19, 2012, 07:37:06 AM
That works too.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 19, 2012, 09:10:46 AM
hope it works well not only in tinycore :)
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 19, 2012, 11:42:57 AM
i decided to make a separate topic (http://forum.tinycorelinux.net/index.php/topic,13882.0.html)
because i have another questions
and i don't want transform this topic
completely into discussion about them
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: tinypoodle on August 19, 2012, 03:08:55 PM
maybe i should analyze variable $DISPLAY?
in tinycore under x it has value :0.0

:0.0 is given to the instance of X server which is started first. Further instances have different numbers.
Title: Re: Anyone interested in testing an aria2 webUI?
Post by: AbNoRMiS on August 19, 2012, 03:34:47 PM
if i understood correctly
that this numbers are only given for x server instances
but for real linux command line they are not given
if it so then this is entirely suitable for my checks
thank very much tinypoodle :)