Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build_docs_gallery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
Test-MSS-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand All @@ -30,8 +30,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand All @@ -43,8 +43,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand All @@ -56,7 +56,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Check for CRLF in the repository
run: |
files_with_crlf="$(git ls-files --eol | awk '$1 ~ "crlf"')"
Expand All @@ -67,7 +67,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Check for whitespace issues in the repository
# The two example.txt files need to be excluded because whitespace at EOL is part
# of their format and they fail to parse otherwise.
Expand All @@ -85,9 +85,9 @@ jobs:
ensure-sha-pinned-actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- name: Ensure SHA pinned actions
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@3db98c0363e2fa5df3e1c4c471777a7c10b24cc9 # v3
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@c5fc58bd0be7a4b94b73ce40250322d5b838a108 # v3
with:
allowlist: |
Open-MSS/
4 changes: 2 additions & 2 deletions .github/workflows/readthedocs_basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
Test-RTFD:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/testing-all-oses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: ["macos-14", "macos-15", "ubuntu-latest"]
os: ["macos-14", "macos-15", "macos-26", "ubuntu-latest", "ubuntu-24.04-arm"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
- uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
cache: true
Expand All @@ -31,7 +31,7 @@ jobs:
run: pixi run -e dev env QT_QPA_PLATFORM=offscreen pytest -v -n logical --durations=20 --cov=mslib tests
- run: pixi run -e dev coverage xml
- name: Send coverage to Coveralls (parallel)
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
with:
fail-on-error: false
debug: true
Expand All @@ -45,7 +45,7 @@ jobs:
if: ${{ always() }}
steps:
- name: Close parallel build
uses: coverallsapp/github-action@5cbfd81b66ca5d10c19b062c04de0199c215fb6e # v2.3.7
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
with:
fail-on-error: false
parallel-finished: true
4 changes: 2 additions & 2 deletions .github/workflows/update-pixi-lockfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
matrix:
base_branch: ["develop", "stable"]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4
with:
ref: ${{ matrix.base_branch }}
- name: Generate new lockfile
uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
uses: prefix-dev/setup-pixi@d3f436a425481402e6a95a1d1fc10331c708cd9e # v0.10.2
with:
pixi-version: latest
run-install: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ tutorials/recordings
tutorials/cursor_image.png
# pixi environments
.pixi
.pixi-*
.coverage
60 changes: 60 additions & 0 deletions .vibepod/overlay/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# overlay: pixi for different architectures
# initial version https://www.fz-juelich.de/de/blogs/programmiere/lokale-ki-gestuetzte-pdf-verarbeitung-vibepod-pi-lm-studio-und-pixi
#
# FROM-less Dockerfile fragment; VibePod prepends the base image's `FROM <image>`

ENV PIXI_HOME=/opt/pixi

# Download pixi binaries + official SHA256 checksums via Docker ADD (no curl/wget
# needed, so this also works on minimal base images).
#
# Both linux-aarch64 and linux-64 are fetched: ADD cannot branch on the build
# architecture (BuildKit's TARGETARCH says arm64/amd64, while pixi's release
# assets are named aarch64/x86_64, and a FROM-less fragment cannot use a helper
# stage to translate). The RUN below picks the matching tarball and deletes the
# other, so the extra ~32 MB is download-only and never lands in a layer.
ADD https://github.com/prefix-dev/pixi/releases/latest/download/pixi-aarch64-unknown-linux-musl.tar.gz /tmp/pixi-aarch64.tar.gz
ADD https://github.com/prefix-dev/pixi/releases/latest/download/pixi-aarch64-unknown-linux-musl.tar.gz.sha256 /tmp/pixi-aarch64.sha256
ADD https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz /tmp/pixi-x86_64.tar.gz
ADD https://github.com/prefix-dev/pixi/releases/latest/download/pixi-x86_64-unknown-linux-musl.tar.gz.sha256 /tmp/pixi-x86_64.sha256

# Verify the checksum of this architecture's tarball with sha256sum -c, then
# extract it to $PIXI_HOME/bin. An unrecognised `uname -m` aborts the build
# rather than producing an image without pixi.
RUN set -ex && \
cd /tmp && \
case "$(uname -m)" in \
aarch64|arm64) PIXI_ARCH=aarch64 ;; \
x86_64|amd64) PIXI_ARCH=x86_64 ;; \
*) echo "unsupported architecture: $(uname -m)" >&2; exit 1 ;; \
esac && \
sed "s|pixi-${PIXI_ARCH}-unknown-linux-musl.tar.gz|/tmp/pixi-${PIXI_ARCH}.tar.gz|g" \
"pixi-${PIXI_ARCH}.sha256" | sha256sum -c - && \
mkdir -p ${PIXI_HOME}/bin && \
tar xzf "/tmp/pixi-${PIXI_ARCH}.tar.gz" -C ${PIXI_HOME}/bin && \
chmod +x ${PIXI_HOME}/bin/pixi && \
rm -f /tmp/pixi-aarch64.tar.gz /tmp/pixi-aarch64.sha256 \
/tmp/pixi-x86_64.tar.gz /tmp/pixi-x86_64.sha256

ENV PATH=/opt/pixi/bin:$PATH
RUN pixi --version

# Create vp_pixi project at /opt/vp_pixi (/opt to avoid overwriting user pixi installations)
RUN mkdir -p /opt/vp_pixi
WORKDIR /opt/vp_pixi
RUN pixi init

ENV PATH=/opt/vp_pixi/.pixi/envs/default/bin:$PATH

# Idea from Claude to use RUN to change the config.toml
# Keep workspace environments off the bind-mounted `.pixi`, which the host may
# have populated for a different platform (e.g. macOS arm64 Mach-O binaries).
# The directory is named after `uname -m`, so each architecture gets its own
# tree (/workspace/.pixi-linux-aarch64, /workspace/.pixi-linux-x86_64) and a
# workspace shared between an aarch64 and a linux-64 container never mixes them.
# `detached-environments` only accepts an absolute path, so this relies on the
# workspace being mounted at /workspace. A bad value makes pixi fall back to
# `.pixi` after printing an error, so the build echoes what it wrote.
RUN printf 'detached-environments = "/workspace/.pixi-linux-%s"\n' "$(uname -m)" \
> ${PIXI_HOME}/config.toml && \
cat ${PIXI_HOME}/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ <h3>Reset Password</h3>

{{form.hidden_tag()}}
</div>
<div class="form-group col-md-6">
<div class="col-md-6 mb-3">
<fieldset>
<div>
<div class="form-row">
<div class="form-group col-md-6">
<label>{{form.password.label(class="form-control-label")}}</label>
<div class="row">
<div class="col-md-6 mb-3">
<label>{{form.password.label(class="form-label")}}</label>
<div type="password" id="inputEmail4" placeholder="Password">
{{form.password(class="form-control form-control-lg is-invalid")}}
</div>
Expand All @@ -44,8 +44,8 @@ <h3>Reset Password</h3>
{% endif %}
</div>

<div class="form-group col-md-6">
<label>{{form.confirm_password.label(class="form-control-label")}}</label>
<div class="col-md-6 mb-3">
<label>{{form.confirm_password.label(class="form-label")}}</label>
<div type="password" id="inputEmail4" placeholder="Confirm Password">
{{form.confirm_password(class="form-control form-control-lg is-invalid")}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ <h3>Recovering a lost MSColab password</h3>

{{form.hidden_tag()}}
</div>
<div id="id-form" class="form-group col-md-6">
<div id="id-form" class="col-md-6 mb-3">
<fieldset>
<div >
<div class="form-row">
<div class="form-group col-md-6">
<div class="row">
<div class="col-md-6 mb-3">
<label>{{form.email.label}}</label>
<div type="email" id="inputEmail4" placeholder="Email">
{{form.email(class="form-control", placeholder="Email")}}
Expand Down
4 changes: 2 additions & 2 deletions mslib/mscolab/blueprints/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from mslib.mscolab.auth import verify_user
from mslib.mscolab.events import SocketEvents
from mslib.mscolab.message_type import MessageType
from mslib.mscolab.utils import get_message_dict
from mslib.mscolab.utils import ATTACHMENTS_URL_PREFIX, get_message_dict

CHAT_BP = Blueprint('chat', __name__)

Expand Down Expand Up @@ -79,7 +79,7 @@ def message_attachment():
return "False"


@CHAT_BP.route('/uploads/<name>/<path:filename>', methods=["GET"])
@CHAT_BP.route(f'/{ATTACHMENTS_URL_PREFIX}/<name>/<path:filename>', methods=["GET"])
def uploads(name=None, filename=None):
base_path = current_app.config['UPLOAD_FOLDER']
if name is None:
Expand Down
10 changes: 5 additions & 5 deletions mslib/mscolab/blueprints/docs/templates/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Mission Support System Collaboration Platform</h1>
</div>
</div>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="rounded mx-auto d-block img-fluid" src="mss_theme/img/polstracc_2016.jpeg" width="592" alt="Logo of Polstracc 2016">
Expand All @@ -42,13 +42,13 @@
<img class="rounded mx-auto d-block img-fluid" src="mss_theme/img/phileas_2023.jpeg" width="592" alt="Logo of PHILEAS 2023">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
<span class="visually-hidden">Next</span>
</a>
</div>
</div>{% endblock %}
Expand Down
6 changes: 3 additions & 3 deletions mslib/mscolab/blueprints/docs/templates/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<ul class="navbar-nav mr-auto">
<ul class="navbar-nav me-auto">
<li style="list-style: none; display: inline">
<a class="navbar-brand" href="{{ url_for('docs.index') }}"><img src="{{ url_for('docs.logo') }}" title="Mission Support System" alt="logo Mission Support System"></a>
</li>
Expand All @@ -40,8 +40,8 @@
<li style="list-style: none">{% endif %} {% endfor %}</li>
</ul>
</div><!--
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<form class="d-flex my-2 my-lg-0">
<input class="form-control me-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
!-->
Expand Down
11 changes: 7 additions & 4 deletions mslib/mscolab/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
import git
import threading
import mimetypes
from pathlib import Path
from pathlib import Path, PurePosixPath
from werkzeug.utils import secure_filename
from sqlalchemy.exc import IntegrityError
from mslib.utils.verify_waypoint_data import verify_waypoint_data
from mslib.mscolab.models import db, Operation, Permission, User, Change, Message
from mslib.mscolab.app import APP
from mslib.mscolab.utils import ATTACHMENTS_URL_PREFIX


class FileManager:
Expand Down Expand Up @@ -314,9 +315,11 @@ def upload_file(self, file, subfolder=None, identifier=None, include_prefix=Fals
file.save(f)

# Relative File path
if include_prefix: # ToDo: add a namespace for the chat attachments, similar as for profile images
static_dir = Path(upload_folder).name
static_file_path = str(Path(static_dir) / str(subfolder) / file_name)
if include_prefix:
# URL path (not a filesystem path) below which the chat blueprint serves
# attachments. It must not depend on the name of the UPLOAD_FOLDER
# directory, which is configurable, and always uses forward slashes.
static_file_path = str(PurePosixPath(ATTACHMENTS_URL_PREFIX, str(subfolder), file_name))
else:
static_file_path = str(Path(file_path).relative_to(Path(upload_folder)))

Expand Down
5 changes: 5 additions & 0 deletions mslib/mscolab/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
limitations under the License.
"""

# URL namespace under which chat attachments are served by the chat blueprint.
# This is deliberately independent of the directory name configured as
# UPLOAD_FOLDER, which may be named arbitrarily.
ATTACHMENTS_URL_PREFIX = "uploads"


def get_recent_op_id(fm, user):
operations = fm.list_operations(user)
Expand Down
9 changes: 3 additions & 6 deletions mslib/msui/wms_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
from mslib.utils.qt import Worker
from mslib.msui.multilayers import Multilayers, Layer
import mslib.utils.ogcwms as ogcwms
from mslib.utils.service_manager import WMSServiceManager
from mslib.utils.service_manager import WMSServiceManager, strip_request_params
from mslib.utils.time import parse_iso_datetime, parse_iso_duration
from mslib.utils.auth import save_password_to_keyring, get_auth_from_url_and_name
from mslib.utils.config import modify_config_file
Expand Down Expand Up @@ -988,11 +988,8 @@ def get_capabilities(self, level=None):

def on_success(request):
self.cpdlg.setValue(5)
# url shortener url translated
url = request.url

url = url.replace("?service=WMS", "").replace("&service=WMS", "") \
.replace("?request=GetCapabilities", "").replace("&request=GetCapabilities", "")
# url shortener url translated, service specific parameters are kept
url = strip_request_params(request.url)
logging.debug("requesting capabilities from %s", url)
self.initialise_wms(url, None, level=level)

Expand Down
10 changes: 5 additions & 5 deletions mslib/mswms/blueprints/docs/templates/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Mission Support System Collaboration Platform</h1>
</div>
</div>
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<img class="rounded mx-auto d-block img-fluid" src="mss_theme/img/polstracc_2016.jpeg" width="592" alt="Logo of Polstracc 2016">
Expand All @@ -42,13 +42,13 @@
<img class="rounded mx-auto d-block img-fluid" src="mss_theme/img/phileas_2023.jpeg" width="592" alt="Logo of PHILEAS 2023">
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
<span class="visually-hidden">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
<span class="visually-hidden">Next</span>
</a>
</div>
</div>{% endblock %}
Expand Down
Loading
Loading