fix ci and update env variable

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
This commit is contained in:
nyagamunene
2026-04-16 19:51:33 +03:00
parent 87f9195e5f
commit ba6d14b4af
4 changed files with 43 additions and 22 deletions
+2 -2
View File
@@ -286,7 +286,7 @@ func main() {
runInfo := make(chan pkglog.RunInfo, channBuffer)
svc, err := newService(cfg, database, runInfo, authz, ec, logger, readersClient, template, callout, tracer)
svc, err := newService(ctx, cfg, database, runInfo, authz, ec, logger, readersClient, template, callout, tracer)
if err != nil {
logger.Error(fmt.Sprintf("failed to create services: %s", err))
exitCode = 1
@@ -326,7 +326,7 @@ func main() {
}
}
func newService(cfg config, db pgclient.Database, runInfo chan pkglog.RunInfo, authz mgauthz.Authorization, ec email.Config, logger *slog.Logger, readersClient grpcReadersV1.ReadersServiceClient, template reports.ReportTemplate, callout callout.Callout, tracer trace.Tracer) (reports.Service, error) {
func newService(ctx context.Context, cfg config, db pgclient.Database, runInfo chan pkglog.RunInfo, authz mgauthz.Authorization, ec email.Config, logger *slog.Logger, readersClient grpcReadersV1.ReadersServiceClient, template reports.ReportTemplate, callout callout.Callout, tracer trace.Tracer) (reports.Service, error) {
repo := repg.NewRepository(db)
idp := uuid.New()
+20 -20
View File
@@ -520,14 +520,14 @@ MG_RE_DB_SSL_KEY=
MG_RE_DB_SSL_ROOT_CERT=
MG_RE_INSTANCE_ID=
MG_RE_EMAIL_TEMPLATE=re.tmpl
MG_RE_CALLOUT_URLS=http://billing:9022/auth
MG_RE_CALLOUT_URLS=""
MG_RE_CALLOUT_METHOD="POST"
MG_RE_CALLOUT_TLS_VERIFICATION="false"
MG_RE_CALLOUT_TIMEOUT="10s"
MG_RE_CALLOUT_CA_CERT=""
MG_RE_CALLOUT_CERT=""
MG_RE_CALLOUT_KEY=""
MG_RE_CALLOUT_OPERATIONS=create
MG_RE_CALLOUT_OPERATIONS=""
MG_RE_URL=http://re:9008
## Email
@@ -578,14 +578,14 @@ MG_REPORTS_EMAIL_TEMPLATE=reports.tmpl
MG_REPORTS_DEFAULT_TEMPLATE=
MG_PDF_CONVERTER_URL=http://pdf-generator:3000/forms/chromium/convert/html
MG_REPORTS_URL=http://reports:9017
MG_REPORTS_CALLOUT_URLS=http://billing:9022/auth
MG_REPORTS_CALLOUT_METHOD=POST
MG_REPORTS_CALLOUT_TLS_VERIFICATION=false
MG_REPORTS_CALLOUT_TIMEOUT=10s
MG_REPORTS_CALLOUT_CA_CERT=
MG_REPORTS_CALLOUT_CERT=
MG_REPORTS_CALLOUT_KEY=
MG_REPORTS_CALLOUT_OPERATIONS=create
MG_REPORTS_CALLOUT_URLS=""
MG_REPORTS_CALLOUT_METHOD="POST"
MG_REPORTS_CALLOUT_TLS_VERIFICATION="false"
MG_REPORTS_CALLOUT_TIMEOUT="10s"
MG_REPORTS_CALLOUT_CA_CERT=""
MG_REPORTS_CALLOUT_CERT=""
MG_REPORTS_CALLOUT_KEY=""
MG_REPORTS_CALLOUT_OPERATIONS=""
## Addon Services
@@ -708,14 +708,14 @@ MG_RE_DB_SSL_KEY=
MG_RE_DB_SSL_ROOT_CERT=
MG_RE_INSTANCE_ID=
MG_RE_EMAIL_TEMPLATE=re.tmpl
MG_RE_CALLOUT_URLS=http://billing:9022/auth
MG_RE_CALLOUT_URLS=""
MG_RE_CALLOUT_METHOD="POST"
MG_RE_CALLOUT_TLS_VERIFICATION="false"
MG_RE_CALLOUT_TIMEOUT="10s"
MG_RE_CALLOUT_CA_CERT=""
MG_RE_CALLOUT_CERT=""
MG_RE_CALLOUT_KEY=""
MG_RE_CALLOUT_OPERATIONS=create
MG_RE_CALLOUT_OPERATIONS=""
MG_RE_URL=http://re:9008
### Email (shared by RE and Reports)
@@ -766,14 +766,14 @@ MG_REPORTS_EMAIL_TEMPLATE=reports.tmpl
MG_REPORTS_DEFAULT_TEMPLATE=
MG_REPORTS_URL=http://reports:9017
MG_PDF_CONVERTER_URL=http://pdf-generator:3000/forms/chromium/convert/html
MG_REPORTS_CALLOUT_URLS=http://billing:9022/auth
MG_REPORTS_CALLOUT_METHOD=POST
MG_REPORTS_CALLOUT_TLS_VERIFICATION=false
MG_REPORTS_CALLOUT_TIMEOUT=10s
MG_REPORTS_CALLOUT_CA_CERT=
MG_REPORTS_CALLOUT_CERT=
MG_REPORTS_CALLOUT_KEY=
MG_REPORTS_CALLOUT_OPERATIONS=create
MG_REPORTS_CALLOUT_URLS=""
MG_REPORTS_CALLOUT_METHOD="POST"
MG_REPORTS_CALLOUT_TLS_VERIFICATION="false"
MG_REPORTS_CALLOUT_TIMEOUT="10s"
MG_REPORTS_CALLOUT_CA_CERT=""
MG_REPORTS_CALLOUT_CERT=""
MG_REPORTS_CALLOUT_KEY=""
MG_REPORTS_CALLOUT_OPERATIONS=""
### Timescale Reader gRPC Client Config (Magistrala)
MG_TIMESCALE_READER_GRPC_URL=timescale-reader:7011
+8
View File
@@ -2139,6 +2139,14 @@ services:
MG_REPORTS_DB_SSL_ROOT_CERT: ${MG_REPORTS_DB_SSL_ROOT_CERT}
MG_REPORTS_DEFAULT_TEMPLATE: ${MG_REPORTS_DEFAULT_TEMPLATE}
MG_PDF_CONVERTER_URL: ${MG_PDF_CONVERTER_URL}
MG_REPORTS_CALLOUT_URLS: ${MG_REPORTS_CALLOUT_URLS}
MG_REPORTS_CALLOUT_METHOD: ${MG_REPORTS_CALLOUT_METHOD}
MG_REPORTS_CALLOUT_TLS_VERIFICATION: ${MG_REPORTS_CALLOUT_TLS_VERIFICATION}
MG_REPORTS_CALLOUT_TIMEOUT: ${MG_REPORTS_CALLOUT_TIMEOUT}
MG_REPORTS_CALLOUT_CA_CERT: ${MG_REPORTS_CALLOUT_CA_CERT}
MG_REPORTS_CALLOUT_CERT: ${MG_REPORTS_CALLOUT_CERT}
MG_REPORTS_CALLOUT_KEY: ${MG_REPORTS_CALLOUT_KEY}
MG_REPORTS_CALLOUT_OPERATIONS: ${MG_REPORTS_CALLOUT_OPERATIONS}
MG_MESSAGE_BROKER_URL: ${MG_MESSAGE_BROKER_URL}
MG_ES_URL: ${MG_ES_URL}
MG_JAEGER_URL: ${MG_JAEGER_URL}
+13
View File
@@ -85,6 +85,19 @@ The service is configured using the following environment variables (values show
| `MG_REPORTS_DEFAULT_TEMPLATE` | Use on-disk HTML template when non-empty | "" |
| `MG_PDF_CONVERTER_URL` | HTML-to-PDF conversion endpoint | `http://pdf-generator:3000/forms/chromium/convert/html` |
### Callout
| Variable | Description | Default |
| --- | --- | --- |
| `MG_REPORTS_CALLOUT_URLS` | Callout target URLs | "" |
| `MG_REPORTS_CALLOUT_METHOD` | Callout HTTP method | `POST` |
| `MG_REPORTS_CALLOUT_TLS_VERIFICATION` | TLS verification for callout | `false` |
| `MG_REPORTS_CALLOUT_TIMEOUT` | Callout timeout | `10s` |
| `MG_REPORTS_CALLOUT_CA_CERT` | Callout CA cert path | "" |
| `MG_REPORTS_CALLOUT_CERT` | Callout client cert path | "" |
| `MG_REPORTS_CALLOUT_KEY` | Callout client key path | "" |
| `MG_REPORTS_CALLOUT_OPERATIONS` | Callout operations filter | "" |
## Features
- **Report generation**: Build report data from time-series messages.