chore: jwt key

pull/21/merge
xiaojunnuo 2023-05-26 16:18:24 +08:00
parent 2297121eff
commit f516b0931f
5 changed files with 15 additions and 14 deletions

7
docker/run/build.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
echo "请先输入一个版本号(如 1.0.6)"
read version
echo "您输入的版本号是: $version"
export TAG="$version"
sudo -E docker compose up -d

View File

@ -1,10 +1,10 @@
version: '3.3' # 指定docker-compose 版本 version: '3.3' # 指定docker-compose 版本
services: # 要拉起的服务们 services: # 要拉起的服务们
certd: certd:
build: # build:
context: ./ # context: ./
dockerfile: Dockerfile # dockerfile: Dockerfile
image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest image: registry.cn-shenzhen.aliyuncs.com/handsfree/certd:v${TAG}
container_name: certd # 容器名 container_name: certd # 容器名
restart: unless-stopped # 重启 restart: unless-stopped # 重启
volumes: # 挂载目录 volumes: # 挂载目录

View File

@ -1 +1 @@
CERTD_AUTH_JWT_KEYS=certd666 CERTD_AUTH_JWT_KEY=certd666

View File

@ -5,11 +5,12 @@ import { MidwayConfig } from '@midwayjs/core';
import { UserEntity } from '../modules/authority/entity/user'; import { UserEntity } from '../modules/authority/entity/user';
import { PipelineEntity } from '../modules/pipeline/entity/pipeline'; import { PipelineEntity } from '../modules/pipeline/entity/pipeline';
import * as dotenv from 'dotenv'; import * as dotenv from 'dotenv';
//import { logger } from '../utils/logger';
// load .env file in process.cwd // load .env file in process.cwd
dotenv.config(); dotenv.config();
export default { export default {
// use for cookie sign key, should change to your own and keep security // use for cookie sign key, should change to your own and keep security
keys: process.env.CERTD_AUTH_JWT_KEYS, keys: process.env.CERTD_AUTH_JWT_KEY,
koa: { koa: {
port: 7001, port: 7001,
}, },

View File

@ -2,7 +2,7 @@ import * as validateComp from '@midwayjs/validate';
import * as productionConfig from './config/config.production'; import * as productionConfig from './config/config.production';
import * as previewConfig from './config/config.preview'; import * as previewConfig from './config/config.preview';
import * as defaultConfig from './config/config.default'; import * as defaultConfig from './config/config.default';
import { Configuration, App } from '@midwayjs/decorator'; import { App, Configuration } from '@midwayjs/decorator';
import * as koa from '@midwayjs/koa'; import * as koa from '@midwayjs/koa';
import * as orm from '@midwayjs/typeorm'; import * as orm from '@midwayjs/typeorm';
import * as cache from '@midwayjs/cache'; import * as cache from '@midwayjs/cache';
@ -15,7 +15,6 @@ import { PreviewMiddleware } from './middleware/preview';
import { AuthorityMiddleware } from './middleware/authority'; import { AuthorityMiddleware } from './middleware/authority';
import * as staticFile from '@midwayjs/static-file'; import * as staticFile from '@midwayjs/static-file';
import * as cron from './plugins/cron'; import * as cron from './plugins/cron';
import { logger } from './utils/logger';
@Configuration({ @Configuration({
imports: [koa, orm, cache, flyway, validateComp, cron, staticFile], imports: [koa, orm, cache, flyway, validateComp, cron, staticFile],
@ -46,12 +45,6 @@ export class ContainerLifeCycle {
// bodyparser options see https://github.com/koajs/bodyparser // bodyparser options see https://github.com/koajs/bodyparser
//this.app.use(bodyParser()); //this.app.use(bodyParser());
//请求日志打印 //请求日志打印
setTimeout(() => {
console.log('heart beat ');
logger.info('heart beat');
}, 5000);
this.app.useMiddleware([ this.app.useMiddleware([
ReportMiddleware, ReportMiddleware,
//统一异常处理 //统一异常处理