Skip to content

Commit

Permalink
Merge branch 'development' into development-keyword-selector
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Dec 18, 2024
2 parents 3b05aa1 + 7af2133 commit 66e6352
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 28 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.1/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 @@ -153,6 +153,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.1/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
6 changes: 5 additions & 1 deletion general/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +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 util import log_error

general_bp = Blueprint('general_bp', __name__,
template_folder='templates/general',
static_folder='static/general',
Expand All @@ -19,6 +21,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.1/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.1/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 @@ -81,18 +81,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.1/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
3 changes: 0 additions & 3 deletions static/lib/purify-3.2.1/js/purify.min.js

This file was deleted.

3 changes: 3 additions & 0 deletions static/lib/purify-3.2.3/js/purify.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions user/templates/user/data_transfer.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h1>Data Transfer</h1>
"irods_home": "/{{ config.get('IRODS_DEFAULT_ZONE') }}/home",
"irods_user_name": "{{ g.user }}",
"irods_zone_name": "{{ config.get('IRODS_DEFAULT_ZONE') }}",
"irods_authentication_scheme": "pam",
"irods_authentication_scheme": "pam_password",
"irods_encryption_algorithm": "AES-256-CBC",
"irods_encryption_key_size": 32,
"irods_encryption_num_hash_rounds": 16,
Expand All @@ -91,7 +91,7 @@ <h1>Data Transfer</h1>
irods_port: 1247
irods_user_name: "{{ g.user }}"
irods_zone_name: "{{ config.get('IRODS_DEFAULT_ZONE') }}"
irods_authentication_scheme: "pam"
irods_authentication_scheme: "pam_password"
irods_encryption_algorithm: "AES-256-CBC"
irods_encryption_key_size: 32
irods_encryption_num_hash_rounds: 16
Expand Down
2 changes: 1 addition & 1 deletion vault/templates/vault/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
{% endblock style %}

{% block scripts %}
<script src="{{ url_for('static', filename='lib/purify-3.2.1/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('vault_bp.static', filename='js/vault.js') }}"></script>
<script src="{{ url_for('vault_bp.static', filename='js/dlgSelectCollection.js') }}"></script>
Expand Down

0 comments on commit 66e6352

Please sign in to comment.