Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 4 of 793  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subject
  69747   Tue Feb 27 06:59:06 2024 Reply Antonio Bulgheroniantonio.bulgheroni@gmail.comQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm

Many thanks for all your efforts!

Laurent Jean-Rigaud wrote:

Hi Stefan,

Nice to have up to date RPMs.

For .DEB, I contact the Ubuntu maintainer for its build script, and cool, he replied that he's searching for it. That's could help me to generate the deb more rapidly...

For Windows target, It's supported in Bitbucket but only with private agent :-(

So I tried to build using docker hub MSVC image (abrarov/msvc-2019) but pipeline fails to retrieve the image. Maybe I need to swipe on alternative images, or these images with MS software are unaccepted from Atlassian...

Also, I tried to crosscompiling ELOG Win32 from Linux with g++-mingw-w64-x86-64, but Makefile/sources need to be patched to manage this 'platform'... For the moment, it fails. :-(

Next solution : use Wine in Debian image to build Elog with mingwin as I know that it works (under Windows :-)). Will be tested after all...

.

Laurent

Stefan Ritt wrote:

Many thanks for your files and instructions. I integrated this into the official elog pipeline, so now the RPMs can be downloaded from https://elog.psi.ch/elog/download.html and they will be updated automatically after each commit. If you succeed with any Debian/Ubunto I'm happy to add that. What's missing now is an easy way to compile for Windows (which I don't have anymore).

Stefan

 

 

  69746   Mon Feb 26 22:23:05 2024 Reply Laurent Jean-Rigaudlollspam@free.frQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm

Hi Stefan,

Nice to have up to date RPMs.

For .DEB, I contact the Ubuntu maintainer for its build script, and cool, he replied that he's searching for it. That's could help me to generate the deb more rapidly...

For Windows target, It's supported in Bitbucket but only with private agent :-(

So I tried to build using docker hub MSVC image (abrarov/msvc-2019) but pipeline fails to retrieve the image. Maybe I need to swipe on alternative images, or these images with MS software are unaccepted from Atlassian...

Also, I tried to crosscompiling ELOG Win32 from Linux with g++-mingw-w64-x86-64, but Makefile/sources need to be patched to manage this 'platform'... For the moment, it fails. :-(

Next solution : use Wine in Debian image to build Elog with mingwin as I know that it works (under Windows :-)). Will be tested after all...

.

Laurent

Stefan Ritt wrote:

Many thanks for your files and instructions. I integrated this into the official elog pipeline, so now the RPMs can be downloaded from https://elog.psi.ch/elog/download.html and they will be updated automatically after each commit. If you succeed with any Debian/Ubunto I'm happy to add that. What's missing now is an easy way to compile for Windows (which I don't have anymore).

Stefan

 

  69745   Mon Feb 26 21:18:23 2024 Reply Antonio Bulgheroniantonio.bulgheroni@gmail.comQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm

+1 for a Windows pipeline!

 

Stefan Ritt wrote:

Many thanks for your files and instructions. I integrated this into the official elog pipeline, so now the RPMs can be downloaded from https://elog.psi.ch/elog/download.html and they will be updated automatically after each commit. If you succeed with any Debian/Ubunto I'm happy to add that. What's missing now is an easy way to compile for Windows (which I don't have anymore).

Stefan

 

  69744   Mon Feb 26 17:39:56 2024 Reply Stefan RittMstefan.ritt@psi.chQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm

Many thanks for your files and instructions. I integrated this into the official elog pipeline, so now the RPMs can be downloaded from https://elog.psi.ch/elog/download.html and they will be updated automatically after each commit. If you succeed with any Debian/Ubunto I'm happy to add that. What's missing now is an easy way to compile for Windows (which I don't have anymore).

Stefan

  69743   Fri Feb 23 18:00:41 2024 Reply Laurent Jean-Rigaudlollspam@free.frQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm

Hi Stefan,

> As you saw I use the bitbucket pipeline for CI/CD. The current bitbucket-pipelines.yml is pretty simple (see attachment). If you make me one which does the rpmbuild automatically, I'm more than happy to upload and use it. The downside there is that it only works for so long. As you saw at the
> error above, the pipeline worked a few years ago when I installed it. But in meantime things changed apparently and need to be fixed. ELOG is around since last century (literally!), and I'm kind of tired to fix things every once in a while. If somebody else could take over the responsibility to
> deliver the RPMs I would be more than delighted.

Good news ! I thought the bitbucket-pipelines.yml was automatically added when importing the repo :-P

Btw, i try to update it as enclosed :

  • first step : build, install, start and test Web connection
  • build on ELx in // with artifacts
    • on centos7
    • on centos8
    • on centos-stream-9
  • automatic deployment on ... where you want. You can push to your website the files by sftp/scp using dedicated account/key using secrets in bitbuckket...

 

Manually, the artifacts (rpm files) are also available from website in pipeline's steps, Artifacts tab and download button.

 

NB : The ELOG version is statically set in pipeline script (3.1.5) so this script need to be updated with git one by bitbuecket vars or script command to retrieve it from src.

 

One more thing : the elog.spec.template must be patched to build last ELOG source on EL7. Without, an error occurs on nullptr usage and C++ must be set to C11 rules... See enclosed elog-EL7_c11_patch.diff .

Now, the Debian/Ubuntu PKGs generation have to be added. Need google as I do not do that for 20 years :-P

Bye

Laurent

 

Attachment 1: elog-EL7_c11_patch.diff
From 57fb0be0c1b6e7e77df57499effc22784edeb898 Mon Sep 17 00:00:00 2001
From: Laurent Jean-Rigaud
Date: Fri, 23 Feb 2024 16:50:21 +0100
Subject: [PATCH] fix C11 error on EL7

---
 elog.spec.template | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/elog.spec.template b/elog.spec.template
index 0e7f8abf..a30dd67a 100644
--- a/elog.spec.template
+++ b/elog.spec.template
@@ -110,7 +110,11 @@ each weblog can be totally different from the rest.
    -g elog -M -r elog 2>/dev/null || :
 
 %build
-make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml"
+%if 0%{?rhel} == 7
+  make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml -std=c++11"
+%else
+  make %{?_with_ssl} %{?_with_pam} %{?_with_ldap} %{?_with_krb5} CFLAGS="$RPM_OPT_FLAGS -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Wno-unused-result -Imxml"
+%endif
 sed "s#\@PREFIX\@#%{prefix}#g" elogd.init_template > elogd.init
 
 %install
-- 
2.41.0

Attachment 4: bitbucket-pipelines.yml
# ELOG Application

# This template allows you to validate your C++ application.
# The workflow allows running tests and code linting on the default branch.


image: gcc:latest


pipelines:
  default:
      - step:
          name: Build run and test
          image: gcc:latest
          deployment: test
          script:
            # Execute your C++ application after compilation to check success
            - apt-get -qq update && apt-get -y --force-yes -qq install cmake wget lsof
            - git submodule update --init
            # Add elog user
            - groupadd -r elog
            - useradd -d / -s /bin/false -g elog -M -r elog
            # Build elog
            - mkdir build; cd build
            - cmake ..
            - make
            # Install in default /usr/local/elog
            - echo "install in test environment"
            - make install
            # Start elogd
            - echo "Start ELOG"
            - /usr/local/sbin/elogd -v 3 -c /usr/local/elog/elogd.cfg 2>&1 &
            - sleep 5
            - if [ -f /var/run/elogd.pid ]; then cat /var/run/elogd.pid ; fi
            # Check open files
            - lsof -p $(cat /var/run/elogd.pid)
            # Test Web page
            - echo "test web"
            - sleep 3
            - wget http://localhost:8080 && true || false
      - parallel:
          steps:
            - step:
                name: Build on EL7
                image: dokken/centos-7
                # trigger: manual  # Uncomment to make this a manual deployment.
                script:
                  - echo "Deploying to test environment"
                  - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh
                  - git submodule update --init
                  # git clone https://bitbucket.org/ritt/elog --recursive
                  - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl
                  - mkdir RPMS
                  - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \;
                  - ls -l RPMS
                artifacts: # defining the artifacts to be passed to each future step.
                  download: false # do not download artifacts in this step
                  paths:
                    - RPMS/*.rpm
            - step:
                name: Build on EL8
                image: dokken/centos-8
                # trigger: manual  # Uncomment to make this a manual deployment.
                script:
                  - echo "Deploying to test environment"
                  - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh
                  - git submodule update --init
                  # git clone https://bitbucket.org/ritt/elog --recursive
                  - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl
                  - mkdir RPMS
                  - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \;
                  - ls -l RPMS
                artifacts: # defining the artifacts to be passed to each future step.
                  download: false # do not download artifacts in this step
                  paths:
                    - RPMS/*.rpm
            - step:
                name: Build on EL9
                image: dokken/centos-stream-9
                # trigger: manual  # Uncomment to make this a manual deployment.
                script:
                  - echo "Deploying to test environment"
                  - yum -y update && yum -y install rpm-build gcc gcc-c++ git openssl-devel krb5-devel pam-devel openldap-devel csh
                  - git submodule update --init
                  # git clone https://bitbucket.org/ritt/elog --recursive
                  - ./buildrpm 3.1.5 $(date +%Y%m%d) -krb5 -ldap -pam -ssl
                  - mkdir RPMS
                  - find ~/rpmbuild/RPMS/ -name "*.rpm" -exec mv {} RPMS \;
                  - ls -l RPMS
                artifacts: # defining the artifacts to be passed to each future step.
                  download: false # do not download artifacts in this step
                  paths:
                    - RPMS/*.rpm
      - step: # non-parallel step
          name: Deployement
          deployment: staging
          script:
            - echo "Deliver results"
            - ls -l RPMS

  69742   Fri Feb 23 15:13:46 2024 Reply Stefan RittThstefan.ritt@psi.chBug reportLinux3.1.5-1Re: user change under webserver authentication not recognized

Thanks for the fix, I committed it. Please give it a quicky try sinc I cannot test it here (don't use webserver authentication...)

Stefan

Frank Heyroth wrote:

I found the reason of the bug:
In line 27441 of elogd.cxx the http_user is overwritten by the user saved in the sid_ array as a sideeffect of the sid_check function:
sid_check(getparam("sid"), http_user)

It can solved by changing elogd.cxx @ line 27441

27441c27441,27446
<          if (!sid_check(getparam("sid"), http_user)) { /*  if we don't have a sid yet, set it */
---
>          i=sid_check(getparam("sid"), thumb_name);
>          if (i && strcmp(http_user,thumb_name)!=0) {  /* user changed */
>             sid_remove(getparam("sid"));
>             i=FALSE;
>          }
>          if (!i) { /*  if we don't have a sid yet, set it */

Remark: I have used the variables i & thumb_name of the function in a local context.

 

  69741   Fri Feb 23 14:59:29 2024 Reply Stefan Rittstefan.ritt@psi.chBug reportLinuxELOG V3.1.5Re: http status 200 returned for "file not found"
> > "file not found" should return http code 404. elogd returns code 200 together
> > with a page containing text "404 not found". This pollutes the browser cache
> > with wrong content (in this case, we are trying to load a css file, and the browser
> > is trying to use text "404 not found" as if it were a css. bad. file not found
> > should return http code 404. K.O.
> 
> Yes. That's quite a problem when interacting with ELOG programmatically. Only way to 
> find whether response succeeded or failed with 404 is to parse response body
> 
> When file is not found send_file_direct calls show_html_header which in turn calls 
> show_http_header which sets HTTP code 200 unconditionally. It's reasonably easy to 
> patch around.

I fixed the code to properly return "404 Not Found" in case a non-existing file is requested.

Stefan
  69740   Fri Feb 23 08:40:26 2024 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux | OtherLatest versionRe: no availability of el8 and el9 rpm
> For my curiosity, I've just clone ELOG repo on Bitbucket to try the process. That's pity : pipelines are currently broken (incident traced in status page https://status.atlassian.com/). 
> The goal is to build elog and pkg file for Ubuntu (docker images list : https://status.atlassian.com/). Next steps should to create a AlmaLinux VM to try RPM builds. 

I fixed the bitbucket pipeline. I compiled it for an (old) GCC 6.3, and even if I installed cmake there, it was not running (maybe I needed cmake3?). Anyhow, I switched GCC 10.2 and now it's fine.

> With BitBucket, it's possible to configure personal runners for CI/CD (systems with pipeline client installed, as RHEL, Fedora, Windows, etc...). The pipeline scripts can build, test and generate the packages automatically, depend on system runners. 
> As CI/CD, the process is automatically done after commits in git repo... A lot of work to make it in place, but when it's running, the delivery process is done
> This is also possible with GitLab and other big platorms.

As you saw I use the bitbucket pipeline for CI/CD. The current bitbucket-pipelines.yml is pretty simple (see attachment). If you make me one which does the rpmbuild automatically, I'm more than happy to upload and use it. The downside there is that it only works for so long. As you saw at the 
error above, the pipeline worked a few years ago when I installed it. But in meantime things changed apparently and need to be fixed. ELOG is around since last century (literally!), and I'm kind of tired to fix things every once in a while. If somebody else could take over the responsibility to 
deliver the RPMs I would be more than delighted.

Stefan
Attachment 1: bitbucket-pipelines.yml
# Build ELOG with GCC 10.2 and latest
image: gcc:10.2

pipelines:
  default:
    - step:
        name: Build on GCC 10.2
        image: gcc:10.2
        script:
          - apt-get update && apt-get install -y imagemagick cmake
          - git submodule update --init
          - mkdir build; cd build
          - cmake ..
          - make

    - step:
        name: Build on GCC latest
        image: gcc:latest
        script:
          - gcc --version
          - apt-get -qq update && apt-get -y --force-yes -qq install cmake
          - git submodule update --init
          - mkdir build; cd build
          - cmake ..
          - make
ELOG V3.1.5-fe60aaf