Compare commits
No commits in common. "b8b55951e80ec80fbe4cadef0cae04fa73fa6b0a" and "64e38bfae459dc448ef0ed38159004b28280d7f7" have entirely different histories.
b8b55951e8
...
64e38bfae4
|
|
@ -1,24 +1,3 @@
|
||||||
def notify(
|
|
||||||
String context,
|
|
||||||
String giteaUser,
|
|
||||||
String giteaPass,
|
|
||||||
String repositoryUrl,
|
|
||||||
String repositoryName,
|
|
||||||
String commitHash,
|
|
||||||
String buildStatus
|
|
||||||
) {
|
|
||||||
def status = buildStatus == 'success' ? 'success' : 'failure'
|
|
||||||
def description = buildStatus == 'success' ? 'Build succeeded' : 'Build failed'
|
|
||||||
|
|
||||||
sh """
|
|
||||||
curl -X POST \
|
|
||||||
-u "${giteaUser}:${giteaPass}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d '{"context":"${context}","state": "${status}", "description": "${description}"}' \
|
|
||||||
${repositoryUrl}deployer3000/${repositoryName}/statuses/${commitHash}
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
environment {
|
environment {
|
||||||
|
|
@ -78,10 +57,7 @@ pipeline {
|
||||||
-d '{"do":"merge"}' \
|
-d '{"do":"merge"}' \
|
||||||
http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
|
http://git.entcor/api/v1/repos/deployer3000/trust-module-backend/pulls/${prId}/merge
|
||||||
"""
|
"""
|
||||||
echo "PR ${prId} merged successfully into main!"
|
echo "PR ${prId} merged successfully into master!"
|
||||||
def context = "test-org/trust-module-backend/pipeline/pr-${env.CHANGE_TARGET}"
|
|
||||||
def commitHash = sh(script: "git rev-parse HEAD~1", returnStdout: true).trim()
|
|
||||||
notify(context, GITEA_USER, GITEA_PASS, env.GITEA_REPOSITORY_URL, "trust-module-backend", commitHash, "success")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,9 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs/axios": "^4.0.0",
|
"@nestjs/axios": "^4.0.0",
|
||||||
"@nestjs/common": "^11.0.1",
|
"@nestjs/common": "^11.0.1",
|
||||||
"@nestjs/config": "^4.0.0",
|
|
||||||
"@nestjs/core": "^11.0.1",
|
"@nestjs/core": "^11.0.1",
|
||||||
"@nestjs/platform-express": "^11.0.1",
|
"@nestjs/platform-express": "^11.0.1",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.7.9",
|
||||||
"dotenv": "^16.3.1",
|
|
||||||
"reflect-metadata": "^0.2.2",
|
"reflect-metadata": "^0.2.2",
|
||||||
"rxjs": "^7.8.1"
|
"rxjs": "^7.8.1"
|
||||||
},
|
},
|
||||||
|
|
@ -2280,20 +2278,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@nestjs/config": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/config/-/config-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-0hr6lKS//Wf8A6VcV69ts8uD0fke6jtmmmXSxzvwAzOM/HEXEKYEp21nRU+cpYxlYqm7Khb0oTOoVuDGk+AWUw==",
|
|
||||||
"dependencies": {
|
|
||||||
"dotenv": "16.4.7",
|
|
||||||
"dotenv-expand": "12.0.1",
|
|
||||||
"lodash": "4.17.21"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@nestjs/common": "^10.0.0 || ^11.0.0",
|
|
||||||
"rxjs": "^7.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@nestjs/core": {
|
"node_modules/@nestjs/core": {
|
||||||
"version": "11.0.9",
|
"version": "11.0.9",
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.0.9.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.0.9.tgz",
|
||||||
|
|
@ -5234,31 +5218,6 @@
|
||||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dotenv": {
|
|
||||||
"version": "16.4.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
|
||||||
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://dotenvx.com"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dotenv-expand": {
|
|
||||||
"version": "12.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-12.0.1.tgz",
|
|
||||||
"integrity": "sha512-LaKRbou8gt0RNID/9RoI+J2rvXsBRPMV7p+ElHlPhcSARbCPDYcYG2s1TIzAfWv4YSgyY5taidWzzs31lNV3yQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"dotenv": "^16.4.5"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://dotenvx.com"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dunder-proto": {
|
"node_modules/dunder-proto": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
|
|
@ -8026,6 +7985,7 @@
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||||
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/lodash.memoize": {
|
"node_modules/lodash.memoize": {
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,21 @@ export class AuthService {
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
async validateUser(login: string, password: string): Promise<any> {
|
async validateUser(login: string, password: string): Promise<any> {
|
||||||
|
console.log(`Проверка пользователя: ${login}, пароль: ${password}`);
|
||||||
|
|
||||||
// Ищем пользователя по login
|
// Ищем пользователя по login
|
||||||
const user = await this.usersRepository.findOne({ where: { login } });
|
const user = await this.usersRepository.findOne({ where: { login } });
|
||||||
|
|
||||||
|
console.log(`Найденный пользователь:`, user);
|
||||||
|
|
||||||
// Проверяем, что нашли пользователя и пароль совпадает
|
// Проверяем, что нашли пользователя и пароль совпадает
|
||||||
if (user && user.password === password) {
|
if (user && user.password === password) {
|
||||||
|
console.log(`Авторизация успешна`);
|
||||||
const { password, ...result } = user;
|
const { password, ...result } = user;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log(`Ошибка: неверный логин или пароль`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,9 @@ import { AppModule } from './app.module';
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = await NestFactory.create(AppModule);
|
const app = await NestFactory.create(AppModule);
|
||||||
|
|
||||||
//настройка CORS
|
|
||||||
|
|
||||||
app.enableCors({
|
app.enableCors({
|
||||||
origin: '*',
|
origin: '*',
|
||||||
//methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE',
|
||||||
methods: '*',
|
|
||||||
allowedHeaders: 'Content-Type, Authorization',
|
allowedHeaders: 'Content-Type, Authorization',
|
||||||
});
|
});
|
||||||
await app.listen(process.env.PORT ?? 3000);
|
await app.listen(process.env.PORT ?? 3000);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue