diff --git a/Writerside/mm.tree b/Writerside/mm.tree index 6a06360..e7ceed1 100644 --- a/Writerside/mm.tree +++ b/Writerside/mm.tree @@ -10,10 +10,10 @@ - - + + diff --git a/Writerside/topics/configuration-backend.md b/Writerside/topics/configuration-backend.md index c925ebd..05d7860 100644 --- a/Writerside/topics/configuration-backend.md +++ b/Writerside/topics/configuration-backend.md @@ -1,7 +1,12 @@ # Backend -These variables configure the core backend application, database connections, authentication, and integrations. They are -typically set as environment variables for the backend Docker container. +These variables configure the core backend application, database connections, authentication, and integrations. + +## General Settings + +| Variable | Description | Default | +|-----------------|-----------------------------|-----------| +| `API_BASE_PATH` | The url base of the backend | `/api/v1` | ## Database Settings diff --git a/Writerside/topics/configuration-frontend.md b/Writerside/topics/configuration-frontend.md index 872cc1d..69cf205 100644 --- a/Writerside/topics/configuration-frontend.md +++ b/Writerside/topics/configuration-frontend.md @@ -8,7 +8,13 @@ ## Build Arguments (web/Dockerfile) -| Argument | Description | Example (in build command) | -|-----------|-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------| -| `VERSION` | Sets the `PUBLIC_VERSION` environment variable at runtime in the frontend container. Passed during build. | `docker build --build-arg VERSION=1.2.3 -f web/Dockerfile .` | +**TODO: expand on this section** + +To configure a url base path for the frontend, you need to build the frontend docker container, this is because +unfortunately SvelteKit needs to know the base path at build time. + +| Argument | Description | Example (in build command) | +|------------|-----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------| +| `VERSION` | Sets the `PUBLIC_VERSION` environment variable at runtime in the frontend container. Passed during build. | `docker build --build-arg VERSION=1.2.3 -f web/Dockerfile .` | +| `BASE_URL` | Sets the base url path, it must begin with a slash and not end | `docker build --build-arg BASE_URL=/media -f web/Dockerfile .` | diff --git a/web/Dockerfile b/web/Dockerfile index 5e7a2ff..994f598 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -1,14 +1,13 @@ ARG VERSION - +ARG BASE_URL="" FROM node:24-alpine AS build -ARG VERSION USER node:node WORKDIR /app COPY --chown=node:node . . RUN npm ci -RUN env PUBLIC_VERSION=${VERSION} npm run build +RUN env PUBLIC_VERSION=${VERSION} BASE_URL=${BASE_URL} npm run build FROM node:24-alpine AS frontend ARG VERSION diff --git a/web/src/routes/dashboard/tv/torrents/+page.svelte b/web/src/routes/dashboard/tv/torrents/+page.svelte index 2a45f15..598f715 100644 --- a/web/src/routes/dashboard/tv/torrents/+page.svelte +++ b/web/src/routes/dashboard/tv/torrents/+page.svelte @@ -60,9 +60,9 @@ {:else} -

- You've not added any torrents yet. -

+
+ No Torrents added yet. +
{/each} {/await} diff --git a/web/svelte.config.js b/web/svelte.config.js index a730c79..c8c96ba 100644 --- a/web/svelte.config.js +++ b/web/svelte.config.js @@ -1,6 +1,8 @@ import adapter from '@sveltejs/adapter-node'; import {vitePreprocess} from '@sveltejs/vite-plugin-svelte'; +const base = process.env.BASE_URL || ''; + /** @type {import('@sveltejs/kit').Config} */ const config = { // Consult https://svelte.dev/docs/kit/integrations @@ -11,7 +13,10 @@ const config = { // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. // If your environment is not supported, or you settled on a specific environment, switch out the adapter. // See https://svelte.dev/docs/kit/adapters for more information about adapters. - adapter: adapter() + adapter: adapter(), + paths: { + base: base + } } };