Skip to content

release: v0.0.5 - #12

Merged
roncodes merged 13 commits into
mainfrom
release/v0.0.5
Oct 27, 2026
Merged

roncodes merged 13 commits into
mainfrom
release/v0.0.5

Conversation

@roncodes

Copy link
Copy Markdown
Member

Release v0.0.5. Merging this PR into main tags v0.0.5 through release.yml. The tag then triggers create-release.yml (GitHub Release from RELEASE.md) and the publish jobs in ember.yml: npm, the GitHub registry, the Fleetbase registry and QA.

Included

Merge these into this branch first, in order (each is stacked on the one before):

  1. fix: restrict Valhalla settings endpoints and never return the API key #9: settings authorization, and the API key is never returned
  2. fix: reject organization Valhalla hosts that point at private addresses #10: organization hosts must be public addresses (SSRF)
  3. feat(valhalla): Fleetbase Hosted Routing as the default server, with plan and usage in the admin panel #11: Fleetbase Hosted Routing as the default server, plan and usage in the admin panel, and the map route control through the server

After #9 merges, retarget #10 to this branch, then #11 after #10. I checked that all three merge cleanly on top of this branch: 89 PHP tests pass on the combined result.

On this branch

  • Version: 0.0.5 in composer.json, package.json and extension.json, plus RELEASE.md. The tag step refuses to tag unless all four agree.
  • Release CI, matching fleetbase/fleetops:
    • ember.yml and server.yml run on PRs into release/v* and dev-v*, not only main;
    • the Ember CI lints;
    • the PHP CI uses actions/checkout@v4.
  • pnpm-workspace.yaml with Fleet-Ops' allowBuilds list. pnpm 11 stopped every Ember CI install on main with ERR_PNPM_IGNORED_BUILDS, so a tag would not have published. Locally with pnpm 11.0.9, pnpm install --frozen-lockfile, pnpm run lint and pnpm run build all pass.

Co-Authored-By: Claude noreply@anthropic.com

roncodes and others added 13 commits October 24, 2026 13:48
The settings endpoints were only behind `fleetbase.protected`, so any
logged-in user could read the system Valhalla API key (including the
VALHALLA_API_KEY env fallback) or change the system host that every
organization falls back to.

- admin-settings (GET/POST) now require a system administrator.
- settings (organization override) require `fleet-ops view
  routing-settings` or `fleet-ops update routing-settings` to read and
  `fleet-ops update routing-settings` to save, matching the Fleet-Ops
  routing settings page these forms live on.
- Responses replace `api_key` with `has_api_key` (and
  `has_environment_api_key` on the admin endpoint). On save, a blank or
  missing key keeps the stored key and `clear_api_key` removes it; the
  env key is no longer copied into the database.
- The admin and organization settings forms use a password field, show
  whether a key is saved, and offer "Remove the saved API key".
- Adds PHPUnit coverage for both endpoints and re-enables the test step
  in PHP CI (laravel/framework as a dev dependency; phpunit instead of
  pest 1, which cannot find a non-default vendor dir).
The server calls the organization's Valhalla host itself, so anyone who
can edit routing settings could make it request loopback, private
network or cloud metadata addresses (SSRF).

- HostPolicy accepts only http(s) URLs without credentials whose host
  is, and resolves only to, public addresses (explicit IPv4/IPv6
  blocklist: loopback, RFC 1918, CGNAT, link-local/metadata, multicast,
  reserved, IPv4-mapped, NAT64, unique local, ...).
- POST settings returns 422 for a host that fails the policy.
- At request time an organization override whose host fails the policy
  is ignored as a whole (host and key), so values saved before this
  change fall back to the system server.
- VALHALLA_ALLOW_PRIVATE_HOSTS=true lets self-hosted installs use
  private hosts. System (admin) settings are not checked.
…dmin Valhalla panel

When the system Valhalla host is routing.fleetbase.io (or a subdomain), the
admin panel (rendered in Admin -> Fleet-Ops -> Routing) shows the key's plan
and today's usage from the gateway's GET /usage. It links to Fleetbase Cloud
to get a free key, upgrade, or manage the subscription. It says when the key
is missing, refused, over today's quota, on the free fallback after a paid
plan ended, or the service can't be reached.

- GET valhalla/int/v1/admin-hosted-status (system administrators only):
  HostedRouting::status() with the saved host and key, then the environment.
  It never returns the key or the account.
- config valhalla.hosted (VALHALLA_HOSTED_DOMAIN, VALHALLA_HOSTED_CONSOLE_URL,
  VALHALLA_HOSTED_TIMEOUT).
- Tests: HostedRoutingStatusTest, 20 cases (41 total with
  SettingsAuthorizationTest).

Builds on #9 (settings authorization).

Co-Authored-By: Claude <noreply@anthropic.com>
…time

- HostedRouting::status() reads the install registration core-api records
  in system.hosted-routing. When the saved key is the one it issued (same
  last four characters) and the gateway does not report it as claimed
  (owner != company), the status adds install_key, the admin email,
  email_verified (plan != routing_unverified) and claim_url, which also
  becomes upgrade_url.
- Usage passes the gateway's owner through.
- Panel: Upgrade opens the claim link, Manage subscription is hidden until
  the key is claimed, a note explains the key stays the same, and an
  unconfirmed email is pointed out (500 vs 2,500 routes a day).
- 5 new PHPUnit cases (46 total).

Co-Authored-By: Claude <noreply@anthropic.com>
…mmunity servers

- Valhalla::DEFAULT_BASE_URI = https://valhalla.routing.fleetbase.io replaces
  https://valhalla1.openstreetmap.de as the default in config, the client,
  Utils and the admin settings controller.
- A host set to the OpenStreetMap community servers (valhalla1/2.openstreetmap.de),
  in the organization or system settings or the environment, counts as unset
  and resolves to the default. This is the same rule as Fleet-Ops' ValhallaClient
  (fleetops#406). Their usage policy does not allow production traffic.
- The admin form shows the server actually in use and saves the default
  when no host is sent.
- The browser's Leaflet routing control (L.Routing.Valhalla) now posts to
  this extension's server proxy (valhalla/int/v1/route) by default, so it
  uses the configured server and key: no key in the browser, no CORS. A
  caller that passes its own serviceUrl keeps the old direct GET.
- Tests: DefaultHostTest (11 cases); 56 in total.

The hosted server needs a key. An install without one gets 401 from the
proxy, and Fleet-Ops falls back to straight-line estimates. The admin panel
says 'Get a free key', and fleetbase/core-api#325 mints one at install.

Co-Authored-By: Claude <noreply@anthropic.com>
…ed when resolving the server

Restacked on #10. resolveBaseUri() reads the organization host directly to
skip the OSM community servers, so it now applies #10's
organizationOverrideAllowed() too: an organization override whose host fails
HostPolicy falls back to the system server, as resolveSetting() does.

Co-Authored-By: Claude <noreply@anthropic.com>
- Version 0.0.5 in composer.json, package.json and extension.json; RELEASE.md.
- Release CI like Fleet-Ops: Ember and PHP CI run on PRs into release/v*
  and dev-v*, the Ember CI lints, and actions/checkout@v4 in the PHP CI.
- pnpm-workspace.yaml with Fleet-Ops' allowBuilds list: pnpm 11 stopped
  every Ember CI install on main with ERR_PNPM_IGNORED_BUILDS.

Co-Authored-By: Claude <noreply@anthropic.com>
fix: restrict Valhalla settings endpoints and never return the API key
fix: reject organization Valhalla hosts that point at private addresses
feat(valhalla): Fleetbase Hosted Routing as the default server, with plan and usage in the admin panel
…min panel

Renamed from 'Fleetbase Hosted Routing'. The bordered block with buttons
becomes one small grey line: the name, the plan, today's usage (e.g.
'Community (free) · 120 / 2,500 routes today'), and Upgrade/Manage links
(or 'Get a free key'). A second small line shows only what needs action:
a missing, refused or over-quota key, the free fallback after a paid plan
ended, or an unconfirmed install email. The install-key explanation moved
to the Upgrade link's tooltip.

Co-Authored-By: Claude <noreply@anthropic.com>
@roncodes
roncodes merged commit 7be6021 into main Oct 27, 2026
9 checks passed
@roncodes
roncodes deleted the release/v0.0.5 branch October 27, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant