Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c5a1f90816 | |||
| 3ec9ef0c91 | |||
| 9f8feb5e40 | |||
| d1a366e88b | |||
| ab36c3c2a5 | |||
| bb5832a751 | |||
| 4ce1ec2f2b | |||
| 1a95a022ea | |||
| 26303f95e8 |
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
> red-coder-bh@1.2.1 build /Users/teacher/code/stc-22-06/red-coder-bh
|
||||||
|
> tsc
|
||||||
|
|
||||||
+3
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "red-coder-bh",
|
"name": "red-coder-bh",
|
||||||
"version": "1.1.0",
|
"version": "1.2.3",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/main.ts",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "nodemon",
|
"start": "nodemon",
|
||||||
"build": "tsc",
|
"build": "tsc",
|
||||||
"up:prod": "node dist/main",
|
"up:prod": "node dist/src/main",
|
||||||
"deploy:d:stop": "docker-compose down",
|
"deploy:d:stop": "docker-compose down",
|
||||||
"deploy:d:build": "docker-compose build",
|
"deploy:d:build": "docker-compose build",
|
||||||
"deploy:d:up": "docker-compose up -d",
|
"deploy:d:up": "docker-compose up -d",
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@ijl/mailer": "^1.1.0",
|
||||||
"@types/cookie-session": "^2.0.44",
|
"@types/cookie-session": "^2.0.44",
|
||||||
"axios": "^0.26.1",
|
"axios": "^0.26.1",
|
||||||
"cookie-session": "^2.0.0",
|
"cookie-session": "^2.0.0",
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { AdminNotificationRequest, addToQueue, configs, init } from '@ijl/mailer'
|
||||||
|
import pkg from '../package.json'
|
||||||
|
|
||||||
|
init({
|
||||||
|
userName: process.env.SMTP_MAIL_LOGIN,
|
||||||
|
password: process.env.SMTP_MAIL_PASSWORD,
|
||||||
|
adminMails: process.env.MAIL_TO_1,
|
||||||
|
smtpConfig: configs.yandex,
|
||||||
|
reserveService: 'gmail',
|
||||||
|
reserveLogin: process.env.MAIL_SERVICE_LOGIN,
|
||||||
|
reservePasswd: process.env.MAIL_SERVICE_PASS,
|
||||||
|
queTimer: process.env.RC_MAIL_STEP_TIMER,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (process.env.MAIL_TO_1 && process.env.MODE !== 'dev') {
|
||||||
|
addToQueue(new AdminNotificationRequest(`Деплой RED-CODER-BH v${pkg.version} прошёл успешно`))
|
||||||
|
}
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@ import { Db } from 'mongodb'
|
|||||||
import { mainDb } from '../../utils/mongo'
|
import { mainDb } from '../../utils/mongo'
|
||||||
import { cleanId } from '../../utils/common'
|
import { cleanId } from '../../utils/common'
|
||||||
import { usersCollection } from '../../__data__/constants'
|
import { usersCollection } from '../../__data__/constants'
|
||||||
|
import { Roles } from '../../model/roles'
|
||||||
|
|
||||||
export const registerUser = async ({ username, regtime, role, email, id, ...rest }) => {
|
export const registerUser = async ({ username, regtime, role, email, id, ...rest }) => {
|
||||||
const db: Db = await mainDb
|
const db: Db = await mainDb
|
||||||
@@ -11,6 +12,7 @@ export const registerUser = async ({ username, regtime, role, email, id, ...rest
|
|||||||
const [registred] = await usersCl.find({ ijlId: id }).toArray()
|
const [registred] = await usersCl.find({ ijlId: id }).toArray()
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
|
role: Roles.User,
|
||||||
...(registred || {}),
|
...(registred || {}),
|
||||||
ijlId: id,
|
ijlId: id,
|
||||||
ijlUser: {
|
ijlUser: {
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
/* Modules */
|
/* Modules */
|
||||||
"module": "commonjs", /* Specify what module code is generated. */
|
"module": "commonjs", /* Specify what module code is generated. */
|
||||||
"rootDir": "./src", /* Specify the root folder within your source files. */
|
"rootDir": ".", /* Specify the root folder within your source files. */
|
||||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
|
|||||||
Reference in New Issue
Block a user