mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-07 15:19:07 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76485f929d | ||
|
|
1f9d0c29ec | ||
|
|
e7f410831f |
+1
-2
@@ -1,5 +1,4 @@
|
|||||||
FROM node:20-alpine AS base_image
|
FROM node:18.17-alpine AS base_image
|
||||||
RUN npm install -g npm@latest
|
|
||||||
|
|
||||||
FROM base_image AS build_base
|
FROM base_image AS build_base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
FROM node:20-alpine AS base_image
|
|
||||||
RUN npm install -g npm@latest
|
|
||||||
|
|
||||||
FROM base_image AS build_base
|
|
||||||
WORKDIR /app
|
|
||||||
RUN apk update
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
aws-cli \
|
|
||||||
chromium \
|
|
||||||
nss \
|
|
||||||
freetype \
|
|
||||||
harfbuzz \
|
|
||||||
ca-certificates \
|
|
||||||
ttf-freefont
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|
||||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
||||||
|
|
||||||
|
|
||||||
# Local build with secrets
|
|
||||||
FROM build_base AS build
|
|
||||||
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
|
||||||
aws codeartifact login --tool npm --namespace @dadosfera --repository dadosfera-npm --domain dadosfera --domain-owner 611330257153 --region us-east-1
|
|
||||||
RUN npm ci
|
|
||||||
COPY . .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
|
|
||||||
FROM base_image
|
|
||||||
WORKDIR /app
|
|
||||||
COPY --from=build /app/dist ./dist
|
|
||||||
COPY --from=build /app/node_modules ./node_modules
|
|
||||||
COPY --from=build /app/package*.json ./
|
|
||||||
RUN apk update
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
chromium \
|
|
||||||
nss \
|
|
||||||
freetype \
|
|
||||||
harfbuzz \
|
|
||||||
ca-certificates \
|
|
||||||
ttf-freefont
|
|
||||||
|
|
||||||
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
|
|
||||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
||||||
|
|
||||||
ENTRYPOINT ["npm", "run", "start:prod"]
|
|
||||||
@@ -9649,9 +9649,6 @@
|
|||||||
"public",
|
"public",
|
||||||
"private"
|
"private"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"docs": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -9906,9 +9903,6 @@
|
|||||||
"public",
|
"public",
|
||||||
"private"
|
"private"
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"docs": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@@ -9948,9 +9942,6 @@
|
|||||||
},
|
},
|
||||||
"embed": {
|
"embed": {
|
||||||
"$ref": "#/components/schemas/EmbedObject"
|
"$ref": "#/components/schemas/EmbedObject"
|
||||||
},
|
|
||||||
"docs": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
Generated
+3047
-2179
File diff suppressed because it is too large
Load Diff
+3
-9
@@ -35,7 +35,7 @@
|
|||||||
"@aws-sdk/signature-v4": "^3.370.0",
|
"@aws-sdk/signature-v4": "^3.370.0",
|
||||||
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
"@dadosfera/dadosfera-logs": "^1.0.0-beta.4",
|
||||||
"@dadosfera/protospack": "2.5.3",
|
"@dadosfera/protospack": "2.5.3",
|
||||||
"@dadosfera/protospack-v2": "3.38.0-beta.19",
|
"@dadosfera/protospack-v2": "3.38.0-beta.18",
|
||||||
"@grpc/grpc-js": "^1.9.3",
|
"@grpc/grpc-js": "^1.9.3",
|
||||||
"@grpc/proto-loader": "^0.7.9",
|
"@grpc/proto-loader": "^0.7.9",
|
||||||
"@nestjs/cli": "^9.5.0",
|
"@nestjs/cli": "^9.5.0",
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
"@nestjs/schematics": "^9.2.0",
|
"@nestjs/schematics": "^9.2.0",
|
||||||
"@nestjs/swagger": "^6.3.0",
|
"@nestjs/swagger": "^6.3.0",
|
||||||
"@nestjs/testing": "^9.4.3",
|
"@nestjs/testing": "^9.4.3",
|
||||||
"axios": "^0.30.2",
|
"axios": "^0.27.2",
|
||||||
"cache-manager": "^5.1.4",
|
"cache-manager": "^5.1.4",
|
||||||
"cache-manager-ioredis-yet": "^1.1.0",
|
"cache-manager-ioredis-yet": "^1.1.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
@@ -80,13 +80,7 @@
|
|||||||
"swagger-ui-express": "^4.6.3"
|
"swagger-ui-express": "^4.6.3"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"multer": "2.0.2",
|
"multer": "1.4.5-lts.1"
|
||||||
"form-data": "^4.0.4",
|
|
||||||
"body-parser": "^1.20.3",
|
|
||||||
"cross-spawn": "^7.0.5",
|
|
||||||
"glob": "^10.5.0",
|
|
||||||
"path-to-regexp": "^3.3.0",
|
|
||||||
"semver": "^7.5.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/cache-manager": "^4.0.6",
|
"@types/cache-manager": "^4.0.6",
|
||||||
|
|||||||
@@ -98,8 +98,6 @@ export class IDataAsset {
|
|||||||
embed?: EmbedObject;
|
embed?: EmbedObject;
|
||||||
@ApiPropertyOptional({ enum: DataAssetShareType })
|
@ApiPropertyOptional({ enum: DataAssetShareType })
|
||||||
share_type?: DataAssetShareType;
|
share_type?: DataAssetShareType;
|
||||||
@ApiPropertyOptional()
|
|
||||||
docs?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IOneDataAsset {
|
export class IOneDataAsset {
|
||||||
@@ -202,8 +200,6 @@ export class IUpdateDataRequest {
|
|||||||
embed: EmbedObject;
|
embed: EmbedObject;
|
||||||
@ApiPropertyOptional({ enum: DataAssetShareType })
|
@ApiPropertyOptional({ enum: DataAssetShareType })
|
||||||
share_type?: DataAssetShareType;
|
share_type?: DataAssetShareType;
|
||||||
@ApiPropertyOptional()
|
|
||||||
docs?: string;
|
|
||||||
}
|
}
|
||||||
export class ICreateDataAsset implements CreateDataAssetRequest {
|
export class ICreateDataAsset implements CreateDataAssetRequest {
|
||||||
@ApiProperty()
|
@ApiProperty()
|
||||||
@@ -218,8 +214,6 @@ export class ICreateDataAsset implements CreateDataAssetRequest {
|
|||||||
location: string;
|
location: string;
|
||||||
@ApiPropertyOptional()
|
@ApiPropertyOptional()
|
||||||
embed: EmbedObject;
|
embed: EmbedObject;
|
||||||
@ApiPropertyOptional()
|
|
||||||
docs: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class IPreview {
|
export class IPreview {
|
||||||
|
|||||||
@@ -274,9 +274,17 @@ export class UsersController {
|
|||||||
@Language() language: LanguageEnum,
|
@Language() language: LanguageEnum,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
if (user.user_id !== id || !user.permissions.includes(PERMISSIONS_GROUPS.USERS.permissions.ADMIN.seqid)) {
|
const isSameUser = user.user_id === id;
|
||||||
|
const isSuperAdmin = user.permissions.includes(PERMISSIONS_GROUPS.USERS.permissions.ADMIN.seqid)
|
||||||
|
if (!isSameUser && !isSuperAdmin) {
|
||||||
throw new ErrorBuilder(ErrorCodes.AUTH.FORBIDDEN);
|
throw new ErrorBuilder(ErrorCodes.AUTH.FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isSameUser && !isSuperAdmin && body.roleNames) {
|
||||||
|
// Prevent users from updating their own roles
|
||||||
|
delete body.roleNames;
|
||||||
|
}
|
||||||
|
|
||||||
this.logger.info('updateUser', { user });
|
this.logger.info('updateUser', { user });
|
||||||
this.userService.setLanguage(language);
|
this.userService.setLanguage(language);
|
||||||
return await this.userService.updateUser(body, id, user.customer_id);
|
return await this.userService.updateUser(body, id, user.customer_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user