Feat/omny psi ch mirror #299

Merged
holler merged 3 commits from feat/omny_psi_ch_mirror into main 2026-08-18 15:04:42 +02:00
5 changed files with 28 additions and 36 deletions
@@ -251,12 +251,7 @@ class LamNI(TomoQueueMixin, LamNIAlignmentMixin, LamNIOpticsMixin, LamniGuiTools
self._webpage_gen = LamniWebpageGenerator(
bec_client=client,
output_dir="~/data/raw/webpage/",
upload_url=[
"https://v1p0zyg2w9n2k9c1.myfritz.net/upload.php",
# TEMP: mirroring to the test server while it's evaluated --
# drop this line once omny-test.psi.ch is confirmed or the trial ends.
"https://omny-test.psi.ch/upload.php",
],
upload_url="https://omny.psi.ch/upload.php",
local_port=8080,
)
self._webpage_gen.start()
@@ -74,10 +74,10 @@ are derived only from the *first/primary* URL, even when `upload_url` is a list
govern access control for the production page and have no meaning for a secondary/test
mirror.
As of 2026-07, both `flomni.py` and `lamni.py` pass a two-element list -- production
(`https://v1p0zyg2w9n2k9c1.myfritz.net/upload.php`) plus a temporary evaluation target
(`https://omny-test.psi.ch/upload.php`) -- marked with a `# TEMP` comment at the call
site. Drop the second entry once the trial ends.
As of 2026-08, both `flomni.py` and `lamni.py` pass a single URL,
`https://omny.psi.ch/upload.php` -- the earlier two-element list (production
`v1p0zyg2w9n2k9c1.myfritz.net` plus the `omny-test.psi.ch` evaluation mirror) has been
retired; omny.psi.ch is now the only webpage-mirror target.
## Call-site map (`webpage_generator_base.py`)
@@ -96,15 +96,20 @@ site. Drop the second entry once the trial ends.
`force=True`) suppresses **all** uploads regardless of how many URLs are configured --
it's a binary "upload at all vs. not" switch, orthogonal to how many mirrors exist.
## Known issue: `.svg` upload failing on `omny-test.psi.ch`
## Known issues on `omny.psi.ch` (as of 2026-08)
Both the live `HttpUploader._UPLOAD_SUFFIXES` and the in-repo reference
`OMNY_shared/server_side/webserver/upload.php` already allow `.svg`. Manual testing
against `omny-test.psi.ch` showed `.json`/`.html` status updates succeeding but `.svg`
(the EPS synoptic image, generated by `OMNY_shared/eps/eps_synoptic_svg.py`) failing.
Since nothing in this repo's client or reference server code excludes `.svg`, the most
likely cause is whatever `upload.php`/WAF is actually deployed on the test box differing
from the reference copy here (a stricter filename regex, or a WAF rule flagging SVG's
potential for embedded `<script>` content). This is a server-side configuration question
for the test box, not a client bug -- follow up there before assuming a code fix is
needed.
1. `/upload.php` reaches the app but `move_uploaded_file()` fails with a
`Permission denied` writing to `/var/www/omny/` -- the web server process lacks write
permission on that directory. Confirmed reproducible from the production network
(129.129.122.0/24). Reported to PSI admins; blocks the webpage mirror entirely until
fixed server-side, not a client bug.
2. An F5 WAF in front of omny.psi.ch intermittently rejects requests (a generic "Request
Rejected" block page) instead of passing them through to the app -- seen on
`/upload.php` and the `/samples/*` endpoints, but inconsistently: identical requests
from the same client sometimes succeed and sometimes don't, suggesting uneven WAF
policy across a load-balanced node pool rather than a fixed per-path block. Also
reported to PSI admins (network@psi.ch), with an F5 support ID from one rejected
request for reference.
(The older `.svg`-specific upload failure noted on `omny-test.psi.ch` was observed on a
host this system no longer targets and hasn't been re-verified against omny.psi.ch.)
@@ -347,8 +347,8 @@ class TomoIDManager:
)
"""
OMNY_URL = "https://v1p0zyg2w9n2k9c1.myfritz.net/samples/newmeasurement.php"
TEST_OMNY_URL = "https://omny-test.psi.ch/samples/newmeasurement.php"
OMNY_URL = "https://omny.psi.ch/samples/newmeasurement.php"
TEST_OMNY_URL = "https://omny.psi.ch/samples/newmeasurement.php"
FALLBACK_TOMO_ID = 0
@staticmethod
@@ -392,12 +392,10 @@ class TomoQueueMixin:
user=user,
)
# Only omny-test.psi.ch, not v1p0zyg2w9n2k9c1.myfritz.net (the host
# TomoIDManager.OMNY_URL registers measurements against, and the
# webpage generators mirror their own content to): only
# omny-test.psi.ch has the sample counter that actually matches
# self.tomo_id.
_SAMPLES_UPLOAD_HOSTS = ("https://omny-test.psi.ch",)
# Must match whatever host TomoIDManager.OMNY_URL/TEST_OMNY_URL
# registered against, since that host's sample counter is what
# self.tomo_id came from.
_SAMPLES_UPLOAD_HOSTS = ("https://omny.psi.ch",)
def _upload_pdf_report_to_samples(self, pdf_path: str) -> None:
"""Upload a just-written PDF report to the OMNY samples web folder
@@ -1640,13 +1640,7 @@ class Flomni(
self._webpage_gen = FlomniWebpageGenerator(
bec_client=client,
output_dir="~/data/raw/webpage/",
# upload_url="http://s1090968537.online.de/upload.php", # optional
upload_url=[
"https://v1p0zyg2w9n2k9c1.myfritz.net/upload.php",
# TEMP: mirroring to the test server while it's evaluated --
# drop this line once omny-test.psi.ch is confirmed or the trial ends.
"https://omny-test.psi.ch/upload.php",
],
upload_url="https://omny.psi.ch/upload.php",
local_port=8080,
)
self._webpage_gen.start()