Config modification for submission system
This commit is contained in:
parent
60a281084a
commit
7f12b55ba7
11
spec/spec.md
11
spec/spec.md
@ -234,6 +234,7 @@ and end with
|
||||
|
||||
comment #
|
||||
|
||||
{optionName}={optionValue};
|
||||
Close variable with ;
|
||||
|
||||
mandatory:
|
||||
@ -241,10 +242,11 @@ mandatory:
|
||||
emailPassword
|
||||
emailServerAddress
|
||||
databaseConnectionString={postgresql://{user}:{password}@{host}:{port}/{database}}
|
||||
sslCrtPath
|
||||
sslKeyPath
|
||||
domain
|
||||
|
||||
Optional if CROW_ENABLE_SSL not defined
|
||||
sslCrtPath=
|
||||
sslKeyPath=
|
||||
|
||||
optional:{default}
|
||||
emailServerPort={587}
|
||||
@ -258,5 +260,8 @@ optional:{default}
|
||||
itemsPerPage={0} 0 == no pagination
|
||||
bruteForceMitigationLockSeconds={900} 15min How long a login lock out is valid
|
||||
bruteForceMitigationAttempts={5} How many login attempts can be made until a login lock out is set
|
||||
|
||||
submissionMaxFileSizeMB={4096} Filesize in MB;
|
||||
submissionMaxtotalStorageMB={131072} Filesize in MB;
|
||||
submissionMaxStorageDurationH={0} Duration in hours 0 = unlimited;
|
||||
submissionAllowedFiletypes={rar|zip|7z} Allowed file extensions like rar|zip|7z|webm|avi etc;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
#configstart#
|
||||
|
||||
# {optionName}={optionValue};
|
||||
|
||||
# Mandatory:
|
||||
# databaseConnectionString={postgresql://{user}:{password}@{host}:{port}/{database}}
|
||||
# emailAddress=
|
||||
@ -15,43 +17,44 @@
|
||||
# emailServerPort={587}
|
||||
# emailAddressDisplay={Cavecomm Automated Management System}
|
||||
# regularTaskExecution={true}
|
||||
# regularTaskExecutionIntervalSeconds={900} 15min
|
||||
# regularTaskExecutionModules={} # options separated by "|": bruteForceMitigationCleaner|freelancerResetKeyCleaner
|
||||
# regularTaskExecutionIntervalSeconds={900} # 15min
|
||||
# regularTaskExecutionModules={} # options separated by "|": bruteForceMitigationCleaner|freelancerResetKeyCleaner|submissionStorageCleaner
|
||||
# itemsPerPage={0} #0 == no pagination
|
||||
# bruteForceMitigationLockSeconds={900} 15min
|
||||
# bruteForceMitigationAttempts={5}
|
||||
# submissionMaxFileSizeMB={4096} # Filesize in MB;
|
||||
# submissionMaxtotalStorageMB={131072} # Filesize in MB;
|
||||
# submissionMaxStorageDurationH={0} # Duration in hours 0 = unlimited;
|
||||
# submissionAllowedFiletypes={rar|zip|7z} # Allowed file extensions like rar|zip|7z|webm|avi etc;
|
||||
|
||||
|
||||
|
||||
databaseConnectionString=postgresql://cavecommadmin:cavecomm@localhost:5432/cavecomm;
|
||||
|
||||
emailAddress=testuser0ed6e@waifu.club;
|
||||
|
||||
emailPassword=Ve4m6GSjJ;
|
||||
|
||||
emailServerAddress=mail.cock.li;
|
||||
|
||||
emailServerPort=587;
|
||||
|
||||
emailAddressDisplay=Cavecomm Automated Management System;
|
||||
|
||||
sslCrtPath=/media/sf_cavecommRemote/example.crt;
|
||||
|
||||
sslKeyPath=/media/sf_cavecommRemote/example.key;
|
||||
|
||||
domain=192.168.56.1:18080;
|
||||
|
||||
regularTaskExecution=true;
|
||||
|
||||
regularTaskExecutionIntervalSeconds=900;
|
||||
|
||||
regularTaskExecutionModules=bruteForceMitigationCleaner|freelancerResetKeyCleaner;
|
||||
regularTaskExecutionModules=bruteForceMitigationCleaner|freelancerResetKeyCleaner|submissionStorageCleaner;
|
||||
|
||||
itemsPerPage=5;
|
||||
|
||||
bruteForceMitigationLockSeconds=900;
|
||||
|
||||
bruteForceMitigationAttempts=5;
|
||||
|
||||
submissionMaxFileSizeMB=8;
|
||||
submissionMaxtotalStorageMB=16;
|
||||
submissionMaxStorageDurationH=24;
|
||||
submissionAllowedFiletypes=rar|zip|7z|arc|jpg|jpeg|png|mp4|webm;
|
||||
|
||||
|
||||
#configend#
|
||||
|
@ -32,6 +32,7 @@ namespace Utilities {
|
||||
|
||||
const static std::string MODULE_NAME_BRUTE_FORCE_MITIGATION_CLEANER = "bruteForceMitigationCleaner";
|
||||
const static std::string MODULE_NAME_FREELANCER_RESET_KEY_CLEANER = "freelancerResetKeyCleaner";
|
||||
const static std::string MODULE_NAME_SUBMISSION_STORAGE_CLEANER = "submissionStorageCleaner";
|
||||
|
||||
/*
|
||||
* Takes string to split it into a vector based on a given delimiter
|
||||
@ -85,11 +86,16 @@ namespace Utilities {
|
||||
int regularTaskExecutionIntervalSeconds = 900;
|
||||
std::unordered_map<std::string, bool> regularTaskExecutionModules = {
|
||||
{MODULE_NAME_BRUTE_FORCE_MITIGATION_CLEANER, false},
|
||||
{MODULE_NAME_FREELANCER_RESET_KEY_CLEANER, false}
|
||||
{MODULE_NAME_FREELANCER_RESET_KEY_CLEANER, false},
|
||||
{MODULE_NAME_SUBMISSION_STORAGE_CLEANER, false}
|
||||
};
|
||||
int itemsPerPage = 20;
|
||||
int bruteForceMitigationLockSeconds = 900;
|
||||
int bruteForceMitigationAttempts = 5;
|
||||
int submissionMaxFileSizeMB = 4096;
|
||||
int submissionMaxtotalStorageMB = 131072;
|
||||
int submissionMaxStorageDurationH = 0;
|
||||
std::vector<std::string> submissionAllowedFiletypes = {"rar", "zip","7z"};
|
||||
|
||||
/*
|
||||
* validates existence of mandatory variables in config
|
||||
@ -222,6 +228,22 @@ namespace Utilities {
|
||||
bruteForceMitigationAttempts = std::stoi(lineString);
|
||||
continue;
|
||||
}
|
||||
if (lineVector.at(0) == "submissionMaxFileSizeMB") {
|
||||
submissionMaxFileSizeMB = std::stoi(lineString);
|
||||
continue;
|
||||
}
|
||||
if (lineVector.at(0) == "submissionMaxtotalStorageMB") {
|
||||
submissionMaxtotalStorageMB = std::stoi(lineString);
|
||||
continue;
|
||||
}
|
||||
if (lineVector.at(0) == "submissionMaxStorageDurationH") {
|
||||
submissionMaxStorageDurationH = std::stoi(lineString);
|
||||
continue;
|
||||
}
|
||||
if (lineVector.at(0) == "submissionAllowedFiletypes") {
|
||||
submissionAllowedFiletypes = Utilities::splitStringIntoVector(lineString, '|');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user