Skip to content

Commit

Permalink
Merge pull request #84 from wguanicedew/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wguanicedew authored Jul 12, 2022
2 parents cea7b75 + dafd6d0 commit c6268fe
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

FROM docker.io/centos:7

ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

ARG TAG

WORKDIR /tmp
Expand Down
56 changes: 56 additions & 0 deletions main/config_default/httpd-idds-443-py39-cc7.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ WSGIPythonPath /opt/idds/lib/python3.9/site-packages
</IfModule>

Listen 8443
Listen 8080

RewriteEngine on
RewriteCond %REQUEST_METHOD ^(TRACE|TRACK)
Expand Down Expand Up @@ -82,12 +83,67 @@ Alias "/monitor" "/opt/idds/monitor/data"
</LocationMatch>

<LocationMatch "^/idds">
GridSiteIndexes on
# GridSiteAuth on
GridSiteDNlists /etc/grid-security/dn-lists/
GridSiteGSIProxyLimit 16
GridSiteEnvs on
GridSiteACLPath /opt/idds/etc/idds/rest/gacl
# GridSiteMethods GET
</LocationMatch>

<Directory /opt/idds/lib/python3.9/site-packages>
# Order deny,allow
# Allow from all
# Require all granted
</Directory>

<Directory /opt/idds/bin>
Order deny,allow
Allow from all
Require all granted
</Directory>

<Directory /opt/idds/website/data>
Order deny,allow
Allow from all
Require all granted
</Directory>

<Directory /opt/idds/monitor/data>
Order deny,allow
Allow from all
Require all granted
DirectoryIndex dashboard.html
DirectoryIndex index.html
</Directory>
</VirtualHost>

<VirtualHost *:8080>
# ServerName aipanda182.cern.ch:8080
ServerAdmin [email protected]

LogLevel debug
ErrorLog /var/log/idds/httpd_error_log
TransferLog /var/log/idds/httpd_access_log

# Proxy authentication via mod_gridsite
<LocationMatch /auth/x509_proxy>
GridSiteIndexes on
GridSiteAuth on
GridSiteDNlists /etc/grid-security/dn-lists/
GridSiteGSIProxyLimit 16
GridSiteEnvs on
GridSiteACLPath /opt/idds/etc/idds/rest/gacl
</LocationMatch>

<LocationMatch "^/idds">
GridSiteIndexes on
# GridSiteAuth on
GridSiteDNlists /etc/grid-security/dn-lists/
GridSiteGSIProxyLimit 16
GridSiteEnvs on
GridSiteACLPath /opt/idds/etc/idds/rest/gacl
# GridSiteMethods GET
</LocationMatch>

Expand Down
6 changes: 6 additions & 0 deletions main/lib/idds/rest/v1/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ def before_request_auth():
if auth_type in ['x509_proxy']:
dn = flask.request.environ.get('SSL_CLIENT_S_DN', None)
client_cert = flask.request.environ.get('SSL_CLIENT_CERT', None)
dn = dn.strip()
client_cert = client_cert.strip()
if not dn or len(dn) == 0:
dn = flask.request.headers.get('SSL_CLIENT_S_DN', default=None)
if not client_cert or len(client_cert) == 0:
client_cert = flask.request.headers.get('SSL_CLIENT_CERT', default=None)
is_authenticated, errors, username = authenticate_x509(vo, dn, client_cert)
if not is_authenticated:
return generate_failed_auth_response(errors)
Expand Down
2 changes: 1 addition & 1 deletion main/tools/env/install_packages.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$'#!/bin/bash
#!/bin/bash
set -m
for package in common main client workflow doma atlas website monitor ;
do
Expand Down

0 comments on commit c6268fe

Please sign in to comment.