diff --git a/.config/example.yml b/.config/example.yml index 873ecdb45..d2202b69f 100644 --- a/.config/example.yml +++ b/.config/example.yml @@ -120,9 +120,13 @@ redis: # Proxy remote files (default: false) #proxyRemoteFiles: true -#allowedPrivateNetworks: [ -# '127.0.0.1/32' -#] +# Storage path for files if stored locally (absolute path) +# default is to store it in ./files in the directory misskey is located in +#internalStoragePath: '/etc/misskey/files' # Upload or download file size limits (bytes) #maxFileSize: 262144000 + +#allowedPrivateNetworks: [ +# '127.0.0.1/32' +#] diff --git a/packages/backend/src/config/types.ts b/packages/backend/src/config/types.ts index 5c1db8669..89eafb093 100644 --- a/packages/backend/src/config/types.ts +++ b/packages/backend/src/config/types.ts @@ -63,6 +63,7 @@ export type Source = { mediaProxy?: string; proxyRemoteFiles?: boolean; + internalStoragePath?: string; }; /** diff --git a/packages/backend/src/services/drive/internal-storage.ts b/packages/backend/src/services/drive/internal-storage.ts index 8f76c81ca..fa8f0ef83 100644 --- a/packages/backend/src/services/drive/internal-storage.ts +++ b/packages/backend/src/services/drive/internal-storage.ts @@ -8,7 +8,7 @@ const _filename = fileURLToPath(import.meta.url); const _dirname = dirname(_filename); export class InternalStorage { - private static readonly path = Path.resolve(_dirname, '../../../../../files'); + private static readonly path = config.internalStoragePath || Path.resolve(_dirname, '../../../../../files'); public static resolvePath = (key: string) => Path.resolve(InternalStorage.path, key);