ID |
Date |
Author |
Author Email |
Category |
Subject |
Status |
Last Revision |
155
|
Fri Dec 1 16:30:46 2023 |
Stefan Ritt | Unstefan.ritt@psi.ch | Other | Re: Fixing repeating first inline_image in email | Stable | Fri Dec 1 16:31:37 2023 by Stefan Ritt | Unfortunately you made your changes against a pretty old version of elogd.c, so I can't see which changes you made (the diffs gives 100's of changes now). If you can apply your fix against the current elogd.cxx from the bitbucket repository, I would be happy to include the fix in the distribution.
Stefan
rami khrais wrote: |
Fixing repeating first image in email (email notification) when the user submit a new log with in_line images.
|
|
154
|
Thu Mar 3 12:01:55 2022 |
rami khrais | rami.khrais@sesame.org.jo | Other | Fixing repeating first inline_image in email | Stable | Thu Mar 10 11:30:20 2022 by rami khrais | Fixing repeating first image in email (email notification) when the user submit a new log with in_line images. |
Attachment 1: elogd.c
|
/********************************************************************
Name: elogd.c
Created by: Stefan Ritt
Copyright 2000 + Stefan Ritt
ELOG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ELOG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the
OpenSSL library under certain conditions as described in each
individual source file, and distribute linked combinations
including the two.
You must obey the GNU General Public License in all respects
for all of the code used other than OpenSSL. If you modify
file(s) with this exception, you may extend this exception to your
version of the file(s), but you are not obligated to do so. If you
do not wish to do so, delete this exception statement from your
version. If you delete this exception statement from all source
files in the program, then also delete it here.
You should have received a copy of the GNU General Public License
along with ELOG. If not, see <http://www.gnu.org/licenses/>.
Contents: Web server program for Electronic Logbook ELOG
\********************************************************************/
#include "elogd.h"
#include "git-revision.h"
const char *_git_revision = GIT_REVISION;
BOOL running_as_daemon; /* Running as a daemon/service? */
int elog_tcp_port; /* Server's TCP port */
static void (*printf_handler)(const char *); /* Handler to printf for logging */
static void (*fputs_handler)(const char *); /* Handler to fputs for logging */
static FILE *current_output_stream = NULL; /* Currently used output stream */
char *return_buffer;
int return_buffer_size;
int strlen_retbuf;
int keep_alive;
char header_buffer[20000];
int return_length;
char host_name[256];
char referer[256];
char browser[256];
char config_file[256];
char resource_dir[256];
char logbook_dir[256];
char listen_interface[256];
char theme_name[80];
char http_host[256];
char http_user[256];
char _param[MAX_PARAM][NAME_LENGTH];
char _value[MAX_PARAM][NAME_LENGTH];
char _mtext[TEXT_SIZE];
char _cmdline[CMD_SIZE];
char *_attachment_buffer;
int _attachment_size;
int _max_content_length = MAX_CONTENT_LENGTH;
struct in_addr rem_addr;
char rem_host[256];
char rem_host_ip[256];
int _sock;
BOOL use_keepalive, enable_execute = FALSE;
BOOL ckedit_exist, image_magick_exist;
int _verbose_level, _current_message_id;
int _logging_level, _ssl_flag;
LOGBOOK *lb_list = NULL;
#define VERBOSE_URL 1
#define VERBOSE_INFO 2
#define VERBOSE_DEBUG 3
#ifdef HAVE_SSL
SSL *_ssl_con;
#endif
char *mname[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September",
"October", "November", "December"
};
char attr_list[MAX_N_ATTR][NAME_LENGTH];
char attr_options[MAX_N_ATTR][MAX_N_LIST][NAME_LENGTH];
int attr_flags[MAX_N_ATTR];
char attr_list_default[][NAME_LENGTH] = {"Author", "Type", "Category", "Subject", ""};
char attr_options_default[][MAX_N_LIST][NAME_LENGTH] = {{""},
{"Routine", "Other"},
{"General", "Other"},
{""}
};
int attr_flags_default[] = {AF_REQUIRED, 0, 0, 0};
struct {
char ext[32];
char type[80];
} filetype[] = {
{
".AI", "application/postscript"},
{
".ASC", "text/plain"},
{
".BZ2", "application/x-bzip2"},
{
".CFG", "text/plain"},
{
".CHRT", "application/x-kchart"},
{
".CONF", "text/plain"},
{
".CSH", "application/x-csh"},
{
".CSS", "text/css"},
{
".DOC", "application/msword"},
{
".DVI", "application/x-dvi"},
{
".EPS", "application/postscript"},
{
".GIF", "image/gif"},
{
".GZ", "application/x-gzip"},
{
".HTM", "text/html"},
{
".HTML", "text/html"},
{
".ICO", "image/x-icon"},
{
".JPEG", "image/jpeg"},
{
".JPG", "image/jpeg"},
{
".JS", "application/x-javascript"},
{
".KPR", "application/x-kpresenter"},
{
".KSP", "application/x-kspread"},
{
".KWD", "application/x-kword"},
{
".MP3", "audio/mpeg"},
{
".OGG", "application/x-ogg"},
{
".PDF", "application/pdf"},
{
".PNG", "image/png"},
{
".PS", "application/postscript"},
{
".RAM", "audio/x-pn-realaudio"},
{
".RM", "audio/x-pn-realaudio"},
{
".RM", "audio/x-pn-realaudio"},
{
".RM", "audio/x-pn-realaudio"},
{
".RPM", "application/x-rpm"},
{
".RTF", "application/rtf"},
{
".SH", "application/x-sh"},
{
".SVG", "image/svg+xml"},
{
".TAR", "application/x-tar"},
{
".TCL", "application/x-tcl"},
{
".TEX", "application/x-tex"},
{
".TGZ", "application/x-gzip"},
{
".TIF", "image/tiff"},
{
".TIFF", "image/tiff"},
{
".TXT", "text/plain"},
{
".WAV", "audio/x-wav"},
{
".XLS", "application/x-msexcel"},
{
".XML", "text/xml"},
{
".XSL", "text/xml"},
{
".ZIP", "application/x-zip-compressed"},
{
/* Open XML file types */
".DOCM", "application/vnd.ms-word.document.macroEnabled.12"},
{
".DOCX", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
{
".DOTM", "application/vnd.ms-word.template.macroEnabled.12"},
{
".DOTX", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
{
".PPSM", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"},
{
".PPSX", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
{
".PPTM", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"},
{
".PPTX", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
{
".XLSB", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"},
{
".XLSM", "application/vnd.ms-excel.sheet.macroEnabled.12"},
{
".XLSX", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
{
".XPS", "application/vnd.ms-xpsdocument"},
{
"", ""},};
struct {
char language[32];
char abbrev[32];
} lang_table[] = {
{"brazilian", "br"},
{"bulgarian", "bg"},
{"czech", "cz"},
{"danish", "dk"},
{"dutch", "nl"},
{"french", "fr"},
{"german", "de"},
{"indonesia", "id"},
{"italian", "it"},
{"japanese", "jp"},
{"polish", "pl"},
{"ru_CP1251", "ru"},
{"slowak", "sk"},
{"spanish", "es"},
{"swedish", "se"},
{"turkish", "tr"},
{"zh_CN-GB2314", "zh"},
{"zh_CN-UTF8", "zh"},
{"", ""}
};
char _convert_cmd[256];
char _identify_cmd[256];
#ifdef OS_WINNT
int run_service(void);
#endif
#ifdef OS_UNIX
gid_t orig_gid; /* Original effective GID before dropping privilege */
uid_t orig_uid; /* Original effective UID before dropping privilege */
char pidfile[256]; /* Pidfile name */
#endif
#ifdef __CYGWIN__ /* bug in cygwin, 'timezone' not linked automatically */
long _timezone;
#endif
/*---- Funcions from the MIDAS library -----------------------------*/
#define my_toupper(_c) ( ((_c)>='a' && (_c)<='z') ? ((_c)-'a'+'A') : (_c) )
#define my_tolower(_c) ( ((_c)>='A' && (_c)<='Z') ? ((_c)-'A'+'a') : (_c) )
BOOL strieq(const char *str1, const char *str2) {
char c1, c2;
if (str1 == NULL && str2 == NULL)
return TRUE;
if (str1 == NULL || str2 == NULL)
return FALSE;
if (strlen(str1) != strlen(str2))
return FALSE;
while (*str1) {
c1 = *str1++;
c2 = *str2++;
... 30972 more lines ...
|
153
|
Tue Dec 7 01:38:23 2021 |
Anthony J Krishock | ajkrishock@gmail.com | Theme/Skin | Astronomical logbook using Elog | Stable | Tue Dec 7 01:44:25 2021 by Anthony J Krishock | Hello all,
I became aware of the usefulness of Elog while working at Brookhaven National Lab. Since that time, I have developed a version of Elog that can be used as a log book for observations in Astronomy (my longtime hobby). Attached is my default.css theme and replacement icon files that match the theme. The color scheme is chosen to minimize bright lights and preserve night vision
To install, just place the default.css file in the default theme directory and copy over the icon files into the default theme directory and replace the default ones.
Comments and suggestions welcome!
Thank you |
Attachment 1: theme.zip
|
Attachment 2: elog.PNG
|
|
152
|
Wed Mar 4 18:40:57 2020 |
Laurent Jean-Rigaud | lollspam@free.fr | Other | Re: Re: RPM build process enhancements | Stable | Wed Mar 4 18:45:05 2020 by Laurent Jean-Rigaud | Sorry, the patch is malformed for the template file. Check PJ.
Bye,
Laurent
Laurent Jean-Rigaud wrote: |
Hi Stefan,
2nd patch for RPM build which adds :
- dynamic build options for krb5/ldap/pam/ssl support :
- for git / non rpm users :
- buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
- for rpm users using SRPMS (dependances are managed) :
- rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
- dynamic 2 last changelog entries :
- last with build information with
- dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
- build options list (KBR5, LDAP, PAM, SSL)
- before last for product changelog of current ELOG version-release
- customrel flag for local rebuild :
- release = %elogrel%{?customrel}%{?dist)
- so custom builder can add --define 'customrel NSA' at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
- elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
- buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).
Tested on EL6 and EL7 x86_64 :-)
Bye
Laurent Jean-Rigaud wrote: |
Hi Stefan,
I enclosed a patch for RPM build process available on GIT.
changes :
- rpmbuild :
- checks if provider or custom build (the rm/mv are done on your computers only :-))
- call rpmbuild with version / release given as parameters
- elog.spec :
- last changelog entry date is set to build date
- build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
- elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists
Todo:
- add RPMbuild options for ldap/pam/...
- enclosed git log in changelog automatically (the dream :-))
|
|
|
Attachment 1: elog.spec.template
|
# ELOG weblog application
# rpmbuild -ba --define 'elogver 3.1.4' --define 'elogrel 2' --with ssl --with pam --with ldap --with krb5 --define 'factorydate date'
# define date of build for changelog and default release
%define build_timestamp %(LC_TIME=C date '+%a %b %d %Y')
%{!?factorydate: %define factorydate %build_timestamp}
# default version and release
%{!?elogver: %define elogver __ELOGVER__ }
%{!?elogrel: %define elogrel __ELOGREL__ }
# default release is build date
%{!?elogrel: %define elogrel %{build_timestamp} }
# Build options :
# Read: If neither macro exists, then add the default definition.
%{?_with_krb5: %define _with_krb5 USEKRB5=1}
%{?_with_ldap: %define _with_ldap USELDAP=1}
%{?_with_pam: %define _with_pam USEPAM=1}
%{?_with_ssl: %define _with_ssl USESSL=1}
# Default build options are with SSL
%{!?_with_ssl: %{!?_without_ssl: %define _with_ssl USESSL=1}}
# builder info
%define whoami %(eval who am i | awk '{print $1}')
%define HOSTNAME %(hostname)
%{!?packager: %define packager %{whoami} %{whoami}@%{HOSTNAME}}
Name: elog
Summary: elog is a standalone electronic web logbook
Version: %elogver
Release: %elogrel%{?customrel}%{?dist}
License: GPL
Group: Applications/Networking
Source: http://elog.psi.ch/elog/download/elog-%{elogver}-%{elogrel}.tar.gz
Vendor: Stefan Ritt <stefan.ritt@psi.ch>
URL: http://elog.psi.ch/elog
BuildRoot: /tmp/%{name}-root
Prefix: /usr/local
# Add build dependencies for pam, ssl and ldap features if enabled.
# Note: Tag tokens must start at beginning-of-line.
#
# Read: If feature is enabled, then add the build dependency.
%{?_with_krb5:BuildRequires: krb5-devel}
%{?_with_krb5:Requires: krb5-libs}
%{?_with_ldap:BuildRequires: openldap-devel >= 2.4.1}
%{?_with_ldap:Requires: openldap >= 2.4.1}
%{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
%{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}
%description
ELOG is part of a family of applications known as weblogs.
Their general purpose is :
1. To make it easy for people to put information online in a chronological
fashion, in the form of short, time-stamped text messages ("entries")
with optional HTML markup for presentation, and optional file attachments
(images, archives, etc.)
2. To make it easy for other people to access this information through a
Web interface, browse entries, search, download files, and optionally add,
update, delete or comment on entries.
ELOG is a remarkable implementation of a weblog in at least two respects :
- Its simplicity of use: you don't need to be a seasoned server operator
and/or an experimented database administrator to run ELOG ; one executable
file (under Unix or Windows), a simple configuration text file, and it works.
No Web server or relational database required. It is also easy to translate
the interface to the appropriate language for your users.
- Its versatility: through its single configuration file, ELOG can be made
to display an infinity of variants of the weblog concept. There are options
for what to display, how to display it, what commands are available and to whom,
access control, etc. Moreover, a single server can host several weblogs, and
each weblog can be totally different from the rest.
%changelog
* %{build_timestamp} %{packager} %{version}-%{release}
- rebuild with option(s): %{?_with_krb5:KRB5 }%{?_with_ldap:LDAP }%{?_with_pam:PAM }%{?_with_ssl:SSL}
* %{factorydate} Stefan Ritt <stefan.ritt@psi.ch> %{version}-%{release}
- Updated from git
* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
- Made adjustments for new elog server and RH7
* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
- Added BuildRequires, thanks to Stefan Roiser from CERN
* Fri Oct 21 2005 Stefan Ritt <stefan.ritt@psi.ch>
- Added resources/ directory
* Fri Mar 14 2003 Stefan Ritt <stefan.ritt@psi.ch>
- Added %post to change ownership of elog files
* Thu Jan 30 2003 Stefan Ritt <stefan.ritt@psi.ch>
- Added installation of man pages, thanks to Serge Droz <serge.droz@psi.ch>
* Tue Aug 13 2002 Stefan Ritt <stefan.ritt@psi.ch>
- Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr]
* Tue Jun 18 2002 Stefan Ritt <stefan.ritt@psi.ch>
- Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/
* Tue Jun 18 2002 Serge Droz <serge.droz@psi.ch>
- Update to 2.0.0
* Mon Jun 3 2002 Serge Droz <serge.droz@psi.ch>
- Update to 1.3.6
* Fri May 31 2002 Serge Droz <serge.droz@psi.ch>
- Initial RPM
%prep
%setup -q
%pre
%{_sbindir}/groupadd -r elog 2>/dev/null || :
%{_sbindir}/useradd -d / -s /bin/false \
-g elog -M -r elog 2>/dev/null || :
%build
make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
%install
make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir}
%post
chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
/etc/rc.d/init.d/elogd
%{_mandir}/man1/*
%{_mandir}/man8/*
%doc README COPYING doc
%defattr(-,elog,elog)
%prefix/bin/*
%prefix/sbin/elogd
%prefix/elog/resources
%prefix/elog/ssl
%prefix/elog/themes
%prefix/elog/scripts
%prefix/elog/logbooks
%config(noreplace) %prefix/elog/elogd.cfg
|
151
|
Mon Mar 2 14:31:12 2020 |
Laurent Jean-Rigaud | lollspam@free.fr | Other | Re: RPM build process enhancements | Stable | Wed Mar 4 18:40:40 2020 by Laurent Jean-Rigaud | Hi Stefan,
2nd patch for RPM build which adds :
- dynamic build options for krb5/ldap/pam/ssl support :
- for git / non rpm users :
- buildrpm version release [-krb5] [-ldap] [-pam] [-ssl]
- for rpm users using SRPMS (dependances are managed) :
- rpm -i elog-ver-rel.src.rpm && rpmbuld -bb [--use krb5] [--use ldap] [--use pam] [--use ssl] ~/rpmbuild/SPECS/elog.spec
- dynamic 2 last changelog entries :
- last with build information with
- dynamic user 's info (use your info if builded from PSI, or use %packager from ~/.rpmmacros if exists, or set to username username@ostname)
- build options list (KBR5, LDAP, PAM, SSL)
- before last for product changelog of current ELOG version-release
- customrel flag for local rebuild :
- release = %elogrel%{?customrel}%{?dist)
- so custom builder can add --define 'customrel NSA' at rpmbuild command or in .rpmmacros file -> elog-3.1.4-2.NSA.el7.x86_64.rpm by example.
- elog version and release are delivered in specfile as default for rebuild (tarball name uses it so it can not be changed for local rebuild from SRPMS).
- buildrpm uses ~/rpmbuild/SPECS/elog.spec generated from elog.spec.template (elog.spec is deleted in repo, replaced by elog.spec.template).
Tested on EL6 and EL7 x86_64 :-)
Bye
Laurent Jean-Rigaud wrote: |
Hi Stefan,
I enclosed a patch for RPM build process available on GIT.
changes :
- rpmbuild :
- checks if provider or custom build (the rm/mv are done on your computers only :-))
- call rpmbuild with version / release given as parameters
- elog.spec :
- last changelog entry date is set to build date
- build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
- elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists
Todo:
- add RPMbuild options for ldap/pam/...
- enclosed git log in changelog automatically (the dream :-))
|
|
Attachment 1: elog-git_dd35f04ec8effce1c12927078a9efb59822ceb3f-add_use_options.diff
|
diff --git a/Makefile b/Makefile
index d8eecba..87cb502 100644
--- a/Makefile
+++ b/Makefile
@@ -23,16 +23,32 @@ RCDIR = $(ROOT)/etc/rc.d/init.d
SRVDIR = $(ROOT)/usr/lib/systemd/system
# flag for SSL support
+ifdef USESSL
USE_SSL = 1
+else
+USE_SSL = 0
+endif
# flag for Kerberos support, please turn on if you need Kerberos
+ifdef USEKRB5
+USE_KRB5 = 1
+else
USE_KRB5 = 0
+endif
# flag for LDAP support, please turn on if you need LDAP
+ifdef USELDAP
+USE_LDAP = 1
+else
USE_LDAP = 0
+endif
# flag for PAM support, please turn on if you need PAM
+ifdef USEPAM
+USE_PAM = 1
+else
USE_PAM = 0
+endif
#############################################################
diff --git a/buildrpm b/buildrpm
index 1c0b9bc..8dde819 100755
--- a/buildrpm
+++ b/buildrpm
@@ -1,17 +1,38 @@
#!/bin/csh
-# Usage: build [-n] <version> <release>
+# Usage: build [-n] <version> <release> [-krb5] [-ldap] [-pam] [-ssl]
# Build ELOG distribution
if ($#argv < 2) then
- echo "Usage: build <version> <release>"
+ echo "Usage: build <version> <release> [-krb5] [-ldap] [-pam] [-ssl]"
exit
endif
set version = $argv[1]
set release = $argv[2]
+set i = 0
+set BUILDOPTS=""
+foreach argument ($argv)
+ set i=`expr $i + 1`
+ if ($i <= 2) continue
+ switch ($argument)
+ case "-ldap":
+ set BUILDOPTS="$BUILDOPTS --with ldap"
+ breaksw
+ case "-pam":
+ set BUILDOPTS="$BUILDOPTS --with pam"
+ breaksw
+ case "-ssl":
+ set BUILDOPTS="$BUILDOPTS --with ssl"
+ breaksw
+ case "-krb5":
+ set BUILDOPTS="$BUILDOPTS --with krb5"
+ breaksw
+ endsw
+end
+
set dist = `rpm --eval %{\?dist}`
set dir = /tmp/elog-$version
-set archive = elog-$version.tar.gz
+set archive = elog-$version-$release.tar.gz
# create temporary directory
rm -Rf $dir
@@ -65,7 +86,8 @@ rm -Rf $dir
# transfer archive
echo Transfer archive...
-mkdir -p ~/rpmbuild/SOURCES && cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz
+[ ! -d ~/rpmbuild/SOURCES ] && mkdir -p ~/rpmbuild/SOURCES
+cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version-$release.tar.gz
# if running on at PSI copy to download area
if (`hostname` == 'elog01.psi.ch') then
@@ -75,6 +97,8 @@ if (`hostname` == 'elog01.psi.ch') then
cp -v /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
cp -vf doc/ChangeLog ~ritt/html/elog/download/ChangeLog
endif
+ # define Factory Packager
+ set BUILDOPTS="${BUILDOPTS} --define \"packager Stefan Ritt <stefan.ritt@psi.ch>\""
endif
rm -f /tmp/$archive
@@ -83,8 +107,13 @@ rm -f ~/rpmbuild/RPMS/*/elog*${version}-${release}*.rpm
rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm
# building RPMs
+cp elog.spec.template ~/rpmbuild/SPECS/elog.spec
+sed -i "s/__ELOGVER__/${version}/;s/__ELOGREL__/${release}/" ~/rpmbuild/SPECS/elog.spec
echo Build RPMs...
-rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $?
+set factorydate = `env LC_TIME=C date '+%a %b %d %Y'`
+rpmbuild -ba ${BUILDOPTS} --define "factorydate ${factorydate}" \
+ --define "version ${version}" --define "elogrel ${release}" \
+ ~/rpmbuild/SPECS/elog.spec || exit $?
# if running on at PSI copy to download area
if (`hostname` == 'elog01.psi.ch') then
diff --git a/elog.spec b/elog.spec
deleted file mode 100755
index 8397eab..0000000
--- a/elog.spec
+++ /dev/null
@@ -1,107 +0,0 @@
-# ELOG weblog application
-# rpmbuild -ba --define 'version 3.1.4' --define 'release 2' --define "date $(LC_TIME=En date '+%a %b %d %Y')" elog.spec
-
-#define date $(LC_TIME=En date '+%a %b %d %Y')
-%define build_timestamp %(LC_TIME=En date '+%a %b %d %Y')
-
-Name: elog
-Summary: elog is a standalone electronic web logbook
-Version: %version
-Release: %release%{?dist}
-License: GPL
-Group: Applications/Networking
-Source: http://elog.psi.ch/elog/download/elog-%{version}.tar.gz
-Vendor: Stefan Ritt <stefan.ritt@psi.ch>
-URL: http://elog.psi.ch/elog
-BuildRoot: /tmp/%{name}-root
-Prefix: /usr/local
-BuildRequires: openssl-devel >= 0.9.8e
-
-%description
-ELOG is part of a family of applications known as weblogs.
-Their general purpose is :
-
-1. To make it easy for people to put information online in a chronological
- fashion, in the form of short, time-stamped text messages ("entries")
- with optional HTML markup for presentation, and optional file attachments
- (images, archives, etc.)
-
-2. To make it easy for other people to access this information through a
- Web interface, browse entries, search, download files, and optionally add,
- update, delete or comment on entries.
-
-ELOG is a remarkable implementation of a weblog in at least two respects :
-
-- Its simplicity of use: you don't need to be a seasoned server operator
-and/or an experimented database administrator to run ELOG ; one executable
-file (under Unix or Windows), a simple configuration text file, and it works.
-No Web server or relational database required. It is also easy to translate
-the interface to the appropriate language for your users.
-
-- Its versatility: through its single configuration file, ELOG can be made
-to display an infinity of variants of the weblog concept. There are options
-for what to display, how to display it, what commands are available and to whom,
-access control, etc. Moreover, a single server can host several weblogs, and
-each weblog can be totally different from the rest.
-
-%changelog
-* %{build_timestamp} Stefan Ritt <stefan.ritt@psi.ch> %version-%release
-- Updated from git
-* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
-- Made adjustments for new elog server and RH7
-* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
-- Added BuildRequires, thanks to Stefan Roiser from CERN
-* Fri Oct 21 2005 Stefan Ritt <stefan.ritt@psi.ch>
-- Added resources/ directory
-* Fri Mar 14 2003 Stefan Ritt <stefan.ritt@psi.ch>
-- Added %post to change ownership of elog files
-* Thu Jan 30 2003 Stefan Ritt <stefan.ritt@psi.ch>
-- Added installation of man pages, thanks to Serge Droz <serge.droz@psi.ch>
-* Tue Aug 13 2002 Stefan Ritt <stefan.ritt@psi.ch>
-- Added elog group and user, thanks to Nicolas Chuche [nchuche@teaser.fr]
-* Tue Jun 18 2002 Stefan Ritt <stefan.ritt@psi.ch>
-- Put elogd.init into TAR file, add logbooks directory, put elogd in sbin/
-* Tue Jun 18 2002 Serge Droz <serge.droz@psi.ch>
-- Update to 2.0.0
-* Mon Jun 3 2002 Serge Droz <serge.droz@psi.ch>
-- Update to 1.3.6
-* Fri May 31 2002 Serge Droz <serge.droz@psi.ch>
-- Initial RPM
-
-
-%prep
-%setup -q
-
-%pre
-%{_sbindir}/groupadd -r elog 2>/dev/null || :
-%{_sbindir}/useradd -d / -s /bin/false \
- -g elog -M -r elog 2>/dev/null || :
-
-%build
-make CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
-sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
-
-%install
-make install ROOT=$RPM_BUILD_ROOT MANDIR=$RPM_BUILD_ROOT%{_mandir}
-
-%post
-chown -R elog:elog $RPM_BUILD_ROOT%{prefix}/elog
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files
-%defattr(-,root,root)
-/etc/rc.d/init.d/elogd
-%{_mandir}/man1/*
-%{_mandir}/man8/*
-%doc README COPYING doc
-%defattr(-,elog,elog)
-%prefix/bin/*
-%prefix/sbin/elogd
-%prefix/elog/resources
-%prefix/elog/ssl
-%prefix/elog/themes
-%prefix/elog/scripts
-%prefix/elog/logbooks
-%config(noreplace) %prefix/elog/elogd.cfg
diff --git a/elog.spec.template b/elog.spec.template
--- a/elog.spec.template
+++ b/elog.spec.template
0a1,139
> # ELOG weblog application
> # rpmbuild -ba --define 'elogver 3.1.4' --define 'elogrel 2' --with ssl --with pam --with ldap --with krb5 --define 'factorydate date'
>
> # define date of build for changelog and default release
> %define build_timestamp %(LC_TIME=C date '+%a %b %d %Y')
> %{!?factorydate: %define factorydate %build_timestamp}
>
> # default version and release
> %{!?elogver: %define elogver __ELOGVER__ }
> %{!?elogrel: %define elogrel __ELOGREL__ }
> # default release is build date
> %{!?elogrel: %define elogrel %{build_timestamp} }
>
> # Build options :
> # Read: If neither macro exists, then add the default definition.
> %{?_with_krb5: %define _with_krb5 USEKRB5=1}
> %{?_with_ldap: %define _with_ldap USELDAP=1}
> %{?_with_pam: %define _with_pam USEPAM=1}
> %{?_with_ssl: %define _with_ssl USESSL=1}
> # Default build options are with SSL
> %{!?_with_ssl: %{!?_without_ssl: %define _with_ssl USESSL=1}}
> # builder info
> %define whoami %(eval who am i | awk '{print $1}')
> %define HOSTNAME %(hostname)
> %{!?packager: %define packager %{whoami} %{whoami}@%{HOSTNAME}}
>
> Name: elog
> Summary: elog is a standalone electronic web logbook
> Version: %elogver
> Release: %elogrel%{?customrel}%{?dist}
> License: GPL
> Group: Applications/Networking
> Source: http://elog.psi.ch/elog/download/elog-%{elogver}-%{elogrel}.tar.gz
> Vendor: Stefan Ritt <stefan.ritt@psi.ch>
> URL: http://elog.psi.ch/elog
> BuildRoot: /tmp/%{name}-root
> Prefix: /usr/local
> # Add build dependencies for pam, ssl and ldap features if enabled.
> # Note: Tag tokens must start at beginning-of-line.
> #
> # Read: If feature is enabled, then add the build dependency.
> %{?_with_krb5:BuildRequires: krb5-devel}
> %{?_with_krb5:Requires: krb5-libs}
> %{?_with_ldap:BuildRequires: openldap-devel >= 2.4.1}
> %{?_with_ldap:Requires: openldap >= 2.4.1}
> %{?_with_pam:BuildRequires: pam-devel >= 1.1.1}
> %{?_with_ssl:BuildRequires: openssl-devel >= 0.9.8e}
>
> %description
> ELOG is part of a family of applications known as weblogs.
> Their general purpose is :
>
> 1. To make it easy for people to put information online in a chronological
> fashion, in the form of short, time-stamped text messages ("entries")
> with optional HTML markup for presentation, and optional file attachments
> (images, archives, etc.)
>
> 2. To make it easy for other people to access this information through a
> Web interface, browse entries, search, download files, and optionally add,
> update, delete or comment on entries.
>
> ELOG is a remarkable implementation of a weblog in at least two respects :
>
> - Its simplicity of use: you don't need to be a seasoned server operator
> and/or an experimented database administrator to run ELOG ; one executable
> file (under Unix or Windows), a simple configuration text file, and it works.
... 74 more lines ...
|
150
|
Fri Feb 21 19:05:18 2020 |
Laurent Jean-Rigaud | lollspam@free.fr | Other | RPM build process enhancements | Stable | Fri Feb 21 19:14:53 2020 by Laurent Jean-Rigaud | Hi Stefan,
I enclosed a patch for RPM build process available on GIT.
changes :
- rpmbuild :
- checks if provider or custom build (the rm/mv are done on your computers only :-))
- call rpmbuild with version / release given as parameters
- elog.spec :
- last changelog entry date is set to build date
- build with debug for debuginfo rpms (product rpms are normally automatically strimmed)
- elog.init call /etc/ini.d/functions for RHEL/Centos/Fedora/? dists
Todo:
- add RPMbuild options for ldap/pam/...
- enclosed git log in changelog automatically (the dream :-))
|
Attachment 1: elog_patch_for_4936b76915d63a9ebb3788d50d62faadf49cdb6b.patch
|
diff --git a/buildrpm b/buildrpm
index 9d21f4a..dba7067 100755
--- a/buildrpm
+++ b/buildrpm
@@ -12,7 +12,7 @@ set release = $argv[2]
set dir = /tmp/elog-$version
set archive = elog-$version-$release.tar.gz
-perl -wapi.bak -e 's&^(Version:\s+).*$&${1}'"${version}"'&;s&^(Release:\s+).*$&${1}'"${release}"'&;' elog.spec
+#perl -wapi.bak -e 's&^(Version:\s+).*$&${1}'"${version}"'&;s&^(Release:\s+).*$&${1}'"${release}"'&;' elog.spec
# create temporary directory
rm -Rf $dir
@@ -68,19 +68,33 @@ rm -Rf $dir
# transfer archive
echo Transfer archive...
-cp /tmp/$archive ~ritt/html/elog/download/tar/
-cp /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
cp /tmp/$archive ~/rpmbuild/SOURCES/elog-$version.tar.gz
-cd ~ritt/elog
-cp -f doc/ChangeLog ~ritt/html/elog/download/ChangeLog
+# If Stefan...
+if ( -d /home/ritt ) then
+ echo "Manager mode"
+ if ( -d ~ritt/html/elog/download/tar ) then
+ cp /tmp/$archive ~ritt/html/elog/download/tar/
+ cp /tmp/$archive ~ritt/html/elog/download/tar/elog-latest.tar.gz
+ cd ~ritt/elog
+ cp -f doc/ChangeLog ~ritt/html/elog/download/ChangeLog
+ endif
+endif
+cd -
rm -f /tmp/$archive
+echo Cleanup $version-$release rpms
+rm -f ~/rpmbuild/RPMS/*/elog*${version}-${release}*.rpm
+rm -f ~/rpmbuild/SRPMS/elog*${version}-${release}*.rpm
# building RPMs
-echo Build RPMs...
-rm -f ~/rpmbuild/RPMS/x86_64/*
-rm -f ~/rpmbuild/SRPMS/*
-rpmbuild -ba elog.spec || exit $?
-cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/
-cp ~/rpmbuild/RPMS/x86_64/elog-$version-$release.x86_64.rpm ~ritt/html/elog/download/RPMS/elog-latest.x86_64.rpm
-cp ~/rpmbuild/SRPMS/elog*rpm ~ritt/html/elog/download/SRPMS/
-cp ~/rpmbuild/SRPMS/elog-$version-$release.src.rpm ~ritt/html/elog/download/SRPMS/elog-latest.src.rpm
+echo Build RPMs..
+rpmbuild -ba --define "version ${version}" --define "release ${release}" elog.spec || exit $?
+
+# If Stefan...
+if ( -d /home/ritt ) then
+ if ( -d ~ritt/html/elog/download/tar ) then
+ cp ~/rpmbuild/RPMS/x86_64/elog*rpm ~ritt/html/elog/download/RPMS/
+ cp ~/rpmbuild/RPMS/x86_64/elog-$version-$release.x86_64.rpm ~ritt/html/elog/download/RPMS/elog-latest.x86_64.rpm
+ cp ~/rpmbuild/SRPMS/elog*rpm ~ritt/html/elog/download/SRPMS/
+ cp ~/rpmbuild/SRPMS/elog-$version-$release.src.rpm ~ritt/html/elog/download/SRPMS/elog-latest.src.rpm
+ endif
+endif
diff --git a/elog.spec b/elog.spec
index 16add8f..8397eab 100755
--- a/elog.spec
+++ b/elog.spec
@@ -1,9 +1,13 @@
-# OpenSSH privilege separation requires a user & group ID
+# ELOG weblog application
+# rpmbuild -ba --define 'version 3.1.4' --define 'release 2' --define "date $(LC_TIME=En date '+%a %b %d %Y')" elog.spec
+
+#define date $(LC_TIME=En date '+%a %b %d %Y')
+%define build_timestamp %(LC_TIME=En date '+%a %b %d %Y')
Name: elog
Summary: elog is a standalone electronic web logbook
-Version: 3.1.4
-Release: 2
+Version: %version
+Release: %release%{?dist}
License: GPL
Group: Applications/Networking
Source: http://elog.psi.ch/elog/download/elog-%{version}.tar.gz
@@ -41,6 +45,8 @@ access control, etc. Moreover, a single server can host several weblogs, and
each weblog can be totally different from the rest.
%changelog
+* %{build_timestamp} Stefan Ritt <stefan.ritt@psi.ch> %version-%release
+- Updated from git
* Wed Sep 26 2018 Stefan Ritt <stefan.ritt@psi.ch>
- Made adjustments for new elog server and RH7
* Fri Aug 29 2014 Stefan Ritt <stefan.ritt@psi.ch>
@@ -72,7 +78,7 @@ each weblog can be totally different from the rest.
-g elog -M -r elog 2>/dev/null || :
%build
-make
+make CFLAGS='-O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -g'
sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
%install
diff --git a/elogd.init b/elogd.init
index 5d4e7ee..e04143c 100644
--- a/elogd.init
+++ b/elogd.init
@@ -6,6 +6,9 @@
# config: /usr/local/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
+# RHEL
+[ -f /etc/init.d/functions ] && . /etc/init.d/functions
+
# Check for the config file
if [ ! -f /usr/local/elog/elogd.cfg ]; then
exit 0
diff --git a/elogd.init_template b/elogd.init_template
index e94b5d7..bb1b330 100755
--- a/elogd.init_template
+++ b/elogd.init_template
@@ -6,6 +6,9 @@
# config: @PREFIX@/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
+# RHEL
+[ -f /etc/init.d/functions ] && . /etc/init.d/functions
+
# Check for the config file
if [ ! -f @PREFIX@/elog/elogd.cfg ]; then
exit 0
|
149
|
Sat Jun 15 06:13:07 2019 |
John | secondcomingtechnologies@fastmail.com | Script | Re: Custom input forms implementation | Stable | Sat Jun 15 06:19:24 2019 by John | I have been trying to get my head around this application module. I assume that after the input is done on this example (ShiftCheck), if goes into the usual file system directorys for storage? Or is it (or can it) goto another db like sql, flat, etc.? I also assume that the 'normal' Elog screens we see for input (and output), would be a completely seperate module that you have for (ShiftCheck).. but we do not see them here (as one of the attachments)? I am asking these questions because I am trying to recreate this (type) of input/output system for users, so I would like to know how the 'whole picture' is done with your example here. Thanx again.
Stefan Ritt wrote: |
Dear ELOG users,
starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:
And here is how it looks on the iPad:
Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.
Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.
|
|
148
|
Mon Mar 11 09:28:15 2019 |
Maurat | gm001@free.fr | Script | Code change for LDAP authentication | Stable | Mon Mar 11 10:15:43 2019 by Maurat | Hi,
I had to change code to authenticate users in my organization's LDAP directory. Indeed, accounts are distributed under several organizational units in my LDAP directory.
The current version of the code can't authenticate accounts when these are in different organizational units. Hence my contribution.
I Use a read account to request LDAP to locate the account that has logged in (with e-mail address in the search filter).
I get the number of LDAP entries. If I have one entry then I call ldap_get_dn function to get the DN account and then I call ldap_simple_bind_s using the account's DN and password to perform LDAP authentication.
I changed configuration file elogd.cfg. I added two parameters:
LDAP DN user = <DN read account>
LDAP PW user = <password read account>
I changed code auth.c too (see attached file)
I had to change Makefile. I added a call to lber library
ifdef USE_LDAP
ifneq ($(USE_LDAP), 0 )
CFLAGS += -DHAVE_LDAP
LIBS += -lldap -llber
endif
endif
Have good day
|
Attachment 1: auth.c
|
/********************************************************************\
Name: auth.c
Created by: Stefan Ritt
Copyright 2000 + Stefan Ritt
ELOG is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ELOG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ELOG. If not, see <http://www.gnu.org/licenses/>.
Contents: Authentication subroutines. Currently supported:
- password file authentication
- kerberos5 password authentication
$Id: elog.c 2350 2010-12-23 10:45:10Z ritt $
\********************************************************************/
#include "elogd.h"
#ifdef HAVE_KRB5
#include <krb5.h>
#endif
#ifdef HAVE_LDAP
#include <ldap.h>
LDAP *ldap_ld;
char ldap_login_attr[64];
char ldap_dn_user[256];
char ldap_pw_user[64];
char ldap_userbase[256];
char ldap_bindDN[512];
#endif /* HAVE_LDAP */
extern LOGBOOK *lb_list;
/*==================================================================*/
/*---- Kerberos5 routines ------------------------------------------*/
#ifdef HAVE_KRB5
int auth_verify_password_krb5(LOGBOOK * lbs, const char *user, const char *password, char *error_str,
int error_size)
{
char *princ_name, str[256], realm[256];
krb5_error_code error;
krb5_principal princ;
krb5_context context;
krb5_creds creds;
krb5_get_init_creds_opt options;
if (krb5_init_context(&context) < 0)
return FALSE;
strlcpy(str, user, sizeof(str));
if (getcfg(lbs->name, "Kerberos Realm", realm, sizeof(realm))) {
strlcat(str, "@", sizeof(str));
strlcat(str, realm, sizeof(str));
}
if ((error = krb5_parse_name(context, str, &princ)) != 0) {
strlcpy(error_str, "<b>Kerberos error:</b> ", error_size);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
error = krb5_unparse_name(context, princ, &princ_name);
if (error) {
strlcpy(error_str, "<b>Kerberos error:</b> ", error_size);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
sprintf(str, "Using %s as server principal for authentication", princ_name);
write_logfile(lbs, str);
memset(&options, 0, sizeof(options));
krb5_get_init_creds_opt_init(&options);
memset(&creds, 0, sizeof(creds));
error = krb5_get_init_creds_password(context, &creds, princ,
(char *) password, NULL, NULL, 0, NULL, &options);
krb5_free_context(context);
if (error && error != KRB5KDC_ERR_PREAUTH_FAILED && error != KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN) {
sprintf(error_str, "<b>Kerberos error %d:</b> ", error);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
if (error)
return FALSE;
return TRUE;
}
int auth_change_password_krb5(LOGBOOK * lbs, const char *user, const char *old_pwd, const char *new_pwd,
char *error_str, int error_size)
{
char *princ_name, str[256], realm[256];
int result_code, n;
krb5_error_code error;
krb5_data result_code_string, result_string;
krb5_principal princ;
krb5_context context;
krb5_creds creds;
krb5_get_init_creds_opt options;
if (krb5_init_context(&context) < 0)
return FALSE;
strlcpy(str, user, sizeof(str));
if (getcfg(lbs->name, "Kerberos Realm", realm, sizeof(realm))) {
strlcat(str, "@", sizeof(str));
strlcat(str, realm, sizeof(str));
}
if ((error = krb5_parse_name(context, str, &princ)) != 0) {
strlcpy(error_str, "<b>Kerberos error:</b> ", error_size);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
error = krb5_unparse_name(context, princ, &princ_name);
sprintf(str, "Using %s as server principal for authentication", princ_name);
write_logfile(lbs, str);
memset(&options, 0, sizeof(options));
krb5_get_init_creds_opt_init(&options);
krb5_get_init_creds_opt_set_tkt_life(&options, 300);
krb5_get_init_creds_opt_set_forwardable(&options, FALSE);
krb5_get_init_creds_opt_set_proxiable(&options, FALSE);
memset(&creds, 0, sizeof(creds));
error = krb5_get_init_creds_password(context, &creds, princ,
(char *) old_pwd, NULL, NULL, 0, "kadmin/changepw", &options);
if (error) {
strlcpy(error_str, "<b>Kerberos error:</b> ", error_size);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
error = krb5_set_password(context, &creds, (char *) new_pwd, princ,
&result_code, &result_code_string, &result_string);
if (error) {
strlcpy(error_str, "<b>Kerberos error:</b> ", error_size);
strlcat(error_str, krb5_get_error_message(context, error), error_size);
strlcat(error_str, ". Please check your Kerberos configuration.", error_size);
return FALSE;
}
if (result_code > 0) {
if (result_code_string.length > 0) {
strlcpy(error_str, result_code_string.data, error_size);
if ((int) result_code_string.length < error_size)
error_str[result_code_string.length] = 0;
}
if (result_string.length > 0) {
strlcat(error_str, ": ", error_size);
n = strlen(error_str) + result_string.length;
strlcat(error_str, result_string.data, error_size);
if (n < error_size)
error_str[n] = 0;
}
}
krb5_free_data_contents(context, &result_code_string);
krb5_free_data_contents(context, &result_string);
krb5_free_cred_contents(context, &creds);
krb5_get_init_creds_opt_free(context, &options);
krb5_free_context(context);
if (result_code > 0)
return FALSE;
return TRUE;
}
#endif
/*---- LDAP routines ------------------------------------------*/
#ifdef HAVE_LDAP
int ldap_init(LOGBOOK *lbs, char *error_str, int error_size)
{
char str[512], ldap_server[256];
int version;
int bind=0;
// Read Config file
if (getcfg(lbs->name, "LDAP server", ldap_server, sizeof(ldap_server))) {
strlcpy(str, ldap_server, sizeof(str));
}
else {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
strlcat(str, "ERR: Cannot find LDAP server entry!", sizeof(str));
write_logfile(lbs, str);
return FALSE;
}
if (!getcfg(lbs->name, "LDAP userbase", ldap_userbase, sizeof(ldap_userbase))) {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
strlcat(str, ", ERR: Cannot find LDAP userbase (e.g. \'ou=People,dc=example,dc=org\')!", sizeof(str));
write_logfile(lbs, str);
return FALSE;
}
if (!getcfg(lbs->name, "LDAP login attribute", ldap_login_attr, sizeof(ldap_login_attr))) {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str));
write_logfile(lbs, str);
return FALSE;
}
if (!getcfg(lbs->name, "LDAP DN User", ldap_dn_user, sizeof(ldap_dn_user))) {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str));
write_logfile(lbs, str);
return FALSE;
}
if (!getcfg(lbs->name, "LDAP PW User", ldap_pw_user, sizeof(ldap_pw_user))) {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
strlcat(str, ", ERR: Cannot find LDAP login attribute (e.g. uid, cn, ...)!", sizeof(str));
write_logfile(lbs, str);
return FALSE;
}
// Initialize/open LDAP connection
if(ldap_initialize( &ldap_ld, ldap_server )) {
perror("ldap_initialize");
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
return FALSE;
}
// Use the LDAP_OPT_PROTOCOL_VERSION session preference to specify that the client is LDAPv3 client
version = LDAP_VERSION3;
ldap_set_option(ldap_ld, LDAP_OPT_PROTOCOL_VERSION, &version);
write_logfile(lbs, str);
return TRUE;
}
int auth_verify_password_ldap(LOGBOOK *lbs, const char *user, const char *password, char *error_str,
int error_size)
{ LDAPMessage *result, *err, *entry;
int bind=0, i, rc=0, nb=0;
char str[512], filter[512];
char *attribute , *dn;
BerElement *ber;
BerValue **values;
ldap_ld = NULL;
memset(&ldap_bindDN[0], 0, sizeof(ldap_bindDN));
struct timeval timeOut = {3,0}; // 3 second connection/search timeout
// zerotime.tv_sec = zerotime.tv_usec = 0L;
if(!ldap_init(lbs,error_str,error_size)) {
strlcpy(error_str, "<b>LDAP initialization error</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
return FALSE;
}
printf("\n dn: %s\n", ldap_dn_user );
//Bind with read account
bind = ldap_simple_bind_s(ldap_ld, ldap_dn_user, ldap_pw_user, LDAP_AUTH_SIMPLE);
if(bind != LDAP_SUCCESS) {
strlcpy(error_str, "<b>LDAP BIND error with read account</b> ", error_size);
strlcat(error_str, " Please check your LDAP configuration.", error_size);
return FALSE;
}
// search user
sprintf(filter, "(%s=%s)", ldap_login_attr, user);
rc = ldap_search_ext_s(
ldap_ld, // LDAP session handle
ldap_userbase, // Search Base
... 318 more lines ...
|
53
|
Sat Sep 16 15:47:16 2017 |
David Pilgram | David.Pilgram@epost.org.uk | Script | Re: Check logbook files for wrong references | Stable | Sat Sep 16 15:52:58 2017 by David Pilgram | I had to modify the script because I'm still on elog 2.9.2, where there are not subdirectories (by year) for
each logbook. Line 5 had to be changed to
$logf=q/[0-9][0-9][01][0-9][0-3][0-9]a.log/;
to do this.
Once done, I found the deliberate orphan script that I had put in to test, and rather too many other orphans than I had expected. One or two I cannot explain. If I had clicked on any of those entries elog would have gone into infinate loop.
A very useful utility. Thanks Andreas!
Andreas Luedeke wrote: |
You can run this little script to check if all entries referenced "In reply to:" do actually exist.
To use it, you first need to "cd" to your logbook directory ("cd /usr/local/elog/logbooks") and then run it without arguments "logcheck".
If it finds references pointing to a missing entry, it'll print the path to the file with the offending reference and some lines. For example:
### error: reference to entry 146, that exists 0 times. Reference is:
### Proscan/2012/120507a.log-<p>[...].</p>
### Proscan/2012/120507a.log-$ @ MID @ $: 147
### Proscan/2012/120507a.log-Date: Mon, 07 May 2012 13:44:03 +0200
### Proscan/2012/120507a.log:In reply to: 146
### Proscan/2012/120507a.log-Wann: 1336373261
### Proscan/2012/120507a.log-Autor: [...]
### Proscan/2012/120507a.log-Eintrag: Problem
[...]-
Very often this happens if an entry is deleted AFTER someone already replied to it. Normally that is no problem, but in some cases you might get infinite loops and that causes ELOG to hang. The script is not checking for loops, but wrong references might give you a hint where to look.
The script will print duplicate entries as well, if the referenced entry exist more than once.
Cheers, Andreas
PS: never include the string "$ @ MID @ $:" without spaces in an ELOG entry: apparently ELOG cuts off all text from that token on.
|
|
52
|
Fri Sep 15 17:19:47 2017 |
Andreas Luedeke | andreas.luedeke@psi.ch | Script | Check logbook files for wrong references | Stable | Fri Sep 15 17:41:41 2017 by Andreas Luedeke | You can run this little script to check if all entries referenced "In reply to:" do actually exist.
To use it, you first need to "cd" to your logbook directory ("cd /usr/local/elog/logbooks") and then run it without arguments "logcheck".
If it finds references pointing to a missing entry, it'll print the path to the file with the offending reference and some lines. For example:
### error: reference to entry 146, that exists 0 times. Reference is:
### Proscan/2012/120507a.log-<p>[...].</p>
### Proscan/2012/120507a.log-$ @ MID @ $: 147
### Proscan/2012/120507a.log-Date: Mon, 07 May 2012 13:44:03 +0200
### Proscan/2012/120507a.log:In reply to: 146
### Proscan/2012/120507a.log-Wann: 1336373261
### Proscan/2012/120507a.log-Autor: [...]
### Proscan/2012/120507a.log-Eintrag: Problem
[...]-
Very often this happens if an entry is deleted AFTER someone already replied to it. Normally that is no problem, but in some cases you might get infinite loops and that causes ELOG to hang. The script is not checking for loops, but wrong references might give you a hint where to look.
The script will print duplicate entries as well, if the referenced entry exist more than once.
Cheers, Andreas
PS: never include the string "$ @ MID @ $:" without spaces in an ELOG entry: apparently ELOG cuts off all text from that token on. |
Attachment 1: logcheck
|
#!/usr/bin/perl
$cmd=q/find * -noleaf -maxdepth 0 -wholename Backup -prune -o -wholename en -prune -o -type d -exec printf '%s:' {} + /;
#print $cmd;
$logf=q/*\/[0-9][0-9][01][0-9][0-3][0-9]a.log/;
open(INP,$cmd . "2>/dev/null |") || die "can't open " . $cmd . ": $!";
$list=<INP>;
close(INP);
#print "list=" . $list ."\n";
foreach $dir (split(":",$list)) {
chomp $dir;
if (length($dir) > 1) {
print "Check \"" . $dir . "\"\n";
$files=$dir . "/" . $logf;
$cmd="grep ^In.reply.to: " . $files . " 2>/dev/null | cut -d \" \" -f 4 | sort -nu |";
open(INPB,$cmd) || die "can't open " . $cmd . ": $!";
while (<INPB>) {
chomp;
$id=$_;
$cmd="grep '[\$\]\@MID\@[\$\]:.$id\$' $files |";
open(INPC,$cmd) || die "can't open " . $cmd . ": $!";
$c=0;
while (<INPC>) {$c++};
close(INPC);
if ($c != 1) {
print "### error: reference to entry $id, that exists $c times. Reference is:\n";
$cmd="grep -C 3 '^In.reply.to:.$id\$' $files |";
#print $cmd;
open(INPD,$cmd) || die "can't open " . $cmd . ": $!";
while (<INPD>) {
print "### ".$_;
}
close(INPD);
}
}
close(INPB);
}
}
|
50
|
Tue Jul 26 10:16:22 2016 |
Andreas Luedeke | simon.ebner@psi.ch | Script | Python module to read/write/edit/reply/delete ELOG entries | Stable | Tue Jul 26 10:26:34 2016 by Andreas Luedeke |
Hello Everybody!
I would just like to inform you that there is a new Python module available to access and work with ELOG (read/write/edit/reply/delete).
Currently the module is only supported for Python version 3. The package is pure Python and has no special dependencies. Therefore you can use the package on any machine.
The documentation you can find on https://github.com/paulscherrerinstitute/py_elog
If you want to install the package in an Anaconda on your local machine just use
conda install -c paulscherrerinstitute elog
(also works from outside PSI - the package is available at https://anaconda.org/paulscherrerinstitute/elog)
If there are issues with the package please use the issue tracker that comes with the github repository
https://github.com/paulscherrerinstitute/py_elog/issues or let me know.
Best
Simon |
49
|
Wed May 11 09:35:23 2016 |
Hanno Perrey | hanno.perrey@nuclear.lu.se | Script | Re: Re: Custom input forms implementation | Stable | Wed May 11 09:43:34 2016 by Hanno Perrey |
Stefan Ritt wrote: |
Dear ELOG users,
starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:
And here is how it looks on the iPad:
Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.
Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.
|
Thank you very much for this nice example!
I found a little issue with newer ELOG versions: if the authentication is done via session cookies, the submission of the checklist will fail with the error "Cannot open file passwd". This is actually misleading as the cause of the error is the empty user name submitted (since the cookie storing user name and pwd hash is never created) and not the password file itself. This can be worked around by removing the user name and pwd fields in the html form before submitting in case there is a SID cookie around.
The attached shiftcheck.html contains this workaround and seems to be functioning fine on my installation (ELOG 3.1.0).
Cheers,
Hanno |
Attachment 1: shiftcheck.html
|
47
|
Sun Aug 23 21:27:00 2015 |
Daniel Sajdyk | daniel.sajdyk@gmail.com | Theme/Skin | Simple theme | Beta | Tue Sep 1 07:39:45 2015 by Daniel Sajdyk | Hello.
I did simple theme for ELOG called "dansaj".
This is verision which I did for my ELOG, and if you have troubles in other configurations, please let me know, and we will correct it.
Vectors versions of icons you can find in oryginals folder (if you want to transform it).
The most current version you can download from my blog - Elog theme, czyli skórka, albo temat.
Regards
Daniel. |
Attachment 1: choose_elog.png
|
|
Attachment 2: entry.png
|
|
Attachment 3: Full.png
|
|
Attachment 4: login.png
|
|
Attachment 5: Summary.png
|
|
Attachment 6: Threaded_demo_logbook.png
|
|
Attachment 7: dansaj.7z
|
Attachment 8: Threaded.png
|
|
46
|
Fri Jul 31 13:52:32 2015 |
TorstenJ | torsten.jakob@jet-services.com | Web site | Problem with Internet Explorer when saving an entry | Stable | Fri May 31 14:20:43 2019 by Stefan Ritt | Hi all,
first off all let me say, that I realy like this great tool. That is a lot of help for keeping our server documentation up-to-date. Thanks to all contributors for that.
I right here, because I actually have an issue with saving entries working with IE11 (but also in IE9). When ever I enter an entry, and click the save button, the page open a page with the text: "OK 1" or the second attemp: "OK 2" 3rd "OK 3" and so on. To get back to my Item list, I have to click the back button in the internet explorer. I also opens a lot of draft entries in my databases. When I submit my entry, I don't have an issue, and the entry is saved correctly.
This issue doesn't happen when using Google Chrome.
Had anyone an simlar issue using elog with IE? It would be great to have some help with that issue.
Thanks
Torsten |
45
|
Thu May 7 09:14:25 2015 |
Christof Hanke | hanke@rzg.mpg.de | Script | systemd-unit file | Stable | 1 | sample systemd-unit file.
Use it as you like. |
Attachment 1: elogd.service
|
[Unit]
Description=ELOG Daemon
Wants=network-online.target
After=network-online.target
[Service]
Type=forking
ExecStart=@PREFIX@/elogd -D -c @PREFIX@/elog/elogd.cfg
StandardOutput=null
[Install]
WantedBy=multi-user.target
|
44
|
Tue Jul 8 15:43:21 2014 |
TimS | timpie_s@yahoo.com | Script | Re: Custom input forms implementation | Stable | Tue Mar 19 13:18:33 2013 by Stefan Ritt |
Stefan Ritt wrote: |
Dear ELOG users,
starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:
And here is how it looks on the iPad:
Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.
Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.
|
That's awesome!! Didn't know ELOG was still being developed!! I was looking for this ...been trying this version now with
supplied example but there's files missing which are being referenced from the html file.
Anyway it would be nice to know a little more on how to use this and how it incorporates into ELOG.
Is some more work being done on this version ?
Thankx heaps for this great enhancement although now it's still needs a lot of figuring out on how to do this.
|
43
|
Mon Jun 30 15:00:05 2014 |
Branislav Gardon | branislav.gardon@gmail.com | Theme/Skin | blue-gray theme | Stable | |
I`ve edited-prepared new default.css
It`s very simple but maybe will for someone useful.
Have a nice day.
regards
Branislav
|
Attachment 1: default.css
|
/* default formatting */
body {
margin:3px;
color:black;
background-color:white;
font-family:verdana,tahoma,sans-serif;
/* background-image:url(elog.gif); */
}
/* standard link colors and decorations */
a:link { color:#000000; text-decoration:none }
a:visited { color:#606060; text-decoration:none }
a:hover { color:#FF0092; text-decoration:underline }
a:active { color:#FF0092; text-decoration:underline }
a:focus { color:#FF0092; text-decoration:underline }
td {
color:black;
font-size:12px;
}
/* frame table */
.frame {
width:100%;
}
/* printable frame table */
.pframe {
width:600px;
}
/* standard formatting for logbook tabs */
.tabs {
font-family:sans-serif;
font-size:10pt;
background-color:white;
}
/* logbook selection page */
.selframe {
width:60%;
background-color:#486090;
border:1px solid #486090;
font-size:10pt;
}
.seltitle {
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
background-color:#ffffff;
color:#486090;
text-align:center;
}
.selexp {
border:1px solid #0000FF;
border-top:1px solid white;
border-left:1px solid white;
background-color:#CCCCFF;
color:#486090;
text-align:left;
font-size:10pt;
}
.selspace {
width:2%;
border:1px solid #308000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
}
.selgroup {
border:1px solid #308000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#00ffff;
padding:3px;
text-align:left;
font-weight:bold;
font-size:14pt;
}
.sellogbook {
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
background-color:#ffffff;
padding:3px;
text-align:left;
font-weight:normal;
}
.selcomment {
font-size:8pt;
}
.selentries {
background-color:#ffffff;
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
text-align:center;
font-size:10pt;
}
/* unselected and selected group tabs */
.gtab a {
background-color:#B0E0B0;
padding-left:5px;
padding-right:5px;
}
.gtab {
background-color:#B0E0B0;
border-right:1px solid #409040;
}
.sgtab a {
color:white;
padding-left:5px;
padding-right:5px;
}
.sgtab {
background-color:#486090;
color:white;
border-right:1px solid #084070;
}
.sgtab a:visited { color:white; } /* bug for IE */
/* unselected and selected logbook tabs */
.ltab a {
background-color:#EEEEEE;
padding-left:5px;
padding-right:5px;
}
.ltab {
background-color:#EEEEEE;
border-top:1px solid white;
border-left:1px solid white;
border-right:1px solid gray;
}
.sltab a {
background-color:#486090;
color:white;
padding-left:5px;
padding-right:5px;
}
.sltab {
background-color:#486090;
color:white;
border-left:1px solid #EEEEEE;
border-right:1px solid #084070;
}
.sltab a:visited { color:white; } /* bug for IE */
/* logbook title, left, middle and right cell */
.title1 {
padding:5px;
background-color:#486090;
border-bottom:1px solid black;
border-left:1px solid #EEEEEE;
color:#486090;
font-size:small;
font-family:sans-serif;
text-align:left;
}
.title1 a:visited { color:#A0FFA0; }
.title1 a:link { color:#A0FFA0; }
.title2 {
background-color:#486090;
border-bottom:1px solid black;
color:white;
font-size:xs-small;
font-family:sans-serif;
text-align:right;
}
.title3 {
border-bottom:1px solid black;
border-right:1px solid black;
background-color:#486090;
text-align:right;
width:100px;
}
/* main menu row */
.menuframe {
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
height:29px;
}
.menu1 {
text-align:left;
font-size:10pt;
vertical-align:middle;
}
.menu1a {
text-align:center;
width:110px;
font-size:10pt;
font-weight:bold;
vertical-align:middle;
}
.menu2a {
text-align:left;
font-size:10pt;
}
.menu2b {
text-align:right;
font-size:10pt;
}
.menu3 {
text-align:left;
font-size:8pt;
font-weight:bold;
}
.menu4 {
text-align:right;
font-size:10pt;
vertical-align:middle;
}
.menucenter {
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
text-align:center;
font-size:10pt;
}
.toolframe {
border:1px solid #486090;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
padding:2px;
}
/* frame table in listings */
.listframe {
border:1px solid #0000FF;
border-top:1px solid white;
border-left:1pc solid white;
background-color:#486090;
border:0px;
}
/* title row in listing */
.listtitle {
border:1px solid #000000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
font-size:10pt;
font-weight:normal;
text-align:center;
width:0%;
}
.listtitle2 {
border:1px solid #000000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
font-size:10pt;
font-weight:normal;
text-align:center;
width:100%;
}
.listtitle3 {
border:1px solid #000000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
text-align:center;
width:0%;
... 387 more lines ...
|
Attachment 2: ScreenShot174.jpg
|
|
42
|
Mon Apr 29 04:29:33 2013 |
Ryan Blakeslee | rb@blakesys.net | Theme/Skin | Clean plain-text CSS - modified from default.css | Stable | Mon Apr 29 23:34:40 2013 by Ryan Blakeslee | Hello,
I am using ELOG 2.5.2. I had a real need for a simplified almost text-only version of the application. For me
personally, I like simple, minimalist and text-only as much as possible for the tools I use. I personally found
the layout with all the colors to be distracting from the content of each log entry. Again this is ONLY my
personal preference, NO offense meant. :-)
I took the default.css and modified it to achieve what I needed. I am uploading here, the .css file. It uses
"blue" for some of the things such as attribute fields on single page view, etc. but overall it's all clean,
plain-text.
I don't know if this css will work on newer versions of ELOG (since I know i'm using an old one.) But it's my
hope that others like me, will find this modification very useful.
Thank you Stefan, and community -- this is an awesome tool, that I use in my business. It's amazing how simple
tools are always the most powerful and scale-able! Fantastic, excellent job on this app. |
Attachment 1: plaintxt-blue.css
|
\/* default formatting */
body {
margin:3px;
color:black;
background-color:white;
font-family:sans-serif;
}
/* standard link colors and decorations */
a:link { color:#0000FF; text-decoration:none }
a:visited { color:#0000FF; text-decoration:none }
a:hover { color:#0000FF; text-decoration:underline }
a:active { color:#0000FF; text-decoration:underline }
a:focus { color:#0000FF; text-decoration:underline }
td {
color:black;
font-family:sans-serif;
}
/* frame table */
.frame {
width:100%;
}
/* printable frame table */
.pframe {
width:600;
}
/* standard formatting for logbook tabs */
.tabs {
font-family:sans-serif;
font-size:10pt;
background-color:white;
}
/* logbook selection page */
.selframe {
width:60%;
background-color:#486090;
border:1px solid #486090;
font-size:12pt;
}
.seltitle {
border:1px solid #0000FF;
border-top:1px solid white;
border-left:1px solid white;
background-color:#CCCCFF;
color:#486090;
text-align:center;
}
.selexp {
border:1px solid #0000FF;
border-top:1px solid white;
border-left:1px solid white;
background-color:#CCCCFF;
color:#486090;
text-align:left;
font-size:10pt;
}
.selspace {
width:2%;
border:1px solid #308000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#EEEEEE;
}
.selgroup {
border:1px solid #308000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#FFCCFF;
padding:3px;
text-align:left;
font-weight:bold;
font-size:14pt;
}
.sellogbook {
border:1px solid #308000;
border-top:1px solid white;
border-left:1px solid white;
background-color:#DDEEBB;
padding:3px;
text-align:left;
font-weight:bold;
}
.selcomment {
font-size:8pt;
}
.selentries {
background-color:#E0E0A0;
border:1px solid #0000FF;
border-top:1px solid white;
border-left:1px solid white;
text-align:center;
font-size:10pt;
}
/* unselected and selected group tabs */
.gtab a {
background-color:#B0E0B0;
padding-left:5px;
padding-right:5px;
}
.gtab {
background-color:#B0E0B0;
border-right:1px solid #409040;
}
.sgtab a {
color:white;
padding-left:5px;
padding-right:5px;
}
.sgtab {
background-color:#486090;
color:white;
border-right:1px solid #084070;
}
.sgtab a:visited { color:white; } /* bug for IE */
/* unselected and selected logbook tabs */
.ltab a {
background-color:#E0E0E0;
padding-left:5px;
padding-right:5px;
}
.ltab {
background-color:#E0E0E0;
border-right:1px solid gray;
}
.sltab a {
background-color:#486090;
color:white;
padding-left:5px;
padding-right:5px;
}
.sltab {
background-color:#486090;
color:white;
border-right:1px solid #084070;
}
.sltab a:visited { color:white; } /* bug for IE */
/* logbook title, left, middle and right cell */
.title1 {
background-color:#486090;
border-bottom:1px solid gray;
border-top:1px solid #E0E0E0;
border-left:1px solid #E0E0E0;
color:white;
font-size:medium;
font-family:sans-serif;
text-align:left;
}
.title1 a:visited { color:#A0FFA0; }
.title1 a:link { color:#A0FFA0; }
.title2 {
background-color:#486090;
border-bottom:1px solid black;
border-top:1px solid #E0E0E0;
color:white;
font-size:medium;
font-family:sans-serif;
text-align:center;
}
.title3 {
border-bottom:1px solid black;
border-top:1px solid #E0E0E0;
border-right:0px solid gray;
background-color:#486090;
text-align:left;
}
/* main menu row */
.menuframe {
border:0px solid black;
border-top:1px solid gray;
border-right:0px solid gray;
border-left:0px solid gray;
padding:3px;
background-color:white;
}
.menu1 {
text-align:left;
font-size:10pt;
}
.menu2a {
text-align:left;
font-size:10pt;
}
.menu2b {
text-align:right;
font-size:10pt;
}
.menu3 {
text-align:left;
font-size:8pt;
font-weight:bold;
}
.menu4 {
text-align:right;
font-size:10pt;
vertical-align:middle;
}
/* frame table in listings */
.listframe {
border:0px solid gray;
border-top:0px solid gray;
border-left:0pc solid gray;
background-color:white;
border:0px;
}
/* title row in listing */
.listtitle {
border:0px solid black;
border-top:1px solid gray;
border-left:0px solid gray;
background-color:white;
text-align:left;
}
/* attachment line */
.attachment {
border-left:1px solid gray;
border-right:1px solid gray;
border-bottom:1px solid gray;
background-color:#FFFFB0;
text-align:left;
}
/* threaded listing */
.thread {
border:0px solid gray;
border-top:0px solid gray;
border-left:0px solid gray;
background-color:white;
}
.threadreply {
border:0px solid #808040;
border-top:0px solid white;
border-left:0px solid white;
background-color:white;
text-align:left;
}
/* attribute names and values on single message page */
.attribhead {
background-color:white;
border:0px solid gray;
border-top:1px solid gray;
border-bottom:1px solid gray;
border-left:0px solid gray;
padding:0px;
font-size:12pt;
font-family:sans-serif;
}
.attribname {
width:150px;
background-color:#486090;
color:white;
padding-left:5px;
padding-right:5px;
padding:3px;
border:1px solid white;
}
.attribvalue {
... 225 more lines ...
|
Attachment 2: summary.png
|
|
Attachment 3: full.png
|
|
Attachment 4: single-view.png
|
|
Attachment 5: find.png
|
|
41
|
Mon Jan 7 16:37:21 2013 |
Stefan Ritt | stefan.ritt@psi.ch | Script | Re: Server time offset | Stable | |
Bruce Weber wrote: |
Our server runs on local time, however, we require log entries to be in UTC (-0800hrs) - is there a command to achieve this?
Your assistance will be much appreciated
Thanks
|
Have you tried
Subst <attribute> = $utcdate
Probably you need a dedicated attribute of type "datetime" and have to play with the "Date format" options. |
40
|
Mon Jan 7 08:45:10 2013 |
Bruce Weber | bruce.weber@inmarsat.com | Script | Server time offset | Stable | | Our server runs on local time, however, we require log entries to be in UTC (-0800hrs) - is there a command to achieve this?
Your assistance will be much appreciated
Thanks |
38
|
Fri Sep 9 12:08:26 2011 |
Andreas Luedeke | andreas.luedeke@psi.ch | Script | create incremental daily backups of logbooks for Unix/Linux | Beta | | A very simple backup utility for elog logbooks.
If you want to recover your logbook from corrupted entries, an incremental backup comes in handy:
you can just replace the corrupted files with the previous versions.
Below is a very simple wrapper to create backups of the logbook into some local directory (/logbooks_backup in
the example script). The second wrapper lists the files in a given ".tar" archive.
You would run the backup from a cron job with the line:
1 0 * * * /usr/local/elog/elog_backup_daily
This will create daily backups of modified logbook and config files and a weekly backup of the password file
/usr/local/elog/passwd.txt (if you wonder why: our passwd.txt file has more than 1 MByte and of course it
changes with every login).
elog_backup_daily (copy to /usr/local/elog) script to create tar file and remove tar files older than 90 days
exclude-logbooks (copy to /usr/local/elog) list of files to be excluded in backup (thumbnails, etc.)
elog_backup_listfiles (copy to /usr/local/bin) shows content of a given tar file (omits directories in list) |
Attachment 1: elog_backup_daily
|
#!/bin/sh
# source file directory
srcd=/usr/local/elog/
# backup all files newer than 25 hours
date=$(date -d "-25hours" "+%Y%m%d %H:%M")
# backup file directory
tard=/logbooks_backup
# backup tar file name
tarf=$tard/$(date +%Y%m%d_%a.tar)
# do not backup files that match patterns in this file
excf=/usr/local/elog/exclude-logbooks
# create backup
cd $srcd
tar --ignore-case -X $excf --newer "$date" -cf $tarf . logbooks/*
# copy passwd.txt
if [ "$(date +%u)" -eq 1 ]
then
passwd=$tard/passwd_$(date +%Y%m%d_%a.txt)
cp $srcd/passwd.txt $passwd
gzip -9 $passwd
fi
# delete all backups older than 90 days
find $tard -mtime +90 -name "*_???.tar" -exec rm -f {} +
find $tard -mtime +90 -name "passwd_*_???.txt.gz" -exec rm -f {} +
|
Attachment 2: exclude-logbooks
|
*.png.png
*.gif.png
*.jpg.png
*.pdf.png
oldLogbooks/*
logbooks/elog.log
passwd.txt
ssl/*
logbooks/Backup/*
logbooks/old/*
|
Attachment 3: elog_backup_listfiles
|
tar -tf $1|grep -v "^.*/$"
|
37
|
Tue Aug 23 19:45:16 2011 |
Stuart Wilkins | swilkins@bnl.gov | Script | ELOG Mail Parser | Alpha | | Hi!
I have attached a small script which can process an e-mail and submit this e-mail as a log entry. This is alpha at the moment but if you have suggestions or find bugs please let me know.
The easiest way to process this is to use the ".forward" file in unix. If this file contains the line:
| "/usr/bin/python /home/tardis/elogmail/process.py --log /home/tardis/elogmail/mail.log -r -u http://localhost:8080/TARDIS -a Category=email -a Type=Log"
This will pipe the incoming mail to the e-log running on the localhost with the experiment TARDIS. Attributes can be set using the "-a" switch like in the elog command line utility. To get help with all the options please run the script with the command:
python process.py -h
which will give help.
Any questions, please don't hesitate to contact me, and I will do my best to help.
Thanks again to Stefan for a great application.
Best wishes,
Stuart
|
Attachment 1: process.py.gz
|
Attachment 2: forward.gz
|
36
|
Tue Aug 23 12:07:51 2011 |
Stefan Ritt | stefan.ritt@psi.ch | Script | Re: JavaScript list auto-refresh | Stable | Tue Jul 12 12:36:16 2005 by Emiliano Gabrielli |
Emiliano Gabrielli wrote: | Here is a simple piece of JS code to accomplish a smart page reload.
We don't reload if in some kind of editing mode.
You can put the code everywhere you like in the elog html page, my suggestion is to put it in Bottom Text (or Top Text):
;auto-refresh
Bottom text = [I]<script language="JavaScript">if (null==window.location.href.match('/[0-9]+$|.*(cmd|select)=.*') ) { window.setTimeout("location.reload();", 2*60*1000); now=new Date(); document.write('<br/>Last reload at '+now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate()+', '+( ((h=now.getHours())<10) ? '0'+h :h)+':'+( ((m=now.getMinutes())<10) ? '0'+m :m)+':'+( ((s=now.getSeconds())<10) ? '0'+s :s)) }</script>[/I]
the timer is a product of # of minutes, #of seconds and milliseconds... 2 minutes in the above example
Revision Tue Jul 12 12:36:16 2005 wrote: |
modified regular expression in order to not activate the auto-refresh in the signle entry view
|
|
Starting with SVN revision 2422, there is a new config option
refresh = <seconds>
which lets you do the same thing. |
35
|
Tue May 24 22:43:38 2011 |
JacekK | doctor99@poczta.onet.pl | Script | Javascript verification of simple attributes with regexp | Beta | Tue May 24 22:46:38 2011 by JacekK | Hi,
I added possibility for a new verification of required fields in generated Javascript "function chkform() ". To do this I added new logbook option "ValidPattern", in which you can set regular expression for an attribute, for example
ValidPattern HexDigits=[0-9a-fA-F]+
If there is a pattern set for required field, then in chkform() function is generated additional verification, if value of the field matches validation regexp.
Changes I made should not decrease performance of elogd. Let me know please if you can add it to regular version.
Jacek |
Attachment 1: JScriptREVerify.patch
|
Index: elogd.c
===================================================================
--- elogd.c (revision 2414)
+++ elogd.c (working copy)
@@ -74,6 +74,8 @@
char attr_list[MAX_N_ATTR][NAME_LENGTH];
char attr_options[MAX_N_ATTR][MAX_N_LIST][NAME_LENGTH];
int attr_flags[MAX_N_ATTR];
+/** Validation pattern for attribute, to test if it contains expected value */
+char attr_valid_pattern[MAX_N_ATTR][NAME_LENGTH];
char attr_list_default[][NAME_LENGTH] = { "Author", "Type", "Category", "Subject", "" };
@@ -7033,7 +7035,7 @@
int scan_attributes(char *logbook)
/* scan configuration file for attributes and fill attr_list, attr_options
- and attr_flags arrays */
+ and attr_flags and attr_valid_pattern arrays */
{
char list[10000], str[NAME_LENGTH], str2[NAME_LENGTH], type[NAME_LENGTH],
tmp_list[MAX_N_ATTR][NAME_LENGTH];
@@ -7062,11 +7064,20 @@
}
}
- /* get options lists for attributes */
+ /* get options lists and validation patterns for attributes */
memset(attr_options, 0, sizeof(attr_options));
+ memset(attr_valid_pattern, 0, sizeof(attr_valid_pattern));
for (i = 0; i < n; i++) {
n_options = 0;
+ sprintf(str, "ValidPattern %s", attr_list[i]);
+ if (getcfg(logbook, str, list, sizeof(list)))
+ {
+ strncpy(attr_valid_pattern[i], list, sizeof(attr_valid_pattern[i])-1);
+ attr_valid_pattern[i][sizeof(attr_valid_pattern[i])-1] = 0;
+ attr_flags[i] |= AF_HAS_VALID_PATT;
+ }
+
sprintf(str, "Options %s", attr_list[i]);
if (getcfg(logbook, str, list, sizeof(list)))
n_options = strbreak(list, attr_options[i], MAX_N_LIST, ",", FALSE);
@@ -9650,6 +9661,17 @@
rsprintf(" document.form1.%s.focus();\n", ua);
rsprintf(" return false;\n");
rsprintf(" }\n");
+ if (attr_flags[i] & AF_HAS_VALID_PATT)
+ {
+ sprintf(str, loc("var validPatt=new RegExp(\"%s\");"), attr_valid_pattern[i]);
+ rsprintf(" %s\n", str);
+ rsprintf(" if (!validPatt.test(document.form1.%s.value)) {\n", ua);
+ sprintf(str, loc("Invalid value for attribute '%s'"), attr_list[i]);
+ rsprintf(" alert(\"%s\");\n", str);
+ rsprintf(" document.form1.%s.focus();\n", ua);
+ rsprintf(" return false;\n");
+ rsprintf(" }\n");
+ }
}
}
Index: elogd.h
===================================================================
--- elogd.h (revision 2414)
+++ elogd.h (working copy)
@@ -192,6 +192,7 @@
#define AF_MUSERLIST (1<<13)
#define AF_USEREMAIL (1<<14)
#define AF_MUSEREMAIL (1<<15)
+#define AF_HAS_VALID_PATT (1<<16)
/* attribute format flags */
#define AFF_SAME_LINE 1
|
34
|
Fri Feb 4 10:26:38 2011 |
Stefan Ritt | stefan.ritt@psi.ch | Other | Re: Building elog on OpenBSD | Stable | |
T. Ribbrock wrote: |
Two things are required to get elog (tested with 2.8.1) to compile on OpenBSD (tested on OpenBSD 4.8):
Step 1 - Patch Makefile:
--- Makefile~ Mon Jan 24 21:38:09 2011
+++ Makefile Mon Jan 24 21:42:57 2011
@@ -50,6 +50,10 @@
RM = /usr/bin/rm -f
endif
+ifeq ($(OSTYPE),OpenBSD)
+LIBS += -lcrypto
+endif
+
ifeq ($(OSTYPE),Darwin)
OSTYPE=darwin
endif
Step 2 - Use "gmake" instead of the standard "make" to build.
|
Thanks, I added your patch to the distribution. |
33
|
Thu Feb 3 23:51:16 2011 |
T. Ribbrock | emgaron+elog@ribbrock.org | Other | Building elog on OpenBSD | Stable | | Two things are required to get elog (tested with 2.8.1) to compile on OpenBSD (tested on OpenBSD 4.8):
Step 1 - Patch Makefile:
--- Makefile~ Mon Jan 24 21:38:09 2011
+++ Makefile Mon Jan 24 21:42:57 2011
@@ -50,6 +50,10 @@
RM = /usr/bin/rm -f
endif
+ifeq ($(OSTYPE),OpenBSD)
+LIBS += -lcrypto
+endif
+
ifeq ($(OSTYPE),Darwin)
OSTYPE=darwin
endif
Step 2 - Use "gmake" instead of the standard "make" to build.
|
39
|
Fri Sep 17 06:19:39 2010 |
Stefan Ritt | stefan.ritt@psi.ch | Script | Custom input forms implementation | Stable | Thu Jul 2 20:55:55 2015 by Stefan Ritt | Dear ELOG users,
starting with SVN revision 2328, custom input forms are implemented. This allows application specific formats for check lists etc. In our specific case we had to implement a shift check list, which was quite long. Furthermore the check list should be optimized for an iPad, which we take in the field and record various checks and readings (in our case some gas pressure gauges at the PSI particle accelerator). Since the standard ELOG interface was too inflexible, a completely hand-written form was needed. The form can be activated by the new configuration options Custom New Form, Custom Edit Form and Custom Display Form, one for a new entry, an entry to edit and and entry to display. In our case we used the same form for all three cases. This is how the shift check list looks under the Safari Browser on a PC:
And here is how it looks on the iPad:
Each section can be collapsed and expanded (blue arrows at the left), and various internal checks are made before the check list can be submitted.
Implementing such forms is however more something for the advanced user, since you have to hand-write HTML with CSS and JavaScript code. It can then however be a powerful method for check lists. Please find in the attachments the elogd.cfg configuration for that logbook and the shiftcheck.html source code file. It is a bit complicated since the page is a static page, elogd just serves it from the file. This requires all the dynamic functions to be implemented inside the HTML file with JavaScript. To display an entry for example, the JavaScript loads the raw data with the "?cmd=Download" command and the populates the form fields. The collapsing and expanding is done by using CSS properties. The integrated style sheet was optimized for the rendering on an iPad. Rather large fonts were chosen so that the items can be checked easily with your finger tips. Various parameters are sent between the browser and the elogd program via hidden fields and cookies. So only something for experts! But if you go through the effort and hand-write the form, it can be very handy. Note that you have to upgrade to SVN revision 2328 for the three new options.
|
Attachment 2: elogd.cfg
|
[global]
Port = 8080
Password file = passwd
[ShiftCheck]
Comment = Shift Check List
Attributes = Author, D, M, Y, Shift, a1, a2, a3, a4, a5, h1, h2, h3, h4, h5, c1, c2, c3, c4, c5, c6, c7, bb1, cr1, cr2, cr3, cr4, cr5, cr6, cr7, cr8, cr9, cr10, cr11, cr12, cr13, cr14, cr15, cr16, cr17, cr18, cr19, cr20, cr21, cr22, cr23, cr24, cr25, cr26, sw1, sw2, sw3, sw4, sw5
Quick filter = Shift, Author
Options Shift = Morning, Evening, Night
Enable attachments = 0
Show text = 0
Custom new form = /home/meg/meg/online/elog/shiftcheck.html
Custom edit form = /home/meg/meg/online/elog/shiftcheck.html
Custom display form = /home/meg/meg/online/elog/shiftcheck.html
List after submit = 1
|
Attachment 4: shiftcheck.html
|
Attachment 5: sc_up.png
|
|
Attachment 6: sc_down.png
|
|
32
|
Fri Feb 19 14:05:53 2010 |
Tony Albers | tony.albers@gmail.com | Other | updated eloglang.danish file | Stable | | I have updated the file. Everything should be translated now.
/tony
#
# Danish translation by Miljan Dedic <mde@HVIDOVRE.DK>
# 04-06-2004
# Updated by Tony Albers <tony.albers@gmail.com>
# 19-02-2010
# A more recent version may be available at :
# http://savannah.psi.ch/websvn/listing.php?repname=elog&path=%2Ftrunk%2Fresources%2F
#
New = Ny
Edit = Ændr
Delete = Slet
Reply = Svar
Find = Find
Last day = Sidste Dag
Last 10 = Sidste 10
Config = Konfigurer
Change password = Ændre Password
Logout = Log Ud
Help = Hjælp
Back = Tilbage
Submit = Send
First = Første
Last = Sidste
Previous = Forrige
Next = Næste
Copy to = Kopier til
Move to = Flyt til
Save = Gem
Cancel = Annuller
Wrong password = Forkert kendeord
Please login = Log Ind
Username = Bruger Navn
Password = Kendeord
Old password = Gamle kendeord
New password = Nyt kendeord
ELOG password = ELOG kendeord
ELOG change password = Ændre ELOG kendeord
Please enter password to obtain write access = Skriv kendeord for at opnå skriveadgang
Please enter password to obtain administration access = Skriv kendeord for at opnå admin adgang
Several logbooks are defined on this host = Flere logbøger er defineret på denne host
Please select the one to connect to = Vælg hvilken du vil have adgang til
Change password for user = Ændr kendeord til bruger
Logged in as = Du er logget ind som
Entry date = Dato for indlæg
with = Med
This is the last entry = Dette er det sidste indlæg
This is the first entry = Dette er det første indlæg
Email sent to = Email sendt til
Email notification suppressed = Send ikke Email
please select = Vælg venligst
Suppress Email notification = Notificér ikke med Email
Attachment = Vedhæft
Reply to this = Svar på denne
In reply to = Som svar på
Fields marked with = Felter markeret med
are required = Er påkrævet
Please check that it exists and elogd has write access = Kontroller venligst om det eksisterer,og om elogd har skriveadgang
Error: Attribute <b>%s</b> not supplied = Fejl: Attribut <b>%s</b> ikke udfyldt
Please go back and enter the <b>%s</b> field = Gå tilbage og udfyld <b>%s</b> feltet
Please use your browser's back button to go back = Brug tilbage knappen på din browser
ELOG find = ELOG søg
Find = Find
Search = Søg
Reset Form = Nulstil Form
Summary only = Kun Beskrivelse
Show attachments = Vis vedhæftede filer
Printable output = Vis Print
Sort in reverse order = Sorter i omvendt rækkefølge
Start date = Start dato
End date = Slut dato
Year = År
Text = Tekst
Search all logbooks = Søg i alle log bøger
Last %d days = Sidste %d dage
Last %d entries = Sidste %d indlæg
No entries found = Ingen indlæg fundet
A new entry has been submitted on %s = Et nyt indlæg af %s
Logbook = Logbog
Yes = Ja
No = Nej
Error deleting message: status = Fejl ved sletning: Status
Error: Command "<b>%s</b>" not allowed = Fejl: kommando "<b>%s</b>" ikke tilladt
Cannot open file <b>%s</b> =kan ikke åbne filen <b>%s</b>
Cannot write to <b>%s</b> = kan ikke skrive til <b>%s</b>
No SMTP host defined in [global] section of configuration file = Ingen SMTP host defineret i [global] sektionen af konfigurationsfilen
Display threads = Vis tråde
Logbook is empty = Logbog er tom
Download = Hent
and all its replies = Og alle Svar
Message ID = Besked-ID
Not logged in = Ikke logget ind
Login = Login
Page %d of %d = Side %d af %d
all entries = alle indlæg
Login name = Brugernavn
Full name = Fulde navn
ELOG user config = ELOG bruger Konfig
ELOG new user = Ny ELOG bruger
Admin = admin
Select user = Vælg bruger
Remove user = Fjern bruger
New user = Ny bruger
Retype new password = Gentag det nye kendeord
New passwords do not match, please retype = kendeord passer ikke, prøv igen
Retype password = Gentag kendeord
exists already = Bruger eksisterer allerede
Register as new user = Opret som ny bruger
A new ELOG user has been registered on %s = En ny bruger er blevet registreret på %s
Email = Email
User "%s" registered on logbook "%s" = Bruger "%s" i Logbog "%s" registreret
User [%s] has been deleted = Bruger [%s] er blevet slettet
Hit following URL to activate that account = Tryk på følgende URL for at aktivere bruger konto
ELOG registration = ELOG Registrering
Your ELOG account has been activated on host = Din ELOG Konto er aktiveret
You can access it at = Du kan opnå adgang på
Are you sure to delete these messages? = Er du sikker på at du vil slette disse beskeder?
Select = Vælg
All entries = Alle indlæg
Day = Dag
Week = Uge
Month = Måned
Show last = Vis Sidste(n)
Goto page = Gå til
All = Alle
Display = Vis
entries per page = Indlæg per side
Toggle all = Vis alle
Selected entries = Vælg Indlæg
Collapse = Fold Sammen
Expand = Fold Ud
Full = Fuld
Summary = Beskrivelse
Threaded = Vis som Tråde
Filters = Filtrer
Mode = Modus
Options = Funktioner
Error: start date after end date = Fejl: Start Dato efter Slut Dato
and all their replies = Og alle deres svar
Upload = Overfør til server
Requested = Rekvirer
Registration request on logbook "%s" = Anmodning om registrering på logbog "%s"
A new ELOG user wants to register on "%s" = Ny Bruger Ønsker At Registrere på "%s" logbogen
Search text also in attributes = Søg også text i attributerne
Date = Dato
ID = ID
Forgot password? = Glemt kendeord?
Email address <i>"%s"</i> not registered = Email Adresse <i>"%s"</i> ikke registreret
ELOG password recovery = Gendan ELOG kendeord
No Email address registered with user name <i>"%s"</i> = Bruger "</i> har ikke registreret mail adresse
Error sending Email via <i>"%s"</i> = Fejl ved afsendelse af e mail via <i>"%s"</i>
A new password for user <i>"%s"</i> has been sent to %s = Et nyt kendeord til Bruger <i>"%s"</i> er sendt til %s
Forgot = Glemt
User "%s" registered on host "%s" = Bruger "%s" på host "%s" registreret
Registration request on host "%s" = Andmodning om registrering på host "%s"
A new password has been created for you on host %s = Et nyt kendeord er genereret på %s
Enter your user name or email address = Skriv venligst Bruger navn eller e mail adresse
Password recovery for ELOG %s = Genskab kendeord for ELOG %s
Host = Host
Your ELOG account has been activated = Din ELOG Konto er aktiveret
Maximum number of attachments reached = Max antal vedhæftninger nået
on = Til
Entry is currently edited by = Indlæg er ved at blive redigeret af
recipients = Modtagere
Suppress shell execution = Ignorer kommando shell
Update = Opdater
by = Af
Change %s = rediger %s
Add new option here = Tilføj ny Funktion
Expand all = Udvid Alle
Add %s = Tilføj %s
User name <i>"%s"</i> not registered = Bruger Navn <i>"%s"<i> ikke registreret
Synchronization = Synkronisering
Error: Value <b>%s</b> not allowed for boolean attributes = Fejl: værdi <b>%s</b> ikke tilladt for bool'ske Attributer
Error: Attribute option <b>%s</b> not existing = Fejl: Attribut Funktion <b>%s</b> eksisterer ikke
Last submission = Sidste Indlæg
Synchronize = Synkroniser
No mirror server defined in configuration file = ingen mirror-Server defineret i konfigurations filen
user = Bruger
Maximum number of replies (%d) exceeded = Max antal svar (%d) overskredet
Entry can only be edited %1.2lg hours after creation = Indlæg kan kun redigeres %1.2lg timer efter oprettelse
Display full entries = Vis alt
No entry selected for deletion = Intet indlæg markeret til sletning
Cannot read entry from local logbook = Kan ikke læse fra lokal logbog
Cannot create socket = Kan ikke oprette socket
Cannot resolve host name "%s" = Host "%s" kan ikke opløses
Cannot connect to host %s, port %d = Kan ikke forbinde til %s, Port %d
Cannot receive "%s" = Kan ikke modtage "%s"
Received wrong entry id "%d" = Modtog forkert ID "%d"
Entry #%d is locked on remote server = Indlæg #%d er låst på remote server
Cannot save remote entry locally = Kan ikke gemme remote indlæg lokalt
local = lokal
remote = remote
Please delete %s or %s entry to resolve conflict = Slet venligst indlæg %s eller %s indlæg for at løse problem
Error sending local entry = Fejl ved afsending af lokalt indlæg
Local entry submitted = Lokalt indlæg indlagt
Error deleting remote entry = Fejl ved sleting af remote indlæg
New entry cannot be written to directory "%s" = Nyt indlæg kan ikke skrives til bibliotek "%s"
Entry %s cannot be read from logbook "%s" = Indlæg %s kan ikke læses fra logbog "%s"
This entry has been deleted = Dette indlæg er slettet
Entries = Indlæg
Cannot connect to remote server "%s" = Kan ikke forbinde til remote server "%s"
Remote server is not an ELOG server = Remote server er ikke en ELOG server
Incorrect remote ELOG server version %s = Forkert Version %s fra remote server
Error accessing remote logbook = Fejl ved adgang til remote server
Invalid HTTP header = Forkert HTTP header
No user name supplied to access remote logbook = Intet bruger navn angivet til remote logbog
Synchronizing logbook %s with server "%s" = Synkroniser %s med server "%s"
Configuration has been changed locally and remotely = Konfigurationen er ændret lokalt og remote
Please merge manually to resolve conflict = Sammensmelt manuelt for at løse konflikt
Logbook "%s" does not exist on remote server = Logbog "%s" eksisterer ikke på remote server
Entry has been changed locally and remotely = Indlæg er ændret lokalt og remote
Entry deleted locally = Indlæg slettet lokalt
Changed local entry ID to %d = lokalt indlæg ID til %d
Entry deleted remotely = Indlæg slettet remote
All entries identical = Alle indlæg identiske
Invalid mirror_id or entry_date = Ugyldigt mirror_id eller indlæg_dato
Synchronize all logbooks = Synkroniser alle logbøger
Calendar = Kalender
Remote entry received = Remote indlæg modtaget
Pick a date = Vælg dato
Please select at least one '%s' = Vælg mindst en '%s'
Please select a '%s' = Vælg en '%s'
Please enter month for attribute '%s' = Vælg måned for attribut '%s'
Please enter day for attribute '%s' = Vælg dag for attribut '%s'
Please enter year for attribute '%s' = Vælg år for attribut '%s'
Please enter attribute '%s' = Vælg attribut '%s'
Entry time = Dato/Tid
Start = Start
End = Slut
From = Fra
After = Efter
to = Til
Before = før
Previous Year = Forrige år
Next Year = Næste år
Please enter numeric value for '%s' = Indsæt numerisk værdi for '%s'
Error: Attribute <b>%s</b> must be numeric = Felj: Attribut <b>%s</b> skal være en numerisk værdi
3 Months = 3 måneder
6 Months = 6 måneder
Error sending local message = Fejl ved adsendelse af lokalt besked
Error receiving message = Fejl ved modtagelse af besked
Are you sure to delete this entry? = Er du sikker på at du vil slette dette indlæg?
ELOG CSV import = ELOG CSV Import
Import = Import
CSV filename = CSV filnavn
Field separator = Felt Separator
Edit entry = Rediger Felt
Delete entry = Slet Felt
CSV Import = CSV Import
Derive attributes from CSV file = Hent attributer fra CSV fil
Comma = Komma
Semicolon = Semikolon
Preview import = Forhåndsvis Import
CSV import preview of %s = CSV import forhåndsvisning af %s
Too many attributes in CSV file = For mange attributter i CSV fil
%d entries successfully imported = %d indlæg successfuldt importeret
No 'Attributes' option present in %s = Ingen 'Attributter' funktioner tilstede i %s
CSV ("," separated) = CSV ("," separeret)
CSV (";" separated) = CSV (";" separaret)
Auto detect = Auto detektion
Resubmit as new entry = send som nyt indlæg
#
#---- please translate following items and then remove this comment ----#
#
text = tekst
Column header '%s' must be present in CSV file = Kolonneoverskrift '%s' skal være tilstede i CSV filen
Fill text body = Brødteks
Please re-enter filename = Genindtast venligst filnavnet
New = Ny
Last x = Sidste x
Activate = Aktiver
Entry has been modified = Indlægget er blevet modificeret
No attachment file specified = Der er ikke specificeret en fil til vedhæftning
Submit modified ELOG entry? = Publicer modificeret ELOG indlæg
Delete this logbook = Slet denne logbog
Rename this logbook = Omdøb denne logbog
Create new logbook = Opret ny logbog
Syntax error in config file = Indtastningsfejl i konfigurationsfilen
Email notification = Email notifikation
Are you sure to delete logbook "%s"? = Er du sikker på at du vil slette logbogen ''%s''?
Logbook "%s" exists already, please choose different name = Logbogen ''%s'' findes allerede, vælg venligst et andet navn
Rename logbook = Omdøb logbog
Enter new logbook name = Indtast nyt navn på logbog
Logbook name = Logbog navn
Use existing logbook as template = Brug eksisterende logbog som skabelon
none = ingen
URL is redirected to: = URL er henvist til
Remote config should be received = Fjernkonfiguration skulle blive modtaget
Local entry should be submitted = Lokalt indlæg bør afsendes
Remote entry should be received = Fjernindlæg bør modtages
Local entry = Lokalt indlæg
%s should be deleted = %s bør slettes
Entry should be deleted locally = Indlæg bør slettes lokalt
Local entry ID should be changed to %d = Lokalt indlægs ID bør ændres til %d
Remote entry = Fjernindlæg
Entry should be deleted remotely = Indlæg bør slettes på fjernlokation
Click here to delete this entry = Tryk her for at slette dette indlæg
Maximum number of attribute options exceeded = Maximalt tilladt antal atributmuligheder overskredet
Please increase MAX_N_LIST in elogd.c and recompile = Forøg venligst MAX_N_LIST i elogd.c og kompiler igen
You can "steal" the lock by editing this entry = Du kan ''stjæle'' låsen ved at modoficere dette indlæg
Several logbooks groups are defined on this host = Der er adskillige logbogsgrupper defineret på dette system
Please select one to list the logbooks in that group = Vælg venligst en gruppe for at se dens logbøger
No logbook defined on this server = Der er ikke defineret en logbog på dette system
Goto ELOG home page = Gå til ELOG's hjemmeside
Please enter "%s" = Indtast venligst ''%s''
Change config file = Ændr konfigurationsfil
Click here to delete %d entries = Tryk her for at slette %d indlæg
Please check that it exists and elogd has write access and disk is not full = Kontroller venligst at elogd har skriveadgang og at der er ledig plads på harddisken
Show = Vis
Hide = Skjul
Hide all = Skjul alle
Show all = Vis alle
This logbook requires authentication = Denne logbog behøver opmærksomhed
Attachment file <b>"%s"</b> empty or not found = Vedhæftet fil <b>''%s''</b> er tom eller kunne ikke findes
Case sensitive = Forskel på store og små bogstaver
List = Liste
Date must be between 1970 and 2037 = Dato skal være mellem 1970 og 2037
up = op
down = ned
stop = stands
Entry = Indlæg
name may not contain blanks = Der må ikke være mellemrum i navnet
regular expressions = regulære udtryk
Text fields are treated as %s = Teksfelter behandles som %s
Subscribe to logbooks = Abonnér på logbøger
enable automatic email notifications = aktiver emailnotifikationer
Set all = Sæt alle
Set none = Sæt ingen
Please enter hour for attribute '%s' = Indtast venligst timetal for attribut '%s'
Please enter minute for attribute '%s' = Indtast venligst minuttal for attribut '%s'
Please enter second for attribute '%s' = Indtast venligst sekundtal for attribut '%s'
No admin user has been defined in configuration file = Der er ikke defineret en administrator i konfigurationsfilen
Duplicate = Dupliker
Cannot lookup server name = Servernavn kan ikke slås op
Cannot connect to server = Der kan ikke forbindes til serveren
%s wrote = %s skrev
Quote = Citat
Insert current time = Indtast nuværende tidspunkt
Please enter numeric value for year of attribute '%s' = Indtast venligst numerisk værdi for årstal i attributten '%s'
Preview = Forhåndsvisning
FONT = FONT
SIZE = STØRRELSE
COLOR = FARVE
smiling = smiler
happy = lykkelig
winking = blinker
big grin = griner
crying = græder
cool = kølig
frowning = vrænger ansigt
confused = forvirret
mad = gal
pleased = glad
tongue = rækker tunge
yawn = gaber
Encoding = Formattering
User "%s" not found in password file = Brugeren ''%s'' blev ikke fundet i password filen
Cannot write to file <b>%s</b> = Kan ikke skrive til filen <b>%s</b>
Really remove user %s? = Er du sikker på at du vil slette brugeren %s?
Invalid user name "%s" or password for remote logbook = Ugyldigt brugernavn eller kodeord til fjernlogbog
Hide attachments = Skjul vedhæftninger
Show only new entries = Vis kun nye indlæg
Show all entries = Vis alle indlæg
New entries since = Nye indlæg siden
An old ELOG entry has been updated = Et gammelt ELOG indlæg er blevet opdateret
A new ELOG entry has been submitted = Et nyt ELOG indlæg er blevet publiceret
Cannot open file "%s" = Kan ikke åbne filen ''%s''
Invalid user name or password = Ugyldigt brugernavn eller kodeord
Upload image = Send billede
Please enter filename or URL = Indtast venligst filnavn eller URL
Maximum allowed file size is = Den størst tilladte filstørrelse er
Enter filename or URL = Indtast filnavn eller URL
Image uploaded successfully = Billedet er korrekt overført
Image "%s" uploaded successfully = Billedet ''%s'' er korrekt overført
HelpELCode = HjælpELKode
Cannot retrieve file from URL "%s" = Filen kan ikke hentes fra URL ''%s''
Enter name of hyperlink = Indtast hyperlink navn
Enter URL of hyperlink = Indtast hyperlink URL adresse
astonished = forbløffet
Error in regular expression "%s" = Fejl i regulært udtryk ''%s''
File not found at URL "%s" = Filen blev ikke fundet på URL ''%s''
Entry size too large for email notification = Indlæggets størrelse er for stort til email-notifikation
Please specify a valid email address = Specificer venligst en gyldig email adresse
Cannot send email notification to "%s" = Kan ikke sende email-notifikation til ''%s''
Error: Command "<b>%s</b>" is not allowed for user "<b>%s</b>" = Fejl: Kommando ''<b>%s</b>'' er ikke tilladt for bruger ''<b>%s</b>''
Shell execution not enabled via -x flag = Kommandofortolkerudførelse er ikke slået til med -x flaget
Enter heading level (1, 2 or 3) = Indtast overskiftsniveau (1, 2 eller 3)
User name may not contain blanks = Der må ikke være mellemrum i brugernavnet
Empty password not allowed = Tomme kodeord er ikke tilladt
Password may not contain blanks = Kodeord må ikke indeholde mellemrum
Anonymous = Anonym
Activation notice has been sent to %s = Notifiakation om aktivering er sendt til %s
Your request has been forwarded to the administrator = Din forespørgsel er sendt videre til en administrator
You will be notified by email upon activation of your new account = Du vil få besked i en email når din konto er aktiveret
Select period = Vælg periode
Last week = Sidste uge
Last month = Sidste måned
Last 3 Months = Sidste 3 måneder
Last 6 Months = Sidste 6 måneder
Last Year = Sidste år
Enter %s = Indtast %s
Select %s = Vælg %s
Bold text CTRL+B = Fed tekst CTRL+B
Italics text CTRL+I = Kursiv tekst CTRL+I
Underlined text CTRL+U = Understreget tekst CTRL+U
Centered text = Centreret tekst
Insert hyperlink = Indsat hyperlink
Insert email = Indtast email
Insert image CTRL+M = Indsæt billede CTRL+M
Insert quote = Indsæt citat
Insert list CTRL+L = Indsæt liste CTRL+L
Insert table = Indsæt tabel
Insert heading CTRL+H = Indsæt overskrift CTRL+H
Insert code CTRL+O = Indsæt kode CTRL+O
Hide the smiley bar = Skjul smileymenu
Show the smiley bar = Vis smileymenu
Insert current time/date = Indtast nuværende tidspunkt/dato
Entry is locked on local server and therefore skipped = Indlægget er låst på det lokal system og springes derfor over
Keep me logged in on this computer = Lad mig blive ved at være logget ind på denne maskine
for the next %d minutes = i de næste %d minutter
for the next hour = i den næste time
for the next %d hours = i de næste %d timer
for the next %d days = i de næste %d dage
keep original values = gem oprindelige værdier
Entry is locked = Indlæg er låst
Edit anyhow = Ret alligevel
Submit entry = Publicer indlæg
Insert image = Indsæt billede
Insert Date/Time = Indsæt dato/tid
Insert horizontal line = Indsæt horisontal linje
Insert anchor point = Indsæt ankerpunkt
keep original text = behold oprindelig tekst
unspecified = uspecificeret
To subscribe to any logbook, click on 'Config' in that logbook = For at abonnere på en logbog, vælg 'konfigurer' i denne logbog
ELOG XML import = ELOG XML import
Derive attributes from XML file = Afled attributter fra XML fil
XML filename = XML filnavn
Invalid date format = Ugyldigt datoformat
XML file does not contain %s element = XML filen indeholder ikke elementet %s
XML import preview of %s = XML import forhåndsvisning af %s
XML Import = XML Import
A old entry has been updated on %s = Et gammelt indlæg er blevet opdateret den %s
This entry has in meantime been locked by %s = Dette indlæg er i mellemtiden bleve låst af %s
This entry has in meantime been modified by someone else = Dette indlæg er i mellemtiden blevet modificeret af en anden bruger
First entry, Ctrl-Home = Første indlæg, Ctrl-Home
Previous entry, Ctrl-PgUp = Foregående indlæg, Ctrl-PgUp
Next entry, Ctrl-PgDn = Næste indlæg, Ctrl-PgDn
Last entry, Ctrl-End = Sidste indlæg, Ctrl-End
ELOG import = ELOG import
Please choose format to import: = Vælg det format der skal importeres
Enter text = Indtast tekst
Show HTML source code = Vis HTML kildekode
or until I log out = indtil jeg logger ud
Make smaller = Gør mindre
Original size = Oprindelig størrelse
Make larger = Gør større
Rotate left = Rotér til venstre
Rotate right = Rotér til højre
Delete attachment = Slet vedhæftning
Cannot create thumbnail, please check ImageMagick installation = Kan ikke danne oversigtsbilleder, kontroller at ImageMagick er korrekt installeret
Please log on by clicking on following link and change your password = Log venligst på ved at trykke på følgende link og ændr dit kodeord
Attachments = Vedhæftninger
Error: Content length (%d) larger than maximum content length (%d) = Fejl: Længde af indhold (%d) er større end maksimalt tilladt (%d)
ELOG error = ELOG fejl
Only user <b>%s</b> can edit this entry = Kun brugeren <b>%s</b> kan rette i dette indlæg
Export to = Eksporter til
Do not ignore first line = Ignorer ikke første linje
Last %d hours = Sidste %d timer
Invalid URL = Ugyldig URL
Attribute "%s" is not allowed in config file = Attributten ''%s'' er ikke tilladt i konfigurationsfilen
Only user <b>%s</b> can delete this entry = Kun bruger <b>%s</b> kan slette dette indlæg
File system full, ELOG cannot continue to work = Filsystemet er løbet fuld, ELOG kan ikke fortsætte
|
31
|
Tue Dec 15 20:11:27 2009 |
Michel Bovey | bovey (a) slf ch | Documentation | Sorting dates before and after "Sun Sep 9 > 03:46:39 CEST 2001" | Alpha | | BACKGROUNG
ELOG is storage date and time in unix time: seconds after epoch (Thu Jan 1 00:00:00 UTC 1970).
date -u -d @0
On "Sun Sep 9 03:46:39 CEST 2001" the unix time counter is passing from a presentation of 9 digits to 10 digits.
date -d @999999999
ISSUE
For sorting dates ELOG is using the character representation of the unix time. When ELOG contains dates on both
side of this 9 - 10 digits border sorting get confused.
WORKAROUND
in adding a leading 0 (zero) to the internal storage of dates in ELOG files we get over this problem.
On unix based system in can be easily achived with a sed command against the .log files:
sed -i 's/modification: 9/modification: 09/g' *.log |
30
|
Mon Jul 20 14:23:56 2009 |
Stefan Ritt | stefan.ritt@psi.ch | Script | Doing mathematical calculations with attributes | Stable | | Following entry was written by Richard Stamper. I moved it here for persistency:
On the matter of automatic calculation of fields, it is possible using included javascript but you have to do the work yourself. For example, we have a log which computes responsivity as the ratio of a photocurrent and optical power. With log attributes called "Photocurrent", "Optical Power" and "Responsivity" there is a file in the logbooks directory called photomixer_javascript.html containing something like:
<script>
if (document.form1.Photocurrent) {
document.form1.Photocurrent.onchange = new Function(
"mod();"+
"var power = parseFloat(document.form1.Optical_Power.value);"+
"var current = parseFloat(document.form1.Photocurrent.value);"+
"if (!isNan(power) && !isNan(current) && power != 0.0) {"+
" document.form1.Responsivity.value = Math.round(current/power*100)/100.0"+
"}"
);
document.form1.Optical_Power.onchange = document.form1.Photocurrent.onchange;
}
</script>
and the elogd.cfg file includes
Bottom text = photomixer_javascript.html
for the relevant log.
The assignments to the onchange handlers are guarded because this javascript is included on all pages for that log, including the list pages where there is no such field as Photocurrent, (or Optical_Power) and the event handler function is defined dynamically for the same reason.
|
29
|
Thu Nov 27 11:43:32 2008 |
T. Ribbrock | emgaron+elog@ribbrock.org | Script | /etc/init.d/elog script for Debian-like distros | Stable | | The attached script was used by the Debian package (which is no longer maintained) to start/stop elogd. I have changed it based on some comments in the forum (see script) to add some more functionality. As there is no mainatined elog package for Debian anymore, I'm placing it here in the hope that it might come in handy for users who want to run elog under Debian.
This script needs to be placed in /etc/init.d and expects elogd to be installed as /usr/sbin/elogd (can be changed, of course). |
Attachment 1: elog
|
#!/bin/sh
# Init script for ELOG.
# Copyright © 2003, 2005 Recai Oktaş <roktas@omu.edu.tr>
#
# Additional changes by Thomas Ribbrock <emgaron@ribbrock.org>
# - 2008-11-27: Added better reload functionality, based on suggestion and
# code from Yoshio Imai as posted in elog forum
#
# Licensed under the GNU General Public License, version 2.
# See the file `http://www.gnu.org/copyleft/gpl.txt'.
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/elogd
NAME=elogd
DESC="ELOG daemon"
test -f $DAEMON || exit 0
set -e
# Admin should be able to lock some options.
if [ -f /etc/default/elog ]; then
. /etc/default/elog
fi
# To be in the safe side, the followings should be always defined.
PIDFILE=${PIDFILE:-/var/run/$NAME.pid}
CONFFILE=${CONFFILE:-/etc/elog.conf}
# Add the options to argument list only if defined previously. Since
# some options may also be present in the conffile, we couldn't preset
# those options which would otherwise overwrite the settings in the
# conffile. Also note that, all have reasonable compiled-in defaults.
ARGS="${PIDFILE+"-f $PIDFILE"} \
${CONFFILE+"-c $CONFFILE"} \
${LOGBOOKDIR+"-d $LOGBOOKDIR"} \
${RESOURCEDIR+"-s $RESOURCEDIR"} \
${PORT+"-p $PORT"} \
${HOST+"-n $HOST"} \
${VERBOSE+"-v"}"
# Always run as a daemon.
ARGS=`echo $ARGS -D`
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $ARGS 2>&1
sleep 1
if [ -f "$PIDFILE" ] && ps h `cat "$PIDFILE"` >/dev/null; then
echo "$NAME."
else
echo "$NAME failed to start; check syslog for diagnostics."
exit 1
fi
;;
stop)
echo -n "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $ARGS 2>&1
echo "."
;;
reload)
# Send HUP signal to reload config file
# (Only needed if config is edited manually and not via
# webinterface)
if [ -f $PIDFILE ]; then
echo -n "$DESC to reread config file ... "
kill -HUP `cat "$PIDFILE"`
echo "done"
else
echo "No $PIDFILE found!"
fi
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
if [ "$?" != "0" ]; then
exit 1
fi
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
# vim:ai:sts=8:sw=8:
|
28
|
Fri Mar 28 10:23:50 2008 |
svrmarty | svrmarty@gmx.net | Other | ELOG V2.7.3-2080 debian amd64 package | Stable | Fri Mar 28 10:23:55 2008 by svrmarty | |
Attachment 1: elog_2.7.3+r2080-1_amd64.deb
|
27
|
Tue Jan 29 23:18:39 2008 |
Diogo Alves | diogomiguelalves@gmail.com | Script | Multiple file upload for Firefox | Stable | Wed Jan 30 07:56:53 2008 by Stefan Ritt | Here's a firefox extension that works extremely well if one uses drag n'drop to upload several attachment files at once:
https://addons.mozilla.org/en-US/firefox/addon/219
|
26
|
Mon Jul 16 16:43:07 2007 |
Peter Rienstra | peter.rienstra@gmail.com | Other | Re: Compiling elogd.c on HP-UX 64 bit | Beta | Thu Jul 12 09:38:47 2007 by Peter Rienstra |
I downloaded revision 1888. There were no problems compiling it. It's running on the HP-UX system now and everything seems to work fine. |
25
|
Mon Jul 16 15:57:47 2007 |
Stefan Ritt | stefan.ritt@psi.ch | Other | Re: Compiling elogd.c on HP-UX 64 bit | Beta | Thu Jul 12 09:38:47 2007 by Peter Rienstra |
Peter Rienstra wrote: | HP-UX doesn't have the "seteuid" and "setegid" functions. But there are "setuid+setgid", "setreuid+setregid" and "setresuid+setresgid" functions available. |
I had a look and found that setreuid/setregid is also available under Linux, so I use those functions instead, which should also work on HP-UX. Can you check revision 1888 (http://savannah.psi.ch/viewcvs/trunk/src/elogd.c?root=elog&rev=1888), compile it and see if you can run it at least under your non-root account. |
24
|
Mon Jul 16 15:27:08 2007 |
Peter Rienstra | peter.rienstra@gmail.com | Other | Re: Compiling elogd.c on HP-UX 64 bit | Beta | Thu Jul 12 09:38:47 2007 by Peter Rienstra | Stefan,
First I want to say I really like your program. We work in a small group of 5 database administrators, and this is exactly what we need to inform each other. Elog is simple but very functional, so thanks!
My problem is that I don't have root access to the HP-UX machines. We don't run elogd as root, so I wasn't really interested in the seteuid functionality, I just wanted to compile and run the program.
HP-UX doesn't have the "seteuid" and "setegid" functions. But there are "setuid+setgid", "setreuid+setregid" and "setresuid+setresgid" functions available. I'm not sure which one is the best to use. I uploaded the manpages as attachment. I hope this will help you.
If you want I can do a compile and run test on HP-UX with your altered source code. But I can't do a test with "root".
Stefan Ritt wrote: | I applied most of your patches to the elog source code, SVN revision 1885. The only missing piece has to do with seteuid/setuid. I definitively need seteuid for linux, because elogd might be started under root, then it falls back to an optional elog user. But when it stops, it has to restore the original root user in order to delete the PID file (/var/run/elogd.pid) which was created under root. If seteuid does not exist under HP-UX, you should add something like
#ifdef HP-UX
setuid(...)
#else
seteuid(...)
#endif
Probably the HP-UX has to be something else, but I cannot test this since I don't have such an OS here. Once you get this working I can put it into the standard distribution. |
|
Attachment 1: man_setuid.txt
|
setuid(2) setuid(2)
NAME
setuid(), setgid() - set user and group IDs
SYNOPSIS
#include <unistd.h>
int setuid(uid_t uid);
int setgid(gid_t gid);
DESCRIPTION
setuid() sets the real-user-ID (ruid), effective-user-ID (euid),
and/or saved-user-ID (suid) of the calling process. If the Security
Containment product is installed, these interfaces treat a process
observing CHSUBJIDENT as a privileged process. Otherwise, only
processes with an euid of zero are treated as privileged processes.
See privileges(5) for more information on Security Containment and
fine-grained privileges.
The following conditions govern setuid's behavior:
+ If the process is privileged, setuid() sets the ruid, euid,
and suid to uid.
+ If the process is not privileged and the argument uid is equal
to the ruid or the suid, setuid() sets the euid to uid; the
ruid and suid remain unchanged. (If a set-user-ID program is
not running as superuser, it can change its euid to match its
ruid and reset itself to the previous euid value.)
+ If the process is not privileged, the argument uid is equal to
the euid, and the calling process has the PRIV_SETRUGID
privilege, setuid() sets the ruid to uid; the euid and suid
remain unchanged.
setgid() sets the real-group-ID (rgid), effective-group-ID (egid),
and/or saved-group-ID (sgid) of the calling process. The following
conditions govern setgid()'s behavior:
+ If the process is privileged, setgid() sets the rgid and egid
to gid.
+ If the process is not privileged and the argument gid is equal
to the rgid or the sgid, setgid() sets the egid to gid; the
rgid and sgid remain unchanged.
+ If the process is not privileged, the argument gid is equal to
the egid, and the calling process has the PRIV_SETRUGID
privilege, setgid() sets the rgid to gid; the egid and sgid
remain unchanged.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: May 2006
setuid(2) setuid(2)
Security Restrictions
Some or all of the actions associated with this system call require
the CHSUBJIDENT privilege. Processes owned by the superuser have this
privilege. Processes owned by other users may have this privilege,
depending on system configuration.
See privileges(5) for more information about privileged access on
systems that support fine-grained privileges.
RETURN VALUE
Upon successful completion, setuid() and setgid() return 0; otherwise,
they return -1 and set errno to indicate the error.
ERRORS
setuid() and setgid() fail and return -1 if any of the following
conditions are encountered:
[EPERM] None of the conditions above are met.
[EINVAL] uid (gid) is not a valid user (group) ID.
WARNINGS
It is recommended that the PRIV_SETRUGID capability be avoided, as it
is provided for backward compatibility. This feature may be modified
or dropped from future HP-UX releases. When changing the real user ID
and real group ID, use of setresuid() and setresgid() (see
setresuid(2)) is recommended instead.
AUTHOR
setuid() was developed by AT&T, the University of California,
Berkeley, and HP.
setgid() was developed by AT&T.
SEE ALSO
exec(2), getuid(2), setresuid(2), privileges(5).
STANDARDS CONFORMANCE
setuid(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
setgid(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: May 2006
|
Attachment 2: man_setreuid.txt
|
setreuid(2) setreuid(2)
NAME
setreuid - set real and effective user IDs
SYNOPSIS
#include <unistd.h>
int setreuid(uid_t ruid, uid_t euid);
DESCRIPTION
The setreuid() function sets the real and effective user IDs of the
current process to the values specified by the ruid and euid
arguments. If ruid or euid is -1, the corresponding effective or real
user ID of the current process is left unchanged.
A process with appropriate privileges can set either ID to any value.
An unprivileged process can only set the effective user ID if the euid
argument is equal to either the real, effective, or saved user ID of
the process.
It is unspecified whether a process without appropriate privileges is
permitted to change the real user ID to match the current real,
effective or saved user ID of the process.
RETURN VALUE
Upon successful completion, 0 is returned. Otherwise, -1 is returned
and errno is set to indicate the error.
ERRORS
The setreuid() function will fail if:
[EINVAL] The value of the ruid or euid argument
is invalid or out-of-range.
[EPERM] The current process does not have
appropriate privileges, and either an
attempt was made to change the effective
user ID to a value other than the real
user ID or the saved set-user-ID or an
attempt was made to change the real user
ID to a value not permitted by the
implementation.
SEE ALSO
getuid(2), setuid(2), <unistd.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: August 2003
|
Attachment 3: man_setresuid.txt
|
setresuid(2) setresuid(2)
NAME
setresuid, setresgid - set real, effective, and saved user and group
IDs
SYNOPSIS
#include <unistd.h>
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
DESCRIPTION
setresuid() sets the real, effective and/or saved user ID of the
calling process.
If the current real, effective or saved user ID is equal to that of a
user having appropriate privileges, setresuid() sets the real,
effective and saved user IDs to ruid, euid, and suid, respectively.
Otherwise, setresuid() only sets the real, effective, and saved user
IDs if ruid, euid, and suid each match at least one of the current
real, effective, or saved user IDs.
If ruid, euid, or suid is -1, setresuid() leaves the current real,
effective or saved user ID unchanged.
setresgid() sets the real, effective and/or saved group ID of the
calling process.
If the current real, effective or saved user ID is equal to that of a
user having appropriate privileges, setresgid() sets the real,
effective, and saved group ID to rgid, egid, and sgid, respectively.
Otherwise, setresgid() only sets the real, effective and saved group
ID if rgid, egid, and sgid each match at least one of the current
real, effective or saved group ID.
If rgid, egid, or sgid is -1, setresgid() leaves the current real,
effective or saved group ID unchanged.
Security Restrictions
Some or all of the actions associated with this system call require
the PRIV_CHSUBJIDENT privilege (CHSUBJIDENT). Processes owned by the
superuser will have this privilege. Processes owned by other users
may have this privilege, depending on system configuration. See
privileges(5) for more information about privileged access on systems
that support fine-grained privileges.
RETURN VALUE
Upon successful completion, setresuid() and setresgid() return 0;
otherwise, they return -1 and set errno to indicate the error.
Hewlett-Packard Company - 1 - HP-UX 11i Version 2: May 2005
setresuid(2) setresuid(2)
ERRORS
setresuid() and setresgid() fail if any of the following conditions
are encountered:
[EINVAL] ruid, euid, or suid (rgid, egid, or sgid) is not a
valid user (group) ID.
[EPERM] None of the conditions above are met.
AUTHOR
setresuid() and setresgid() were developed by HP.
SEE ALSO
exec(2), getuid(2), setuid(2).
Hewlett-Packard Company - 2 - HP-UX 11i Version 2: May 2005
|
23
|
Fri Jul 13 12:36:45 2007 |
Stefan Ritt | stefan.ritt@psi.ch | Other | Re: Compiling elogd.c on HP-UX 64 bit | Beta | Thu Jul 12 09:38:47 2007 by Peter Rienstra | I applied most of your patches to the elog source code, SVN revision 1885. The only missing piece has to do with seteuid/setuid. I definitively need seteuid for linux, because elogd might be started under root, then it falls back to an optional elog user. But when it stops, it has to restore the original root user in order to delete the PID file (/var/run/elogd.pid) which was created under root. If seteuid does not exist under HP-UX, you should add something like
#ifdef HP-UX
setuid(...)
#else
seteuid(...)
#endif
Probably the HP-UX has to be something else, but I cannot test this since I don't have such an OS here. Once you get this working I can put it into the standard distribution. |
22
|
Wed Jul 11 11:13:16 2007 |
Peter Rienstra | peter.rienstra@gmail.com | Other | Compiling elogd.c on HP-UX 64 bit | Beta | Thu Jul 12 09:38:47 2007 by Peter Rienstra | We succeeded in compiling and running elogd (elog-2.6.5) on HP-UX 64 bit Itanium platform (HP-UX B.11.23 U ia64).
The main problem was we got a core dump after starting elogd. The cause was that the memory has be allocated with a 4 byte boundary. This could be the case on other 64 bit platforms as well. A colleague of mine (Sander Notting) found the solution.
Unzip and untar the zip file (elog-latest.tar.gz)
Go to the src directory (elog-2.6.5/src)
Edit elogd.c
Replace all:
show_selection_page(NULL); => show_selection_page();
seteuid => setuid
setegid => setgid
On line 564:
void *buffer => char *buffer
Line 645, add the text in bold:
void *xmalloc(size_t bytes)
{
char *temp;
/* Align buffer on 4 byte boundery for HP UX and other 64 bit systems to prevent Bus error(core dump)*/
if (bytes & 3)
bytes += 4 - (bytes & 3);
temp = (char *) malloc(bytes + 12);
After that compile:
cc -w -c -o regex.o regex.c
cc -w -c -o mxml.o ../../mxml/mxml.c
cc -w -c -o strlcpy.o ../../mxml/strlcpy.c
cc -I../../mxml -o elogd elogd.c regex.o mxml.o strlcpy.o
We didn't try to run elogd under root yet. |
Attachment 1: elogdhpux64.c.gz
|
21
|
Tue Feb 20 18:20:40 2007 |
Val Schmidt | vschmidt@ldeo.columbia.edu | Documentation | Secure elog with SSL under Apache2 on Ubuntu | Stable | | The steps for configuration under Apache2 are a bit different. Below I've included a quick list of instructions for Ubuntu. One nice thing about this method, is that only https requests to https://your.url/elog are redirected (not all https connections to your url) so you can have other services running under ssl:
My Setup:
Ubuntu 6.10 (Edgy):
Linux tide1 2.6.17-11-generic #2 SMP Thu Feb 1 19:52:28 UTC 2007 i686 GNU/Linux
Packages:ii apache2 2.0.55-4ubuntu4 next generation, scalable, extendable web se
ii apache2-common 2.0.55-4ubuntu4 next generation, scalable, extendable web se
ii apache2-mpm-worker 2.0.55-4ubuntu4 high speed threaded model for Apache2
ii apache2-utils 2.0.55-4ubuntu4 utility programs for webservers
ii elog 2.6.1+r1642-1 Logbook system to manage notes through a Web ---
To setup ssl in apache2 for elog I started here:
This min-howto was kindly provided in a forum. I reproduced it here without permission.
A Mini-Howto for apache2:
apt-get install apache2
apache2-ssl-certificate
(and answer the questions)
Now, enable ssl:
a2enmod ssl
configure ssl:
cp /etc/apache2/sites-available/default /etc/apache2/sites-available/ssl
ln -s /etc/apache2/sites-available/ssl /etc/apache2/sites-enabled/ssl
"/etc/apache2/sites-enabled/ssl" should look like this:
NameVirtualHost *:443
<VirtualHost *:443>
(... configure the directories too...)
and "/etc/apache2/sites-enabled/default" should look like this:
NameVirtualHost *:80
<VirtualHost *:80>
(... configure the directories too...)
In /etc/apache2/ports.conf, add Listen 443
In the middle of /etc/apache2/sites-available/ssl file, insert this two lines:
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
Hope it helps :)
This method, without configuraiton of any of the <Directory> directives in /etc/apache2/sites-available/ssl, makes everything in /var/www https accessible. This may not be desirable. Configure the directives as you see fit.
To get SSL forwarding going for elog, in /etc/apache2/sites-available/ssl, I added the following:
ServerName tide1.unh.edu
ProxyRequests Off
ProxyPreserveHost On
<Location /elog/>
Order allow,deny
allow from all
ProxyPass http://tide1.unh.edu:8080/
ProxyPassReverse http://tide1.unh.edu:8080/
SSLRequireSSL
</Location>
Once this is in place one must restart apache with
sudo /etc/init.d/apache2 force-reload
In /etc/elog.conf I added:
URL=https://tide1.unh.edu/elog
and restarted elog as above.
Finally, I removed the firewall entry that allowed connections to port 8080 for non-secure elog.
Items of note:
The "apache2-ssl-certificate" created a certificate that seems to expire in 30 days. This obviously not ideal. More details about how to create certificates can be found at HERE. At some point in the future, we'll have to figure this out and create a more appropriate certificate. |
|