mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-26 03:33:58 -05:00
Config: Add WebDAV to media config
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
157d9bb21c
commit
edf71cc177
2 changed files with 27 additions and 0 deletions
|
@ -28,6 +28,11 @@ export interface MediaConfig {
|
|||
imgur: {
|
||||
clientID: string;
|
||||
};
|
||||
webdav: {
|
||||
connectionString: string;
|
||||
uploadDir: string;
|
||||
publicUrl: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -70,6 +75,21 @@ const mediaSchema = Joi.object({
|
|||
}),
|
||||
otherwise: Joi.optional(),
|
||||
}),
|
||||
webdav: Joi.when('use', {
|
||||
is: Joi.valid(BackendType.WEBDAV),
|
||||
then: Joi.object({
|
||||
connectionString: Joi.string()
|
||||
.uri()
|
||||
.label('HD_MEDIA_BACKEND_WEBDAV_CONNECTION_STRING'),
|
||||
uploadDir: Joi.string()
|
||||
.optional()
|
||||
.label('HD_MEDIA_BACKEND_WEBDAV_UPLOAD_DIR'),
|
||||
publicUrl: Joi.string()
|
||||
.uri()
|
||||
.label('HD_MEDIA_BACKEND_WEBDAV_PUBLIC_URL'),
|
||||
}),
|
||||
otherwise: Joi.optional(),
|
||||
}),
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -95,6 +115,12 @@ export default registerAs('mediaConfig', () => {
|
|||
imgur: {
|
||||
clientID: process.env.HD_MEDIA_BACKEND_IMGUR_CLIENT_ID,
|
||||
},
|
||||
webdav: {
|
||||
connectionString:
|
||||
process.env.HD_MEDIA_BACKEND_WEBDAV_CONNECTION_STRING,
|
||||
uploadDir: process.env.HD_MEDIA_BACKEND_WEBDAV_UPLOAD_DIR,
|
||||
publicUrl: process.env.HD_MEDIA_BACKEND_WEBDAV_PUBLIC_URL,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,4 +9,5 @@ export enum BackendType {
|
|||
S3 = 's3',
|
||||
IMGUR = 'imgur',
|
||||
AZURE = 'azure',
|
||||
WEBDAV = 'webdav',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue