diff --git a/apps/docs/content/docs/3.2-beta/manual-installation.mdx b/apps/docs/content/docs/3.2-beta/manual-installation.mdx index d044523..5bdf29b 100644 --- a/apps/docs/content/docs/3.2-beta/manual-installation.mdx +++ b/apps/docs/content/docs/3.2-beta/manual-installation.mdx @@ -201,6 +201,17 @@ You should see the full Palmr. application ready to go! This guide sets up Palmr. using the local file system for storage. Want to use an S3-compatible object storage instead? You can configure that in the `.env` file. Check the Palmr. documentation for details on setting up S3 storage just update the environment variables, then build and run as shown here. +### Custom Installation Paths and Symlinks + +If you're using a custom installation setup with symlinks (for example, `/opt/palmr_data/uploads -> /mnt/data/uploads`), you might encounter issues with disk space detection. Palmr. includes a `CUSTOM_PATH` environment variable to handle these scenarios: + +```bash +# In your .env file (apps/server/.env) +CUSTOM_PATH=/opt/palmr_data +``` + +This tells Palmr. to check your custom path first when determining available disk space, ensuring proper detection even when using symlinks or non-standard directory structures. + --- ## Command cheat sheet diff --git a/apps/docs/content/docs/3.2-beta/quick-start.mdx b/apps/docs/content/docs/3.2-beta/quick-start.mdx index 7d71ac5..8794651 100644 --- a/apps/docs/content/docs/3.2-beta/quick-start.mdx +++ b/apps/docs/content/docs/3.2-beta/quick-start.mdx @@ -166,6 +166,7 @@ Customize Palmr's behavior with these environment variables: | `ENCRYPTION_KEY` | - | **Required when encryption is enabled**: 32+ character key for file encryption | | `DISABLE_FILESYSTEM_ENCRYPTION` | `true` | Disable file encryption for better performance (set to `false` to enable encryption) | | `PRESIGNED_URL_EXPIRATION` | `3600` | Duration in seconds for presigned URL expiration (applies to both filesystem and S3 storage) | +| `CUSTOM_PATH` | - | Custom base path for disk space detection in manual installations with symlinks | | `SECURE_SITE` | `false` | Enable secure cookies for HTTPS/reverse proxy deployments | | `DEFAULT_LANGUAGE` | `en-US` | Default application language ([see available languages](/docs/3.2-beta/available-languages)) | | `PALMR_UID` | `1000` | User ID for container processes (helps with file permissions) | diff --git a/apps/server/src/env.ts b/apps/server/src/env.ts index 19d96db..ba97b97 100644 --- a/apps/server/src/env.ts +++ b/apps/server/src/env.ts @@ -33,6 +33,7 @@ const envSchema = z.object({ .string() .optional() .transform((val) => (val ? parseFloat(val) : undefined)), + CUSTOM_PATH: z.string().optional(), }); export const env = envSchema.parse(process.env); diff --git a/apps/server/src/modules/storage/service.ts b/apps/server/src/modules/storage/service.ts index e75b43f..fe28577 100644 --- a/apps/server/src/modules/storage/service.ts +++ b/apps/server/src/modules/storage/service.ts @@ -284,7 +284,7 @@ export class StorageService { private async _getDiskSpaceMultiplePaths(): Promise<{ total: number; available: number } | null> { const basePaths = IS_RUNNING_IN_CONTAINER ? ["/app/server/uploads", "/app/server/temp-uploads", "/app/server/temp-chunks", "/app/server", "/app", "/"] - : [".", "./uploads", process.cwd()]; + : [env.CUSTOM_PATH || ".", "./uploads", process.cwd()]; const synologyPaths = await this._detectSynologyVolumes();