feat(init-and-run-wiki): Support path-prefix listen parameter

This commit is contained in:
jyusang 2022-07-16 16:15:03 +08:00
parent fbfdfdbd3d
commit 2a342a1cfb
2 changed files with 12 additions and 0 deletions

View file

@ -56,3 +56,12 @@ If you are in a memory-constrained environment, you can provide the
Set the `DEBUG_LEVEL` environment variable to `debug`. For example by passing
`-e DEBUG_LEVEL=debug` option in `docker run`.
### Path prefix
Set the `PATH_PREFIX` environment variable to customize the path prefix for
serving TiddlyWiki. For example by passing `-e PATH_PREFIX=\wiki` option in
`docker run`. According to this [note][path-prefix-note], please remember to
configure the client as well.
[path-prefix-note]: https://tiddlywiki.com/static/Using%2520a%2520custom%2520path%2520prefix%2520with%2520the%2520client-server%2520edition.html

View file

@ -19,6 +19,9 @@ fi
# Configure listen command, see https://tiddlywiki.com/static/ListenCommand.html
listen_params="host=0.0.0.0 port=8080"
listen_params="$listen_params debug-level=${DEBUG_LEVEL-none}"
if [ -n "$PATH_PREFIX" ]; then
listen_params="$listen_params path-prefix=$PATH_PREFIX"
fi
if [ -n "$USERNAME" ]; then
listen_params="$listen_params username=$USERNAME"
listen_params="$listen_params password=${PASSWORD-wiki}"