Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 208 of 801  Not logged in ELOG logo
    icon2.gif   Re: local usage on windows + Linux virtual machine , posted by Sara Vanini on Mon Jan 27 08:46:39 2020 

Thanks John. I found the linux IP address with ifconfig, type it on my windows machine with the port number, but it doesn't work, the error is "website not found"... what else could I try?

Regards

Sara

John wrote:
Elog does not access the outside world by default. With the VM I suppose just access it via the Linux local ip address (and port).
 
Sara Vanini wrote:

Hello again, 

I love to use elog, but I don't need any other accessing it for the moment. So, it is possible to run elog locally on my PC, and make it not accessible from outside? 

Moreover, I installed elog on a linux virtual machine running with Virtual Box on Windows 10. Is it possible to open/edit my elog both from the linux VM and from the Windows system? without any accessibility from outside my PC?

Many many thanks

Sara

 

 

    icon2.gif   Re: Logfile not registering entry numbers?, posted by Stefan Ritt on Wed Apr 1 15:57:27 2020 

I finally found some time to fix that bug. Was just that the log file hat #0, the bug should not have had any ohter side effects. Now the logfile is fine.

David Pilgram wrote:

As a regular elog (ab)user, I have seen this behaviour from time to time.  So far as I recall, the cause actually is that a normal entry is looking for the entry in the "Reply to" field of the normal entry in the yymmdda.log file.  When that entry does not exist, then I see a duplicate line of an entry with entry "#0", in emboldened black type.  I did have a screenshot, but cannot find it for now. 

A quick (relative term, that) search usually finds the entry which references the missing "Reply to" line, and editing that, all is well.  I'm not sure how this can happen, but it does.  NB, I'm still on elog 2.9.2 so I don't know how the draft facility works and possibly enhances the possibility of this issue.

 

Note that this is different to the case (rather more frequent) where the entry in  the "In reply to" field is missing.  This causes elog to go into a continuous loop and only the strongest measures  ("kill -9 xxxx in linux) will break this out.  This can happen more frequently as if you delete a thread with a large number (>40?) of entries, elog crashes, but more importantly, hasn't finished the job.  Clicking on the remenents of the thread (which are usually the later entries) causes the endless loop.

Andreas Luedeke wrote:

It looks like you've found a bug in ELOG. I've checked my elog.log and see that all NEW entry lines show "#0".

I've looked into the code: the message is written before the new entry is submitted, and only then the entry ID is defined.
For new entries one would need to make the logging print line later - but that would blow up the code.
The message IDs are correct for saving drafts and editing entries. I'll discuss with Stefan if that should be fixed.
 
Andreas
 
Sergio Navarrete wrote:

I have configured a logbook with the logfile on, but when a user replies to an entry the line logged goes

Date Time [User@IP] {Logbook} NEW entry #0

How can I make the #0 be the real entry number for the reply?

 

 

 

 

icon5.gif   Using curl to post new entries, posted by Florian Feldbauer on Wed Sep 2 10:24:58 2020 

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

    icon2.gif   Re: Using curl to post new entries, posted by Florian Feldbauer on Wed Sep 2 11:56:04 2020 

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

 

    icon2.gif   Re: Using curl to post new entries, posted by Stefan Ritt on Wed Sep 2 15:42:40 2020 

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

 

 

icon5.gif   Query to get values for Attributes, posted by Florian Feldbauer on Mon Sep 21 09:17:52 2020 

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

    icon3.gif   Re: Query to get values for Attributes, posted by Andreas Luedeke on Mon Sep 21 20:03:49 2020 

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

 

    icon2.gif   Re: Query to get values for Attributes, posted by Florian Feldbauer on Tue Sep 22 09:27:45 2020 

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

 

 

ELOG V3.1.5-3fb85fa6