Il giorno mer, 15/06/2011 alle 10.17 +0200, Alexander Wagner ha scritto:
> Yep.
>
> There's no feedback at the prompt concerning the auth method
> to use and as "admin" is obviously a local alias I thought
> it authenticates with the local method.
Well admin (as any other nickname) is an alias for the whole "person",
no matter what authentication method its chosen.
> Ah. Ic. So if I switch to LDAP by default all local tasks
> use LDAP all the time. In this case it would probably be
> wise to display the same text as on the webpage to the user.
> Anyway: "priority very low" one can now find it in the list
> archives ;)
Definitively rights! I should ticketize all this otherwise we might
forget!
> Besides being a burden for an admin there's also another
> point: at the moment I'm automatising some stuff and it
> always halts at the password prompts ;)
You might be happy to know that there is a Python API to schedule
bitasks (without passing from the CLI):
[...]
from invenio.bitask import task_low_level_submission
## e.g.
task_low_level_submission('bibupload', 'admin', '-i', '/tmp/foo.xml', '-P5')
[...]
Of course yet there is another API that should be more advertised. I
will add it to the hacking guide. And is requires no sudo, no
authorization, no interaction :-)
> > (while still keeping the -u/--user argument for bibtasks
> > so that it is possible to log who requested a certain
> > task).
>
> This is sensible of course. Unfortunately, one can't hook it
> up simply with the Unix login as all tasks run via sudo.
> Maybe that would be a way otherwise.
Well I was meaning the -u/--user argument of the bibtask itself. Already
today (provided we disable the prompt for a password) you can do:
$ sudo -u www-data /opt/invenio/bin/bibupload -u foo -i /tmp/foo.xml
And if you need to script it up, you can wrap all the calls into one
script and just run the script with sudo once.
Cheers!
Sam
--
Samuele Kaplun
Invenio Developer ** <http://invenio-software.org/>