diff --git a/Writerside/mm.tree b/Writerside/mm.tree index 7c906ec..725b19a 100644 --- a/Writerside/mm.tree +++ b/Writerside/mm.tree @@ -21,7 +21,7 @@ - + @@ -29,4 +29,4 @@ - \ No newline at end of file + diff --git a/Writerside/topics/Base-Path.md b/Writerside/topics/Base-Path.md deleted file mode 100644 index 5ee4882..0000000 --- a/Writerside/topics/Base-Path.md +++ /dev/null @@ -1,20 +0,0 @@ -# Base Path - -Unfortunately you need to build the docker container, to configure a url base path. This is because -SvelteKit needs to know the base path at build time. - -## Docker Build Arguments - -When building the Docker image for the frontend, you can pass build arguments to set the base path and version. - -### `BASE_PATH` - -Sets the base url path, it must begin with a slash and not end with one. Example (in build command): -- clone the repo -- cd into the repo's root directory -- `docker build --build-arg BASE_URL=/media -f Dockerfile .` - -### `VERSION` - -Sets the version variable in the container. This isn't strictly necessary, but it can be useful for debugging or versioning purposes. -Example: `docker build --build-arg VERSION=locally-built -f web/Dockerfile .` \ No newline at end of file diff --git a/Writerside/topics/configuration-backend.md b/Writerside/topics/configuration-backend.md index 698cb61..d941bd5 100644 --- a/Writerside/topics/configuration-backend.md +++ b/Writerside/topics/configuration-backend.md @@ -8,7 +8,11 @@ centralized in this TOML file instead of environment variables. - `frontend_url` The URL the frontend will be accessed from. This is a required field and must include the trailing slash. The default -path is `http://localhost:8000/web/`. Make sure to change this to match your actual frontend URL. +path is `http://localhost:8000/web/`. + +Make sure to change this to the URL you will use to access the application in your browser. + +Note that this doesn't affect where the server binds, nor does it affect the base URL prefix. See the page on `BASE_PATH` for information on how to configure a prefix. - `cors_urls` @@ -24,8 +28,8 @@ Here's a complete example of the general settings section in your `config.toml`: ```toml [misc] -# REQUIRED: Change this to match your actual frontend URL -frontend_url = "http://localhost:8000/web/" +# REQUIRED: Change this to match your actual frontend domain. +frontend_url = "http://mediamanager.dev/" cors_urls = ["http://localhost:8000"] @@ -35,4 +39,4 @@ development = false The frontend_url is the most important settings to configure correctly. Make sure it matches your actual deployment URLs. - \ No newline at end of file + diff --git a/Writerside/topics/url-prefix.md b/Writerside/topics/url-prefix.md new file mode 100644 index 0000000..537fb3e --- /dev/null +++ b/Writerside/topics/url-prefix.md @@ -0,0 +1,30 @@ +# URL Prefix + +MediaManager, by default, expects to run at the base of a domain, e.g. `maxdorninger.github.io`. + +In order to run it on a prefixed path, like `maxdorninger.github.io/media`, the docker image must be built with a special build argument. That's because SvelteKit needs to know the base URL at build time. + +In short, clone the repository, then run: + +``` +docker build \ + --build-arg BASE_PATH=/media \ + --build-arg VERSION=my-custom-version \ + -t MediaManager:my-custom-version \ + -f Dockerfile . +``` + +You also need to set the `BASE_PATH` environment variable at runtime in `docker-compose.yaml`: + +```yaml +services: + mediamanager: + image: MediaManager:my-custom-version + ports: + - "8000:8000" + environment: + BASE_PATH: /media + ... +``` + +Finally, ensure that whatever reverse proxy you're using leaves the incoming path unchanged; that is, you should not strip the `/media` from `/media/web/`.