[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: (secure!) web front-end for apt / debconf



On Tue, Mar 27, 2012 at 10:17 AM, Julian Andres Klode <jak@debian.org> wrote:
> On Tue, Mar 27, 2012 at 04:35:28AM +0100, lkcl luke wrote:
>> i'm looking to do a web (HTTP/AJAX) front-end for apt, including
>> presentation and answering of debconf package configuration questions.
>>  my primary programming language is python, and i'm glad to see
>> python-apt.
>
> So, a more dynamic version of debconf's standard web frontend?
>
>        /usr/share/perl5/Debconf/FrontEnd/Web.pm

 *click*... why yes! :)  the source code looks so simple, i'm amazed
(mind you, anything joey writes or is involved with is usually
deceptively simple... :)

 hmmm... http://www.debianadmin.com/debconf-debian-configuration-management-system.html
- no mention of "web".

> There's also a web frontend for cdebconf:
>
>        http://wiki.debian.org/DebianInstaller/WebInstaller

 ah ha!  oh damn - the web site's offline.


> As the repository itself says: It's not up-to-date.

 must have missed that.

> The up-to-date
> one is git://git.debian.org/git/debconf/debconf.git, as APT should
> have told you during the source download.

 got it.

>>
>> i've run the example gtk installer (examples python-apt-doc) which
>> required some updates; the updates i was able to find by examining
>> /usr/share/pyshared/apt/progress/gtk2.py.
>>
>> by looking at the apt/progress/gtk2.py i was able to ascertain that it
>> uses vte: vte would be no good for use on a web server [AJAX will be
>> required, and a special web server which serves only one
>> HTTP connection]
>
> It's for installation progress reporting and installation progress
> reporting needs some kind of terminal or at least something else
> to write to.

 ok - my perhaps naive plan was to write that progress out somewhere
and poll it using AJAX.

>>
>> from _that_ file i was able to ascertain that there's a corresponding
>> text progress system, which could potentially help to be the basis of
>> an HTTP/AJAX-based alternative, but in the entire apt.progress code i
>> saw no evidence of a connection to debconf which would allow dpkg
>> questions to be answered.
>
> Debconf asks the questions itself, it does not go through the
> progress layer.

 yehhs.... but perhaps i am missing something: how does it get told
_to_ "ask" - that bit isn't clear yet; and once it "asks", where is it
asking _to_?  if by "ask" you mean that whatever it's been told to
activate (e.g. Web.pm in the case of debconf) it will activate, and
pause things until it gets a response, then i believe i might have a
way forward.  albeit an incredibly odd one :)

 for example: to minimise the amount of intrusive code, i envisage
perhaps writing an apt-progress reporter that is polled by AJAX, that
sets debconf into "Web.pm" mode, followed by watching for the words
"Note: Debconf is running in web mode. Go to http://localhost:%i/";.

 on receipt of that, it would fire up a python web-client scraper (!)
targetted at reading port 8001, process the results for questions and
re-present those as an AJAX web site.

 does that sound like a reasonable plan?  (other than dpkg-reconfigure
debconf doesn't list "web" as an option, whoops).

> Ask the debconf developers for debconf stuff. We can only
> help with APT specific questions here.

 ok.  willdo.

 hm, i appear to have a question already... :)  i am doing "apt-get
install distcc" - it should and does ask me a question, "do you wish
to install".

 i then remove (purge) it, followed by running the examples python
gui-inst.py (which i had to bug-fix a bit).  on the vte terminal, no
questions appear.

 any clues what's going on?  what's different, and how can gui-inst.py
be triggered to run debconf questions (at the required priority)?

 you appreciate that that's the bit that i'm missing?

 l.


Reply to: