From 72ea96dc71683bbd9afdec12fd3f009c79126dd7 Mon Sep 17 00:00:00 2001 From: ClaraCrazy Date: Thu, 3 Oct 2024 02:14:47 +0200 Subject: [PATCH] Update example config & surroundings --- app.json | 17 ++++++++++++++--- application/config.sample.js | 30 +++++++++++++++--------------- package.json | 2 +- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/app.json b/app.json index 8837ea8..1d310d7 100644 --- a/app.json +++ b/app.json @@ -11,9 +11,13 @@ "DOMAINS": { "description": "Email domains" }, - "DELETE_MAILS_OLDER_THAN_DAYS": { - "description": "How many days to to wait before deleting messages", - "value": 2 + "EMAIL_PURGE_TIME": { + "description": "Config for when to purge the emails", + "value": { + "time": 48, + "unit": "hours", + "convert": true + } }, "IMAP_USER": { "description": "Username to login to the imap server" @@ -47,6 +51,13 @@ "HTTP_BRANDING": { "description": "The branding of the site", "value": ["48hr.email", "Crazyco", "https://crazyco.xyz"] + }, + "HTTP_EXAMPLES": { + "description": "Examples of the domains", + "value": { + "email": "example@48hr.email", + "ids": [1, 2, 3] + } } } } diff --git a/application/config.sample.js b/application/config.sample.js index c5405ad..4618778 100644 --- a/application/config.sample.js +++ b/application/config.sample.js @@ -1,27 +1,27 @@ const config = { email: { - domains: process.env.EMAIL_DOMAINS, - purgeTime: process.env.PURGE_TIME || { - time: 48, + domains: process.env.EMAIL_DOMAINS, // List object of domains + purgeTime: process.env.EMAIL_PURGE_TIME || { + time: 48, // Time value to purge unit: 'hours', // minutes, hours, days convert: true, // Convert to highest sensible unit } }, imap: { - user: process.env.IMAP_USER, - password: process.env.IMAP_PASSWORD, - host: process.env.IMAP_SERVER, - port: process.env.IMAP_PORT || 993, - tls: process.env.IMAP_TLS || true, - authTimeout: process.env.IMAP_AUTHTIMEOUT || 3000, - refreshIntervalSeconds: process.env.IMAP_REFRESH_INTERVAL_SECONDS || 60 + user: process.env.IMAP_USER, // imap user + password: process.env.IMAP_PASSWORD, // imap password + host: process.env.IMAP_SERVER, // imap server + port: process.env.IMAP_PORT || 993, // imap port + tls: process.env.IMAP_TLS || true, // use secure connection? + authTimeout: process.env.IMAP_AUTHTIMEOUT || 3000, // timeout for auth + refreshIntervalSeconds: process.env.IMAP_REFRESH_INTERVAL_SECONDS || 60 // refresh interval }, http: { - port: normalizePort(process.env.HTTP_PORT || 3000), - branding: process.env.HTTP_BRANDING || ["48hr.email", "CrazyCo", "https://crazyco.xyz"], - examples: process.env.HTTP_EXAMPLES || { - email: "example@48hr.email", - ids: [1, 2, 3] + port: normalizePort(process.env.HTTP_PORT || 3000), // http port + branding: process.env.HTTP_BRANDING || ["48hr.email", "CrazyCo", "https://crazyco.xyz"], // branding + examples: process.env.HTTP_EXAMPLES || { + email: "example@48hr.email", // example email + ids: [1, 2, 3] // example ids } }, } diff --git a/package.json b/package.json index 838433e..2b06bd2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "48hr.email", - "version": "1.5.3", + "version": "1.5.4", "private": false, "scripts": { "start": "node --trace-warnings ./app.js",