Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 724390 - www-apps/bareos-webui-21.1.2 Need ebuild
Summary: www-apps/bareos-webui-21.1.2 Need ebuild
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Marc Schiffbauer
URL:
Whiteboard:
Keywords:
: 724582 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-21 06:41 UTC by master_volkov
Modified: 2023-12-07 15:03 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
bareos-webui-19.2.7.ebuild (bareos-webui-19.2.7.ebuild,1.66 KB, text/plain)
2020-05-21 06:44 UTC, master_volkov
Details
bareos-webui-9999.ebuild (bareos-webui-9999.ebuild,1.88 KB, text/plain)
2020-05-25 09:23 UTC, master_volkov
Details
bareos-webui-9999.ebuild (bareos-webui-9999.ebuild,1.88 KB, text/plain)
2020-05-31 18:00 UTC, master_volkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description master_volkov 2020-05-21 06:41:27 UTC
Need ebuild for www-apps/bareos-webui-19.2.7

In attach mostly work ebuild

Reproducible: Always
Comment 1 master_volkov 2020-05-21 06:44:45 UTC
Created attachment 640616 [details]
bareos-webui-19.2.7.ebuild
Comment 2 Jonas Stein gentoo-dev 2020-05-22 20:19:05 UTC
*** Bug 724582 has been marked as a duplicate of this bug. ***
Comment 3 master_volkov 2020-05-25 09:23:07 UTC
Created attachment 641666 [details]
bareos-webui-9999.ebuild
Comment 4 master_volkov 2020-05-31 18:00:08 UTC
Created attachment 642902 [details]
bareos-webui-9999.ebuild
Comment 5 master_volkov 2020-05-31 18:01:15 UTC
Fix version for bareos-webui-9999.ebuild
Vith wrong version unable login toweb interface
Comment 6 Marc Schiffbauer gentoo-dev 2020-08-01 14:47:56 UTC
Thank you ver much for the ebuilds! I am working on it and will add them (slightly tuned) to the tree soon.
Comment 7 Plüss Roland 2023-11-19 12:12:28 UTC
What's the status of this ticket? I searched for bareos-webui and ended up on an overlay repository. Then I found this ticket which states this build will be included in the main repository. I searched in the main gentoo repositories and I find nothing. Did the inclusion never happen or am I missing something?
Comment 8 Marc Schiffbauer gentoo-dev 2023-12-04 11:08:55 UTC
(In reply to Plüss Roland from comment #7)
> What's the status of this ticket? I searched for bareos-webui and ended up
> on an overlay repository. Then I found this ticket which states this build
> will be included in the main repository. I searched in the main gentoo
> repositories and I find nothing. Did the inclusion never happen or am I
> missing something?

Granted, this took way too long. Sorry for that, but there are some reasons for it. That being said, now it will work and I will have a look and add webui package for the current version of bareos (+ the 9999 version) very soon
Comment 9 INODE64 Sistemas 2023-12-04 11:28:41 UTC
I maintain a version in my repository

https://github.com/inode64/inode64-overlay/tree/main/www-apps/bareos-webui
Comment 10 Marc Schiffbauer gentoo-dev 2023-12-04 13:11:53 UTC
(In reply to INODE64 Sistemas from comment #9)
> I maintain a version in my repository
> 
> https://github.com/inode64/inode64-overlay/tree/main/www-apps/bareos-webui

Thanks! I will have a look a see what I can merge from it to improve thew new ebuild
Comment 11 Larry the Git Cow gentoo-dev 2023-12-05 14:52:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee05fd6e5dabc192452af2f91ba49c2797d29115

commit ee05fd6e5dabc192452af2f91ba49c2797d29115
Author:     Marc Schiffbauer <mschiff@gentoo.org>
AuthorDate: 2023-12-05 14:51:29 +0000
Commit:     Marc Schiffbauer <mschiff@gentoo.org>
CommitDate: 2023-12-05 14:52:19 +0000

    www-apps/bareos-webui: new package, add 22.1.0, 9999
    
    Closes: https://bugs.gentoo.org/724390
    Signed-off-by: Marc Schiffbauer <mschiff@gentoo.org>

 www-apps/bareos-webui/Manifest                   |   1 +
 www-apps/bareos-webui/bareos-webui-22.1.0.ebuild | 110 +++++++++++++++++++++++
 www-apps/bareos-webui/bareos-webui-9999.ebuild   | 110 +++++++++++++++++++++++
 www-apps/bareos-webui/files/apache.conf          |  50 +++++++++++
 www-apps/bareos-webui/files/nginx.include        |  17 ++++
 www-apps/bareos-webui/files/postinstall-en.txt   |  36 ++++++++
 www-apps/bareos-webui/metadata.xml               |  11 +++
 7 files changed, 335 insertions(+)
Comment 12 Plüss Roland 2023-12-06 00:14:21 UTC
I can emerge the package now but it is not working. It shows an empty web page with only a single text field with the content "localhost-dir" and nothing else. The web console contains these warnings:

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
bareos-webui
Cookie “bareos” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite bareos-webui
InstallTrigger is deprecated and will be removed in the future.
Comment 13 Marc Schiffbauer gentoo-dev 2023-12-06 01:33:56 UTC
(In reply to Plüss Roland from comment #12)
> I can emerge the package now but it is not working. It shows an empty web
> page with only a single text field with the content "localhost-dir" and
> nothing else. The web console contains these warnings:
> 
> This page is in Quirks Mode. Page layout may be impacted. For Standards Mode
> use “<!DOCTYPE html>”.
> bareos-webui
> Cookie “bareos” does not have a proper “SameSite” attribute value. Soon,
> cookies without the “SameSite” attribute or with an invalid value will be
> treated as “Lax”. This means that the cookie will no longer be sent in
> third-party contexts. If your application depends on this cookie being
> available in such contexts, please add the “SameSite=None“ attribute to it.
> To know more about the “SameSite“ attribute, read
> https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite
> bareos-webui
> InstallTrigger is deprecated and will be removed in the future.

Please make sure you used webapp-config to actually install an instance for the webui and followed the instructions given after that. I tested it that way and it worked without any issues using apache with php-fpm.

Can you give some details about your webserver and php-fpm config etc.?
Comment 14 Plüss Roland 2023-12-06 17:22:15 UTC
php-fpm I never required nor used for anything. It is the default after emerging. I looked at the config but I see nothing special.

I used webapp-config but it copied the files to the a wrong directory "htdocs" or something like this. I moved the directory to the correct location manually (inside "http"/server-name). I updated the apache config accordingly.

I do get now the login screen and I can log in but then I get a 404 since the URL ".../bareos-webgui/dashboard" does not exist. I checked the files installed by webapp-config and such a directory or file does not exists.

Webserver is apache2 and is a multi-host server with around 8 or so different server names hosted on the same IP.

The apache config contains now this (copied from the apache conf file inside /etc/bareos-webui):

<Directory "/var/www/http/XXX/admin/bareos-webui/public">
        Options FollowSymLinks
        AllowOverride None
        
        RewriteEngine on
        RewriteBase /admin/bareos-webui
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
        
        <IfModule mod_php5.c>
                php_flag magic_quotes_gpc off
                php_flag register_globals off
        </IfModule>
</Directory>

As mentioned php-fpm I did not touch. It is thouch just contained commented out lines as per default.
Comment 15 Marc Schiffbauer gentoo-dev 2023-12-07 12:11:07 UTC
(In reply to Plüss Roland from comment #14)
> php-fpm I never required nor used for anything.

It will be mandatory for bareos >=23 (at least upstream writes it in the docs)

> It is the default after
> emerging. I looked at the config but I see nothing special.

please make sure, that a php testpage is working before proceeding installing bareos-webui. A working apache with php via fpm is out of scope here

> 
> I used webapp-config but it copied the files to the a wrong directory
> "htdocs" or something like this.

Why is this wrong? Its default for all webapp-config based packages I think

> I moved the directory to the correct
> location manually (inside "http"/server-name). I updated the apache config
> accordingly.

I would recommend not moving things around manually here or I would expect even more breakage


> I do get now the login screen and I can log in but then I get a 404 since
> the URL ".../bareos-webgui/dashboard" does not exist. I checked the files
> installed by webapp-config and such a directory or file does not exists.

see above

> 
> Webserver is apache2 and is a multi-host server with around 8 or so
> different server names hosted on the same IP.

Ok, and you can use webapp-config to let it install all required file sinto the correct location for you

> 
> The apache config contains now this (copied from the apache conf file inside
> /etc/bareos-webui):

There should be no apache conf in /etc/bareos-webui. Maybe this is an old file you had from a previous install?

> 
> <Directory "/var/www/http/XXX/admin/bareos-webui/public">
>         Options FollowSymLinks
>         AllowOverride None
>         
>         RewriteEngine on
>         RewriteBase /admin/bareos-webui
>         RewriteCond %{REQUEST_FILENAME} -s [OR]
>         RewriteCond %{REQUEST_FILENAME} -l [OR]
>         RewriteCond %{REQUEST_FILENAME} -d
>         RewriteRule ^.*$ - [NC,L]
>         RewriteRule ^.*$ index.php [NC,L]
>         
>         <IfModule mod_php5.c>
>                 php_flag magic_quotes_gpc off
>                 php_flag register_globals off
>         </IfModule>
> </Directory>

The above is not a correct apache config for using php-fpm

> 
> As mentioned php-fpm I did not touch. It is thouch just contained commented
> out lines as per default.

Please have a look at /usr/share/webapps/bareos-webui/22.1.2/conf/apache-apache.conf
Comment 16 Plüss Roland 2023-12-07 13:07:28 UTC
I managed now to get it working somehow, what goes for the webpage. But it is still not working correctly. When I go to "bareos-webui/director/messages" I see messages of all the recently run jobs. But if I go to "bareos-webui/job//" everything is empty. Also storage devices, files, backups, nothing is found. The only thing that works is the director messages page.
Comment 17 Marc Schiffbauer gentoo-dev 2023-12-07 13:46:26 UTC
(In reply to Plüss Roland from comment #16)
> I managed now to get it working somehow, what goes for the webpage. But it
> is still not working correctly. When I go to
> "bareos-webui/director/messages" I see messages of all the recently run
> jobs. But if I go to "bareos-webui/job//" everything is empty. Also storage
> devices, files, backups, nothing is found. The only thing that works is the
> director messages page.

I cannot reproduce this here. Everythign is working fine. Sounds like an ACL problem you have there. Did you reload the bareos-dir and is it really using the config snippets that came with the bareos-webui package?

(most important: /etc/bareos/bareos-dir.d/profile/webui-admin.conf)

If this is all ok I think its beyond the scope of this package and this bug
Comment 18 Plüss Roland 2023-12-07 14:21:48 UTC
The permissions are fine. It's just that all the listings show empty lists although there are jobs, volumes, backups and more.
Comment 19 Plüss Roland 2023-12-07 14:45:41 UTC
Okay, the problem is that bareos-webui requires

Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' domain *.domain"

In the apache configuration. If not present all listings are empty. This is not mentioned in the documentation nor in the apache config file installed by this ebuild.
Comment 20 Plüss Roland 2023-12-07 14:50:13 UTC
I found another CPS config required. Without "blob: data:" file listings as in the backup jobs are also not working. The full line required is thus:

Header set Content-Security-Policy "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: data: domain *.domain"
Comment 21 Marc Schiffbauer gentoo-dev 2023-12-07 15:03:51 UTC
(In reply to Plüss Roland from comment #20)
> I found another CPS config required. Without "blob: data:" file listings as
> in the backup jobs are also not working. The full line required is thus:
> 
> Header set Content-Security-Policy "script-src 'self' 'unsafe-inline'
> 'unsafe-eval' blob: data: domain *.domain"

Thanks for the feedback. But why did my firefox not complain? Maybe its because I was only using localhost through a SSH tunnel