-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logserver and fixed Glidein log token and URL propagation
Added php and python example for a server receiving Glidein logs Fixed JWT generation and GLIDEIN_LOG_RECIPIENTS_FACTORY param for Factory logserver, improved also code and docstrings, and added documentation for logging and log server Added the glideinwms-logserver RPM
- Loading branch information
Showing
14 changed files
with
655 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ | |
%define factory_web_base %{_localstatedir}/lib/gwms-factory/web-base | ||
%define factory_dir %{_localstatedir}/lib/gwms-factory/work-dir | ||
%define condor_dir %{_localstatedir}/lib/gwms-factory/condor | ||
%define logserver_dir %{_localstatedir}/lib/gwms-logserver | ||
%define logserver_web_dir %{_localstatedir}/lib/gwms-logserver/web-area | ||
%define systemddir %{_prefix}/lib/systemd/system | ||
|
||
Name: glideinwms | ||
|
@@ -58,6 +60,7 @@ Source8: gwms-frontend.sysconfig | |
Source9: gwms-factory.sysconfig | ||
Source11: creation/templates/frontend_startup_sl7 | ||
Source12: creation/templates/factory_startup_sl7 | ||
Source13: gwms-logserver.conf.httpd | ||
|
||
BuildRequires: python3 | ||
BuildRequires: python3-devel | ||
|
@@ -153,6 +156,7 @@ This subpackage includes the Glidein components for the Frontend. | |
%package vofrontend-httpd | ||
Summary: The Apache http configuration for GWMS Frontend. | ||
Requires: httpd | ||
Requires: mod_ssl | ||
%description vofrontend-httpd | ||
This subpackage includes the minimal configuration to start Apache to | ||
serve the Frontend files to the pilot and the monitoring pages. | ||
|
@@ -279,6 +283,7 @@ Factory. Created to separate out the httpd server. | |
%package factory-httpd | ||
Summary: The Apache httpd configuration for the GWMS Factory | ||
Requires: httpd | ||
Requires: mod_ssl | ||
%description factory-httpd | ||
This subpackage includes the minimal configuration to start Apache to | ||
serve the Factory files to the pilot and the monitoring pages. | ||
|
@@ -293,6 +298,17 @@ This is a package including condor_config for a full one-node | |
install of wmscollector + wms factory | ||
|
||
|
||
%package logserver | ||
Summary: The Glidein Log server and its Apache http configuration. | ||
Requires: httpd | ||
Requires: mod_ssl | ||
Requires: php | ||
Requires: php-fpm | ||
%description logserver | ||
This subpackage includes an example of the files and Apache configuration | ||
to implement a simple server to receive Glidein logs. | ||
|
||
|
||
%prep | ||
%setup -q -n glideinwms | ||
# Apply the patches here if any | ||
|
@@ -469,7 +485,6 @@ install -d $RPM_BUILD_ROOT%{factory_web_dir}/monitor/group_main/total | |
install -m 644 creation/web_base/nodes.blacklist $RPM_BUILD_ROOT%{web_dir}/stage/nodes.blacklist | ||
install -m 644 creation/web_base/nodes.blacklist $RPM_BUILD_ROOT%{web_dir}/stage/group_main/nodes.blacklist | ||
|
||
|
||
# Install the logs | ||
install -d $RPM_BUILD_ROOT%{_localstatedir}/log/gwms-frontend/frontend | ||
install -d $RPM_BUILD_ROOT%{_localstatedir}/log/gwms-frontend/group_main | ||
|
@@ -589,10 +604,11 @@ install -m 0755 install/glidecondor_createSecCol $RPM_BUILD_ROOT%{_sbindir}/glid | |
install -m 0644 etc/checksum.frontend $RPM_BUILD_ROOT%{frontend_dir}/checksum.frontend | ||
install -m 0644 etc/checksum.factory $RPM_BUILD_ROOT%{factory_dir}/checksum.factory | ||
|
||
#Install web area conf | ||
# Install web area conf | ||
install -d $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d | ||
install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/gwms-frontend.conf | ||
install -m 0644 %{SOURCE5} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/gwms-factory.conf | ||
install -m 0644 %{SOURCE13} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/gwms-logserver.conf | ||
|
||
install -d $RPM_BUILD_ROOT%{web_base}/../creation | ||
install -d $RPM_BUILD_ROOT%{web_base}/../creation/templates | ||
|
@@ -603,6 +619,15 @@ install -d $RPM_BUILD_ROOT%{factory_web_base}/../creation/templates | |
install -m 0644 creation/templates/factory_initd_startup_template $RPM_BUILD_ROOT%{factory_web_base}/../creation/templates/ | ||
install -m 0644 creation/templates/frontend_initd_startup_template $RPM_BUILD_ROOT%{web_base}/../creation/templates/ | ||
|
||
# Install the logserver | ||
install -d $RPM_BUILD_ROOT%{logserver_dir} | ||
install -d $RPM_BUILD_ROOT%{logserver_web_dir} | ||
install -d $RPM_BUILD_ROOT%{logserver_web_dir}/uploads | ||
install -d $RPM_BUILD_ROOT%{logserver_web_dir}/uploads_unauthorized | ||
cp logserver/put.php $RPM_BUILD_ROOT%{logserver_web_dir}/put.php | ||
cp logserver/jwt.php $RPM_BUILD_ROOT%{logserver_web_dir}/jwt.php | ||
cp logserver/logging_config.json $RPM_BUILD_ROOT%{logserver_web_dir}/logging_config.json | ||
|
||
|
||
%post usercollector | ||
/sbin/service condor condrestart > /dev/null 2>&1 || true | ||
|
@@ -680,6 +705,10 @@ systemctl daemon-reload | |
# Protecting from failure in case it is not running/installed | ||
/sbin/service httpd reload > /dev/null 2>&1 || true | ||
|
||
%post logserver | ||
# Protecting from failure in case it is not running/installed | ||
/sbin/service httpd reload > /dev/null 2>&1 || true | ||
|
||
%pre vofrontend-core | ||
# Add the "frontend" user and group if they do not exist | ||
getent group frontend >/dev/null || groupadd -r frontend | ||
|
@@ -754,6 +783,10 @@ fi | |
# Protecting from failure in case it is not running/installed | ||
/sbin/service httpd reload > /dev/null 2>&1 || true | ||
|
||
%postun logserver | ||
# Protecting from failure in case it is not running/installed | ||
/sbin/service httpd reload > /dev/null 2>&1 || true | ||
|
||
%postun factory-core | ||
# Protecting from failure in case it is not running/installed | ||
/sbin/service condor condrestart > /dev/null 2>&1 || true | ||
|
@@ -1052,6 +1085,18 @@ rm -rf $RPM_BUILD_ROOT | |
%config(noreplace) %{_sysconfdir}/condor/certs/condor_mapfile | ||
#%config(noreplace) %{_sysconfdir}/condor/scripts/frontend_condortoken | ||
|
||
%files logserver | ||
%defattr(-,root,root,-) | ||
%config(noreplace) %{_sysconfdir}/httpd/conf.d/gwms-logserver.conf | ||
%attr(-, root, apache) %{logserver_web_dir} | ||
%attr(-, root, apache) %{logserver_web_dir}/logging_config.json | ||
%attr(-, apache, apache) %{logserver_web_dir}/uploads | ||
%attr(-, apache, apache) %{logserver_web_dir}/uploads_unauthorized | ||
%attr(-, gfactory, gfactory) %{factory_web_base} | ||
%attr(-, gfactory, gfactory) %{factory_web_base}/../creation | ||
%attr(-, root, root) %{logserver_dir} | ||
MMDB | ||
|
||
%changelog | ||
* Mon Nov 25 2024 Marco Mambelli <[email protected]> - 3.10.8 | ||
- Glideinwms v3.10.8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# This is the httpd conf file | ||
# GlideinWMS Logging Server web configuration | ||
|
||
Alias /logserver /var/lib/gwms-logserver/web-area | ||
<Directory /var/lib/gwms-logserver/web-area/> | ||
<IfModule mod_authz_core.c> | ||
# Apache 2.4 | ||
Require all granted | ||
</IfModule> | ||
<IfModule !mod_authz_core.c> | ||
# Apache 2.2 | ||
Order allow,deny | ||
Allow from all | ||
</IfModule> | ||
<IfModule mod_authnz_jwt> | ||
AuthType jwt | ||
AuthName "private area" | ||
# Require valid-user | ||
</IfModule> | ||
# Options +Indexes | ||
AllowMethods PUT GET POST OPTIONS | ||
# Require method PUT GET POST OPTIONS | ||
#<Limit GET POST PUT OPTIONS DELETE PATCH HEAD> | ||
# Require all granted | ||
#</Limit> | ||
</Directory> | ||
|
||
# Use the following version if you are using mod_jwt (authnz_mod_jwt) | ||
# This will allow a simpler PUT uploader because it will not need to validate the JWT | ||
|
||
#AuthJWTSignatureAlgorithm HS256 | ||
#AuthJWTSignatureSharedSecret VG9rZVNlY3JldEtleQo= | ||
#AuthJWTIss factory-workspace.glideinwms.org | ||
# | ||
#Alias /logging /var/lib/gwms-logging/logging | ||
#<Directory /var/lib/gwms-logging/logging/> | ||
# <IfModule mod_authz_core.c> | ||
# # Apache 2.4 | ||
# Require all granted | ||
# </IfModule> | ||
# <IfModule !mod_authz_core.c> | ||
# # Apache 2.2 | ||
# Order allow,deny | ||
# Allow from all | ||
# </IfModule> | ||
# <IfModule mod_authnz_jwt> | ||
# AuthType jwt | ||
# AuthName "private area" | ||
# # Require valid-user | ||
# <IFModule> | ||
# # Options +Indexes | ||
# AllowMethods PUT GET POST OPTIONS | ||
# # Require method PUT GET POST OPTIONS | ||
#</Directory> | ||
# | ||
# # This is needed to always forward the HTTP_AUTHORIZATION header | ||
# # See: https://www.codepunker.com/blog/php-a-primer-on-the-basic-authorization-header | ||
# RewriteEngine On | ||
# RewriteCond %{HTTP:Authorization} ^(.+)$ | ||
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.