Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWS: 'path-prefix' parameter doesn't work consistently #8759

Open
Jermolene opened this issue Nov 18, 2024 · 2 comments
Open

MWS: 'path-prefix' parameter doesn't work consistently #8759

Jermolene opened this issue Nov 18, 2024 · 2 comments

Comments

@Jermolene
Copy link
Member

As reported in the forum, the path-prefix parameter to the --mws-listen command does not work properly.

It is intended to allow the server to run with a base path prefix, rather than everything running from the root /. See the docs for the same feature with the regular Node.js server.

@webplusai would you be able to look at this?

@jrbntt
Copy link
Contributor

jrbntt commented Nov 18, 2024

Since my original post on the forum, I did follow up on how I think it's currently working. In summary:

  • The templates used for rendering the list of wikis, references to bags, recipes, etc don't currently take an alternate path into account
  • The $:/config/multiwikiclient/host tiddler does work when it's loaded as part of a wiki

Thinking about it some more since making that post, it raises a couple of questions about exactly how the path-prefix should interact with the multi-wiki support:

  1. Where should the path-prefix for reference to bags/recipes/admin/etc be stored?
    1.1. If a config tiddler is used, how does a user create it without a working web interface?
  2. Should the multiwikiserver inject the path-prefix into any wikis it is hosting?

For the 2nd question, I'd tend toward "yes", since manually inserting a config tiddler into multiple bags could become unwieldy and confusing for end users. However, this injection could become complex itself, so there might be a benefit to just trusting anyone who wants to do this is willing to deal with the complexity of making sure their paths work.

EDIT to add: After some more thought, I'm reversing opinion on question 2 above. If there's a means to insert a tiddler into the correct bag via command line or other method, then trusting the user to set up the config tiddler for the multiwikiclient is in line with what happens doing the same operation with the regular Node.js server. There just needs to be a documented way for adding that config tiddler without relying on having a working instance that can save from the web browser.

webplusai added a commit to webplusai/TiddlyWiki5 that referenced this issue Nov 22, 2024
@Jermolene
Copy link
Member Author

Thanks @jrbntt

Where should the path-prefix for reference to bags/recipes/admin/etc be stored?
1.1. If a config tiddler is used, how does a user create it without a working web interface?

MWS is configured via configuration tiddlers in what we call the "admin wiki", which is an ordinary TW Node.js edition. One of the longer term goals is to be able to use a separate subdomain to access the admin features.

Should the multiwikiserver inject the path-prefix into any wikis it is hosting?

Yes, I think so. The purpose of the path-prefix is to enable people to host MWS other than at the root of a server. MWS should ignore requests that do not start with the path-prefix, and should insert the path-prefix in all the URLs it generates.

@webplusai I think the solution in webplusai@a4ee6bc is not quite right; it seems to be redirecting URLs that don't include the path-prefix to include it.

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

No branches or pull requests

2 participants