Skip to content

Commit

Permalink
Merge branch 'development' into portal-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 20, 2024
2 parents 66d6d96 + 7af2133 commit 25f0ec5
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 1,367 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8==6.0.0 flake8-import-order==0.18.2 darglint==1.8.1 codespell mypy types-requests werkzeug
python -m pip install flake8==7.1.1 flake8-import-order==0.18.2 darglint==1.8.1 codespell
python -m pip install mypy types-requests werkzeug
- name: Lint with flake8
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
run: |
cd yoda/docker/compose
docker exec provider.yoda sh -c 'set -x ; cd /etc/irods/yoda-ruleset && sudo chown irods:irods -R /etc/irods/yoda-ruleset && sudo -u irods git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*" && sudo -u irods git pull && sudo -u irods git status'
docker exec provider.yoda sh -c "set -x ; cd /etc/irods/yoda-ruleset && ( sudo -u irods git checkout ${{ steps.extract_branch.outputs.branch }} || sudo -u irods git checkout development) && sudo -u irods python -m pip --no-cache-dir install --user -r /etc/irods/yoda-ruleset/requirements.txt && sudo -u irods make && sudo -u irods make install"
docker exec provider.yoda sh -c "set -x ; sudo -u irods /var/lib/irods/irodsctl restart"
docker exec provider.yoda sh -c "set -x ; cd /etc/irods/yoda-ruleset && sudo -u irods git checkout ${{ steps.extract_branch.outputs.branch }} && sudo -u irods python3 -m pip --no-cache-dir install --user --break-system-packages -r /etc/irods/yoda-ruleset/requirements.txt && sudo -u irods make && sudo -u irods make install"
docker exec provider.yoda sh -c 'set -x ; sudo -u irods /var/lib/irods/irodsctl restart'
- name: Pull and install branch version of the portal
shell: bash
Expand Down Expand Up @@ -111,7 +111,9 @@ jobs:
docker logs portal.yoda
docker logs provider.yoda
docker exec portal.yoda sh -c 'set -x; cat /var/log/apache2/error.log || echo "Apache error log file not found."'
docker exec provider.yoda sh -c 'set -x ; cat /var/lib/irods/log/rodsLog*' || echo "rodsLog not found."'
docker exec provider.yoda sh -c 'set -x ; cat /var/log/syslog' || echo "rodsLog not found."'
cat ../../copytovault.log
cat ../../publication.log
# Uncomment section below when needed for debugging.
#
Expand Down
2 changes: 1 addition & 1 deletion admin/templates/admin/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block title %}{{ super() }} - Administration{% endblock title %}

{% block scripts %}
<script src="{{ url_for('static', filename='lib/purify-3.2.0/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/purify-3.2.3/js/purify.min.js') }}"></script>
<script src="{{ url_for('admin_bp.static', filename='js/create_preview.js') }}"></script>
<script src="{{ url_for('admin_bp.static', filename='js/file_formats.js') }}"></script>
{% endblock scripts %}
Expand Down
1 change: 1 addition & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def load_admin_setting() -> Dict[str, Any]:

# CSRF protection.
csrf = CSRFProtect(app)
app.config['WTF_CSRF_TIME_LIMIT'] = None # Set CSRF token lifetime tied to the life of the session.


@app.before_request
Expand Down
2 changes: 1 addition & 1 deletion deposit/templates/deposit/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
var path = {{ path|tojson|safe }};
var view = 'browse';
</script>
<script src="{{ url_for('static', filename='lib/purify-3.2.0/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/purify-3.2.3/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/datatables-1.13.5/datatables.min.js') }}"></script>
<script src="{{ url_for('deposit_bp.static', filename='lib/flow-js/flow.min.js') }}"></script>
<script src="{{ url_for('deposit_bp.static', filename='lib/dragbetter-js/jquery.dragbetter.js') }}"></script>
Expand Down
5 changes: 4 additions & 1 deletion general/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
__copyright__ = 'Copyright (c) 2021-2024, Utrecht University'
__license__ = 'GPLv3, see LICENSE'

from flask import Blueprint, redirect, render_template, Response, url_for
from flask import Blueprint, redirect, render_template, request, Response, session, url_for
from flask_wtf.csrf import CSRFError

from cache_config import cache_view
from util import log_error

general_bp = Blueprint('general_bp', __name__,
template_folder='templates/general',
Expand All @@ -22,6 +23,8 @@ def index() -> Response:

@general_bp.app_errorhandler(CSRFError)
def csrf_error(e: Exception) -> Response:
username = session.get("login_username", "N/A")
log_error(f"CSRF error occurred for user {username} on path {request.path}.")
return redirect(url_for('user_bp.login'))


Expand Down
2 changes: 1 addition & 1 deletion group_manager/templates/group_manager/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% endblock style %}

{% block scripts %}
<script src="{{ url_for('static', filename='lib/purify-3.2.0/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/purify-3.2.3/js/purify.min.js') }}"></script>
<script src="{{ url_for('group_manager_bp.static', filename='js/group_manager.js') }}"></script>
<script src="{{ url_for('group_manager_bp.static', filename='lib/select2/select2.full.min.js') }}"></script>
<script>
Expand Down
14 changes: 7 additions & 7 deletions research/templates/research/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block title %}{{ super() }} - Research{% endblock title %}

{% block scripts %}
<script src="{{ url_for('static', filename='lib/purify-3.2.0/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/purify-3.2.3/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/datatables-1.13.5/datatables.min.js') }}"></script>
<script src="{{ url_for('research_bp.static', filename='lib/flow-js/flow.min.js') }}"></script>
<script src="{{ url_for('research_bp.static', filename='js/research.js') }}"></script>
Expand Down Expand Up @@ -77,18 +77,18 @@ <h5 class="modal-title">
</div>

<div class="modal" tabindex="-1" role="dialog" id="cleanup-collection">
<div class="modal-dialog">
<div class="modal-dialog modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-body">
<h5 class="modal-title">Clean up collection</h5>
<div class="alert alert-warning" id="alert-panel-cleanup-collection">
<div class="modal-header d-flex flex-column align-items-start">
<h5 class="modal-title mb-2">Clean up collection</h5>
<div class="alert alert-warning w-100" id="alert-panel-cleanup-collection">
<span></span>
</div>

<p><b><span id="collection"></span></b></p>
</div>

<div class="modal-body">
<div id="cleanup-files"></div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
Expand Down
2 changes: 1 addition & 1 deletion search/templates/search/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{% block title %}{{ super() }} - Search{% endblock title %}

{% block scripts %}
<script src="{{ url_for('static', filename='lib/purify-3.2.0/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/purify-3.2.3/js/purify.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/datatables-1.13.5/datatables.min.js') }}"></script>
<script src="{{ url_for('search_bp.static', filename='js/revision.js') }}"></script>
<script src="{{ url_for('search_bp.static', filename='js/search.js') }}"></script>
Expand Down
2 changes: 1 addition & 1 deletion static/css/homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
position: absolute;
top: 50px;
background-color: rgba(0, 0, 0, .7);
right: 5%;
right: 6%;
padding: 15px 30px;
}

Expand Down
Binary file modified static/img/frontpage_banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 25f0ec5

Please sign in to comment.