various fixups, allow FTP max size config
This commit is contained in:
@@ -197,10 +197,12 @@ if (minisrv_config.services["wtv-author"].max_pages) {
|
||||
</table>
|
||||
<p>A maximum of <b>${minisrv_config.services["wtv-author"].max_pages}</b> pages can be created, regardless of publish status.
|
||||
<br><br>
|
||||
Your published pages are available at<br>
|
||||
`
|
||||
if (numofpages > 0) {
|
||||
`Your published pages are available at<br>
|
||||
<a href="http://${site}/${session_data.getSessionData("subscriber_username")}/">http://${site}/${session_data.getSessionData("subscriber_username")}/</a>
|
||||
</table>`
|
||||
|
||||
}
|
||||
}
|
||||
data += `
|
||||
<SCRIPT language=JavaScript>
|
||||
|
||||
@@ -72,6 +72,8 @@ async function processLC2DownloadPage(flashrom_info, headers, numparts = null) {
|
||||
downloadTime = elapsedMinutes * remainingParts;
|
||||
}
|
||||
session.lastDownloadTime = now;
|
||||
|
||||
if (isNaN(downloadTime) || downloadTime < 1) downloadTime = 1;
|
||||
|
||||
|
||||
headers = `200 OK
|
||||
@@ -127,7 +129,7 @@ Updating now
|
||||
<font size=+1>
|
||||
Your ${session_data.getBoxName()} is being<br>updated automatically.
|
||||
<p> <font size=+1>
|
||||
This will take about ${downloadTime} minutes and<br>then you can use your ${session_data.getBoxName()} again.
|
||||
This will take about ${downloadTime} minute${downloadTime !== 1 ? "s" : ""} and<br>then you can use your ${session_data.getBoxName()} again.
|
||||
`;
|
||||
if (flashrom_info.is_bootrom && flashrom_info.part_number === (flashrom_info.part_count - 1)) {
|
||||
data += `<p>
|
||||
|
||||
@@ -70,7 +70,7 @@ class WTVFTP {
|
||||
stream.on('data', (chunk) => {
|
||||
chunks.push(chunk);
|
||||
totalsize += chunk.length;
|
||||
if (totalsize > 1024 * 1024 * 4) {
|
||||
if (totalsize > 1024 * 1024 * this.minisrv_config.services[this.service_name].max_response_size) {
|
||||
this.sendToClient(socket, { 'Status': '413 The item chosen contains too much information to be used.', 'Content-Type': 'text/plain' }, 'Item too large');
|
||||
ftpClient.end();
|
||||
return;
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
"ftp": {
|
||||
"port": 1650,
|
||||
"connections": 3,
|
||||
"max_response_size": 8, // Megabytes
|
||||
"handler_module": "WTVFTP",
|
||||
"handler_extra_vars": ["wtvmime"]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user