Add job queue; e-mail sending; password reset support

This commit is contained in:
garrettmills
2020-05-25 15:45:26 -05:00
parent f371310620
commit 76ba843348
22 changed files with 884 additions and 30 deletions

35
config/jobs.config.js Normal file
View File

@@ -0,0 +1,35 @@
/*
* Job Queue Configuration
* -------------------------------------------------
* This file is provided by flitter-jobs and defines the job
* queues available to the application. It also specifies the
* workers and which queues they process.
*
* You can start a worker process by running the command:
* ./flitter worker <worker name>
*/
const jobs_config = {
// Array of queues by name
queues: [
'mailer',
'password_resets',
],
// Mapping of worker name => worker config
workers: {
// The name of the worker is "main"
main: {
// This worker will process these queues
queues: ['mailer', 'password_resets'],
},
// You can have many workers, and multiple workers can
// process the same queue. Likewise, you can have multiple
// worker processes of the same type.
// (e.g. you can have two "main" workers)
},
}
module.exports = exports = jobs_config

17
config/redis.config.js Normal file
View File

@@ -0,0 +1,17 @@
/*
* Configuration for Flitter-Redis.
* You can access the IORedis instance on the redis service:
* app.di().service('redis').client()
*/
const redis_config = {
// How to connect to the server
// See IORedis docs for config options:
// https://github.com/luin/ioredis#connect-to-redis
server: {
host: env('REDIS_HOST', 'localhost'),
port: env('REDIS_PORT', 6379),
},
}
module.exports = exports = redis_config

12
config/smtp.config.js Normal file
View File

@@ -0,0 +1,12 @@
const smtp_config = {
host: env('SMTP_HOST', 'localhost'),
port: env('SMTP_PORT', 587),
secure: env('SMTP_SECURE', false),
default_sender: env('SMTP_DEFAULT_SENDER'),
auth: {
user: env('SMTP_USER'),
pass: env('SMTP_PASS'),
},
}
module.exports = exports = smtp_config