-
-
Notifications
You must be signed in to change notification settings - Fork 258
Adding support for hosting with URL prefix #1357
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
Conversation
…p on sub-path possible
…er rebasing from upstream
bed4fb6
to
0c972e6
Compare
Thanks for this. I need the time to properly tests this. I anticipate a lot of edge cases and places where being hosted at the root is implicitly assumed. |
Absolutely! I am fairly new to silverbullet so it is very possible that I missed something. As if to illustrate my point, I just realised I never tested in offline mode. I just did and sure enough, the service_worker.ts will need tweaking. And unlike the rest of the client code, it doesn't have access to document.baseURI to derive the prefix. I'll try to take a closer if I have some more time. |
* Add more tests for week calculation * Fix week calculation * Add more tests
* Implement Lua built-in function os.difftime * Test os.difftime --------- Co-authored-by: Zef Hemel <[email protected]>
* Generate version from git describe at build time * Add 2.0-beta prefix * Use Deno.Command instead of Deno.run
Configurable with queryCollation, default value maintains old behaviour. Added tests, schema, example settings, and documentation to query page. Close: silverbulletmd#614 Close: silverbulletmd#1316
…ulletmd#1386) * Add global Lua function 'some' Moved documentation for 'each' function to non-standard section. * Revert "Add optional argument to template.each for empty collection output (silverbulletmd#1359)" This reverts commit b73dade. * Reimplement silverbulletmd#1359 using 'some' function
…d#1397) The documentation, example, and other function names use `event.listEvents`, but `event.list` is being registered with the client.
Also add a 10px margin below the header to maintain consistent spacing around the widget contents.
…d#1392) * Add optional priority attribute to PageCreatingContent * Minor simplification * Fix comments * Revert changes * Add pageEventHandlers
Now storing config in localStorage.
Thanks a lot for this effort, a lot of people have asked for it! I'm sure there may be subtle issues, but based on some testing this seems to work great! |
Closes #163. Adding support for hosting with URL prefix to make reverse-proxy setup on sub-path possible.
Starting silverbullet server specifying a "prefix" (or "context root") in environment variable
SB_URL_PREFIX
will cause the application to be hosted on the specified prefix. This allows sub-path configuration when setting up reverse proxies (e.g.https://myserver/sb/
->http://localhost:3000/sb/
)Summary of changes:
base
element ofindex.html
andauth.html
/myresource
) to page-relative URLs (e.g.myresource
)document.baseURI
instead oflocation.origin|host
when constructing URLsNOTES:
JSON utils => ./plug-api/lib/json.test.ts:4:6
fails withActual 2023-05-02 / Expected 2023-05-03
. Probably a timezone thing). I left it alone.