diff --git a/.gitignore b/.gitignore index 287181f..1eb68c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ -node_modules -.idea -.DS_Store -.vscode -application/config.js .env +.idea +.vscode +.DS_Store + +node_modules +application/config.js + diff --git a/README.md b/README.md index 1aa05df..dcfdcb6 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ All data is being removed 48hrs after they have reached the mail server. - `cd 48hr.email` - `npm i` - Change all settings to the desired values: - - Either use environmental variables, or modify `application/config.js` + - Either use environmental variables, or modify `application/config.sample.js` (Rename to `config.js` after) + - For a list of values, check `application/config.sample.js`. - `npm run start` - #### Service file example: diff --git a/application/config.js b/application/config.sample.js similarity index 62% rename from application/config.js rename to application/config.sample.js index a779b93..acbdf6f 100644 --- a/application/config.js +++ b/application/config.sample.js @@ -2,20 +2,22 @@ const config = { email: { - domains: process.env.DOMAINS, - deleteMailsOlderThanDays: process.env.DELETE_MAILS_OLDER_THAN_DAYS + domains: process.env.EMAIL_DOMAINS, + deleteMailsOlderThanDays: process.env.EMAIL_DELETE_MAILS_OLDER_THAN_DAYS || 2 }, imap: { user: process.env.IMAP_USER, password: process.env.IMAP_PASSWORD, host: process.env.IMAP_SERVER, - port: 993, - tls: true, - authTimeout: 3000, - refreshIntervalSeconds: process.env.IMAP_REFRESH_INTERVAL_SECONDS + 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 || 10 + }, + http: { + port: normalizePort(process.env.HTTP_PORT || '3000'), + branding: process.env.HTTP_BRANDING || ["48hr.email", "CrazyCo", "https://crazyco.xyz"] }, - http: {port: normalizePort(process.env.PORT || '3000')}, - branding: process.env.BRANDING || ["PROJECT_NAME", "YOUR_NAME", "YOUR_WEBSITE"] } if (!config.imap.user || !config.imap.password || !config.imap.host) { @@ -46,4 +48,4 @@ function normalizePort(val) { return false } -module.exports = config +module.exports = config; \ No newline at end of file