Moved dev file storage to inside meteor app folder

Prevented verbose logging of file storage
This commit is contained in:
Stefan Zermatten
2022-11-19 18:34:52 +02:00
parent b6b0cfbb9b
commit cea63e6a8e
4 changed files with 6 additions and 5 deletions

1
app/.gitignore vendored
View File

@@ -3,6 +3,7 @@
.demeteorized
.cache
.vscode
fileStorage
settings.json
public/components
public/_imports.html

View File

@@ -6,13 +6,13 @@ import { CreatureSchema } from '/imports/api/creature/creatures/Creatures.js';
const ArchiveCreatureFiles = createS3FilesCollection({
collectionName: 'archiveCreatureFiles',
storagePath: Meteor.isDevelopment ? '/DiceCloud/archiveCreatures/' : 'assets/app/archiveCreatures',
storagePath: Meteor.isDevelopment ? '../../../../../fileStorage/archiveCreatures' : 'assets/app/archiveCreatures',
onBeforeUpload(file) {
// Allow upload files under 10MB, and only in json format
if (file.size > 10485760) {
return 'Please upload with size equal or less than 10MB';
}
if (!/json/i.test(file.extension)){
if (!/json/i.test(file.extension)) {
return 'Please upload only a JSON file';
}
return true;

View File

@@ -2,7 +2,7 @@ import { createS3FilesCollection } from '/imports/api/files/s3FileStorage.js';
const UserImages = createS3FilesCollection({
collectionName: 'userImages',
storagePath: Meteor.isDevelopment ? '/DiceCloud/userImages/' : 'assets/app/userImages',
storagePath: Meteor.isDevelopment ? '../../../../../fileStorage/userImages' : 'assets/app/userImages',
onBeforeUpload(file) {
// Allow upload files under 10MB
if (file.size > 10485760) {

View File

@@ -50,7 +50,7 @@ if (Meteor.isServer && Meteor.settings.useS3) {
storagePath,
onBeforeUpload,
onAfterUpload,
debug = !Meteor.isProduction,
debug,// = !Meteor.isProduction,
allowClientCode = false,
}) {
const collection = new FilesCollection({
@@ -224,7 +224,7 @@ if (Meteor.isServer && Meteor.settings.useS3) {
storagePath,
onBeforeUpload,
onAfterUpload,
debug = !Meteor.isProduction,
debug,// = !Meteor.isProduction,
allowClientCode = false,
}) {
const collection = new FilesCollection({