@opencrvs/toolkit 2.0.1 → 2.1.0-beta
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 +16 -0
- package/build.sh +14 -5
- package/create-countryconfig/index.js +293 -103
- package/create-countryconfig/node_modules/.bin/degit +21 -0
- package/create-countryconfig/package.json +5 -2
- package/dist/application-config/index.js +369 -282
- package/dist/authentication/index.d.ts +67 -0
- package/dist/authentication/index.d.ts.map +1 -0
- package/dist/authentication/index.js +750 -0
- package/dist/cli.js +4343 -4788
- package/dist/commons/api/router.d.ts +4120 -2946
- package/dist/commons/application-config/index.d.ts +6 -6
- package/dist/commons/conditionals/conditionals.d.ts +32 -323
- package/dist/commons/conditionals/validate.d.ts +16 -5
- package/dist/commons/events/ActionConfig.d.ts +302 -71
- package/dist/commons/events/ActionDocument.d.ts +159 -121
- package/dist/commons/events/ActionInput.d.ts +30 -10
- package/dist/commons/events/ActionStatus.d.ts +14 -0
- package/dist/commons/events/ActionType.d.ts +63 -58
- package/dist/commons/events/AdvancedSearchConfig.d.ts +531 -501
- package/dist/commons/events/AuditLog.d.ts +189 -40
- package/dist/commons/events/CompositeFieldValue.d.ts +4 -4
- package/dist/commons/events/Conditional.d.ts +3 -3
- package/dist/commons/events/CountryConfigQueryInput.d.ts +603 -561
- package/dist/commons/events/Draft.d.ts +38 -36
- package/dist/commons/events/DynamicFieldValue.d.ts +9 -9
- package/dist/commons/events/EventConfig.d.ts +8 -3
- package/dist/commons/events/EventDocument.d.ts +537 -47
- package/dist/commons/events/EventIndex.d.ts +61 -59
- package/dist/commons/events/EventMetadata.d.ts +59 -43
- package/dist/commons/events/EventStatus.d.ts +19 -0
- package/dist/commons/events/FieldConfig.d.ts +424 -384
- package/dist/commons/events/FieldType.d.ts +51 -51
- package/dist/commons/events/FieldTypeMapping.d.ts +86 -86
- package/dist/commons/events/FieldValue.d.ts +14 -14
- package/dist/commons/events/Flag.d.ts +57 -15
- package/dist/commons/events/FormConfig.d.ts +0 -6
- package/dist/commons/events/PageConfig.d.ts +0 -4
- package/dist/commons/events/PlainDate.d.ts +8 -0
- package/dist/commons/events/SummaryConfig.d.ts +249 -0
- package/dist/commons/events/TemplateConfig.d.ts +1 -1
- package/dist/commons/events/WorkqueueColumnConfig.d.ts +40 -40
- package/dist/commons/events/WorkqueueConfig.d.ts +835 -790
- package/dist/commons/events/deduplication.d.ts +1 -1
- package/dist/commons/events/event.d.ts +14 -2
- package/dist/commons/events/field.d.ts +69 -198
- 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 +248 -14
- package/dist/commons/events/mocks.test.utils.d.ts +48 -4
- package/dist/commons/events/scopes.d.ts +5 -4
- package/dist/commons/events/state/index.d.ts +23 -15
- package/dist/commons/events/state/utils.d.ts +15 -6
- package/dist/commons/events/test.utils.d.ts +68 -42
- package/dist/commons/events/utils.d.ts +139 -110
- package/dist/commons/notification/UserNotifications.d.ts +38 -18
- package/dist/commons/notification/dispatch.d.ts +10 -0
- package/dist/commons/notification/index.d.ts +1 -0
- package/dist/conditionals/index.js +341 -68
- package/dist/csv.d.ts +25 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/csv.js +120 -0
- package/dist/environment/custom-types.d.ts +33 -0
- package/dist/environment/custom-types.d.ts.map +1 -0
- package/dist/environment/custom-types.js +12 -0
- package/dist/environment/derived-variables.d.ts +122 -0
- package/dist/environment/derived-variables.d.ts.map +1 -0
- package/dist/environment/derived-variables.js +155 -0
- package/dist/environment/editor-questions.d.ts +4 -0
- package/dist/environment/editor-questions.d.ts.map +1 -0
- package/dist/environment/editor-questions.js +67 -0
- package/dist/environment/git.d.ts +5 -0
- package/dist/environment/git.d.ts.map +1 -0
- package/dist/environment/git.js +38 -0
- package/dist/environment/github.d.ts +26 -0
- package/dist/environment/github.d.ts.map +1 -0
- package/dist/environment/github.js +247 -0
- package/dist/environment/index.d.ts +6 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +81 -0
- package/dist/environment/logger.d.ts +18 -0
- package/dist/environment/logger.d.ts.map +1 -0
- package/dist/environment/logger.js +25 -0
- package/dist/environment/manage-users.d.ts +11 -0
- package/dist/environment/manage-users.d.ts.map +1 -0
- package/dist/environment/manage-users.js +507 -0
- 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-helper.d.ts +15 -0
- package/dist/environment/questions-helper.d.ts.map +1 -0
- package/dist/environment/questions-helper.js +70 -0
- package/dist/environment/questions.d.ts +200 -0
- package/dist/environment/questions.d.ts.map +1 -0
- package/dist/environment/questions.js +418 -0
- package/dist/environment/setup-environment.d.ts +2 -0
- package/dist/environment/setup-environment.d.ts.map +1 -0
- package/dist/environment/setup-environment.js +795 -0
- package/dist/environment/ssh-keygen.d.ts +5 -0
- package/dist/environment/ssh-keygen.d.ts.map +1 -0
- package/dist/environment/ssh-keygen.js +21 -0
- package/dist/environment/swarm-to-k8s.d.ts +2 -0
- package/dist/environment/swarm-to-k8s.d.ts.map +1 -0
- package/dist/environment/swarm-to-k8s.js +183 -0
- package/dist/environment/templates.d.ts +27 -0
- package/dist/environment/templates.d.ts.map +1 -0
- package/dist/environment/templates.js +164 -0
- package/dist/environment/update-workflows.d.ts +2 -0
- package/dist/environment/update-workflows.d.ts.map +1 -0
- package/dist/environment/update-workflows.js +191 -0
- 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.d.ts +2 -0
- package/dist/environment/users.d.ts.map +1 -0
- package/dist/environment/users.js +120 -0
- package/dist/environment/utils.d.ts +18 -0
- package/dist/environment/utils.d.ts.map +1 -0
- package/dist/environment/utils.js +110 -0
- package/dist/events/deduplication.d.ts +1 -1
- package/dist/events/index.js +8104 -7408
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts +2 -2
- package/dist/migrations/v2.0/checkout-upstream-files.d.ts.map +1 -1
- package/dist/migrations/v2.0/checkout-upstream-files.js +2 -2
- package/dist/migrations/v2.0/convert-config-files-to-ts.js +17 -7
- package/dist/migrations/v2.0/index.js +88 -5143
- package/dist/migrations/v2.0/merge-infrastructure-directory.js +3 -3
- package/dist/migrations/v2.0/migrate-application-config-url.js +4 -3
- package/dist/migrations/v2.0/remove-hearth-migrations.js +17 -7
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +3 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +1 -0
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +234 -0
- 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 +213 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts +3 -0
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +1 -0
- package/dist/migrations/v2.1/enable-telemetry.js +438 -0
- package/dist/migrations/v2.1/index.d.ts +6 -0
- package/dist/migrations/v2.1/index.d.ts.map +1 -0
- package/dist/migrations/v2.1/index.js +1276 -0
- package/dist/notification/index.js +2010 -1451
- package/dist/scopes/index.d.ts +512 -231
- package/dist/scopes/index.js +342 -68
- package/dist/telemetry/index.d.ts +45 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +39 -0
- package/dist/templates/charts-values/dependencies/values.override.yaml +4 -0
- package/dist/templates/charts-values/dependencies/values.yaml +82 -0
- package/dist/templates/charts-values/opencrvs-services/values.override.yaml +4 -0
- package/dist/templates/charts-values/opencrvs-services/values.yaml +78 -0
- package/dist/templates/charts-values/opentelemetry/values.yaml +95 -0
- package/dist/templates/charts-values/traefik/values.override.yaml +4 -0
- package/dist/templates/charts-values/traefik/values.yaml +129 -0
- package/dist/templates/inventory/inventory.template.yml +98 -0
- package/dist/translations/check.d.ts +19 -0
- package/dist/translations/check.d.ts.map +1 -0
- package/dist/translations/check.js +127 -0
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +25 -25
- package/opencrvs-toolkit-2.1.0-beta.tgz +0 -0
- package/package.json +25 -6
- package/tsconfig.build.json +11 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/opencrvs-toolkit-2.0.1.tgz +0 -0
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# GENERATED FILE — DO NOT EDIT
|
|
3
|
+
#
|
|
4
|
+
# This file is managed by `opencrvs environment init` and may be overwritten.
|
|
5
|
+
# Put all custom Helm values in values.override.yaml, preserving the same YAML
|
|
6
|
+
# hierarchy used here. To remove a generated section, set its top-level key to
|
|
7
|
+
# null in values.override.yaml.
|
|
8
|
+
##################################################################################
|
|
9
|
+
|
|
10
|
+
# Default: storage_type: host_path
|
|
11
|
+
# host_path option is backward compatible with Docker Swarm,
|
|
12
|
+
# configured to use sub-directories within /data folder
|
|
13
|
+
# For new installations feel free to remove storage_type
|
|
14
|
+
storage_type: host_path
|
|
15
|
+
|
|
16
|
+
# All datastores are placed on first node (master1) for backward compatibility
|
|
17
|
+
# with Docker Swarm.
|
|
18
|
+
# For new installations feel free to remove node_selector
|
|
19
|
+
node_selector:
|
|
20
|
+
role: data1
|
|
21
|
+
|
|
22
|
+
minio:
|
|
23
|
+
use_default_credentials: false
|
|
24
|
+
{{#if restore_enabled}}
|
|
25
|
+
restore:
|
|
26
|
+
type: {{restore_type}}
|
|
27
|
+
{{/if}}
|
|
28
|
+
{{#if backup_enabled}}
|
|
29
|
+
backup:
|
|
30
|
+
type: {{backup_type}}
|
|
31
|
+
{{/if}}
|
|
32
|
+
|
|
33
|
+
elasticsearch:
|
|
34
|
+
use_default_credentials: false
|
|
35
|
+
|
|
36
|
+
postgres:
|
|
37
|
+
use_default_credentials: false
|
|
38
|
+
{{#if restore_enabled}}
|
|
39
|
+
restore:
|
|
40
|
+
type: {{restore_type}}
|
|
41
|
+
{{/if}}
|
|
42
|
+
{{#if backup_enabled}}
|
|
43
|
+
backup:
|
|
44
|
+
type: {{backup_type}}
|
|
45
|
+
{{/if}}
|
|
46
|
+
|
|
47
|
+
redis:
|
|
48
|
+
auth_mode: acl
|
|
49
|
+
|
|
50
|
+
monitoring:
|
|
51
|
+
enabled: true
|
|
52
|
+
|
|
53
|
+
elastalert:
|
|
54
|
+
env:
|
|
55
|
+
NOTIFICATION_TYPE: email
|
|
56
|
+
secrets:
|
|
57
|
+
smtp-config:
|
|
58
|
+
- ALERT_EMAIL
|
|
59
|
+
- SENDER_EMAIL_ADDRESS
|
|
60
|
+
- SMTP_HOST
|
|
61
|
+
- SMTP_PASSWORD
|
|
62
|
+
- SMTP_PORT
|
|
63
|
+
- SMTP_SECURE
|
|
64
|
+
- SMTP_USERNAME
|
|
65
|
+
|
|
66
|
+
# Backup configuration
|
|
67
|
+
backup:
|
|
68
|
+
enabled: {{backup_enabled}}
|
|
69
|
+
schedule: "0 1 * * *"
|
|
70
|
+
backup_server_secret: backup-server-ssh-credentials
|
|
71
|
+
backup_server_dir: /home/backup/{{env}}
|
|
72
|
+
host: {{backup_host}}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
# Restore configuration
|
|
76
|
+
restore:
|
|
77
|
+
enabled: {{restore_enabled}}
|
|
78
|
+
schedule: "0 0 * * *"
|
|
79
|
+
backup_server_secret: backup-server-ssh-credentials
|
|
80
|
+
backup_server_dir: /home/backup/{{restore_environment_name}}
|
|
81
|
+
backup_encryption_secret: restore-encryption-secret
|
|
82
|
+
host: {{restore_host}}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# Use this file to customize helm chart behavior
|
|
3
|
+
# Please make sure your custom changes doesn't conflict with values.yaml
|
|
4
|
+
##################################################################################
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# GENERATED FILE — DO NOT EDIT
|
|
3
|
+
#
|
|
4
|
+
# This file is managed by `opencrvs environment init` and may be overwritten.
|
|
5
|
+
# Put all custom Helm values in values.override.yaml, preserving the same YAML
|
|
6
|
+
# hierarchy used here. To remove a generated section, set its top-level key to
|
|
7
|
+
# null in values.override.yaml.
|
|
8
|
+
##################################################################################
|
|
9
|
+
|
|
10
|
+
########################################################################################
|
|
11
|
+
# Initial configuration file for OpenCRVS installation
|
|
12
|
+
########################################################################################
|
|
13
|
+
# Some properties are not defined in this file and should be provided as key/value at
|
|
14
|
+
# installation time:
|
|
15
|
+
# - hostname: valid DNS name for opencrvs
|
|
16
|
+
# - countryconfig.image.name: Countryconfig image repository
|
|
17
|
+
# - countryconfig.image.tag: Countryconfig image tag
|
|
18
|
+
environment_type: {{environment_type}}
|
|
19
|
+
|
|
20
|
+
hpa:
|
|
21
|
+
enabled: false
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
MINIO_BUCKET: ocrvs
|
|
25
|
+
OPENCRVS_ENVIRONMENT: {{opencrvs_environment}}
|
|
26
|
+
|
|
27
|
+
otel:
|
|
28
|
+
enabled: true
|
|
29
|
+
deployment_environment: {{env}}
|
|
30
|
+
exporter_otlp_endpoint: "opentelemetry-collector.opencrvs-deps-{{env}}.svc.cluster.local:4317"
|
|
31
|
+
|
|
32
|
+
elasticsearch:
|
|
33
|
+
auth_mode: auto
|
|
34
|
+
host: elasticsearch.opencrvs-deps-{{env}}.svc.cluster.local
|
|
35
|
+
|
|
36
|
+
minio:
|
|
37
|
+
auth_mode: use_secret
|
|
38
|
+
host: minio-0.minio.opencrvs-deps-{{env}}.svc.cluster.local
|
|
39
|
+
|
|
40
|
+
redis:
|
|
41
|
+
auth_mode: use_secret
|
|
42
|
+
host: redis-0.redis.opencrvs-deps-{{env}}.svc.cluster.local
|
|
43
|
+
|
|
44
|
+
postgres:
|
|
45
|
+
auth_mode: auto
|
|
46
|
+
host: postgres-0.postgres.opencrvs-deps-{{env}}.svc.cluster.local
|
|
47
|
+
|
|
48
|
+
platform:
|
|
49
|
+
imagePullSecrets:
|
|
50
|
+
# Default value for credentials created while yarn environment:init
|
|
51
|
+
- name: dockerhub-credentials
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
auth:
|
|
55
|
+
env:
|
|
56
|
+
TWO_FA_ENABLED: {{two_fa_enabled}}
|
|
57
|
+
|
|
58
|
+
events:
|
|
59
|
+
env:
|
|
60
|
+
TWO_FA_ENABLED: {{two_fa_enabled}}
|
|
61
|
+
|
|
62
|
+
countryconfig:
|
|
63
|
+
secrets:
|
|
64
|
+
smtp-config:
|
|
65
|
+
- ALERT_EMAIL
|
|
66
|
+
- SENDER_EMAIL_ADDRESS
|
|
67
|
+
- SMTP_HOST
|
|
68
|
+
- SMTP_PASSWORD
|
|
69
|
+
- SMTP_PORT
|
|
70
|
+
- SMTP_SECURE
|
|
71
|
+
- SMTP_USERNAME
|
|
72
|
+
|
|
73
|
+
dashboards:
|
|
74
|
+
use_default_credentials: false
|
|
75
|
+
enabled: true
|
|
76
|
+
|
|
77
|
+
on_restore_cronjob:
|
|
78
|
+
enabled: {{restore_enabled}}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
mode: deployment
|
|
2
|
+
|
|
3
|
+
image:
|
|
4
|
+
repository: otel/opentelemetry-collector-k8s
|
|
5
|
+
|
|
6
|
+
resources:
|
|
7
|
+
requests:
|
|
8
|
+
cpu: 100m
|
|
9
|
+
memory: 128Mi
|
|
10
|
+
limits:
|
|
11
|
+
cpu: 500m
|
|
12
|
+
memory: 512Mi
|
|
13
|
+
|
|
14
|
+
ports:
|
|
15
|
+
jaeger-compact:
|
|
16
|
+
enabled: false
|
|
17
|
+
jaeger-thrift:
|
|
18
|
+
enabled: false
|
|
19
|
+
jaeger-grpc:
|
|
20
|
+
enabled: false
|
|
21
|
+
zipkin:
|
|
22
|
+
enabled: false
|
|
23
|
+
|
|
24
|
+
config:
|
|
25
|
+
receivers:
|
|
26
|
+
otlp:
|
|
27
|
+
protocols:
|
|
28
|
+
grpc:
|
|
29
|
+
endpoint: ${env:MY_POD_IP}:4317
|
|
30
|
+
http:
|
|
31
|
+
endpoint: ${env:MY_POD_IP}:4318
|
|
32
|
+
prometheus: null
|
|
33
|
+
jaeger: null
|
|
34
|
+
zipkin: null
|
|
35
|
+
|
|
36
|
+
exporters:
|
|
37
|
+
otlp/elastic:
|
|
38
|
+
endpoint: apm-server.opencrvs-deps-{{env}}.svc.cluster.local:8200
|
|
39
|
+
tls:
|
|
40
|
+
insecure: true
|
|
41
|
+
processors:
|
|
42
|
+
batch:
|
|
43
|
+
timeout: 15s
|
|
44
|
+
send_batch_size: 1024
|
|
45
|
+
|
|
46
|
+
memory_limiter:
|
|
47
|
+
check_interval: 5s
|
|
48
|
+
limit_percentage: 80
|
|
49
|
+
spike_limit_percentage: 25
|
|
50
|
+
|
|
51
|
+
transform/traces:
|
|
52
|
+
error_mode: ignore
|
|
53
|
+
trace_statements:
|
|
54
|
+
# Start with the raw path.
|
|
55
|
+
- set(span.attributes["http.route"], span.attributes["url.path"]) where resource.attributes["service.name"] == "traefik" and span.attributes["url.path"] != nil
|
|
56
|
+
|
|
57
|
+
# Match getTracePath(): collapse repeated slashes.
|
|
58
|
+
- replace_pattern(span.attributes["http.route"], "/+", "/") where resource.attributes["service.name"] == "traefik" and span.attributes["http.route"] != nil
|
|
59
|
+
|
|
60
|
+
# Match getTracePath(): replace dynamic-looking segments with "#".
|
|
61
|
+
- 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
|
|
62
|
+
|
|
63
|
+
# Concatenate Request method and normalized URL to conform same format as NodeJs.
|
|
64
|
+
- 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
|
|
65
|
+
|
|
66
|
+
# SDK language to avoid errors in Kibana on APM -> Service Inventory -> Traefik -> Metrics.
|
|
67
|
+
- delete_key(resource.attributes, "telemetry.sdk.language") where resource.attributes["service.name"] == "traefik"
|
|
68
|
+
|
|
69
|
+
# Nginx OTEL module uses older HTTP semantic convention names, so build the span name from http.method and http.route.
|
|
70
|
+
- 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
|
|
71
|
+
|
|
72
|
+
service:
|
|
73
|
+
telemetry:
|
|
74
|
+
metrics:
|
|
75
|
+
level: none
|
|
76
|
+
readers: null
|
|
77
|
+
pipelines:
|
|
78
|
+
logs: null
|
|
79
|
+
metrics:
|
|
80
|
+
receivers:
|
|
81
|
+
- otlp
|
|
82
|
+
processors:
|
|
83
|
+
- memory_limiter
|
|
84
|
+
- batch
|
|
85
|
+
exporters:
|
|
86
|
+
- otlp/elastic
|
|
87
|
+
traces:
|
|
88
|
+
receivers:
|
|
89
|
+
- otlp
|
|
90
|
+
processors:
|
|
91
|
+
- memory_limiter
|
|
92
|
+
- transform/traces
|
|
93
|
+
- batch
|
|
94
|
+
exporters:
|
|
95
|
+
- otlp/elastic
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# Use this file to customize helm chart behavior
|
|
3
|
+
# Please make sure your custom changes doesn't conflict with values.yaml
|
|
4
|
+
##################################################################################
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# GENERATED FILE — DO NOT EDIT
|
|
3
|
+
#
|
|
4
|
+
# This file is managed by `opencrvs environment init` and may be overwritten.
|
|
5
|
+
# Put all custom Helm values in values.override.yaml, preserving the same YAML
|
|
6
|
+
# hierarchy used here. To remove a generated section, set its top-level key to
|
|
7
|
+
# null in values.override.yaml.
|
|
8
|
+
##################################################################################
|
|
9
|
+
|
|
10
|
+
# Overwriting https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
|
|
11
|
+
namespaceOverride: "traefik"
|
|
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:
|
|
28
|
+
enabled: true
|
|
29
|
+
grpc:
|
|
30
|
+
enabled: true
|
|
31
|
+
endpoint: "opentelemetry-collector.opencrvs-deps-{{env}}.svc.cluster.local:4317"
|
|
32
|
+
insecure: true
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
ingressRoute:
|
|
36
|
+
dashboard:
|
|
37
|
+
enabled: false
|
|
38
|
+
|
|
39
|
+
# Be explicit that we only use CRDs, not ingress/gw support
|
|
40
|
+
providers:
|
|
41
|
+
kubernetesCRD:
|
|
42
|
+
enabled: true
|
|
43
|
+
kubernetesIngress:
|
|
44
|
+
enabled: false
|
|
45
|
+
kubernetesGateway:
|
|
46
|
+
enabled: false
|
|
47
|
+
|
|
48
|
+
service:
|
|
49
|
+
enabled: true
|
|
50
|
+
single: false
|
|
51
|
+
type: NodePort
|
|
52
|
+
|
|
53
|
+
ports:
|
|
54
|
+
web:
|
|
55
|
+
port: 8000
|
|
56
|
+
hostPort: 80
|
|
57
|
+
protocol: TCP
|
|
58
|
+
nodePort: 30080
|
|
59
|
+
http:
|
|
60
|
+
redirections:
|
|
61
|
+
entryPoint:
|
|
62
|
+
to: websecure
|
|
63
|
+
scheme: https
|
|
64
|
+
permanent: true
|
|
65
|
+
|
|
66
|
+
websecure:
|
|
67
|
+
port: 8443
|
|
68
|
+
hostPort: 443
|
|
69
|
+
protocol: TCP
|
|
70
|
+
nodePort: 30443
|
|
71
|
+
{{#if lets_encrypt}}
|
|
72
|
+
http:
|
|
73
|
+
tls:
|
|
74
|
+
enabled: true
|
|
75
|
+
certResolver: letsencrypt
|
|
76
|
+
{{/if}}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
{{#if lets_encrypt}}
|
|
80
|
+
certificatesResolvers:
|
|
81
|
+
letsencrypt:
|
|
82
|
+
acme:
|
|
83
|
+
tlsChallenge: false
|
|
84
|
+
httpChallenge:
|
|
85
|
+
entryPoint: web
|
|
86
|
+
email: admin@opencrvs.org
|
|
87
|
+
# Storage for certificates:
|
|
88
|
+
storage: /certificates/acme.json
|
|
89
|
+
# NOTE: Sometimes Let's Encrypt hit production SSL certificate issuing limits
|
|
90
|
+
# If you are having issues, switch to staging
|
|
91
|
+
# Staging server
|
|
92
|
+
# caServer: https://acme-staging-v02.api.letsencrypt.org/directory
|
|
93
|
+
# Production server
|
|
94
|
+
caServer: https://acme-v02.api.letsencrypt.org/directory
|
|
95
|
+
|
|
96
|
+
additionalVolumeMounts:
|
|
97
|
+
- name: acme
|
|
98
|
+
mountPath: /certificates
|
|
99
|
+
{{/if}}
|
|
100
|
+
{{#if static_ssl}}
|
|
101
|
+
certificatesResolvers: {}
|
|
102
|
+
|
|
103
|
+
# 👇 Custom TLS configuration
|
|
104
|
+
tlsStore:
|
|
105
|
+
default:
|
|
106
|
+
defaultCertificate:
|
|
107
|
+
# Check documentation how to create secret with static SSL certificate
|
|
108
|
+
secretName: traefik-cert
|
|
109
|
+
{{/if}}
|
|
110
|
+
|
|
111
|
+
deployment:
|
|
112
|
+
hostNetwork: true
|
|
113
|
+
podLabels:
|
|
114
|
+
service_name: traefik
|
|
115
|
+
{{#if static_ssl}}
|
|
116
|
+
kind: DaemonSet
|
|
117
|
+
{{/if}}
|
|
118
|
+
{{#if lets_encrypt}}
|
|
119
|
+
additionalVolumes:
|
|
120
|
+
- name: acme
|
|
121
|
+
hostPath:
|
|
122
|
+
path: /data/traefik
|
|
123
|
+
{{/if}}
|
|
124
|
+
|
|
125
|
+
# If you need to run traefik on all cluster nodes
|
|
126
|
+
# Add this line to traefik/values.override.yaml
|
|
127
|
+
# nodeSelector: {}
|
|
128
|
+
nodeSelector:
|
|
129
|
+
traefik-role: ingress
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
##################################################################################
|
|
2
|
+
# DON'T MODIFY THIS FILE
|
|
3
|
+
# File was generated by "yarn environment:init"
|
|
4
|
+
# File will be overwritten on next run of this script
|
|
5
|
+
# Please use values.override.yaml to modify helm chart behavior
|
|
6
|
+
# make sure your custom changes doesn't conflict with values.yaml
|
|
7
|
+
##################################################################################
|
|
8
|
+
all:
|
|
9
|
+
vars:
|
|
10
|
+
|
|
11
|
+
# Domain/IP address for remote access to your cluster API
|
|
12
|
+
# Domain/IP address will be added as main endpoint to your ~/.kube/config
|
|
13
|
+
# - If you are behind VPN, use private IP address
|
|
14
|
+
# - If your server is exposed (not recommeded), use public IP address
|
|
15
|
+
# - If you would like to run kubectl commands from the remote server, leave this field empty
|
|
16
|
+
# kube_api_host: ''
|
|
17
|
+
# IMPORTANT: If master VM has multiple ethernet interfaces, put private IP address at kube_api_host
|
|
18
|
+
kube_api_host: {{kube_api_host}}
|
|
19
|
+
|
|
20
|
+
# Default ansible provision user, keep as is
|
|
21
|
+
ansible_user: provision
|
|
22
|
+
# single_node:
|
|
23
|
+
# For development/qa/testing/staging keep true
|
|
24
|
+
# For production keep false
|
|
25
|
+
# Defaults production configuration:
|
|
26
|
+
# - master node
|
|
27
|
+
# - 2 worker nodes
|
|
28
|
+
single_node: {{single_node}}
|
|
29
|
+
################################################################
|
|
30
|
+
# DON'T MODIFY THIS SECTION BY HANDS
|
|
31
|
+
# Use: yarn environment:users
|
|
32
|
+
################################################################
|
|
33
|
+
# users: Add as many users as you wish
|
|
34
|
+
# Configuration example
|
|
35
|
+
# - name: <login>
|
|
36
|
+
# ssh_keys:
|
|
37
|
+
# - <public ssh key 1>
|
|
38
|
+
# - <public ssh key 2>
|
|
39
|
+
# state: present
|
|
40
|
+
# role: admin
|
|
41
|
+
# Allowed roles:
|
|
42
|
+
# - operator: grant read only access to OS and full access to kubernetes cluster
|
|
43
|
+
# - admin: grant full access to OS and kubernetes cluster
|
|
44
|
+
# Allowed states:
|
|
45
|
+
# - present: user is allowed to login
|
|
46
|
+
# - absent: user account is disabled
|
|
47
|
+
# users: []
|
|
48
|
+
{{#if users}}
|
|
49
|
+
users:
|
|
50
|
+
{{#each users as |user|}}
|
|
51
|
+
- name: {{user.name}}
|
|
52
|
+
ssh_keys:
|
|
53
|
+
{{#each user.ssh_keys as |key| }}
|
|
54
|
+
- {{{key}}}
|
|
55
|
+
{{/each}}
|
|
56
|
+
state: {{user.state}}
|
|
57
|
+
role: {{user.role}}
|
|
58
|
+
{{/each}}
|
|
59
|
+
{{else}}
|
|
60
|
+
users: []
|
|
61
|
+
{{/if}}
|
|
62
|
+
|
|
63
|
+
children:
|
|
64
|
+
master:
|
|
65
|
+
hosts:
|
|
66
|
+
# Replace master with value returned by command: hostname
|
|
67
|
+
master:
|
|
68
|
+
# Keep values (ansible_host, ansible_connection) as is
|
|
69
|
+
# Ansible is executed on master node
|
|
70
|
+
ansible_host: localhost
|
|
71
|
+
ansible_connection: local
|
|
72
|
+
labels:
|
|
73
|
+
# traefik-role label is used to identify where to deploy traefik
|
|
74
|
+
traefik-role: ingress
|
|
75
|
+
# By default all datastores are deployed to node with role data1
|
|
76
|
+
role: data1
|
|
77
|
+
{{#if kube_worker_nodes}}
|
|
78
|
+
# Workers section is optional, for single node cluster feel free to remove this section
|
|
79
|
+
# section can be added later
|
|
80
|
+
# more workers can be added later as well
|
|
81
|
+
workers:
|
|
82
|
+
hosts:
|
|
83
|
+
{{#each kube_worker_nodes as |host idx|}}
|
|
84
|
+
worker{{idx}}:
|
|
85
|
+
ansible_host: {{host}}
|
|
86
|
+
labels:
|
|
87
|
+
# Labels have index + 2 for backward compatibility with existing swarm setup
|
|
88
|
+
role: data{{data_label_idx idx}}
|
|
89
|
+
{{/each}}
|
|
90
|
+
{{/if}}
|
|
91
|
+
{{#if backup_host}}
|
|
92
|
+
# backup section is optional, feel free to remove if backups are not enabled
|
|
93
|
+
# section can be added later
|
|
94
|
+
backup:
|
|
95
|
+
hosts:
|
|
96
|
+
backup0:
|
|
97
|
+
ansible_host: {{backup_host}}
|
|
98
|
+
{{/if}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type Message = {
|
|
2
|
+
id: string;
|
|
3
|
+
defaultMessage: string;
|
|
4
|
+
description: string;
|
|
5
|
+
};
|
|
6
|
+
export type CheckResult = {
|
|
7
|
+
missing: Message[];
|
|
8
|
+
/** Rows in countryconfig.csv that nothing in the source declares. */
|
|
9
|
+
outdated: string[];
|
|
10
|
+
/** Files declaring a message whose id is assembled at runtime. */
|
|
11
|
+
dynamicIds: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare function check(cwd: string): CheckResult;
|
|
14
|
+
/**
|
|
15
|
+
* Adds a row per missing message, filling in only English — the rest is copy
|
|
16
|
+
* somebody has to write. Returns the ids added.
|
|
17
|
+
*/
|
|
18
|
+
export declare function writeMissing(cwd: string, missing: Message[]): string[];
|
|
19
|
+
//# sourceMappingURL=check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/translations/check.ts"],"names":[],"mappings":"AAwCA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,cAAc,EAAE,MAAM,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,CAAA;CACrB,CAAA;AAgED,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAyB9C;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,YAuB3D"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
4
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
5
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
6
|
+
*
|
|
7
|
+
* OpenCRVS is also distributed under the terms of the Civil Registration
|
|
8
|
+
* & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
9
|
+
*
|
|
10
|
+
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
11
|
+
*/
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.check = check;
|
|
17
|
+
exports.writeMissing = writeMissing;
|
|
18
|
+
/**
|
|
19
|
+
* Checks that every message a country config declares has a row in
|
|
20
|
+
* `countryconfig.csv`.
|
|
21
|
+
*
|
|
22
|
+
* The mirror of the check core runs over its own packages: core validates
|
|
23
|
+
* `client.csv` and `login.csv` against the client and login sources, and this
|
|
24
|
+
* validates `countryconfig.csv` against the country config's own source.
|
|
25
|
+
* Without it, a form or event label added to a country config renders as a raw
|
|
26
|
+
* id.
|
|
27
|
+
*
|
|
28
|
+
* `client.csv` and `login.csv` are read but never written: core owns them, and
|
|
29
|
+
* `opencrvs upgrade` keeps them in sync.
|
|
30
|
+
*/
|
|
31
|
+
const ts_morph_1 = require("ts-morph");
|
|
32
|
+
const path_1 = __importDefault(require("path"));
|
|
33
|
+
const csv_1 = require("../csv");
|
|
34
|
+
const TRANSLATIONS = 'src/translations';
|
|
35
|
+
const OWN_FILE = `${TRANSLATIONS}/countryconfig.csv`;
|
|
36
|
+
const CORE_FILES = [`${TRANSLATIONS}/client.csv`, `${TRANSLATIONS}/login.csv`];
|
|
37
|
+
/**
|
|
38
|
+
* The value of a property when the source says what it is outright. A template
|
|
39
|
+
* literal with something interpolated into it does not count.
|
|
40
|
+
*/
|
|
41
|
+
function staticStringOf(node, name) {
|
|
42
|
+
const property = node.getProperty(name);
|
|
43
|
+
if (!property || !ts_morph_1.Node.isPropertyAssignment(property)) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
const initializer = property.getInitializer();
|
|
47
|
+
return initializer &&
|
|
48
|
+
(ts_morph_1.Node.isStringLiteral(initializer) ||
|
|
49
|
+
ts_morph_1.Node.isNoSubstitutionTemplateLiteral(initializer))
|
|
50
|
+
? initializer.getLiteralValue()
|
|
51
|
+
: undefined;
|
|
52
|
+
}
|
|
53
|
+
function messagesDeclaredIn(cwd) {
|
|
54
|
+
const project = new ts_morph_1.Project({ skipAddingFilesFromTsConfig: true });
|
|
55
|
+
project.addSourceFilesAtPaths([
|
|
56
|
+
path_1.default.join(cwd, 'src/**/*.ts'),
|
|
57
|
+
path_1.default.join(cwd, 'src/**/*.tsx'),
|
|
58
|
+
`!${path_1.default.join(cwd, 'src/**/*.test.ts')}`,
|
|
59
|
+
`!${path_1.default.join(cwd, 'src/**/*.test.tsx')}`,
|
|
60
|
+
`!${path_1.default.join(cwd, 'src/**/*.stories.ts')}`,
|
|
61
|
+
`!${path_1.default.join(cwd, 'src/**/*.stories.tsx')}`
|
|
62
|
+
]);
|
|
63
|
+
const messages = [];
|
|
64
|
+
const dynamicIds = [];
|
|
65
|
+
for (const sourceFile of project.getSourceFiles()) {
|
|
66
|
+
sourceFile.forEachDescendant((node) => {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
if (!ts_morph_1.Node.isObjectLiteralExpression(node)) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (!(node.getProperty('id') && node.getProperty('defaultMessage'))) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const id = staticStringOf(node, 'id');
|
|
75
|
+
if (id === undefined) {
|
|
76
|
+
dynamicIds.push(path_1.default.relative(cwd, sourceFile.getFilePath()));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
messages.push({
|
|
80
|
+
id,
|
|
81
|
+
defaultMessage: (_a = staticStringOf(node, 'defaultMessage')) !== null && _a !== void 0 ? _a : '',
|
|
82
|
+
description: (_b = staticStringOf(node, 'description')) !== null && _b !== void 0 ? _b : ''
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return { messages, dynamicIds: [...new Set(dynamicIds)] };
|
|
87
|
+
}
|
|
88
|
+
function check(cwd) {
|
|
89
|
+
var _a;
|
|
90
|
+
const { messages, dynamicIds } = messagesDeclaredIn(cwd);
|
|
91
|
+
const own = (0, csv_1.readCsvFile)(path_1.default.join(cwd, OWN_FILE));
|
|
92
|
+
const covered = new Set([own, ...CORE_FILES.map((file) => (0, csv_1.readCsvFile)(path_1.default.join(cwd, file)))]
|
|
93
|
+
.flatMap((csv) => { var _a; return (_a = csv === null || csv === void 0 ? void 0 : csv.body) !== null && _a !== void 0 ? _a : []; })
|
|
94
|
+
.map(csv_1.idOf));
|
|
95
|
+
// The same message is often declared in more than one place.
|
|
96
|
+
const missing = [
|
|
97
|
+
...new Map(messages
|
|
98
|
+
.filter(({ id }) => !covered.has(id))
|
|
99
|
+
.map((message) => [message.id, message])).values()
|
|
100
|
+
].sort((a, b) => (a.id < b.id ? -1 : 1));
|
|
101
|
+
const declared = new Set(messages.map(({ id }) => id));
|
|
102
|
+
const outdated = ((_a = own === null || own === void 0 ? void 0 : own.body) !== null && _a !== void 0 ? _a : [])
|
|
103
|
+
.map(csv_1.idOf)
|
|
104
|
+
.filter((id) => !declared.has(id));
|
|
105
|
+
return { missing, outdated, dynamicIds };
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Adds a row per missing message, filling in only English — the rest is copy
|
|
109
|
+
* somebody has to write. Returns the ids added.
|
|
110
|
+
*/
|
|
111
|
+
function writeMissing(cwd, missing) {
|
|
112
|
+
const file = (0, csv_1.readCsvFile)(path_1.default.join(cwd, OWN_FILE));
|
|
113
|
+
if (!file) {
|
|
114
|
+
throw new Error(`${OWN_FILE} not found in ${cwd}`);
|
|
115
|
+
}
|
|
116
|
+
const columns = file.header.split(',');
|
|
117
|
+
const rows = missing.map((message) => (0, csv_1.toCsvLine)(columns.map((column) => {
|
|
118
|
+
if (column === 'id')
|
|
119
|
+
return message.id;
|
|
120
|
+
if (column === 'description')
|
|
121
|
+
return message.description;
|
|
122
|
+
return column === 'en' ? message.defaultMessage : '';
|
|
123
|
+
})));
|
|
124
|
+
const added = (0, csv_1.addRows)(file, rows);
|
|
125
|
+
(0, csv_1.writeCsvFile)(path_1.default.join(cwd, OWN_FILE), file);
|
|
126
|
+
return added;
|
|
127
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/verify/endpoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/verify/endpoints.ts"],"names":[],"mappings":"AA2QA,wBAAsB,kBAAkB,CACtC,MAAM,GAAE,MAA2B,GAClC,OAAO,CAAC,IAAI,CAAC,CAkIf"}
|