Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .config/cspell.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: en,pt-BR
words:
- mysql
- postgresql
- herbario
- distro
- caprover
- certbot
Expand Down
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,12 @@ SMTP_PASS="sua-senha-de-app-de-16-digitos"
SMTP_FROM="Sistema HCF <no-reply@hcf.com>"

PAINEL_BASE_URL=http://localhost:5173

PG_DATABASE=herbario_dev
PG_HOST=127.0.0.1
PG_PORT=5432
PG_USERNAME=postgres
PG_PASSWORD=masterkey

PG_MIGRATION_USERNAME=postgres
PG_MIGRATION_PASSWORD=masterkey
24 changes: 11 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
services:
mysql:
image: mysql:8.0
container_name: hcf_mysql
postgres:
image: postgres:18
container_name: herbario_postgresql
environment:
MYSQL_DATABASE: $MYSQL_DATABASE
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD
POSTGRES_DB: $PG_DATABASE
POSTGRES_USER: $PG_USERNAME
POSTGRES_PASSWORD: $PG_PASSWORD
volumes:
- ./mysql/data:/var/lib/mysql
- ./postgresql:/var/lib/postgresql
ports:
- ${MYSQL_PORT}:3306
command:
- --default-time-zone=+00:00
- --character-set-server=utf8mb4
- --sql-mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
- ${PG_PORT:-5432}:5432
shm_size: 128mb

api:
build:
context: .
dockerfile: Dockerfile
platform: linux/amd64
image: hcf-api:local
container_name: hcf_api
container_name: herbario_api
env_file: .env
ports:
- $PORT:$PORT

nginx:
image: nginx:1.17-alpine
container_name: hcf_nginx
container_name: berbario_nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/conf.d:/etc/nginx/conf.d
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/tokens-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default (tipoUsuarioPermitido = []) =>

const usuario = decodificaTokenUsuario(token);

const estaPermitido = !Array.isArray(tipoUsuarioPermitido) || tipoUsuarioPermitido.length < 1 || tipoUsuarioPermitido.includes(usuario.tipo_usuario_id);
const estaPermitido = !Array.isArray(tipoUsuarioPermitido) || tipoUsuarioPermitido.length < 1 || tipoUsuarioPermitido.includes(Number(usuario.tipo_usuario_id));

if (!estaPermitido) {
throw new ForbiddenException(102);
Expand Down
Loading