diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/mail.js | 101 | ||||
-rw-r--r-- | config/persona.js | 98 |
2 files changed, 199 insertions, 0 deletions
diff --git a/config/mail.js b/config/mail.js new file mode 100644 index 0000000..6b18db2 --- /dev/null +++ b/config/mail.js | |||
@@ -0,0 +1,101 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | const Env = use('Env') | ||
4 | |||
5 | module.exports = { | ||
6 | /* | ||
7 | |-------------------------------------------------------------------------- | ||
8 | | Connection | ||
9 | |-------------------------------------------------------------------------- | ||
10 | | | ||
11 | | Connection to be used for sending emails. Each connection needs to | ||
12 | | define a driver too. | ||
13 | | | ||
14 | */ | ||
15 | connection: Env.get('MAIL_CONNECTION', 'smtp'), | ||
16 | |||
17 | /* | ||
18 | |-------------------------------------------------------------------------- | ||
19 | | SMTP | ||
20 | |-------------------------------------------------------------------------- | ||
21 | | | ||
22 | | Here we define configuration for sending emails via SMTP. | ||
23 | | | ||
24 | */ | ||
25 | smtp: { | ||
26 | driver: 'smtp', | ||
27 | pool: true, | ||
28 | port: Env.get('SMTP_PORT', 2525), | ||
29 | host: Env.get('SMTP_HOST'), | ||
30 | secure: false, | ||
31 | auth: { | ||
32 | user: Env.get('MAIL_USERNAME'), | ||
33 | pass: Env.get('MAIL_PASSWORD') | ||
34 | }, | ||
35 | maxConnections: 5, | ||
36 | maxMessages: 100, | ||
37 | rateLimit: 10 | ||
38 | }, | ||
39 | |||
40 | /* | ||
41 | |-------------------------------------------------------------------------- | ||
42 | | SparkPost | ||
43 | |-------------------------------------------------------------------------- | ||
44 | | | ||
45 | | Here we define configuration for spark post. Extra options can be defined | ||
46 | | inside the `extra` object. | ||
47 | | | ||
48 | | https://developer.sparkpost.com/api/transmissions.html#header-options-attributes | ||
49 | | | ||
50 | | extras: { | ||
51 | | campaign_id: 'sparkpost campaign id', | ||
52 | | options: { // sparkpost options } | ||
53 | | } | ||
54 | | | ||
55 | */ | ||
56 | sparkpost: { | ||
57 | driver: 'sparkpost', | ||
58 | apiKey: Env.get('SPARKPOST_API_KEY'), | ||
59 | extras: {} | ||
60 | }, | ||
61 | |||
62 | /* | ||
63 | |-------------------------------------------------------------------------- | ||
64 | | Mailgun | ||
65 | |-------------------------------------------------------------------------- | ||
66 | | | ||
67 | | Here we define configuration for mailgun. Extra options can be defined | ||
68 | | inside the `extra` object. | ||
69 | | | ||
70 | | https://mailgun-documentation.readthedocs.io/en/latest/api-sending.html#sending | ||
71 | | | ||
72 | | extras: { | ||
73 | | 'o:tag': '', | ||
74 | | 'o:campaign': '',, | ||
75 | | . . . | ||
76 | | } | ||
77 | | | ||
78 | */ | ||
79 | mailgun: { | ||
80 | driver: 'mailgun', | ||
81 | domain: Env.get('MAILGUN_DOMAIN'), | ||
82 | region: Env.get('MAILGUN_API_REGION'), | ||
83 | apiKey: Env.get('MAILGUN_API_KEY'), | ||
84 | extras: {} | ||
85 | }, | ||
86 | |||
87 | /* | ||
88 | |-------------------------------------------------------------------------- | ||
89 | | Ethereal | ||
90 | |-------------------------------------------------------------------------- | ||
91 | | | ||
92 | | Ethereal driver to quickly test emails in your browser. A disposable | ||
93 | | account is created automatically for you. | ||
94 | | | ||
95 | | https://ethereal.email | ||
96 | | | ||
97 | */ | ||
98 | ethereal: { | ||
99 | driver: 'ethereal' | ||
100 | } | ||
101 | } | ||
diff --git a/config/persona.js b/config/persona.js new file mode 100644 index 0000000..71fbc3f --- /dev/null +++ b/config/persona.js | |||
@@ -0,0 +1,98 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | /* | ||
4 | |-------------------------------------------------------------------------- | ||
5 | | Persona | ||
6 | |-------------------------------------------------------------------------- | ||
7 | | | ||
8 | | The persona is a simple and opinionated service to register, login and | ||
9 | | manage user account | ||
10 | | | ||
11 | */ | ||
12 | |||
13 | module.exports = { | ||
14 | /* | ||
15 | |-------------------------------------------------------------------------- | ||
16 | | Uids | ||
17 | |-------------------------------------------------------------------------- | ||
18 | | | ||
19 | | An array of fields, that can be used to indetify a user uniquely. During | ||
20 | | login and reset password, these fields be checked against the user | ||
21 | | input | ||
22 | | | ||
23 | */ | ||
24 | uids: ['email'], | ||
25 | |||
26 | /* | ||
27 | |-------------------------------------------------------------------------- | ||
28 | | Email field | ||
29 | |-------------------------------------------------------------------------- | ||
30 | | | ||
31 | | The name of the email field inside the database and the user payload. | ||
32 | | | ||
33 | */ | ||
34 | email: 'email', | ||
35 | |||
36 | /* | ||
37 | |-------------------------------------------------------------------------- | ||
38 | | Password | ||
39 | |-------------------------------------------------------------------------- | ||
40 | | | ||
41 | | The password field to be used for verifying and storing user password | ||
42 | | | ||
43 | */ | ||
44 | password: 'password', | ||
45 | |||
46 | /* | ||
47 | |-------------------------------------------------------------------------- | ||
48 | | New account state | ||
49 | |-------------------------------------------------------------------------- | ||
50 | | | ||
51 | | State of user when a new account is created | ||
52 | | | ||
53 | */ | ||
54 | newAccountState: 'pending', | ||
55 | |||
56 | /* | ||
57 | |-------------------------------------------------------------------------- | ||
58 | | Verified account state | ||
59 | |-------------------------------------------------------------------------- | ||
60 | | | ||
61 | | State of user after they verify their email address | ||
62 | | | ||
63 | */ | ||
64 | verifiedAccountState: 'active', | ||
65 | |||
66 | /* | ||
67 | |-------------------------------------------------------------------------- | ||
68 | | Model | ||
69 | |-------------------------------------------------------------------------- | ||
70 | | | ||
71 | | The model to be used for verifying and creating users | ||
72 | | | ||
73 | */ | ||
74 | model: 'App/Models/User', | ||
75 | |||
76 | /* | ||
77 | |-------------------------------------------------------------------------- | ||
78 | | Date Format | ||
79 | |-------------------------------------------------------------------------- | ||
80 | | | ||
81 | | The date format for the tokens table. It is required to calculate the | ||
82 | | expiry of a token. | ||
83 | | | ||
84 | */ | ||
85 | dateFormat: 'YYYY-MM-DD HH:mm:ss', | ||
86 | |||
87 | /* | ||
88 | |-------------------------------------------------------------------------- | ||
89 | | Validation messages | ||
90 | |-------------------------------------------------------------------------- | ||
91 | | | ||
92 | | An object of validation messages to be used when validation fails. | ||
93 | | | ||
94 | */ | ||
95 | validationMessages: () => { | ||
96 | return {} | ||
97 | } | ||
98 | } | ||