Skip to content

Commit 13de4a1

Browse files
committed
Document Oracle CORS and service sanity checks
1 parent 0b6c515 commit 13de4a1

3 files changed

Lines changed: 169 additions & 0 deletions

File tree

docs/research/new-publisher-source-planning/New_Publisher_Implementation_Checklist_2026-05-26.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ This checklist captures the repeatable workflow proven during the Environment Ag
7373
- Verify backend observations directly.
7474
- Verify Explorer visibility on the correct preset.
7575
- Verify production bundle content after pushing Explorer changes.
76+
- Verify the public reverse proxy from the production Explorer origin so browser CORS failures are caught, not just command-line endpoint success.
7677
- Record any server warnings separately from publisher failures.
7778

7879
## 9. Documentation
@@ -99,6 +100,7 @@ A new publisher is not done until all of these are true:
99100
- runtime can publish at least one clean live cycle,
100101
- observations can be read back from CSAPI,
101102
- Explorer can find and explain the resources,
103+
- the production Explorer can load the public endpoint without CORS-blocked OSH requests,
102104
- side-card/popup output is domain-meaningful,
103105
- docs explain source, model, commands, validation, and limitations,
104106
- commits are pushed to the relevant repositories.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Oracle Caddy CORS Operational Note - 2026-05-26
2+
3+
## Summary
4+
5+
The public Oracle endpoint at `https://129-80-248-53.sslip.io/sensorhub/api` is fronted by Caddy and proxies to SensorHub on `localhost:8181`.
6+
7+
Production Explorer loads OSH resources from Cloudflare Pages at `https://ogc-csapi-explorer.pages.dev`. Browser requests failed when both Caddy and SensorHub emitted CORS response headers, producing a duplicate `Access-Control-Allow-Origin` value such as:
8+
9+
```text
10+
*, https://ogc-csapi-explorer.pages.dev
11+
```
12+
13+
Browsers reject that response even though command-line clients can still read the endpoint.
14+
15+
## Live Fix
16+
17+
The Caddy reverse proxy for SensorHub should strip upstream CORS headers before Caddy emits the public CORS policy.
18+
19+
Relevant `/etc/caddy/Caddyfile` reverse proxy block:
20+
21+
```caddy
22+
reverse_proxy localhost:8181 {
23+
header_down -Access-Control-Allow-Origin
24+
header_down -Access-Control-Allow-Credentials
25+
header_up Authorization "Basic <sensorhub-basic-auth>"
26+
}
27+
```
28+
29+
Do not commit the raw `Authorization` value to git. Keep it only in host-local server configuration or a host-local secret mechanism.
30+
31+
## Validation
32+
33+
After changing Caddy, validate the config and reload:
34+
35+
```bash
36+
sudo caddy validate --config /etc/caddy/Caddyfile
37+
sudo systemctl reload caddy
38+
sudo systemctl status caddy --no-pager
39+
```
40+
41+
Then verify the public endpoint from the production Explorer origin:
42+
43+
```powershell
44+
$resp = Invoke-WebRequest -Method Head `
45+
-Uri 'https://129-80-248-53.sslip.io/sensorhub/api' `
46+
-Headers @{ Origin = 'https://ogc-csapi-explorer.pages.dev' }
47+
48+
$resp.Headers.GetEnumerator() |
49+
Where-Object { $_.Key -match 'Access-Control|Vary' } |
50+
ForEach-Object { "$($_.Key): $($_.Value -join ', ')" }
51+
```
52+
53+
Expected result includes exactly one `Access-Control-Allow-Origin` value:
54+
55+
```text
56+
Access-Control-Allow-Origin: *
57+
```
58+
59+
The production Explorer smoke test should then reach `https://ogc-csapi-explorer.pages.dev/map`, finish loading features, and show the new source filters without a duplicate-origin CORS console error.
60+
61+
## 2026-05-26 Verification
62+
63+
The live Oracle host was patched and production-verified after the Met Office, BGS, Environment Agency Hydrology, and UK-AIR Explorer polish pass.
64+
65+
Observed production Explorer result:
66+
67+
- URL: `https://ogc-csapi-explorer.pages.dev/map`
68+
- Feature count: `810 FEATURES`
69+
- Source filters: `EA Hydrology4`, `UK-AIR4`, `BGS / UKGEOS9`, `Met Office15`
70+
- CORS duplicate-origin error: not present
71+
- Met Office deployed-system card: opened successfully with `Weather Observation Site`, recent readings, and the Charterhall weather-station representative image
72+
- BGS deployed-system card: opened successfully with the UKGEOS borehole representative image and groundwater readings
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Oracle New Publisher Service Sanity Check - 2026-05-26
2+
3+
## Summary
4+
5+
After the production Explorer CORS and new-source visibility fixes, the Oracle host and public CSAPI endpoint were checked for the four newly added publisher sources:
6+
7+
- Environment Agency Hydrology
8+
- UK-AIR
9+
- BGS SensorThings / UKGEOS
10+
- Met Office Weather DataHub Land Observations
11+
12+
## Live Endpoint Read-Back
13+
14+
Public endpoint checked:
15+
16+
```text
17+
https://129-80-248-53.sslip.io/sensorhub/api
18+
```
19+
20+
Root deployment read-back succeeded for all four new publisher demos:
21+
22+
| Source | Deployment UID | Server ID | Result |
23+
| --- | --- | --- | --- |
24+
| Environment Agency Hydrology | `urn:os4csapi:deployment:environment-agency-hydrology-demo:v1` | `05d0` | present |
25+
| UK-AIR | `urn:os4csapi:deployment:uk-air-demo:v1` | `05g0` | present |
26+
| BGS SensorThings | `urn:os4csapi:deployment:bgs-sensorthings-demo:v1` | `05ig` | present |
27+
| Met Office DataHub | `urn:os4csapi:deployment:met-office-datahub-demo:v1` | `05l0` | present |
28+
29+
## Oracle Service State
30+
31+
Core public path services were active:
32+
33+
```text
34+
caddy.service: active
35+
sensorhub.service: active
36+
met-office-datahub-publisher.service: active
37+
```
38+
39+
The Oracle service inventory shows `met-office-datahub-publisher.service` installed and running as the persistent service for the newest access-gated publisher.
40+
41+
No persistent systemd units were discovered for Environment Agency Hydrology, UK-AIR, or BGS SensorThings during this check. Those publishers have been bootstrapped and one-shot published successfully, and their live CSAPI root deployments remain present, but they are not yet represented by dedicated Oracle scheduler/service units in the same way as Met Office.
42+
43+
## Public CORS Check
44+
45+
Production-origin CORS check from `https://ogc-csapi-explorer.pages.dev` returned a single public origin header:
46+
47+
```text
48+
Access-Control-Allow-Origin: *
49+
```
50+
51+
This confirms the live Caddy fix is still in place and avoids the previous duplicate-origin browser failure.
52+
53+
## Controlled-Repo Issue Draft
54+
55+
The local environment did not provide a GitHub issue tool, `gh` CLI, or GitHub API token at the time of this check. If an issue is filed, file it only in a controlled OS4CSAPI repository, preferably `OS4CSAPI/OSHConnect-Python`.
56+
57+
Suggested title:
58+
59+
```text
60+
Install persistent Oracle services for EA Hydrology, UK-AIR, and BGS publishers
61+
```
62+
63+
Suggested body:
64+
65+
```markdown
66+
## Summary
67+
68+
Environment Agency Hydrology, UK-AIR, and BGS SensorThings were implemented, bootstrapped, one-shot published, and verified in production Explorer, but the Oracle host currently only has Met Office installed as a persistent new-publisher service.
69+
70+
## Current State
71+
72+
- `met-office-datahub-publisher.service` is installed and active.
73+
- No dedicated systemd units were discovered for:
74+
- Environment Agency Hydrology
75+
- UK-AIR
76+
- BGS SensorThings / UKGEOS
77+
- Live CSAPI root deployments are present:
78+
- `urn:os4csapi:deployment:environment-agency-hydrology-demo:v1` -> `05d0`
79+
- `urn:os4csapi:deployment:uk-air-demo:v1` -> `05g0`
80+
- `urn:os4csapi:deployment:bgs-sensorthings-demo:v1` -> `05ig`
81+
- `urn:os4csapi:deployment:met-office-datahub-demo:v1` -> `05l0`
82+
83+
## Proposed Work
84+
85+
Add host-local systemd service/timer units or equivalent scheduler entries for the three one-shot-verified publishers, using the existing Oracle service pattern and without committing any secrets.
86+
87+
## Acceptance Criteria
88+
89+
- Environment Agency Hydrology publishes on a bounded recurring cadence.
90+
- UK-AIR publishes on a bounded recurring cadence.
91+
- BGS SensorThings publishes on a bounded recurring cadence appropriate for its source update frequency.
92+
- Units use host-local environment/secret files only.
93+
- `systemctl status` and journal checks are documented.
94+
- Production Explorer still loads the public endpoint without CORS-blocked OSH requests.
95+
```

0 commit comments

Comments
 (0)