ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
69211
|
Wed Sep 2 15:42:40 2020 |
| Stefan Ritt | stefan.ritt@psi.ch | Question | Linux | 3.1.3 | Re: Using curl to post new entries | This is correct. The elogd daemon needs username and password in parameters "unm" and "upwd". The password must be SHA256 encoded, so best is to grab it from the password file. This way one does not have to send clear text passwords over the network.
Florian Feldbauer wrote: |
After going through the code of the Python API (https://github.com/paulscherrerinstitute/py_elog/blob/master/elog/logbook.py) I tried the following:
$ python3
>>> from passlib.hash import sha256_crypt
>>> sha256_crypt.hash( 'foobaa', salt='', rounds=5000)[4:]
'waa2sT6eBt.qk0wsucX/nxU5GcqffqlEx6ja5Lg1OR5'
>>> from datetime import datetime
>>> datetime.now().timestamp()
1599039390.964989
$ curl -F cmd=Submit -F exp=labor -F unm=florian -F upwd='waa2sT6eBt.qk0wsucX/nxU5GcqffqlEx6ja5Lg1OR5' -F Encoding=plain -F When=1599039390.964989 -F Author=curl -F Subject="curl test" -F Category=General -F Type=Diary -F Text="foo baa" http://localhost:8080/test/
This worked. It seems to me, that the "-u" option from Curl is not working for elog.
Cheers,
Florian
Florian Feldbauer wrote: |
Hey,
i'm trying to use curl to post new entries to our logbook as described here: https://elog.psi.ch/elogs/Forum/68597.
The Elog is installed via the Deban package on Buster.
I created a test logbook with attributes Author, Type, Category and Subject.
curl -u florian:foobaa -F cmd=Submit -F Author=Florian -F Type=Diary -F Category=General -F Subject="testing curl" -F Text="foo baa" http://localhost:8080/test
<!DOCTYPE html>
<html><head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<title>ELOG Login</title>
<link rel="stylesheet" type="text/css" href="elog.css">
<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="favicon.png" type="image/png" />
</head>
<body OnLoad="document.form1.uname.focus();">
<form name=form1 method="POST" action="./" enctype="multipart/form-data">
<input type=hidden name=redir value="">
<table class="login_frame" cellspacing=0 align=center><tr><td class="login_title">Please login</td></tr>
<tr><td class="login_form">
<span class="overlay_wrapper">
<label for="uname" id="uname" class="overlabel">Username</label>
<input type="text" class="login_input" name="uname" value="" title="Username" onInput="document.getElementById('uname').style.display='none';">
</span></td></tr>
<tr><td class="login_form">
<span class="overlay_wrapper">
<label for="upassword" id="upassword" class="overlabel">Password</label>
<input type="password" class="login_input" name="upassword" onInput="document.getElementById('upassword').style.display='none';">
</span></td></tr>
<tr><td align=center class="login_form"><input type=checkbox checked name=remember value=1>
Keep me logged in on this computer
for the next 31 days or until I log out</td></tr>
<tr><td align=center class="login_form">
<a href="?cmd=Forgot">Forgot password?</a></td></tr>
<tr><td align=center class="login_form_bottom"><input type="submit" class="login_submit" value="Submit"></td></tr></table>
<center><a class="bottomlink" title="Goto ELOG home page" href="https://midas.psi.ch/elog/">ELOG V3.1.3-7933898</a></center></form></body></html>
As you can see, curl only prints the login page of the logbook and no new entry has been created. Any suggestions what might go worng here?
Regards,
Florian
|
|
|
69218
|
Mon Sep 14 15:40:02 2020 |
| Jose Caballero | jcaballero.hep@gmail.com | Question | Linux | 3.1.4 | Re: testing the client: unclear it worked | Sorry for the late reply. I didn't get email notification about an answer to my question :)
Actually, I just wrote <hostname> and so on for privacy. In my attempt, they have real values.
And yet, I got as result: "Message successfully transmitted, ID=-1".
Follow up question: do I really need to install everything even though I only want the client? Or is there somewhere a package just with the client code?
Thanks
Jose
Stefan Ritt wrote: |
The <hostname> you have to actually replace with your real host name. Same for logbook, username and password.
On my local test system I get (actual password hidden here with "...")
~$ elog -h localhost -p 8080 -l demo -u stefan ... -a Authort=SR -a Subject=test test
Message successfully transmitted, ID=5
~$
Jose Caballero wrote: |
Hello,
I just gave it a quick try to the command line client, to see if I can use it to access our institution service.
[root@host ~]# cd /tmp/
[root@host ~]# mkdir elog
[root@host ~]# cd elog
[root@host ~]# wget https://elog.psi.ch/elog/download/RPMS/elog-3.1.4-2.el7.x86_64.rpm
[root@host ~]# rpm2cpio elog-3.1.4-2.el7.x86_64.rpm | cpio -idmv
[root@host ~]# cd usr/local/bin/
[root@host ~]# ./elog --help
[root@host ~]# ./elog -h <hostname> -l <logbook> -u <myusername> <mypassword> -w last
"Message successfully transmitted, ID=-1"
Is that the expected output? I was expecting to see info about the latest message in the server.
Cheers,
Jose
|
|
|
69221
|
Mon Sep 21 09:17:52 2020 |
| Florian Feldbauer | florian@ep1.ruhr-uni-bochum.de | Question | Linux | 3.1.3 | Query to get values for Attributes | Hey,
I'm trying to integrate the Elog into our SlowControl System (Phoebus/EPICS). As a first step I translated the python library to Java. So writing new Entries and viewing them works.
But for Phoebus, you need a list of the possible values for the attributes. Currently this is done via the config file from Phoebus.
Is there a way to get the values also via a query directly from the Elog?
Cheers,
Florian |
69222
|
Mon Sep 21 20:03:49 2020 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Question | Linux | 3.1.3 | Re: Query to get values for Attributes | That would be a nice feature...
If you are good in parsing HTML you can achieve this feature: when you create a new entry "<elog-URL>?cmd=new", you'll get HTML source code that provides you with all possible attribute choices.
Disclaimer: this only works if you don't use Conditional attributes.
Florian Feldbauer wrote: |
Hey,
I'm trying to integrate the Elog into our SlowControl System (Phoebus/EPICS). As a first step I translated the python library to Java. So writing new Entries and viewing them works.
But for Phoebus, you need a list of the possible values for the attributes. Currently this is done via the config file from Phoebus.
Is there a way to get the values also via a query directly from the Elog?
Cheers,
Florian
|
|
69223
|
Tue Sep 22 09:27:45 2020 |
| Florian Feldbauer | florian@ep1.ruhr-uni-bochum.de | Question | Linux | 3.1.3 | Re: Query to get values for Attributes | Thanks for the tipp. I managed to use XPATH to get the values for my Type and Category attributes!
The API, I'm developing for Phoebus is quiet simple. It currently just supports Author, Subject, Type and Category as attributes and the latter two are just lists of values.
Andreas Luedeke wrote: |
That would be a nice feature...
If you are good in parsing HTML you can achieve this feature: when you create a new entry "<elog-URL>?cmd=new", you'll get HTML source code that provides you with all possible attribute choices.
Disclaimer: this only works if you don't use Conditional attributes.
Florian Feldbauer wrote: |
Hey,
I'm trying to integrate the Elog into our SlowControl System (Phoebus/EPICS). As a first step I translated the python library to Java. So writing new Entries and viewing them works.
But for Phoebus, you need a list of the possible values for the attributes. Currently this is done via the config file from Phoebus.
Is there a way to get the values also via a query directly from the Elog?
Cheers,
Florian
|
|
|
69224
|
Tue Sep 22 18:54:04 2020 |
| Andrey | kowaraj4stuff@gmail.com | Bug report | Linux | ELOG V3.1.4-493 | Bug report. "Submit" button misbehave | Hi.
I am an IT guy of the AMS collaboration at CERN. We have been using your wonderful elog software for about 10 years now. Thanks! It served us so well that I guess we never got in touch with you.
Recently we have upgraded it (probably for the first time in years) up to the version ELOG V3.1.4-4936b76.
Since then, we have a particular problem. And finally, I managed to reproduce it.
So, when I edit a record and click the "Submit" button it goes back to the summary view (as usual, as before) but it does not really save the entry. And it shows that the record is still being edited. I can actually click "back" in the browser and not to lose the modifications (otherwise, if I try to edit and steal the lock, it's lost).
I will try to figure out where the problem is coming from. The most verbose mode of the elog server I've found is just GET-POST lines, not helpful. Is there a debug mode?
Also, we ran httpd configured with the elogd as a virtual host (proxy).
Any help is very appreciated.
Cheers,
Andrey
|
69225
|
Wed Sep 23 11:51:57 2020 |
| Andrey | kowaraj4stuff@gmail.com | Bug report | Linux | ELOG V3.1.4-493 | SOLVED | Hi again. We have solved our problem!
It was caused by a non-defined mod_auth_openidc configuration parameter:
# Interval in seconds after which the session will be invalidated when no interaction has occurred.
# When not defined, the default is 300 seconds.
#OIDCSessionInactivityTimeout <seconds>
As a guess... This somehow makes elogd to forget a user who is editing an entry. And then, clicking "Submit" button makes elogd to start a new session?
Andrey wrote: |
Hi.
I am an IT guy of the AMS collaboration at CERN. We have been using your wonderful elog software for about 10 years now. Thanks! It served us so well that I guess we never got in touch with you.
Recently we have upgraded it (probably for the first time in years) up to the version ELOG V3.1.4-4936b76.
Since then, we have a particular problem. And finally, I managed to reproduce it.
So, when I edit a record and click the "Submit" button it goes back to the summary view (as usual, as before) but it does not really save the entry. And it shows that the record is still being edited. I can actually click "back" in the browser and not to lose the modifications (otherwise, if I try to edit and steal the lock, it's lost).
I will try to figure out where the problem is coming from. The most verbose mode of the elog server I've found is just GET-POST lines, not helpful. Is there a debug mode?
Also, we ran httpd configured with the elogd as a virtual host (proxy).
Any help is very appreciated.
Cheers,
Andrey
|
|
69237
|
Tue Oct 20 15:08:17 2020 |
| David Wallis | wallis@aps.anl.gov | Question | Linux | ELOG V3.1.4-ba8 | From command line: "command Submit not allowed" | I'm running Elog version V3.1.4-ba84827 on Red Hat Linux 7.9. As part of migrating from an older in-house logbook to Elog, I need to upload all the old logbook entries. However, when I attempt to do that with the "elog" command line tool, I'm getting the error "command Submit not allowed.
I read through a similar report from 2015 (entry #68149), but none of the potential causes seem to be at play here. The logbook is using PAM authentication, and I can log in to the web interface using the same credentials I'm using from the command line. The other case mentioned a dis-allowed encoding format, but my logbook is configured to allow all formats.
This is the command line I'm using:
/usr/local/elog/bin/elog -v -h logbook.aps.anl.gov -p 8081 -l On_Call -x -n 2 -a Date='10/19/2020 01:02' Author="David Wallis" Title='Test Upload' Status='Open' System='On-Call' -u 'wallis' '*****' "This is a test message" |
|