kopia lustrzana https://github.com/harvard-lil/archive.social
commit
60a6c62956
|
@ -70,7 +70,7 @@ export class SuccessLog {
|
|||
* - Updates `this.#hashes` (so it doesn't need to reload from file)
|
||||
*
|
||||
* @param {string} identifier - Can be an IP or access key
|
||||
* @param {string} why - Reason for creating this archive
|
||||
* @param {string} why - Reason for creating this archive (500 chars max).
|
||||
* @param {Buffer} pdfBytes - Used to store a SHA512 hash of the PDF that was delivered
|
||||
*/
|
||||
add(identifier, why, pdfBytes) {
|
||||
|
@ -86,6 +86,8 @@ export class SuccessLog {
|
|||
.replaceAll("{", "")
|
||||
.replaceAll("}", "");
|
||||
|
||||
why = why.substring(0, 500);
|
||||
|
||||
// Save entry
|
||||
const entry = `${new Date().toISOString()}\t${identifier}\t${why}\tsha512-${hash}\n`;
|
||||
fs.appendFileSync(SuccessLog.filepath, entry);
|
||||
|
|
|
@ -53,7 +53,7 @@ Calculates hash of a PDF an:
|
|||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| identifier | <code>string</code> | Can be an IP or access key |
|
||||
| why | <code>string</code> | Reason for creating this archive |
|
||||
| why | <code>string</code> | Reason for creating this archive (500 chars max). |
|
||||
| pdfBytes | <code>Buffer</code> | Used to store a SHA512 hash of the PDF that was delivered |
|
||||
|
||||
<a name="utils.module_SuccessLog.SuccessLog+findHashInLogs"></a>
|
||||
|
|
Ładowanie…
Reference in New Issue