mirror of
https://github.com/wekan/wekan.git
synced 2026-01-06 09:38:49 +01:00
Support WRITEABLE_PATH envrionemnt variable
This commit is contained in:
parent
1cddd607ec
commit
a4732bacce
3 changed files with 30 additions and 26 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { FilesCollection } from 'meteor/ostrio:files';
|
||||
import path from 'path';
|
||||
import { createBucket } from './lib/grid/createBucket';
|
||||
import { createOnAfterUpload } from './lib/fsHooks/createOnAfterUpload';
|
||||
import { createInterceptDownload } from './lib/fsHooks/createInterceptDownload';
|
||||
|
|
@ -14,6 +15,12 @@ Avatars = new FilesCollection({
|
|||
debug: false, // Change to `true` for debugging
|
||||
collectionName: 'avatars',
|
||||
allowClientCode: true,
|
||||
storagePath() {
|
||||
if (process.env.WRITABLE_PATH) {
|
||||
return path.join(process.env.WRITABLE_PATH, 'uploads', 'avatars');
|
||||
}
|
||||
return path.normalize(`assets/app/uploads/${this.collectionName}`);;
|
||||
},
|
||||
onBeforeUpload(file) {
|
||||
if (file.size <= 72000 && file.type.startsWith('image/')) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue