forked from FoundKeyGang/FoundKey
Allow files storage path to be set explicitly
Also added to the example config file - Johann150 Co-authored-by: Johann150 <johann.galle@protonmail.com> Changelog: Added
This commit is contained in:
parent
f0b91a62c9
commit
7b7d4f5467
3 changed files with 9 additions and 4 deletions
|
@ -120,9 +120,13 @@ redis:
|
||||||
# Proxy remote files (default: false)
|
# Proxy remote files (default: false)
|
||||||
#proxyRemoteFiles: true
|
#proxyRemoteFiles: true
|
||||||
|
|
||||||
#allowedPrivateNetworks: [
|
# Storage path for files if stored locally (absolute path)
|
||||||
# '127.0.0.1/32'
|
# 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)
|
# Upload or download file size limits (bytes)
|
||||||
#maxFileSize: 262144000
|
#maxFileSize: 262144000
|
||||||
|
|
||||||
|
#allowedPrivateNetworks: [
|
||||||
|
# '127.0.0.1/32'
|
||||||
|
#]
|
||||||
|
|
|
@ -63,6 +63,7 @@ export type Source = {
|
||||||
|
|
||||||
mediaProxy?: string;
|
mediaProxy?: string;
|
||||||
proxyRemoteFiles?: boolean;
|
proxyRemoteFiles?: boolean;
|
||||||
|
internalStoragePath?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8,7 +8,7 @@ const _filename = fileURLToPath(import.meta.url);
|
||||||
const _dirname = dirname(_filename);
|
const _dirname = dirname(_filename);
|
||||||
|
|
||||||
export class InternalStorage {
|
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);
|
public static resolvePath = (key: string) => Path.resolve(InternalStorage.path, key);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue