@opencrvs/toolkit 2.1.0-rc.ff27df4 โ 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -12
- package/build.sh +22 -4
- package/create-countryconfig/index.js +441 -59
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +4 -1
- package/dist/application-config/index.js +362 -284
- package/dist/authentication/index.d.ts +66 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +765 -0
- package/dist/cli.js +3751 -1232
- package/dist/commons/api/router.d.ts +940 -363
- package/dist/commons/application-config/index.d.ts +0 -2
- package/dist/commons/conditionals/conditionals.d.ts +6 -6
- package/dist/commons/conditionals/validate.d.ts +34 -8
- package/dist/commons/events/ActionConfig.d.ts +5 -14
- package/dist/commons/events/ActionDocument.d.ts +35 -15
- package/dist/commons/events/ActionInput.d.ts +4 -4
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/AdvancedSearchConfig.d.ts +48 -12
- package/dist/commons/events/AuditLog.d.ts +148 -0
- package/dist/commons/events/Draft.d.ts +1 -21
- package/dist/commons/events/EventConfig.d.ts +3 -0
- package/dist/commons/events/EventDocument.d.ts +472 -4
- package/dist/commons/events/EventIndex.d.ts +3 -26
- package/dist/commons/events/EventMetadata.d.ts +1 -11
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +109 -63
- package/dist/commons/events/FieldTypeMapping.d.ts +17 -17
- package/dist/commons/events/FieldValue.d.ts +3 -2
- package/dist/commons/events/Flag.d.ts +42 -0
- package/dist/commons/events/FormConfig.d.ts +6 -0
- package/dist/commons/events/PageConfig.d.ts +4 -0
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +17 -14
- package/dist/commons/events/event.d.ts +12 -0
- package/dist/commons/events/index.d.ts +1 -0
- package/dist/commons/events/locationPayloads.d.ts +95 -0
- package/dist/commons/events/locations.d.ts +169 -26
- package/dist/commons/events/mocks.test.utils.d.ts +30 -0
- package/dist/commons/events/scopes.d.ts +21 -1
- package/dist/commons/events/test.utils.d.ts +78 -25
- package/dist/commons/events/utils.d.ts +39 -4
- package/dist/commons/notification/UserNotifications.d.ts +28 -13
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +349 -65
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/index.d.ts +1 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +12 -1
- package/dist/environment/logger.d.ts +15 -3
- package/dist/environment/logger.d.ts.map +1 -1
- package/dist/environment/manage-users.js +1 -1
- package/dist/environment/paths.d.ts +7 -0
- package/dist/environment/paths.d.ts.map +1 -0
- package/dist/environment/paths.js +72 -0
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +20 -14
- package/dist/environment/setup-environment.d.ts +1 -1
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +594 -562
- package/dist/environment/swarm-to-k8s.js +3 -4
- package/dist/environment/templates.d.ts +0 -1
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/environment/templates.js +5 -9
- package/dist/environment/update-workflows.d.ts.map +1 -1
- package/dist/environment/update-workflows.js +21 -5
- package/dist/environment/upgrade.d.ts +2 -0
- package/dist/environment/upgrade.d.ts.map +1 -0
- package/dist/environment/upgrade.js +82 -0
- package/dist/environment/users.js +11 -13
- package/dist/environment/utils.d.ts +0 -12
- package/dist/environment/utils.d.ts.map +1 -1
- package/dist/environment/utils.js +1 -28
- package/dist/events/index.js +7689 -7063
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +3 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +511 -0
- package/dist/migrations/v2.1/add-translations.d.ts +9 -0
- package/dist/migrations/v2.1/add-translations.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-translations.js +149 -0
- package/dist/migrations/{v2.0/rename-api-paths.d.ts โ v2.1/enable-telemetry.d.ts} +1 -1
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +455 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -1
- package/dist/migrations/v2.1/index.js +1952 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +14 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +1 -0
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +348 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +2 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +161 -0
- package/dist/migrations/{v2.0/migrate-scopes.d.ts โ v2.1/remove-sentry.d.ts} +1 -1
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +1 -0
- package/dist/migrations/v2.1/remove-sentry.js +354 -0
- package/dist/migrations/{v2.0/create-events-index.d.ts โ v2.1/rename-trigger-paths.d.ts} +1 -1
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +1 -0
- package/dist/migrations/{v2.0/rename-api-paths.js โ v2.1/rename-trigger-paths.js} +69 -40
- package/dist/migrations/v2.1/template-files.d.ts +8 -0
- package/dist/migrations/v2.1/template-files.d.ts.map +1 -0
- package/dist/migrations/v2.1/template-files.js +49 -0
- package/dist/migrations/v2.1/upgrade-tilt.d.ts +8 -0
- package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +1 -0
- package/dist/migrations/v2.1/upgrade-tilt.js +139 -0
- package/dist/notification/index.js +1887 -1438
- package/dist/scopes/index.d.ts +614 -36
- package/dist/scopes/index.js +351 -65
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +43 -0
- package/dist/templates/charts-values/dependencies/values.yaml +8 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +10 -3
- package/dist/templates/charts-values/opentelemetry/values.yaml +102 -0
- package/dist/templates/charts-values/traefik/values.yaml +23 -9
- package/dist/templates/countryconfig-template/.tiltignore +1 -0
- package/dist/templates/countryconfig-template/Dockerfile.assets +7 -0
- package/dist/templates/countryconfig-template/Tiltfile +112 -0
- package/dist/templates/countryconfig-template/assets/README.md +1 -0
- package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +61 -0
- package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +455 -0
- package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +168 -0
- package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +67 -0
- package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +168 -0
- package/dist/templates/countryconfig-template/assets/metabase/README.md +34 -0
- package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +36 -0
- package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +46 -0
- package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +27737 -0
- package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +21 -0
- package/dist/templates/countryconfig-template/assets/metabase/package.json +13 -0
- package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +108 -0
- package/dist/templates/countryconfig-template/assets/metabase/run.sh +120 -0
- package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +40 -0
- package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +135 -0
- package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +108 -0
- package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +50 -0
- package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +35 -0
- package/dist/templates/countryconfig-template/tilt/common.tilt +145 -0
- package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +15 -0
- package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +56 -0
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +21 -0
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +38 -0
- package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +17 -0
- package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +16 -0
- package/dist/templates/countryconfig-template/tilt/lib.tilt +95 -0
- package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +136 -0
- package/dist/templates/inventory/inventory.template.yml +1 -3
- package/dist/translations/template.d.ts +11 -0
- package/dist/translations/template.d.ts.map +1 -0
- package/dist/translations/template.js +100 -0
- package/dist/verify/endpoints.d.ts +2 -0
- package/dist/verify/endpoints.d.ts.map +1 -0
- package/dist/verify/endpoints.js +510 -0
- package/opencrvs-toolkit-2.1.0.tgz +0 -0
- package/package.json +13 -7
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts +0 -3
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-birth-certificate-issuance-flag.js +0 -429
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts +0 -3
- package/dist/migrations/v2.0/add-resend-invite-notification.d.ts.map +0 -1
- package/dist/migrations/v2.0/add-resend-invite-notification.js +0 -373
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +0 -22
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +0 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +0 -146
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts +0 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +0 -838
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts +0 -3
- package/dist/migrations/v2.0/convert-paragraph-to-heading.d.ts.map +0 -1
- package/dist/migrations/v2.0/convert-paragraph-to-heading.js +0 -158
- package/dist/migrations/v2.0/create-events-index.d.ts.map +0 -1
- package/dist/migrations/v2.0/create-events-index.js +0 -325
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts +0 -11
- package/dist/migrations/v2.0/delete-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/delete-infrastructure-directory.js +0 -123
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts +0 -3
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.d.ts.map +0 -1
- package/dist/migrations/v2.0/fix-accept-requested-registration-function-type.js +0 -110
- package/dist/migrations/v2.0/index.d.ts +0 -13
- package/dist/migrations/v2.0/index.d.ts.map +0 -1
- package/dist/migrations/v2.0/index.js +0 -103
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts +0 -3
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.d.ts.map +0 -1
- package/dist/migrations/v2.0/make-built-in-validate-actions-custom.js +0 -432
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts +0 -13
- package/dist/migrations/v2.0/merge-infrastructure-directory.d.ts.map +0 -1
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +0 -222
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-application-config-url.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-application-config-url.js +0 -343
- package/dist/migrations/v2.0/migrate-scopes.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-scopes.js +0 -305
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-validated-workqueue-status-to-flag.js +0 -267
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts +0 -3
- package/dist/migrations/v2.0/migrate-workqueue-configs.d.ts.map +0 -1
- package/dist/migrations/v2.0/migrate-workqueue-configs.js +0 -317
- package/dist/migrations/v2.0/remove-delete-actions.d.ts +0 -3
- package/dist/migrations/v2.0/remove-delete-actions.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-delete-actions.js +0 -156
- package/dist/migrations/v2.0/remove-demo-scope.d.ts +0 -3
- package/dist/migrations/v2.0/remove-demo-scope.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-demo-scope.js +0 -74
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts +0 -3
- package/dist/migrations/v2.0/remove-deprecated-imports.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-deprecated-imports.js +0 -96
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts +0 -3
- package/dist/migrations/v2.0/remove-fhir-url-helpers.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-fhir-url-helpers.js +0 -163
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts +0 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-hearth-migrations.js +0 -87
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts +0 -3
- package/dist/migrations/v2.0/remove-old-statistics-service.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-old-statistics-service.js +0 -356
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts +0 -3
- package/dist/migrations/v2.0/remove-pending-certification-flag.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-pending-certification-flag.js +0 -109
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts +0 -3
- package/dist/migrations/v2.0/remove-review-from-register-action.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-review-from-register-action.js +0 -163
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts +0 -3
- package/dist/migrations/v2.0/remove-unused-environment-variables.d.ts.map +0 -1
- package/dist/migrations/v2.0/remove-unused-environment-variables.js +0 -186
- package/dist/migrations/v2.0/rename-api-paths.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts +0 -3
- package/dist/migrations/v2.0/rename-location-parent-id.d.ts.map +0 -1
- package/dist/migrations/v2.0/rename-location-parent-id.js +0 -180
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts +0 -3
- package/dist/migrations/v2.0/simplify-analytics-precalculations.d.ts.map +0 -1
- package/dist/migrations/v2.0/simplify-analytics-precalculations.js +0 -195
- package/dist/migrations/v2.0/update-package-json.d.ts +0 -3
- package/dist/migrations/v2.0/update-package-json.d.ts.map +0 -1
- package/dist/migrations/v2.0/update-package-json.js +0 -105
- package/dist/templates/inventory/production.example.yml +0 -77
- package/dist/templates/inventory/qa.example.yml +0 -48
- package/opencrvs-toolkit-2.1.0-rc.ff27df4.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
# null in values.override.yaml.
|
|
8
8
|
##################################################################################
|
|
9
9
|
|
|
10
|
+
network_policy:
|
|
11
|
+
ingress_mode: deny
|
|
12
|
+
egress_mode: deny
|
|
13
|
+
allowed_namespaces:
|
|
14
|
+
- opencrvs-{{env}}
|
|
15
|
+
|
|
10
16
|
# Default: storage_type: host_path
|
|
11
17
|
# host_path option is backward compatible with Docker Swarm,
|
|
12
18
|
# configured to use sub-directories within /data folder
|
|
@@ -69,6 +75,7 @@ backup:
|
|
|
69
75
|
schedule: "0 1 * * *"
|
|
70
76
|
backup_server_secret: backup-server-ssh-credentials
|
|
71
77
|
backup_server_dir: /home/backup/{{env}}
|
|
78
|
+
host: {{backup_host}}
|
|
72
79
|
|
|
73
80
|
|
|
74
81
|
# Restore configuration
|
|
@@ -78,3 +85,4 @@ restore:
|
|
|
78
85
|
backup_server_secret: backup-server-ssh-credentials
|
|
79
86
|
backup_server_dir: /home/backup/{{restore_environment_name}}
|
|
80
87
|
backup_encryption_secret: restore-encryption-secret
|
|
88
|
+
host: {{restore_host}}
|
|
@@ -17,16 +17,23 @@
|
|
|
17
17
|
# - countryconfig.image.tag: Countryconfig image tag
|
|
18
18
|
environment_type: {{environment_type}}
|
|
19
19
|
|
|
20
|
+
network_policy:
|
|
21
|
+
ingress_mode: deny
|
|
22
|
+
egress_mode: deny
|
|
23
|
+
allowed_namespaces:
|
|
24
|
+
- opencrvs-deps-{{env}}
|
|
25
|
+
|
|
20
26
|
hpa:
|
|
21
27
|
enabled: false
|
|
22
28
|
|
|
23
29
|
env:
|
|
24
|
-
APN_SERVICE_URL: "http://apm-server.opencrvs-deps-{{env}}.svc.cluster.local:8200"
|
|
25
30
|
MINIO_BUCKET: ocrvs
|
|
26
31
|
OPENCRVS_ENVIRONMENT: {{opencrvs_environment}}
|
|
27
32
|
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
otel:
|
|
34
|
+
enabled: true
|
|
35
|
+
deployment_environment: {{env}}
|
|
36
|
+
exporter_otlp_endpoint: "opentelemetry-collector.opencrvs-deps-{{env}}.svc.cluster.local:4317"
|
|
30
37
|
|
|
31
38
|
elasticsearch:
|
|
32
39
|
auth_mode: auto
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
mode: deployment
|
|
2
|
+
|
|
3
|
+
image:
|
|
4
|
+
repository: otel/opentelemetry-collector-k8s
|
|
5
|
+
|
|
6
|
+
networkPolicy:
|
|
7
|
+
enabled: true
|
|
8
|
+
presets:
|
|
9
|
+
kubernetesObjects:
|
|
10
|
+
networking:
|
|
11
|
+
enabled: true
|
|
12
|
+
|
|
13
|
+
resources:
|
|
14
|
+
requests:
|
|
15
|
+
cpu: 100m
|
|
16
|
+
memory: 128Mi
|
|
17
|
+
limits:
|
|
18
|
+
cpu: 500m
|
|
19
|
+
memory: 512Mi
|
|
20
|
+
|
|
21
|
+
ports:
|
|
22
|
+
jaeger-compact:
|
|
23
|
+
enabled: false
|
|
24
|
+
jaeger-thrift:
|
|
25
|
+
enabled: false
|
|
26
|
+
jaeger-grpc:
|
|
27
|
+
enabled: false
|
|
28
|
+
zipkin:
|
|
29
|
+
enabled: false
|
|
30
|
+
|
|
31
|
+
config:
|
|
32
|
+
receivers:
|
|
33
|
+
otlp:
|
|
34
|
+
protocols:
|
|
35
|
+
grpc:
|
|
36
|
+
endpoint: ${env:MY_POD_IP}:4317
|
|
37
|
+
http:
|
|
38
|
+
endpoint: ${env:MY_POD_IP}:4318
|
|
39
|
+
prometheus: null
|
|
40
|
+
jaeger: null
|
|
41
|
+
zipkin: null
|
|
42
|
+
|
|
43
|
+
exporters:
|
|
44
|
+
otlp/elastic:
|
|
45
|
+
endpoint: apm-server.opencrvs-deps-{{env}}.svc.cluster.local:8200
|
|
46
|
+
tls:
|
|
47
|
+
insecure: true
|
|
48
|
+
processors:
|
|
49
|
+
batch:
|
|
50
|
+
timeout: 15s
|
|
51
|
+
send_batch_size: 1024
|
|
52
|
+
|
|
53
|
+
memory_limiter:
|
|
54
|
+
check_interval: 5s
|
|
55
|
+
limit_percentage: 80
|
|
56
|
+
spike_limit_percentage: 25
|
|
57
|
+
|
|
58
|
+
transform/traces:
|
|
59
|
+
error_mode: ignore
|
|
60
|
+
trace_statements:
|
|
61
|
+
# Start with the raw path.
|
|
62
|
+
- set(span.attributes["http.route"], span.attributes["url.path"]) where resource.attributes["service.name"] == "traefik" and span.attributes["url.path"] != nil
|
|
63
|
+
|
|
64
|
+
# Match getTracePath(): collapse repeated slashes.
|
|
65
|
+
- replace_pattern(span.attributes["http.route"], "/+", "/") where resource.attributes["service.name"] == "traefik" and span.attributes["http.route"] != nil
|
|
66
|
+
|
|
67
|
+
# Match getTracePath(): replace dynamic-looking segments with "#".
|
|
68
|
+
- replace_pattern(span.attributes["http.route"], "/([^/]*\\.[^/]*|[0-9]+|[0-9a-fA-F]{24}|[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})(/|$)", "/#$$2") where resource.attributes["service.name"] == "traefik" and span.attributes["http.route"] != nil
|
|
69
|
+
|
|
70
|
+
# Concatenate Request method and normalized URL to conform same format as NodeJs.
|
|
71
|
+
- set(span.name, Concat([span.attributes["http.request.method"], span.attributes["http.route"]], " ")) where resource.attributes["service.name"] == "traefik" and span.attributes["http.request.method"] != nil and span.attributes["http.route"] != nil
|
|
72
|
+
|
|
73
|
+
# SDK language to avoid errors in Kibana on APM -> Service Inventory -> Traefik -> Metrics.
|
|
74
|
+
- delete_key(resource.attributes, "telemetry.sdk.language") where resource.attributes["service.name"] == "traefik"
|
|
75
|
+
|
|
76
|
+
# Nginx OTEL module uses older HTTP semantic convention names, so build the span name from http.method and http.route.
|
|
77
|
+
- set(span.name, Concat([span.attributes["http.method"], span.attributes["http.route"]], " ")) where (resource.attributes["service.name"] == "opencrvs_client" or resource.attributes["service.name"] == "opencrvs_login") and span.attributes["http.method"] != nil and span.attributes["http.route"] != nil
|
|
78
|
+
|
|
79
|
+
service:
|
|
80
|
+
telemetry:
|
|
81
|
+
metrics:
|
|
82
|
+
level: none
|
|
83
|
+
readers: null
|
|
84
|
+
pipelines:
|
|
85
|
+
logs: null
|
|
86
|
+
metrics:
|
|
87
|
+
receivers:
|
|
88
|
+
- otlp
|
|
89
|
+
processors:
|
|
90
|
+
- memory_limiter
|
|
91
|
+
- batch
|
|
92
|
+
exporters:
|
|
93
|
+
- otlp/elastic
|
|
94
|
+
traces:
|
|
95
|
+
receivers:
|
|
96
|
+
- otlp
|
|
97
|
+
processors:
|
|
98
|
+
- memory_limiter
|
|
99
|
+
- transform/traces
|
|
100
|
+
- batch
|
|
101
|
+
exporters:
|
|
102
|
+
- otlp/elastic
|
|
@@ -9,16 +9,28 @@
|
|
|
9
9
|
|
|
10
10
|
# Overwriting https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
|
|
11
11
|
namespaceOverride: "traefik"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
access
|
|
19
|
-
|
|
12
|
+
log:
|
|
13
|
+
# "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL", "PANIC"
|
|
14
|
+
level: "INFO"
|
|
15
|
+
# format: "common" # For local environment
|
|
16
|
+
format: "json" # For server environment
|
|
17
|
+
accessLog:
|
|
18
|
+
# -- To enable access logs
|
|
19
|
+
enabled: true
|
|
20
|
+
format: "json"
|
|
21
|
+
|
|
22
|
+
tracing:
|
|
23
|
+
serviceName: traefik
|
|
24
|
+
resourceAttributes:
|
|
25
|
+
deployment.environment.name: "{{env}}"
|
|
26
|
+
service.namespace: traefik
|
|
27
|
+
otlp:
|
|
20
28
|
enabled: true
|
|
21
|
-
|
|
29
|
+
grpc:
|
|
30
|
+
enabled: true
|
|
31
|
+
endpoint: "opentelemetry-collector.opencrvs-deps-{{env}}.svc.cluster.local:4317"
|
|
32
|
+
insecure: true
|
|
33
|
+
|
|
22
34
|
|
|
23
35
|
ingressRoute:
|
|
24
36
|
dashboard:
|
|
@@ -98,6 +110,8 @@ tlsStore:
|
|
|
98
110
|
|
|
99
111
|
deployment:
|
|
100
112
|
hostNetwork: true
|
|
113
|
+
podLabels:
|
|
114
|
+
service_name: traefik
|
|
101
115
|
{{#if static_ssl}}
|
|
102
116
|
kind: DaemonSet
|
|
103
117
|
{{/if}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.opencrvs-core-charts/
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
##########################################################################
|
|
2
|
+
# Tiltfile: OpenCRVS Country config developer
|
|
3
|
+
# For more information about variables, please check:
|
|
4
|
+
# https://github.com/opencrvs/infrastructure/blob/develop/Tiltfile
|
|
5
|
+
|
|
6
|
+
# OpenCRVS core images tag:
|
|
7
|
+
core_images_tag = os.getenv("OPENCRVS_CORE_IMAGE_TAG", "v2.1.0")
|
|
8
|
+
|
|
9
|
+
core_ref = os.getenv("OPENCRVS_CORE_REF", "release/2.1.0")
|
|
10
|
+
|
|
11
|
+
# Build countryconfig image in local registry (use any name and tag you want)
|
|
12
|
+
countryconfig_image_name="opencrvs/ocrvs-countryconfig"
|
|
13
|
+
countryconfig_image_tag="local"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Internal variable for helm charts checkout
|
|
17
|
+
core_charts_dir = ".opencrvs-core-charts"
|
|
18
|
+
|
|
19
|
+
core_repo_url = 'https://github.com/opencrvs/opencrvs-core.git'
|
|
20
|
+
|
|
21
|
+
# Tilt re-evaluates this file on every reload, so clone only once per ref.
|
|
22
|
+
# Delete the directory (or change OPENCRVS_CORE_REF) to fetch the charts again.
|
|
23
|
+
core_charts_marker = "{}/.tilt-ref-{}".format(core_charts_dir, core_ref.replace("/", "_"))
|
|
24
|
+
if not os.path.exists(core_charts_marker):
|
|
25
|
+
print("Cloning OpenCRVS Helm charts ({}) from {}...".format(core_ref, core_repo_url))
|
|
26
|
+
# set -e and git -C: a failed clone must never leave git running in the country config repository
|
|
27
|
+
local("""
|
|
28
|
+
set -e
|
|
29
|
+
rm -rf {core_charts_dir}
|
|
30
|
+
git clone \
|
|
31
|
+
--depth 1 \
|
|
32
|
+
--filter=blob:none \
|
|
33
|
+
--sparse \
|
|
34
|
+
--branch {core_ref} \
|
|
35
|
+
{core_repo_url} \
|
|
36
|
+
{core_charts_dir}
|
|
37
|
+
git -C {core_charts_dir} sparse-checkout set charts
|
|
38
|
+
touch {core_charts_marker}
|
|
39
|
+
""".format(
|
|
40
|
+
core_ref=core_ref,
|
|
41
|
+
core_charts_dir=core_charts_dir,
|
|
42
|
+
core_repo_url=core_repo_url,
|
|
43
|
+
core_charts_marker=core_charts_marker
|
|
44
|
+
))
|
|
45
|
+
else:
|
|
46
|
+
print("Using OpenCRVS Helm charts ({}) from {}".format(core_ref, core_charts_dir))
|
|
47
|
+
|
|
48
|
+
if not os.path.exists('{core_charts_dir}/charts/dependencies'.format(core_charts_dir=core_charts_dir)) or not os.path.exists('{core_charts_dir}/charts/opencrvs-services'.format(core_charts_dir=core_charts_dir)):
|
|
49
|
+
fail('Something went wrong while cloning infrastructure repository!')
|
|
50
|
+
|
|
51
|
+
load('./tilt/opencrvs.tilt', 'setup_opencrvs')
|
|
52
|
+
|
|
53
|
+
# FIXME: in future releases remove this check and require pnpm only, as yarn is deprecated
|
|
54
|
+
# Package manager follows the lockfile, so country configs still on yarn keep working
|
|
55
|
+
if os.path.exists('pnpm-lock.yaml'):
|
|
56
|
+
package_manager = 'pnpm'
|
|
57
|
+
startup_command = 'start:tilt'
|
|
58
|
+
lockfile = 'pnpm-lock.yaml'
|
|
59
|
+
elif os.path.exists('yarn.lock'):
|
|
60
|
+
package_manager = 'yarn'
|
|
61
|
+
startup_command = 'start:prod'
|
|
62
|
+
lockfile = 'yarn.lock'
|
|
63
|
+
else:
|
|
64
|
+
fail('No pnpm-lock.yaml or yarn.lock found, install dependencies before running Tilt')
|
|
65
|
+
|
|
66
|
+
dependency_files = ['./' + lockfile]
|
|
67
|
+
if os.path.exists('.pnpmfile.cjs'):
|
|
68
|
+
dependency_files.append('./.pnpmfile.cjs')
|
|
69
|
+
|
|
70
|
+
# Build countryconfig image
|
|
71
|
+
docker_build(
|
|
72
|
+
"{0}:{1}".format(countryconfig_image_name, countryconfig_image_tag),
|
|
73
|
+
".",
|
|
74
|
+
dockerfile="Dockerfile",
|
|
75
|
+
network="host",
|
|
76
|
+
entrypoint=[package_manager, startup_command],
|
|
77
|
+
only=[
|
|
78
|
+
'./src',
|
|
79
|
+
'./package.json',
|
|
80
|
+
'./tsconfig.json',
|
|
81
|
+
'./Dockerfile'
|
|
82
|
+
] + dependency_files,
|
|
83
|
+
live_update=[
|
|
84
|
+
# Fallback to full rebuild if dependencies change
|
|
85
|
+
fall_back_on(['package.json', lockfile, 'Dockerfile']),
|
|
86
|
+
# Sync source code changes
|
|
87
|
+
sync('./src', '/usr/src/app/src'),
|
|
88
|
+
]
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
# Build image with postgres and metabase assets
|
|
93
|
+
docker_build("{0}:{1}-assets".format(countryconfig_image_name, countryconfig_image_tag), ".",
|
|
94
|
+
dockerfile="Dockerfile.assets",
|
|
95
|
+
network="host",
|
|
96
|
+
only=[
|
|
97
|
+
'assets/metabase',
|
|
98
|
+
'assets/postgres',
|
|
99
|
+
'assets/deployment',
|
|
100
|
+
'assets/elasticsearch',
|
|
101
|
+
'./Dockerfile.assets'
|
|
102
|
+
]
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
setup_opencrvs(
|
|
106
|
+
opencrvs_chart_repo=core_charts_dir,
|
|
107
|
+
core_images_tag=core_images_tag,
|
|
108
|
+
countryconfig_image_name=countryconfig_image_name,
|
|
109
|
+
countryconfig_image_tag=countryconfig_image_tag,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
print("โ
Tiltfile configuration loaded successfully.")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Put custom assets and scripts to extend Country Configuration
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
3
|
+
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
4
|
+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
5
|
+
#
|
|
6
|
+
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
7
|
+
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
8
|
+
#
|
|
9
|
+
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
10
|
+
|
|
11
|
+
set -e
|
|
12
|
+
|
|
13
|
+
echo "๐งน Clearing all development data..."
|
|
14
|
+
|
|
15
|
+
# Default PostgreSQL connection parameters for development
|
|
16
|
+
POSTGRES_HOST=${POSTGRES_HOST:-localhost}
|
|
17
|
+
POSTGRES_PORT=${POSTGRES_PORT:-5432}
|
|
18
|
+
POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
19
|
+
POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-postgres}
|
|
20
|
+
ANALYTICS_POSTGRES_USER=${ANALYTICS_POSTGRES_USER:-events_analytics}
|
|
21
|
+
|
|
22
|
+
print_usage_and_exit() {
|
|
23
|
+
echo 'Usage: ./clear-all-data-dev.sh'
|
|
24
|
+
echo ""
|
|
25
|
+
echo "Environment variables (with defaults for development):"
|
|
26
|
+
echo "POSTGRES_HOST=${POSTGRES_HOST}"
|
|
27
|
+
echo "POSTGRES_PORT=${POSTGRES_PORT}"
|
|
28
|
+
echo "POSTGRES_USER=${POSTGRES_USER}"
|
|
29
|
+
echo "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
|
|
30
|
+
echo "ANALYTICS_POSTGRES_USER=${ANALYTICS_POSTGRES_USER}"
|
|
31
|
+
echo ""
|
|
32
|
+
echo "This script clears all development databases including:"
|
|
33
|
+
echo "- PostgreSQL analytics schema and data"
|
|
34
|
+
echo "- Metabase configuration database (H2)"
|
|
35
|
+
echo "- Any additional custom databases (can be extended by country configurations)"
|
|
36
|
+
exit 1
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
# Check if PostgreSQL is accessible
|
|
40
|
+
if ! PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d postgres -c '\q' 2>/dev/null; then
|
|
41
|
+
echo "โ Cannot connect to PostgreSQL at ${POSTGRES_HOST}:${POSTGRES_PORT}"
|
|
42
|
+
echo " Make sure PostgreSQL is running and credentials are correct."
|
|
43
|
+
print_usage_and_exit
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# Clear PostgreSQL analytics schema
|
|
47
|
+
echo "๐๏ธ Clearing PostgreSQL analytics schema..."
|
|
48
|
+
PGPASSWORD="$POSTGRES_PASSWORD" psql -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER" -d events -v ON_ERROR_STOP=1 <<EOSQL || echo "โ ๏ธ Analytics schema may not exist yet"
|
|
49
|
+
-- Drop analytics schema and recreate it
|
|
50
|
+
DROP SCHEMA IF EXISTS analytics CASCADE;
|
|
51
|
+
CREATE SCHEMA analytics;
|
|
52
|
+
|
|
53
|
+
-- Drop and recreate analytics user
|
|
54
|
+
DROP ROLE IF EXISTS "$ANALYTICS_POSTGRES_USER";
|
|
55
|
+
EOSQL
|
|
56
|
+
|
|
57
|
+
echo "โ
PostgreSQL analytics data cleared"
|
|
58
|
+
|
|
59
|
+
echo ""
|
|
60
|
+
echo "๐ All development data cleared successfully!"
|
|
61
|
+
echo ""
|