Skip to content

feat(env): add MMPM_UI_BASE_URL for reverse-proxy sub-path deployments#315

Open
rgrizzell wants to merge 7 commits into
Bee-Mar:developfrom
rgrizzell:ui_base_path
Open

feat(env): add MMPM_UI_BASE_URL for reverse-proxy sub-path deployments#315
rgrizzell wants to merge 7 commits into
Bee-Mar:developfrom
rgrizzell:ui_base_path

Conversation

@rgrizzell

Copy link
Copy Markdown

Injects the path component as in index.html at serve time so Angular assets and routing resolve correctly when the UI is hosted at a custom sub-path (e.g. /mmpm) without requiring a rebuild.

Injects the path component as <base href> in index.html at serve time so
Angular assets and routing resolve correctly when the UI is hosted at a
custom sub-path (e.g. /mmpm) without requiring a rebuild.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rgrizzell rgrizzell closed this May 18, 2026
@rgrizzell rgrizzell deleted the ui_base_path branch May 18, 2026 00:46
@rgrizzell

Copy link
Copy Markdown
Author

@Bee-Mar Saw your comment briefly before it was removed, but if you've already covered this feature, I'll wait for those to make it into a future release. For now my fork will work for me. Thanks!

@Bee-Mar

Bee-Mar commented May 18, 2026

Copy link
Copy Markdown
Owner

@rgrizzell I removed my comment since I wasn't sure if the existing environment variables that were added in 4.6.2 were working properly for you (MMPM_UI_SOCKET_URL and MMPM_UI_API_BASE_URL). Version 4.6.4 was released today and if you're experiencing issues I'll happily look at the PR you had submitted previously

image

@rgrizzell rgrizzell restored the ui_base_path branch May 18, 2026 00:54
@rgrizzell rgrizzell reopened this May 18, 2026
@rgrizzell

Copy link
Copy Markdown
Author

@Bee-Mar Yes, working on a fresh install of MMPM 4.6.4.

If you could include this as an addition to those two variables, then I would appreciate it. That would allow me to run both MagicMirror and MMPM behind the same Reverse Proxy config.

MagicMirror running in server mode and is publicly accessible, but I'm protecting the MMPM UI, API, and Socket with Apache's LDAP Auth. Both run on the same host, so having the MMPM services under a single /mmpm path helps a lot.

@rgrizzell rgrizzell marked this pull request as draft May 18, 2026 02:19
@rgrizzell

Copy link
Copy Markdown
Author

@Bee-Mar Apologies, but not quite ready yet. The static files won't work with this patch, but it will if Flask serves the content. I'm going to keep working on this with Claude.

rgrizzell and others added 6 commits May 17, 2026 21:44
Introduces a dedicated Flask endpoint that serves window.MMPM_CONFIG as
a JavaScript snippet, enabling static file servers to serve index.html
without requiring Flask's HTML injection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g endpoint

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… href regex

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents caching proxies from serving stale config after mmpm-env.json
is edited, preserving the live-reload guarantee.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rgrizzell

Copy link
Copy Markdown
Author

From what I understand in the short amount of time I've gotten acquainted with the project, it seems the Angular app is hard-coding the base URL as / and it can't be changed once the PyPi package is compiled and released. Users who might want to change it need to re-build/re-patch with every new update.

These changes allow the Angular application to get its configuration from the Flask API layer, static files can still be served by Nginx. Users configure it once.


This was quite the rabbit hole for me. I saw you'd been working with Claude, so I threw tokens into the pool for the efforts. Thanks for being super responsive.

@rgrizzell rgrizzell marked this pull request as ready for review May 18, 2026 03:59
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.

2 participants