-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366 from LerianStudio/feature/MIDAZ-255
Feature/MIDAZ-255
- Loading branch information
Showing
55 changed files
with
3,149 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
- [ ] Ledger | ||
- [ ] Mdz | ||
- [ ] Transaction | ||
- [ ] Audit | ||
- [ ] Pipeline | ||
- [ ] Documentation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# DEFAULT local | ||
# ENV_NAME=production | ||
|
||
# APP | ||
VERSION=v1.31.0 | ||
SERVER_PORT=3005 | ||
SERVER_ADDRESS=:${SERVER_PORT} | ||
|
||
# LOG LEVEL | ||
LOG_LEVEL=debug | ||
|
||
# MONGO DB | ||
MONGO_HOST=midaz-mongodb | ||
MONGO_NAME=audit | ||
MONGO_USER=midaz | ||
MONGO_PASSWORD=lerian | ||
MONGO_PORT=5703 | ||
|
||
# CASDOOR | ||
CASDOOR_PORT=8080 | ||
CASDOOR_ADDRESS=http://midaz-casdoor:${CASDOOR_PORT} | ||
CASDOOR_CLIENT_ID=9670e0ca55a29a466d31 | ||
CASDOOR_CLIENT_SECRET=dd03f916cacf4a98c6a413d9c38ba102dce436a9 | ||
CASDOOR_ORGANIZATION_NAME=lerian | ||
CASDOOR_APPLICATION_NAME=app-midaz | ||
CASDOOR_MODEL_NAME=api-model | ||
CASDOOR_JWK_ADDRESS=${CASDOOR_ADDRESS}/.well-known/jwks | ||
|
||
# OPEN TELEMETRY | ||
OTEL_RESOURCE_SERVICE_NAME=audit | ||
OTEL_LIBRARY_NAME=github.com/LerianStudio/midaz/components/audit | ||
OTEL_RESOURCE_SERVICE_VERSION=${VERSION} | ||
OTEL_RESOURCE_DEPLOYMENT_ENVIRONMENT=${ENV_NAME} | ||
OTEL_EXPORTER_OTLP_ENDPOINT_PORT=4317 | ||
OTEL_EXPORTER_OTLP_ENDPOINT=midaz-otel-lgtm:${OTEL_EXPORTER_OTLP_ENDPOINT_PORT} | ||
|
||
# RABBITMQ | ||
RABBITMQ_HOST=midaz-rabbitmq | ||
RABBITMQ_PORT_HOST=3003 | ||
RABBITMQ_PORT_AMPQ=3004 | ||
RABBITMQ_DEFAULT_USER=audit | ||
RABBITMQ_DEFAULT_PASS=lerian | ||
RABBITMQ_QUEUE=audit_queue | ||
|
||
# TRILLIAN | ||
TRILLIAN_DATABASE_NAME=audit-db | ||
TRILLIAN_DATABASE_USER=midaz | ||
TRILLIAN_DATABASE_PASSWORD=lerian | ||
TRILLIAN_DATABASE_ROOT_PASSWORD=lerian | ||
TRILLIAN_DATABASE_PORT=5705 | ||
TRILLIAN_GRPC_PORT=8082 | ||
TRILLIAN_HTTP_PORT=8083 | ||
TRILLIAN_SIGNER_PORT=8084 | ||
TRILLIAN_GRPC_ADDRESS=midaz-audit-server:${TRILLIAN_GRPC_PORT} | ||
TRILLIAN_HTTP_ADDRESS=http://midaz-audit-server:${TRILLIAN_HTTP_PORT} | ||
|
||
# SWAGGER | ||
SWAGGER_TITLE=Audit API | ||
SWAGGER_DESCRIPTION=Documentation for the Midaz Audit API | ||
SWAGGER_VERSION=${VERSION} | ||
SWAGGER_HOST=${SERVER_ADDRESS} | ||
SWAGGER_BASE_PATH=/ | ||
SWAGGER_SCHEMES=http | ||
SWAGGER_LEFT_DELIMITER={{ | ||
SWAGGER_RIGHT_DELIMITER=}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM golang:1.23-alpine AS builder | ||
|
||
WORKDIR /audit-app | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLE=0 GOOS=linux go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o /app components/audit/cmd/app/main.go | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder /app /app | ||
|
||
EXPOSE 3005 | ||
|
||
ENTRYPOINT ["/app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
service_name := audit-service | ||
bin_dir := ./.bin | ||
artifacts_dir := ./artifacts | ||
|
||
$(shell mkdir -p $(artifacts_dir)) | ||
|
||
.PHONY: info gen run test cover-html tidy help build up start down destroy stop restart logs logs-api ps generate-docs | ||
|
||
# Display available commands | ||
info: | ||
@echo " " | ||
@echo " " | ||
@echo "To run a specific command inside the auth container using make, you can execute: " | ||
@echo " " | ||
@echo "make auth COMMAND=\"any\" " | ||
@echo " " | ||
@echo "This command will run the specified command inside the auth container. Replace \"any\" with the desired command you want to execute. " | ||
@echo " " | ||
@echo "## App commands:" | ||
@echo " " | ||
@echo " COMMAND=\"generate-docs\" Generates Swagger API documentation using swag." | ||
@echo " " | ||
@echo "## Docker commands:" | ||
@echo " " | ||
@echo " COMMAND=\"build\" Builds all Docker images defined in docker-compose.yml." | ||
@echo " COMMAND=\"up\" Starts and runs all services defined in docker-compose.yml." | ||
@echo " COMMAND=\"start\" Starts existing containers defined in docker-compose.yml without creating them." | ||
@echo " COMMAND=\"stop\" Stops running containers defined in docker-compose.yml without removing them." | ||
@echo " COMMAND=\"down\" Stops and removes containers, networks, and volumes defined in docker-compose.yml." | ||
@echo " COMMAND=\"destroy\" Stops and removes containers, networks, and volumes (including named volumes) defined in docker-compose.yml." | ||
@echo " COMMAND=\"restart\" Stops and removes containers, networks, and volumes, then starts all services in detached mode." | ||
@echo " COMMAND=\"logs\" Shows the last 100 lines of logs and follows live log output for services defined in docker-compose.yml." | ||
@echo " COMMAND=\"logs-api\" Shows the last 100 lines of logs and follows live log output for the auth service defined in docker-compose.yml." | ||
@echo " COMMAND=\"ps\" Lists the status of containers defined in docker-compose.yml." | ||
|
||
# Docker Compose Commands | ||
build: | ||
@docker-compose -f docker-compose.yml build $(c) | ||
|
||
up: | ||
@docker-compose -f docker-compose.yml up $(c) -d | ||
|
||
start: | ||
@docker-compose -f docker-compose.yml start $(c) | ||
|
||
down: | ||
@docker-compose -f docker-compose.yml down $(c) | ||
|
||
destroy: | ||
@docker-compose -f docker-compose.yml down -v $(c) | ||
|
||
stop: | ||
@docker-compose -f docker-compose.yml stop $(c) | ||
|
||
restart: | ||
docker-compose -f docker-compose.yml down $(c) && \ | ||
docker-compose -f docker-compose.yml up -d $(c) | ||
|
||
logs: | ||
@docker-compose -f docker-compose.yml logs --tail=100 -f $(c) | ||
|
||
logs-api: | ||
@docker-compose -f docker-compose.yml logs --tail=100 -f auth | ||
|
||
ps: | ||
@docker-compose -f docker-compose.yml ps | ||
|
||
generate-docs: | ||
@swag init -g ../../../cmd/app/main.go -d ./internal/adapters/http -o ./api --parseDependency --parseInternal |
Oops, something went wrong.