@opencrvs/toolkit 2.1.2 → 2.2.0-rc.19ec10b
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/build.sh +9 -14
- package/create-countryconfig/package.json +1 -1
- package/dist/application-config/index.js +57 -14
- package/dist/authentication/index.d.ts +2 -1
- package/dist/authentication/index.js +34 -14
- package/dist/cli.js +1491 -2020
- package/dist/commons/api/router.d.ts +1564 -248
- package/dist/commons/application-config/index.d.ts +3 -3
- package/dist/commons/conditionals/conditionals.d.ts +58 -7
- package/dist/commons/conditionals/index.d.ts +1 -0
- package/dist/commons/conditionals/validate.d.ts +6 -1
- package/dist/commons/events/ActionConfig.d.ts +146 -20
- package/dist/commons/events/ActionDocument.d.ts +89 -0
- package/dist/commons/events/ActionInput.d.ts +56 -4
- package/dist/commons/events/ActionStatus.d.ts +2 -2
- package/dist/commons/events/ActionType.d.ts +13 -1
- package/dist/commons/events/AdvancedSearchConfig.d.ts +15 -0
- package/dist/commons/events/AuditLog.d.ts +4 -0
- package/dist/commons/events/CompositeFieldValue.d.ts +5 -1
- package/dist/commons/events/CountryConfigQueryInput.d.ts +192 -18
- package/dist/commons/events/Draft.d.ts +36 -1
- package/dist/commons/events/EventConfig.d.ts +473 -6
- package/dist/commons/events/EventDocument.d.ts +90 -0
- package/dist/commons/events/EventIndex.d.ts +44 -6
- package/dist/commons/events/EventInput.d.ts +1 -0
- package/dist/commons/events/EventMetadata.d.ts +24 -1
- package/dist/commons/events/EventStatus.d.ts +1 -0
- package/dist/commons/events/FieldConfig.d.ts +11 -1
- package/dist/commons/events/FieldTypeMapping.d.ts +17 -17
- package/dist/commons/events/Flag.d.ts +1 -7
- package/dist/commons/events/PlainDate.d.ts +6 -0
- package/dist/commons/events/WorkqueueConfig.d.ts +224 -33
- package/dist/commons/events/defineConfig.d.ts +7 -2
- package/dist/commons/events/event.d.ts +20 -1
- package/dist/commons/events/eventConfigValidation.d.ts +26 -1
- package/dist/commons/events/field.d.ts +37 -0
- package/dist/commons/events/index.d.ts +3 -0
- package/dist/commons/events/locations.d.ts +1 -1
- package/dist/commons/events/scopes.d.ts +4 -1
- package/dist/commons/events/state/flags.d.ts +1 -1
- package/dist/commons/events/state/index.d.ts +11 -2
- package/dist/commons/events/state/utils.d.ts +11 -1
- package/dist/commons/events/test.utils.d.ts +89 -7
- package/dist/commons/events/toNotificationForm.d.ts +17 -0
- package/dist/commons/events/utils.d.ts +90 -10
- package/dist/commons/users/Role.d.ts +23 -0
- package/dist/commons/users/User.d.ts +263 -0
- package/dist/commons/users/authentication.d.ts +67 -0
- package/dist/commons/users/index.d.ts +5 -0
- package/dist/commons/users/roleValidations.d.ts +15 -0
- package/dist/commons/users/scopes.d.ts +1402 -0
- package/dist/commons/users/userReferences.d.ts +176 -0
- package/dist/conditionals/index.js +29 -9
- package/dist/environment/custom-types.d.ts +1 -0
- package/dist/environment/custom-types.d.ts.map +1 -1
- package/dist/environment/derived-variables.d.ts +24 -4
- package/dist/environment/derived-variables.d.ts.map +1 -1
- package/dist/environment/derived-variables.js +27 -4
- package/dist/environment/questions.d.ts +42 -9
- package/dist/environment/questions.d.ts.map +1 -1
- package/dist/environment/questions.js +71 -48
- package/dist/environment/registry.d.ts +15 -0
- package/dist/environment/registry.d.ts.map +1 -0
- package/dist/environment/registry.js +112 -0
- package/dist/environment/setup-environment.d.ts.map +1 -1
- package/dist/environment/setup-environment.js +165 -35
- package/dist/environment/templates.d.ts.map +1 -1
- package/dist/events/index.js +2050 -1156
- package/dist/migrations/add-notify-config.d.ts +40 -0
- package/dist/migrations/add-notify-config.d.ts.map +1 -0
- package/dist/migrations/add-notify-config.js +249 -0
- package/dist/migrations/index.d.ts +9 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +1306 -0
- package/dist/migrations/move-declaration-to-declare-action.d.ts +38 -0
- package/dist/migrations/move-declaration-to-declare-action.d.ts.map +1 -0
- package/dist/migrations/move-declaration-to-declare-action.js +260 -0
- package/dist/migrations/{v2.1 → persistent}/add-translations.d.ts +7 -1
- package/dist/migrations/persistent/add-translations.d.ts.map +1 -0
- package/dist/migrations/{v2.1 → persistent}/add-translations.js +14 -12
- package/dist/migrations/persistent/check-upgrade-path.d.ts +36 -0
- package/dist/migrations/persistent/check-upgrade-path.d.ts.map +1 -0
- package/dist/migrations/persistent/check-upgrade-path.js +105 -0
- package/dist/migrations/persistent/update-toolkit-dependency.d.ts +7 -0
- package/dist/migrations/persistent/update-toolkit-dependency.d.ts.map +1 -0
- package/dist/migrations/persistent/update-toolkit-dependency.js +77 -0
- package/dist/migrations/read-declaration-through-helper.d.ts +39 -0
- package/dist/migrations/read-declaration-through-helper.d.ts.map +1 -0
- package/dist/migrations/read-declaration-through-helper.js +199 -0
- package/dist/migrations/replace-incomplete-flag.d.ts +26 -0
- package/dist/migrations/replace-incomplete-flag.d.ts.map +1 -0
- package/dist/migrations/replace-incomplete-flag.js +126 -0
- package/dist/migrations/resolve-versioned-event-config.d.ts +56 -0
- package/dist/migrations/resolve-versioned-event-config.d.ts.map +1 -0
- package/dist/migrations/resolve-versioned-event-config.js +353 -0
- package/dist/migrations/utils.d.ts +61 -0
- package/dist/migrations/utils.d.ts.map +1 -0
- package/dist/migrations/utils.js +218 -0
- package/dist/notification/index.js +1081 -209
- package/dist/roles/index.d.ts +2 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/dist/roles/index.js +730 -0
- package/dist/scopes/index.d.ts +83 -100
- package/dist/scopes/index.js +29 -13
- package/dist/templates/charts-values/dependencies/values.yaml +6 -3
- package/dist/templates/charts-values/opencrvs-services/values.yaml +5 -10
- package/dist/templates/charts-values/traefik/values.yaml +4 -3
- package/dist/verify/endpoints.d.ts +11 -0
- package/dist/verify/endpoints.d.ts.map +1 -1
- package/dist/verify/endpoints.js +21 -27
- package/opencrvs-toolkit-2.2.0-rc.19ec10b.tgz +0 -0
- package/package.json +5 -3
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +3 -5
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts +0 -3
- package/dist/migrations/v2.1/add-explicit-correction-flags.d.ts.map +0 -1
- package/dist/migrations/v2.1/add-explicit-correction-flags.js +0 -234
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts +0 -3
- package/dist/migrations/v2.1/add-recovery-link-notifications.d.ts.map +0 -1
- package/dist/migrations/v2.1/add-recovery-link-notifications.js +0 -511
- package/dist/migrations/v2.1/add-translations.d.ts.map +0 -1
- package/dist/migrations/v2.1/enable-telemetry.d.ts +0 -3
- package/dist/migrations/v2.1/enable-telemetry.d.ts.map +0 -1
- package/dist/migrations/v2.1/enable-telemetry.js +0 -455
- package/dist/migrations/v2.1/index.d.ts +0 -6
- package/dist/migrations/v2.1/index.d.ts.map +0 -1
- package/dist/migrations/v2.1/index.js +0 -2170
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts +0 -14
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.d.ts.map +0 -1
- package/dist/migrations/v2.1/migrate-infrastructure-to-assets.js +0 -348
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts +0 -2
- package/dist/migrations/v2.1/remove-metabase-package-installs.d.ts.map +0 -1
- package/dist/migrations/v2.1/remove-metabase-package-installs.js +0 -161
- package/dist/migrations/v2.1/remove-sentry.d.ts +0 -3
- package/dist/migrations/v2.1/remove-sentry.d.ts.map +0 -1
- package/dist/migrations/v2.1/remove-sentry.js +0 -354
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts +0 -3
- package/dist/migrations/v2.1/rename-trigger-paths.d.ts.map +0 -1
- package/dist/migrations/v2.1/rename-trigger-paths.js +0 -216
- package/dist/migrations/v2.1/template-files.d.ts +0 -8
- package/dist/migrations/v2.1/template-files.d.ts.map +0 -1
- package/dist/migrations/v2.1/template-files.js +0 -49
- package/dist/migrations/v2.1/upgrade-tilt.d.ts +0 -8
- package/dist/migrations/v2.1/upgrade-tilt.d.ts.map +0 -1
- package/dist/migrations/v2.1/upgrade-tilt.js +0 -139
- package/dist/templates/countryconfig-template/.tiltignore +0 -1
- package/dist/templates/countryconfig-template/Dockerfile.assets +0 -7
- package/dist/templates/countryconfig-template/Tiltfile +0 -112
- package/dist/templates/countryconfig-template/assets/README.md +0 -1
- package/dist/templates/countryconfig-template/assets/clear-all-data-dev.sh +0 -61
- package/dist/templates/countryconfig-template/assets/deployment/deploy.sh +0 -455
- package/dist/templates/countryconfig-template/assets/deployment/reindex.sh +0 -168
- package/dist/templates/countryconfig-template/assets/deployment/validate-required-variables-in-compose-files.ts +0 -67
- package/dist/templates/countryconfig-template/assets/elasticsearch/reindex.sh +0 -168
- package/dist/templates/countryconfig-template/assets/metabase/README.md +0 -34
- package/dist/templates/countryconfig-template/assets/metabase/environment-configuration.sql +0 -36
- package/dist/templates/countryconfig-template/assets/metabase/initialize-database.sh +0 -46
- package/dist/templates/countryconfig-template/assets/metabase/metabase.init.db.sql +0 -27737
- package/dist/templates/countryconfig-template/assets/metabase/open-shell.sh +0 -21
- package/dist/templates/countryconfig-template/assets/metabase/package.json +0 -13
- package/dist/templates/countryconfig-template/assets/metabase/run-dev.sh +0 -108
- package/dist/templates/countryconfig-template/assets/metabase/run.sh +0 -120
- package/dist/templates/countryconfig-template/assets/metabase/update-database.sh +0 -40
- package/dist/templates/countryconfig-template/assets/postgres/setup-analytics.sh +0 -135
- package/dist/templates/countryconfig-template/assets/postgres/setup-reference-data.sh +0 -108
- package/dist/templates/countryconfig-template/tilt/clear-all-data.ps1 +0 -50
- package/dist/templates/countryconfig-template/tilt/clear-all-data.sh +0 -35
- package/dist/templates/countryconfig-template/tilt/common.tilt +0 -145
- package/dist/templates/countryconfig-template/tilt/examples/dependencies/values.yaml +0 -15
- package/dist/templates/countryconfig-template/tilt/examples/opencrvs-services/values.yaml +0 -56
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values-minikube.yaml +0 -21
- package/dist/templates/countryconfig-template/tilt/examples/traefik/values.yaml +0 -38
- package/dist/templates/countryconfig-template/tilt/helm/dependencies/values.yaml +0 -17
- package/dist/templates/countryconfig-template/tilt/helm/opencrvs-services/values.yaml +0 -16
- package/dist/templates/countryconfig-template/tilt/lib.tilt +0 -95
- package/dist/templates/countryconfig-template/tilt/opencrvs.tilt +0 -136
- package/opencrvs-toolkit-2.1.2.tgz +0 -0
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
############################################################
|
|
11
|
-
# What common Tiltfile does?:
|
|
12
|
-
# - Traefik deployment
|
|
13
|
-
# - Group resources by label on UI: http://localhost:10350/
|
|
14
|
-
|
|
15
|
-
########################################################
|
|
16
|
-
# Load extensions for namespace and helm operations
|
|
17
|
-
load('ext://namespace', 'namespace_create', 'namespace_inject')
|
|
18
|
-
load('ext://helm_resource', 'helm_resource', 'helm_repo')
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
secret_settings(disable_scrub=True)
|
|
22
|
-
########################################################
|
|
23
|
-
# Traefik Deployment
|
|
24
|
-
print("🚀 Deploying traefik...")
|
|
25
|
-
namespace_create('traefik')
|
|
26
|
-
traefik_tilt_label = '5.Traefik'
|
|
27
|
-
|
|
28
|
-
# Which local Kubernetes you're running Tilt against:
|
|
29
|
-
# "orbstack" (default) - OrbStack/Docker Desktop expose LoadBalancer
|
|
30
|
-
# services on localhost automatically.
|
|
31
|
-
# "minikube" - minikube doesn't expose LoadBalancer/NodePort
|
|
32
|
-
# services to the host on its own (EXTERNAL-IP stays
|
|
33
|
-
# <pending> without a separate `minikube tunnel` /
|
|
34
|
-
# `minikube service` process), so we deploy Traefik
|
|
35
|
-
# with a NodePort values file instead
|
|
36
|
-
|
|
37
|
-
current_k8s_context = k8s_context()
|
|
38
|
-
detected_local_k8s = "minikube" if "minikube" in current_k8s_context else "orbstack"
|
|
39
|
-
local_k8s = os.getenv("LOCAL_K8S", detected_local_k8s)
|
|
40
|
-
print("☸️ Kubernetes context: {} (local_k8s={})".format(current_k8s_context, local_k8s))
|
|
41
|
-
|
|
42
|
-
# values-minikube.yaml only contains what differs from values.yaml (NodePort
|
|
43
|
-
# instead of LoadBalancer, a pinned port). Helm merges multiple --values files
|
|
44
|
-
# in order, so on minikube we layer both instead of duplicating the file.
|
|
45
|
-
traefik_values_files = ["values.yaml"]
|
|
46
|
-
if local_k8s == "minikube":
|
|
47
|
-
traefik_values_files.append("values-minikube.yaml")
|
|
48
|
-
|
|
49
|
-
override_values_file = os.getenv("TRAEFIK_VALUES_FILE", "")
|
|
50
|
-
if override_values_file:
|
|
51
|
-
traefik_values_files = [override_values_file]
|
|
52
|
-
|
|
53
|
-
print("🔀 Using traefik values file(s): {}".format(", ".join(traefik_values_files)))
|
|
54
|
-
|
|
55
|
-
# Install Traefik GW
|
|
56
|
-
helm_repo('traefik-repo', 'https://traefik.github.io/charts', labels=[traefik_tilt_label])
|
|
57
|
-
helm_resource(
|
|
58
|
-
'traefik',
|
|
59
|
-
'traefik-repo/traefik',
|
|
60
|
-
namespace='traefik',
|
|
61
|
-
resource_deps=['traefik-repo'],
|
|
62
|
-
flags=[
|
|
63
|
-
'--version=39.0.0',
|
|
64
|
-
'--create-namespace',
|
|
65
|
-
] + ['--values=./examples/traefik/{}'.format(f) for f in traefik_values_files],
|
|
66
|
-
)
|
|
67
|
-
# OpenCRVS application has traefik CRDs IngressRoute
|
|
68
|
-
# and Middleware, so we need to add traefik as dependency
|
|
69
|
-
# to all workloads that use them
|
|
70
|
-
traefik_deps = [
|
|
71
|
-
'client',
|
|
72
|
-
'countryconfig',
|
|
73
|
-
'gateway',
|
|
74
|
-
'login',
|
|
75
|
-
'minio'
|
|
76
|
-
]
|
|
77
|
-
|
|
78
|
-
k8s_resource("traefik", labels=[traefik_tilt_label])
|
|
79
|
-
|
|
80
|
-
# Add labels to traefik resources
|
|
81
|
-
traefik_ingress_objects = ["{}-route:ingressroute".format(dep) for dep in traefik_deps] + ['internal-routes:ingressroute']
|
|
82
|
-
traefik_middleware_objects = ["sts-and-basic-response-headers:middleware", "enable-compression:middleware", "block-internal-routes:middleware"]
|
|
83
|
-
k8s_resource(
|
|
84
|
-
objects=traefik_ingress_objects,
|
|
85
|
-
new_name='traefik-ingress-routes',
|
|
86
|
-
resource_deps=['traefik'],
|
|
87
|
-
labels=[traefik_tilt_label]
|
|
88
|
-
)
|
|
89
|
-
k8s_resource(
|
|
90
|
-
objects=traefik_middleware_objects,
|
|
91
|
-
new_name='traefik-middleware',
|
|
92
|
-
resource_deps=['traefik'],
|
|
93
|
-
labels=[traefik_tilt_label]
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
######################################################
|
|
97
|
-
# Add labels to resources to OpenCRVS services
|
|
98
|
-
tilt_label = '4.Dependencies'
|
|
99
|
-
dependencies = [
|
|
100
|
-
'elasticsearch',
|
|
101
|
-
'minio',
|
|
102
|
-
'redis',
|
|
103
|
-
'postgres',
|
|
104
|
-
]
|
|
105
|
-
|
|
106
|
-
for workload in dependencies:
|
|
107
|
-
k8s_resource(workload, labels=[tilt_label])
|
|
108
|
-
|
|
109
|
-
######################################################
|
|
110
|
-
# Add labels to resources to OpenCRVS services
|
|
111
|
-
tilt_label = '1.OpenCRVS'
|
|
112
|
-
|
|
113
|
-
opensrvs_predeploy_jobs = [
|
|
114
|
-
'postgres-on-deploy',
|
|
115
|
-
'data-migration',
|
|
116
|
-
'data-migration-analytics'
|
|
117
|
-
]
|
|
118
|
-
|
|
119
|
-
opensrvs_services = [
|
|
120
|
-
'auth',
|
|
121
|
-
'client',
|
|
122
|
-
'countryconfig',
|
|
123
|
-
'documents',
|
|
124
|
-
'events',
|
|
125
|
-
'gateway',
|
|
126
|
-
'login',
|
|
127
|
-
]
|
|
128
|
-
|
|
129
|
-
opensrvs_postdeploy_jobs = [
|
|
130
|
-
'elasticsearch-reindex',
|
|
131
|
-
]
|
|
132
|
-
|
|
133
|
-
job_label = '3.Jobs'
|
|
134
|
-
previous_jobs = []
|
|
135
|
-
for job in opensrvs_predeploy_jobs:
|
|
136
|
-
if previous_jobs:
|
|
137
|
-
k8s_resource(job, labels=[job_label], resource_deps=dependencies + previous_jobs)
|
|
138
|
-
else:
|
|
139
|
-
k8s_resource(job, labels=[job_label], resource_deps=dependencies + previous_jobs)
|
|
140
|
-
previous_jobs.append(job)
|
|
141
|
-
|
|
142
|
-
for workload in opensrvs_services:
|
|
143
|
-
k8s_resource(workload, labels=[tilt_label], resource_deps=dependencies + opensrvs_predeploy_jobs)
|
|
144
|
-
for job in opensrvs_postdeploy_jobs:
|
|
145
|
-
k8s_resource(job, labels=[job_label], resource_deps=opensrvs_services)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
hostname: opencrvs.localhost
|
|
11
|
-
|
|
12
|
-
ingress:
|
|
13
|
-
ssl_enabled: false
|
|
14
|
-
|
|
15
|
-
storage_type: host_path
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
ingress:
|
|
11
|
-
ssl_enabled: false
|
|
12
|
-
|
|
13
|
-
env:
|
|
14
|
-
OPENCRVS_ENVIRONMENT: development
|
|
15
|
-
|
|
16
|
-
credentials:
|
|
17
|
-
super_user_password: password
|
|
18
|
-
|
|
19
|
-
# OpenCRVS core image tag:
|
|
20
|
-
platform:
|
|
21
|
-
tag: v2.0.0
|
|
22
|
-
|
|
23
|
-
countryconfig:
|
|
24
|
-
image:
|
|
25
|
-
tag: v2.0.0
|
|
26
|
-
|
|
27
|
-
# Horizontal Pod Autoscaler (HPA) configuration:
|
|
28
|
-
# Disabled by default for local environment.
|
|
29
|
-
hpa:
|
|
30
|
-
enabled: false
|
|
31
|
-
|
|
32
|
-
# Pod Disruption Budget (PDB) configuration:
|
|
33
|
-
# Disabled by default for local environment.
|
|
34
|
-
pdb:
|
|
35
|
-
enabled: false
|
|
36
|
-
|
|
37
|
-
# Dashboards is disabled by default to allow easy deployment on Apple Silicon
|
|
38
|
-
# If you are using x86 device, feel free to enable:
|
|
39
|
-
dashboards:
|
|
40
|
-
enabled: false
|
|
41
|
-
|
|
42
|
-
# Expose services on Node port
|
|
43
|
-
service_type: NodePort
|
|
44
|
-
|
|
45
|
-
data_seed:
|
|
46
|
-
enabled: false
|
|
47
|
-
env:
|
|
48
|
-
ACTIVATE_USERS: true
|
|
49
|
-
|
|
50
|
-
auth:
|
|
51
|
-
env:
|
|
52
|
-
TWO_FA_ENABLED: false
|
|
53
|
-
|
|
54
|
-
events:
|
|
55
|
-
env:
|
|
56
|
-
TWO_FA_ENABLED: false
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
#
|
|
10
|
-
# Minikube-only overrides, layered on top of values.yaml (see tilt/common.tilt,
|
|
11
|
-
# which passes both --values files to helm when the active context is minikube).
|
|
12
|
-
#
|
|
13
|
-
# minikube doesn't expose LoadBalancer services to the host on its own, so we
|
|
14
|
-
# switch to NodePort here, pinned to what
|
|
15
|
-
# `minikube start --ports=80:30080` publishes onto the host.
|
|
16
|
-
service:
|
|
17
|
-
type: NodePort
|
|
18
|
-
|
|
19
|
-
ports:
|
|
20
|
-
web:
|
|
21
|
-
nodePort: 30080
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
# Overwriting https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
|
|
11
|
-
namespaceOverride: "traefik"
|
|
12
|
-
logs:
|
|
13
|
-
general:
|
|
14
|
-
level: "INFO"
|
|
15
|
-
format: "common"
|
|
16
|
-
access:
|
|
17
|
-
enabled: true
|
|
18
|
-
ingressRoute:
|
|
19
|
-
dashboard:
|
|
20
|
-
enabled: false
|
|
21
|
-
|
|
22
|
-
tlsStore: {}
|
|
23
|
-
|
|
24
|
-
providers:
|
|
25
|
-
kubernetesCRD:
|
|
26
|
-
enabled: true
|
|
27
|
-
kubernetesIngress:
|
|
28
|
-
enabled: true
|
|
29
|
-
kubernetesGateway:
|
|
30
|
-
enabled: false
|
|
31
|
-
service:
|
|
32
|
-
enabled: true
|
|
33
|
-
single: false
|
|
34
|
-
|
|
35
|
-
ports:
|
|
36
|
-
web:
|
|
37
|
-
port: 8000
|
|
38
|
-
protocol: TCP
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
##################################################################################
|
|
11
|
-
# Use this file to customize helm chart behavior
|
|
12
|
-
# Please make sure your custom changes doesn't conflict with values.yaml
|
|
13
|
-
##################################################################################
|
|
14
|
-
|
|
15
|
-
# Country specific overrides for the dependencies chart in local Tilt development.
|
|
16
|
-
# Applied on top of tilt/examples/dependencies/values.yaml and never overwritten by
|
|
17
|
-
# 'opencrvs upgrade'.
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
##################################################################################
|
|
11
|
-
# Use this file to customize helm chart behavior
|
|
12
|
-
# Please make sure your custom changes doesn't conflict with values.yaml
|
|
13
|
-
##################################################################################
|
|
14
|
-
# Country specific overrides for the opencrvs-services chart in local Tilt development.
|
|
15
|
-
# Applied on top of tilt/examples/opencrvs-services/values.yaml and never overwritten by
|
|
16
|
-
# 'opencrvs upgrade'.
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def copy_secrets(dependencies_namespace, opencrvs_namespace):
|
|
12
|
-
|
|
13
|
-
secrets_to_copy = [
|
|
14
|
-
"elasticsearch-admin-user",
|
|
15
|
-
"redis-opencrvs-users",
|
|
16
|
-
"minio-opencrvs-users",
|
|
17
|
-
"mongodb-admin-user",
|
|
18
|
-
"postgres-admin-user",
|
|
19
|
-
]
|
|
20
|
-
k8s_resource(
|
|
21
|
-
new_name="deps-secrets",
|
|
22
|
-
objects=["{}:secret".format(secret) for secret in secrets_to_copy],
|
|
23
|
-
labels=['3.Dependencies']
|
|
24
|
-
)
|
|
25
|
-
local_resource(
|
|
26
|
-
"copy-secrets",
|
|
27
|
-
cmd="""kubectl get secret {2} -n {0} -o yaml \
|
|
28
|
-
| sed "s#namespace: {0}#namespace: {1}#" | grep -v 'resourceVersion\\|uid\\|creationTimestamp' \
|
|
29
|
-
| kubectl apply -n {1} -f -""".format(dependencies_namespace, opencrvs_namespace, " ".join(secrets_to_copy)),
|
|
30
|
-
resource_deps=["deps-secrets"],
|
|
31
|
-
labels=['2.Data-tasks'])
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def data_cleanup(
|
|
35
|
-
opencrvs_namespace,
|
|
36
|
-
opencrvs_configuration_file,
|
|
37
|
-
core_images_tag,
|
|
38
|
-
countryconfig_image_name,
|
|
39
|
-
countryconfig_image_tag,
|
|
40
|
-
opencrvs_tools_chart_path
|
|
41
|
-
):
|
|
42
|
-
job_yaml = local("""
|
|
43
|
-
helm template {opencrvs_tools_chart_path} \
|
|
44
|
-
--namespace {opencrvs_namespace} \
|
|
45
|
-
-f {opencrvs_configuration_file} \
|
|
46
|
-
--set platform.tag={core_images_tag} \
|
|
47
|
-
--set data_cleanup.enabled=true \
|
|
48
|
-
--set countryconfig.image.name={countryconfig_image_name} \
|
|
49
|
-
--set countryconfig.image.tag={countryconfig_image_tag} \
|
|
50
|
-
--show-only templates/data-cleanup-job.yaml
|
|
51
|
-
""".format(
|
|
52
|
-
opencrvs_namespace=opencrvs_namespace,
|
|
53
|
-
opencrvs_configuration_file=opencrvs_configuration_file,
|
|
54
|
-
core_images_tag=core_images_tag,
|
|
55
|
-
countryconfig_image_name=countryconfig_image_name,
|
|
56
|
-
countryconfig_image_tag=countryconfig_image_tag,
|
|
57
|
-
opencrvs_tools_chart_path=opencrvs_tools_chart_path
|
|
58
|
-
),
|
|
59
|
-
quiet=True
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
k8s_yaml(job_yaml)
|
|
63
|
-
k8s_resource(
|
|
64
|
-
'data-cleanup',
|
|
65
|
-
labels=['2.Data-tasks'],
|
|
66
|
-
auto_init=False
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
def seed_data(
|
|
70
|
-
opencrvs_namespace,
|
|
71
|
-
opencrvs_configuration_file,
|
|
72
|
-
core_images_tag,
|
|
73
|
-
countryconfig_image_name,
|
|
74
|
-
countryconfig_image_tag,
|
|
75
|
-
opencrvs_tools_chart_path
|
|
76
|
-
):
|
|
77
|
-
job_yaml = local("""
|
|
78
|
-
helm template -f {opencrvs_configuration_file} \
|
|
79
|
-
--set platform.tag={core_images_tag} \
|
|
80
|
-
--set data_seed.enabled=true -s templates/data-seed-job.yaml --namespace {opencrvs_namespace} {opencrvs_tools_chart_path}
|
|
81
|
-
""".format(
|
|
82
|
-
opencrvs_namespace=opencrvs_namespace,
|
|
83
|
-
opencrvs_configuration_file=opencrvs_configuration_file,
|
|
84
|
-
core_images_tag=core_images_tag,
|
|
85
|
-
opencrvs_tools_chart_path=opencrvs_tools_chart_path
|
|
86
|
-
),
|
|
87
|
-
quiet=True
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
k8s_yaml(job_yaml)
|
|
91
|
-
k8s_resource(
|
|
92
|
-
'data-seed',
|
|
93
|
-
labels=['2.Data-tasks'],
|
|
94
|
-
auto_init=False
|
|
95
|
-
)
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
#
|
|
5
|
-
# OpenCRVS is also distributed under the terms of the Civil Registration
|
|
6
|
-
# & Healthcare Disclaimer located at http://opencrvs.org/license.
|
|
7
|
-
#
|
|
8
|
-
# Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# Shared OpenCRVS Tilt configuration
|
|
12
|
-
# Load extensions
|
|
13
|
-
load('ext://namespace', 'namespace_create', 'namespace_inject')
|
|
14
|
-
load("./lib.tilt",
|
|
15
|
-
"copy_secrets", "data_cleanup", "seed_data")
|
|
16
|
-
include('./common.tilt')
|
|
17
|
-
|
|
18
|
-
def setup_opencrvs(
|
|
19
|
-
core_images_tag,
|
|
20
|
-
countryconfig_image_tag,
|
|
21
|
-
countryconfig_image_name="opencrvs/ocrvs-countryconfig",
|
|
22
|
-
dependencies_namespace='opencrvs-deps-dev',
|
|
23
|
-
opencrvs_namespace='opencrvs-dev',
|
|
24
|
-
security_enabled=False,
|
|
25
|
-
monitoring_enabled=False,
|
|
26
|
-
opencrvs_chart_repo='.'
|
|
27
|
-
):
|
|
28
|
-
"""
|
|
29
|
-
Common OpenCRVS setup function
|
|
30
|
-
|
|
31
|
-
Args:
|
|
32
|
-
core_images_tag: OpenCRVS core images tag to use for deployment
|
|
33
|
-
countryconfig_image_name: Countryconfig image repository (e.g. your DockerHub repository or Farajaland demo repository)
|
|
34
|
-
countryconfig_image_tag: Countryconfig image tag to use for deployment
|
|
35
|
-
dependencies_namespace: Kubernetes namespace for dependencies (e.g. MongoDB, MinIO, Elasticsearch)
|
|
36
|
-
opencrvs_namespace: Kubernetes namespace for OpenCRVS services
|
|
37
|
-
security_enabled: If true, OpenCRVS and dependencies will be deployed in secure mode with authentication enabled. If false, OpenCRVS and dependencies will be deployed in non-secure mode with default passwords and no authentication.
|
|
38
|
-
monitoring_enabled: If true, monitoring components like Kibana will be deployed together with dependencies
|
|
39
|
-
opencrvs_chart_repo: Path to OpenCRVS charts directory (relative)
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
# Create namespaces
|
|
43
|
-
namespace_create(dependencies_namespace)
|
|
44
|
-
namespace_create(opencrvs_namespace)
|
|
45
|
-
|
|
46
|
-
# Select configuration files
|
|
47
|
-
if security_enabled:
|
|
48
|
-
print("🔑 Deploying OpenCRVS and Dependencies in secure mode")
|
|
49
|
-
deps_configuration_file = './tilt/examples/dependencies/values-secure.yaml'
|
|
50
|
-
opencrvs_configuration_file = './tilt/examples/opencrvs-services/values-secure.yaml'
|
|
51
|
-
else:
|
|
52
|
-
print("""🔑 Deploying OpenCRVS and Dependencies in non-secure mode
|
|
53
|
-
- Minio admin user/password: minioadmin/minioadmin
|
|
54
|
-
- Postgres admin user/password: postgres/postgres
|
|
55
|
-
- Authentication for Redis, MongoDB and Elasticsearch is disabled""")
|
|
56
|
-
deps_configuration_file = './tilt/examples/dependencies/values.yaml'
|
|
57
|
-
opencrvs_configuration_file = './tilt/examples/opencrvs-services/values.yaml'
|
|
58
|
-
|
|
59
|
-
# Country specific overrides, layered on top of the examples above.
|
|
60
|
-
# tilt/examples/ is replaced on every upgrade, tilt/helm/ is left alone.
|
|
61
|
-
deps_values = [deps_configuration_file]
|
|
62
|
-
if os.path.exists('./tilt/helm/dependencies/values.yaml'):
|
|
63
|
-
deps_values.append('./tilt/helm/dependencies/values.yaml')
|
|
64
|
-
opencrvs_values = [opencrvs_configuration_file]
|
|
65
|
-
if os.path.exists('./tilt/helm/opencrvs-services/values.yaml'):
|
|
66
|
-
opencrvs_values.append('./tilt/helm/opencrvs-services/values.yaml')
|
|
67
|
-
|
|
68
|
-
# Deploy dependencies
|
|
69
|
-
print("🚀 Deploying dependencies: mongo, minio, elasticsearch...")
|
|
70
|
-
dependencies_chart_path = '{}/charts/dependencies'.format(opencrvs_chart_repo)
|
|
71
|
-
k8s_yaml(helm(dependencies_chart_path,
|
|
72
|
-
namespace=dependencies_namespace,
|
|
73
|
-
values=deps_values,
|
|
74
|
-
set=["monitoring.enabled={}".format(monitoring_enabled).lower()]
|
|
75
|
-
))
|
|
76
|
-
opencrvs_chart_path = '{}/charts/opencrvs-services'.format(opencrvs_chart_repo)
|
|
77
|
-
certs_dir = '{opencrvs_chart_path}/certs'.format(opencrvs_chart_path=opencrvs_chart_path)
|
|
78
|
-
if not os.path.exists("{certs_dir}/tls.crt".format(certs_dir=certs_dir)):
|
|
79
|
-
local("""
|
|
80
|
-
mkdir -p {certs_dir}
|
|
81
|
-
openssl req -x509 -nodes -days 365 \
|
|
82
|
-
-newkey rsa:2048 \
|
|
83
|
-
-keyout {certs_dir}/tls.key \
|
|
84
|
-
-out {certs_dir}/tls.crt \
|
|
85
|
-
-subj "/CN=local.dev"
|
|
86
|
-
""".format(certs_dir=certs_dir))
|
|
87
|
-
|
|
88
|
-
# Deploy OpenCRVS services
|
|
89
|
-
print("🚀 Deploying services: auth, events, gateway...")
|
|
90
|
-
k8s_yaml(
|
|
91
|
-
helm(opencrvs_chart_path,
|
|
92
|
-
namespace=opencrvs_namespace,
|
|
93
|
-
values=opencrvs_values,
|
|
94
|
-
set=[
|
|
95
|
-
"platform.tag={}".format(core_images_tag),
|
|
96
|
-
"countryconfig.image.name={}".format(countryconfig_image_name),
|
|
97
|
-
"countryconfig.image.tag={}".format(countryconfig_image_tag),
|
|
98
|
-
"data_seed.enabled=false", # Disable data seeding on helm install for tilt
|
|
99
|
-
"certs.crt_file=certs/tls.crt",
|
|
100
|
-
"certs.key_file=certs/tls.key"
|
|
101
|
-
]
|
|
102
|
-
)
|
|
103
|
-
)
|
|
104
|
-
cleanup_cmd = "./scripts/cleanup.sh"
|
|
105
|
-
|
|
106
|
-
if os.name == "nt":
|
|
107
|
-
cleanup_cmd = "powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\\scripts\\cleanup.ps1"
|
|
108
|
-
|
|
109
|
-
local_resource(
|
|
110
|
-
name="clean-&-seed",
|
|
111
|
-
auto_init=False,
|
|
112
|
-
labels="2.Data-tasks",
|
|
113
|
-
cmd="./tilt/clear-all-data.sh",
|
|
114
|
-
allow_parallel=True,
|
|
115
|
-
)
|
|
116
|
-
# Add data tasks
|
|
117
|
-
data_cleanup(
|
|
118
|
-
opencrvs_namespace,
|
|
119
|
-
opencrvs_configuration_file,
|
|
120
|
-
core_images_tag,
|
|
121
|
-
countryconfig_image_name,
|
|
122
|
-
countryconfig_image_tag,
|
|
123
|
-
opencrvs_chart_path
|
|
124
|
-
)
|
|
125
|
-
|
|
126
|
-
seed_data(
|
|
127
|
-
opencrvs_namespace,
|
|
128
|
-
opencrvs_configuration_file,
|
|
129
|
-
core_images_tag,
|
|
130
|
-
countryconfig_image_name,
|
|
131
|
-
countryconfig_image_tag,
|
|
132
|
-
opencrvs_chart_path
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
if security_enabled:
|
|
136
|
-
copy_secrets(dependencies_namespace, opencrvs_namespace)
|
|
Binary file
|