diff --git a/Dockerfile b/Dockerfile index d7588cfb48f932581443f68b7fdc94bc5de497b6..a79481d070210865c7540c1c94e840d609a8896c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,12 @@ ARG PYFF_VERSION #COPY --from=hairyhenderson/gomplate:v3.11.5 /gomplate /bin/gomplate +ARG UID=1000 +ARG GID=1000 + USER root -RUN useradd -rms /bin/bash eccs +RUN groupadd -g $GID -o eccs +RUN useradd -u $UID -g $GID -rms /bin/bash eccs RUN apt-get update \ && apt-get install -y apt-utils net-tools vim cron wget gpg gpg-agent unzip ca-certificates \ @@ -18,9 +22,9 @@ RUN apt-get update \ python3-requests python3-selenium python3-urllib3 --no-install-recommends \ && sed -i -e 's/"syntax on/syntax on/g' /etc/vim/vimrc +# Install PyFF RUN python3 -m pip install pyff==${PYFF_VERSION} --break-system-packages -# Install PyFF #RUN python3 -m pip install pyff==${PYFF_VERSION} --break-system-packages \ # && sed 's/random.seed(self)/random.seed(id(self))/' -i $(find /usr -name repo.py) # Until the commit https://github.com/IdentityPython/pyFF/commit/601f796776a1948bf09278e6f7ad4c1266904992 will not be implemented into a new PyFF release @@ -30,14 +34,13 @@ RUN wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stabl && apt install -y ./google-chrome-stable_current_amd64.deb --no-install-recommends \ && rm google-chrome-stable_current_amd64.deb -USER eccs +USER eccs:eccs # Get ECCS WORKDIR /home/eccs # Google Chrome Driver RUN wget "https://storage.googleapis.com/chrome-for-testing-public/${CHROMEDRIVER_VERSION}/linux64/chromedriver-linux64.zip" -O chromedriver_linux64.zip \ - && unzip chromedriver_linux64.zip \ && rm chromedriver_linux64.zip \ && mv chromedriver-linux64/chromedriver . \ @@ -48,8 +51,10 @@ COPY --chown=eccs:eccs pyff-config/ pyff-config/ COPY --chown=eccs:eccs api.py clean7daysOldFiles.sh cleanAndRunEccs.sh eccs.ini eccs.py eccs_properties.py eccs-wsgi.py get-sps-metadata.sh retryFailedChecks.py runEccs.py utils.py . COPY --chown=eccs:eccs input/ input/ COPY --chown=eccs:eccs web/ web/ +RUN mkdir -m 755 output html logs selenium-logs \ + && chown -R eccs:eccs output html logs selenium-logs -USER root +USER root:root COPY eccs-logrotate.conf /etc/logrotate.d/eccs COPY eccs_cron /etc/cron.d/eccs diff --git a/docker-compose.yml b/docker-compose.yml index 6554c8014ead1d8852fe1b9684f9935ea5365ffb..6388fe7131b4af2a08574f931d54417fce9ff967 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,9 +5,9 @@ services: context: . dockerfile: Dockerfile args: - CHROME_VERSION: "126.0.6478.126-1" - CHROMEDRIVER_VERSION: "126.0.6478.126" - PYFF_VERSION: "2.1.2" + CHROME_VERSION: 126.0.6478.126-1 + CHROMEDRIVER_VERSION: 126.0.6478.126 + PYFF_VERSION: 2.1.2 container_name: eccs hostname: eccs ports: diff --git a/eccs.ini b/eccs.ini index 7c1b3c3639c8c0a246af1e80d40e3975afbc8174..2a55c66a6861eefc076b83cf30ce9fae7e36818b 100644 --- a/eccs.ini +++ b/eccs.ini @@ -20,7 +20,7 @@ die-on-term = true listen = 128 wsgi-file = eccs-wsgi.py -plugins = python3 +plugins = python3,logfile enable-threads = true logto = logs/%(project)-uwsgi.log @@ -38,5 +38,6 @@ harakiri = 20 pidfile = %(project).pid touch-reload = %(project).ini -#stats = 127.0.0.1:9193 -#stats-http = True + +# Keep logs cleaned and prevent filling disk +log-reopen = true diff --git a/supervisord.conf b/supervisord.conf index c14b15973e2832b4dd13c65eb8b4435b72637e4a..7c160b84f687d9acfd0cf8cb6de92c08a0036a70 100644 --- a/supervisord.conf +++ b/supervisord.conf @@ -27,11 +27,11 @@ autostart=true autorestart=true [program:uwsgi] -#command=uwsgi --ini /root/eccs/eccs.ini --die-on-term command=uwsgi --ini /home/eccs/eccs.ini -stdout_logfile=/home/eccs/logs/eccs-uwsgi.log +user=eccs +stdout_logfile=/home/eccs/logs/eccs-uwsgi-supervisor.log stdout_logfile_maxbytes=0 -stderr_logfile=/home/eccs/logs/eccs-uwsgi.log +stderr_logfile=/home/eccs/logs/eccs-uwsgi-supervisor.log stderr_logfile_maxbytes=0 autostart=true autorestart=true diff --git a/web/edugain_logo1.png b/web/edugain_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..515274148cbdb8867283c1a87b624e49c661d134 Binary files /dev/null and b/web/edugain_logo1.png differ diff --git a/web/eu_logo.png b/web/eu_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..fddda1f7ed05106bc80ad123d523300e5176d12b Binary files /dev/null and b/web/eu_logo.png differ diff --git a/web/footer.php b/web/footer.php new file mode 100644 index 0000000000000000000000000000000000000000..b77362398a88d458a6b4b51da9071a14a0978439 --- /dev/null +++ b/web/footer.php @@ -0,0 +1,104 @@ +<?php +?> + </div> + + + + +</div> +</div> + + +<footer style="visibility: hidden;"> + <div class="central-section"> + <div class="col-1-1" style="padding:15px; display:inline-block"> + <img src="eu_logo.png"/> + </div> + + <div class="col-1-2" style="color:white"> + <a href="https://edugain.org/privacy/" target="_blank">Privacy Notice</a> + <a href="https://edugain.org/disclaimer/" target="_blank">Disclaimer</a> + <a href="https://www.geant.org/Policies" target="_blank">Policies</a> + </div> + </div> + </footer> + + + + + <script> + var Help = new Array(); +Help['Entities in eduGAIN'] = 'You may notice that the sum of all IdPs, SPs and AAs is to more then the number of all entities. The reason for this is that a few entites are listed in two roles - IdP and SP therefore they are counted twice when you add IdPs to SPs.'; +Help['Federations in eduGAIN'] = 'Federations which have passed the acceptance process but have not yet stated providing their own metadata are shown in the Voting-only group.'; +Help['Entity category filter'] = 'Entity categories allow grouping entities sharing common criteria, some of them like <strong>GÉANT Data Protection Code of Conduct</strong> have particular use for eduGAIN as their usage is meant to help in defining attribute release policies. This filter allows you to find out how the entity catiegories concept is spread within eduGAIN. More on this topic at <a href="https://refeds.org/display/ENT/Entity-Categories+Home\"><strong>REFEDS WIKI</strong></a>.'; +Help['SAML 2.0 support'] = 'This filter allows you to find out which entities do and which do not declare SAML 2.0 support'; +Help['ECCS IdP test status'] = 'eduGAIN Connectivity Check Service - ECCS is to identify eduGAIN Identity Providers (IdP) that are not properly configured. With this filter you can quickly find out how the IdPs respond to these tests. More info in <a href="https://wiki.edugain.org/EduGAIN_Connectivity_Check" target="_blank"><strong>eduGAIN WIKI</strong></a>'; +Help['Entity clashes'] = 'Show clash information. If one entityID is supplied by more then one federation, display information in which federations it was found. <br />When the display is limited to a subset of federations, having this option set will also display entities which were exported within the selected federations but were overriden by the clash resolution. <br />CLASHes shown in Yelow make it to eduGAIN but block others, the ones show in Red are the blocked ones.<br />Click on the CLASH link to see the list of conflicts.'; +Help['Validator warnings'] = 'Select based on existance of validator warnings; click on Entity details to see the warnings.'; +Help['CoCo status'] = 'Filter on Code of Conduct monitoring status of Service providers.'; +Help['Download CSV'] = 'Rather then displaying the results as a table, download the results as tab separated text file. This file can be imported into a spreadsheet (LibreOffice works particularly nice)'; +Help['SIRTFI errors'] = "<p>Show entities declararing <a href='https://wiki.refeds.org/display/GROUPS/SIRTFI' target='_blank'>REFEDS SIRTFI</a> support but violating the specification"; +Help['Appeared in eduGAIN'] = 'Only show enetities which appered in eduGAIN in the selected time period.<p>The <i>first seen</i> dates are collected only since 2017-04-13.'; + +function openHelp($helpTrigger){ + var helpId = $helpTrigger.attr('data-help_id'); + $help = $('#help_dialog'); + $help.html('<p>' + Help[helpId] + '</p>'); + $help.dialog('option', 'title', helpId); + $help.dialog('option', { position: { my: "left top", at: "right bottom", of: $helpTrigger } }); + $help.dialog('open'); +} + +$(function(){ + var $footer = $('footer'); + + var $body = $("body"); + $body.css('margin-top', 0); + $body.css('margin-bottom', 0); + + // function to set the height on fly + function autoHeight() { + // $('#wrap').css('min-height', 0); + $('#wrap').css('min-height', ( + $(document).outerHeight() + - $('header').outerHeight() + + $('#wrap').height() + - $('#wrap').outerHeight() + - $footer.height() + )); + } + + // onDocumentReady function bind + $(document).ready(function() { + autoHeight(); + + $("button").mouseout(function(){ + this.blur(); + }) + }); + + // onResize bind of the function + $(window).resize(function() { + autoHeight(); + }); + + + $footer.css('visibility', 'visible'); + + $('#help_dialog').dialog({ + autoOpen: false + }); + + $('.help').click(function(e){ + e.preventDefault(); + var $helpTrigger = $(this); + openHelp($helpTrigger); + }); + + +}); + </script> + <script src="menu.js"></script> + +<div id="html_templates"> +</div> diff --git a/web/geant_logo1.png b/web/geant_logo1.png new file mode 100644 index 0000000000000000000000000000000000000000..588e8f5fedd3744739ed8545da106482b553cbb7 Binary files /dev/null and b/web/geant_logo1.png differ diff --git a/web/header.php b/web/header.php new file mode 100644 index 0000000000000000000000000000000000000000..70412821b9f6ef1af8885594c4507775baf65150 --- /dev/null +++ b/web/header.php @@ -0,0 +1,76 @@ +<?php +?> +<div id="inner" style="position: relative;"> + <div id="help_dialog"></div> + + <header> + <div style="position: relative; height: 115px; width: 100%; background: #003f5f"> + <img id="geant_logo_t" src="geant_logo1.png" style="position: absolute; left: 20px; bottom: 0px;"> + <img src="edugain_logo1.png" style="position:absolute; right: 40px; bottom: 0px;"> + </div> + </header> + + + <div id="wrap"> + <nav class="main-nav"> + <div class="central-section"> + <div id="nav_icon" class="nav-icon"><a id="nav_icon_toggle" href="javascript:void(0);"><img src="images/menu-icon.gif" /></a></div> + <div id="core_nav_section" class="et-menu-holder"> + <ul id="core_nav" class="et-menu et-left"> + <li class="et-first-option no-children"><a href="https://technical.edugain.org" title="Home"><img style="width: 16px; height: 15px; position: relative; top: 3px" src="home_logo.png" alt="Home icon" /></a></li> + <li class="et-option et-has-children"><span>Members</span> + <ul class="et-submenu"> + <li class="et-submenu-option"><a href="https://technical.edugain.org/status">Member Federations</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/whatsnew">Recent Changes</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/governance">Assembly</a></li> + </ul> + </li> + <li class="et-option et-has-children"><span>Joining</span> + <ul class="et-submenu"> + <li class="et-submenu-option"><a href="https://technical.edugain.org/joining_checklist">As Federation</a></li> + <li class="et-submenu-option"><a href="https://wiki.geant.org/display/eduGAIN/How+to+Join+eduGAIN+as+Service+Provider">As Service Provider</a></li> + <li class="et-submenu-option"><a href="https://wiki.geant.org/display/eduGAIN/How+to+set+up+an+Identity+Provider+for+eduGAIN">As Identity Provider</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/metadata">eduGAIN metadata</a></li> + </ul> + </li> + <li class="et-option et-has-children"><span>Tools</span> + <ul class="et-submenu"> + <li class="et-submenu-option"><a href="https://technical.edugain.org/validator" target="_blank">Metadata Validator</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/entities">Entities Database</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/isFederatedCheck" target="_blank">isFederated Check</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/eccs" target="_blank">Connectivity Check</a></li> + <li class="et-submenu-option"><a href="https://release-check.edugain.org/" target="_blank">Release Check</a></li> + <li class="et-submenu-option"><a href="https://access-check.edugain.org/" target="_blank">Access Check</a></li> + <li class="et-submenu-option"><a href="https://monitor.edugain.org/coco/" target="_blank">CoCo Check</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/api">Access API</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/monitoring">Monitoring</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/compliance_audit">Profile compliance audit</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/link_tests">Members URL testing</a></li> + </ul> + </li> + <li class="et-option no-children"><a href="https://technical.edugain.org/documents">Policy framework</a></li> + <li class="et-option et-has-children"><span>Operations</span> + <ul class="et-submenu"> + <li class="et-submenu-option"><a href="https://technical.edugain.org/issues">Current issues</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/operations">Operational documentation</a></li> + <li class="et-submenu-option"><a href="https://technical.edugain.org/metadata">eduGAIN metadata</a></li> + <li class="et-submenu-option"><a href="https://wiki.geant.org/display/eduGAIN/eduGAIN+Services+Status">System status</a></li> + </ul> + <li class="et-option no-children"><a href="https://technical.edugain.org/contact">Support</a></li> + </ul> +</div> +<div id="help_nav_section" class="et-menu-holder"> + <ul class="et-menu et-right"> + <li class="et-option no-children"><a href="https://wiki.edugain.org/">Wiki</a></li> + <li class="et-option no-children"><a href="https://edugain.org">Main webpage</a></li> + </ul> +</div> + </div> + </nav> + <div id="breadcrumb" class="central-section"> + Tools > eduGAIN Connectivity Check Service + </div> + + + <div id="main_body"> + <div class="eccs-central"> diff --git a/web/home_logo.png b/web/home_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..ac3a19490ad6310ff6b2c9424c4d6a392cd9e16e Binary files /dev/null and b/web/home_logo.png differ diff --git a/web/index.php b/web/index.php index 0bd952987c57bdd129b7f1fe126a99ad3ea1e6a7..680f22daf3f9ecd3ce53cae2f1724451b43a2bdd 100644 --- a/web/index.php +++ b/web/index.php @@ -56,7 +56,9 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); </head> <body> <div class="eccs-central"> - + <!-- eduGAIN Header START --> + <?php include('header.php'); ?> + <!-- eduGAIN Header END --> <h1><a href="/eccs" target="_self">eduGAIN Connectivity Check Service</a> (<a href="https://wiki.geant.org/display/eduGAIN/eduGAIN+Connectivity+Check">Instructions</a>, <a href="mailto:support@edugain.org">Contacts</a>)</h1> <p>The purpose of the eduGAIN Connectivity Check is to identify eduGAIN Identity Providers (IdP) that does not properly consume eduGAIN SAML2 SP metadata.</p> <div id="status"> @@ -108,5 +110,6 @@ $data['check_result'] = htmlspecialchars($_GET["check_result"]); </script> <script type="text/javascript" src="eccs.js" /></script> </div> <!-- END eccs-central --> + <?php include('footer.php'); ?> </body> </html> diff --git a/web/menu.js b/web/menu.js new file mode 100644 index 0000000000000000000000000000000000000000..9e377bb992772425a93d56187396d58a87122caa --- /dev/null +++ b/web/menu.js @@ -0,0 +1,81 @@ +var $_expandedItems, $_allMenuItems, $_navIcon; +var _expandedClass = "et-expanded"; +var _menuPauseTime = 1000; +var _menuTimeout; + +function toggleWholeMenu(){ + var $expandedItems = getExpandedItems(); + if($expandedItems) { + collapseMenu($expandedItems); + } else { + expandMenu($_allMenuItems); + } +} + +function expandMenu($elements) { + $elements.addClass(_expandedClass); + $_expandedItems = $elements; +} + +function collapseMenu($expandedItems) { + $expandedItems.removeClass(_expandedClass); +} + +function isWide() { + return $_navIcon.is(':hidden'); +} + +function getExpandedItems() { + var $expandedItems = $("." + _expandedClass); + if($expandedItems.length == 0) { + $expandedItems = undefined; + } + return $expandedItems; +} + + +$(function(){ + $_navIcon = $(".nav-icon"); + $_allMenuItems = $(".et-first-option, .et-option, .et-last-option, .et-submenu"); + + $(window).resize(function() { + collapseMenu($_allMenuItems); + }); + + $(".et-has-children").mouseover(function(){ + if(isWide()){ + clearTimeout(_menuTimeout); + collapseMenu($_allMenuItems); + expandMenu($(this)); + } + }); + + $(".et-has-children").mouseout(function(){ + if(isWide()){ + _menuTimeout = setTimeout(function(){ + collapseMenu($_allMenuItems); + }, _menuPauseTime); + } + }); + + $(".et-submenu").mouseover(function(){ + clearTimeout(_menuTimeout); + }); + + $(".et-submenu").mouseover(function(){ + if(isWide()){ + collapseMenu($_allMenuItems); + } + }); + + $(".no-children").mouseover(function(){ + if(isWide()){ + collapseMenu($_allMenuItems); + } + }); + + $($_navIcon).click(function(){ + toggleWholeMenu(); + }); + +});