-
Notifications
You must be signed in to change notification settings - Fork 16
/
env.base
322 lines (254 loc) · 15.2 KB
/
env.base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
#!/bin/bash
###############################################################################
# The following variables are the "main" values. Most of the technical #
# variables in the final section are computed from those main values, and #
# should not be manually modified without being extra careful #
###############################################################################
###############################################################################
# Image configuration #
###############################################################################
# Where images will be pulled from
IMAGE_REGISTRY=${CUSTOM_IMAGE_REGISTRY:-cooghub}
IMAGE_REGISTRY_COOG=${CUSTOM_IMAGE_REGISTRY_COOG:-${IMAGE_REGISTRY}}
IMAGE_REGISTRY_STATIC=${CUSTOM_IMAGE_REGISTRY_STATIC:-${IMAGE_REGISTRY}}
###############################################################################
# Image names, should usually not change
# Back
IMAGE_NAME_COOG=${CUSTOM_IMAGE_NAME_COOG:-coog}
IMAGE_NAME_STATIC=${CUSTOM_IMAGE_NAME_STATIC:-coog-static}
IMAGE_NAME_UNOCONV=${CUSTOM_IMAGE_NAME_UNOCONV:-coog-libroconv}
# APIs
IMAGE_NAME_API=${CUSTOM_IMAGE_NAME_API:-coog-api}
IMAGE_NAME_API_B2B_CONFIG=${CUSTOM_IMAGE_NAME_API_B2B_CONFIG:-coog-api-b2b-config}
IMAGE_NAME_API_IDENTITY_MANAGER=${CUSTOM_IMAGE_NAME_API_IDENTITY_MANAGER:-coog-api-identity-manager}
IMAGE_NAME_API_REFERENTIAL=${CUSTOM_IMAGE_NAME_API_REFERENTIAL:-coog-api-referential}
IMAGE_NAME_GATEWAY=${CUSTOM_IMAGE_NAME_GATEWAY:-coog-gateway}
IMAGE_NAME_WEB=${CUSTOM_IMAGE_NAME_WEB:-coog-web}
IMAGE_NAME_API_B2C=${CUSTOM_IMAGE_NAME_API_B2C:-coog-api-b2c}
# Front
IMAGE_NAME_APP_B2C=${CUSTOM_IMAGE_NAME_APP_B2C:-coog-app-b2c}
IMAGE_NAME_PORTAL=${CUSTOM_IMAGE_NAME_PORTAL:-coog-b2b}
# B2C
IMAGE_NAME_B2C_BACK=${CUSTOM_IMAGE_NAME_B2C_BACK:-coog-customer-backend}
IMAGE_NAME_B2C_FRONT=${CUSTOM_IMAGE_NAME_B2C_FRONT:-coog-customer-frontend}
###############################################################################
# The current images for the project
# Back
IMAGE_VERSION_DEFAULT=${IMAGE_VERSION_DEFAULT:-${IMAGE_VERSION_COOG:?}}
IMAGE_VERSION_COOG=${IMAGE_VERSION_COOG:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_STATIC=${IMAGE_VERSION_STATIC:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_UNOCONV=${IMAGE_VERSION_UNOCONV:-${IMAGE_VERSION_DEFAULT}}
# APIs
IMAGE_VERSION_API=${IMAGE_VERSION_API:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_API_B2B_CONFIG=${IMAGE_VERSION_API_B2B_CONFIG:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_API_IDENTITY_MANAGER=${IMAGE_VERSION_API_IDENTITY_MANAGER:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_API_REFERENTIAL=${IMAGE_VERSION_API_REFERENTIAL:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_GATEWAY=${IMAGE_VERSION_GATEWAY:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_WEB=${IMAGE_VERSION_WEB:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_API_B2C=${IMAGE_VERSION_API_B2C:-${IMAGE_VERSION_DEFAULT}}
# Front
IMAGE_VERSION_APP_B2C=${IMAGE_VERSION_APP_B2C:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_PORTAL=${IMAGE_VERSION_PORTAL:-${IMAGE_VERSION_DEFAULT}}
# B2C
IMAGE_VERSION_B2C_BACK=${IMAGE_VERSION_B2C_BACK:-${IMAGE_VERSION_DEFAULT}}
IMAGE_VERSION_B2C_FRONT=${IMAGE_VERSION_B2C_FRONT:-${IMAGE_VERSION_DEFAULT}}
###############################################################################
# Project wide configuration #
###############################################################################
# Log level
COOG_LOG_LEVEL=${COOG_LOG_LEVEL:-WARNING}
API_DEBUG_LEVEL=${API_LOG_PERIMETER:-*}
# Logging configuration
LOGGING_CONFIGURATION_TEMPLATE=${LOGGING_CONFIGURATION_TEMPLATE:-default}
# Timezone
COOG_TIMEZONE=${CUSTOM_COOG_TIMEZONE:-Europe/Paris}
# Name of project used for compose and docker swarm
COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-coog}
# Where all data will be effectively stored. Will be automatically created if
# needed
FILESYSTEM_ROOT=${FILESYSTEM_ROOT:?}/${COMPOSE_PROJECT_NAME}
# Mount points
COOG_TMP_VOLUME=${CUSTOM_COOG_TMP_VOLUME:-${COOG_TMP:-${FILESYSTEM_ROOT}/coog_tmp}} # Temporary filesystem
COOG_DATA_VOLUME=${CUSTOM_COOG_DATA_VOLUME:-${COOG_VOLUME:-${FILESYSTEM_ROOT}/coog_data}} # Backoffice data (batches i/o, edm)
POSTGRES_DATA_VOLUME=${CUSTOM_POSTGRES_DATA_VOLUME:-${POSTGRES_DATA_VOLUME:-${FILESYSTEM_ROOT}/postgresql_data}} # Backoffice db data
MONGODB_DATA_VOLUME=${CUSTOM_MONGODB_DATA_VOLUME:-${MONGODB_DATA_VOLUME:-${FILESYSTEM_ROOT}/mongodb_data}} # Api db data
REDIS_DATA_VOLUME=${CUSTOM_REDIS_DATA_VOLUME:-${REDIS_DATA_VOLUME:-${FILESYSTEM_ROOT}/redis_data}} # Api db data
B2C_BACKEND_BUILD_VOLUME=${CUSTOM_B2C_BACKEND_BUILD_VOLUME:-${FILESYSTEM_ROOT}/b2c_backend/build} # B2C Backend build
B2C_FRONTEND_BUILD_VOLUME=${CUSTOM_B2C_FRONTEND_BUILD_VOLUME:-${FILESYSTEM_ROOT}/b2c_frontend/build} # B2C Frontend build
###############################################################################
# Network configuration #
###############################################################################
NETWORK_BACKEND_NAME=${CUSTOM_NETWORK_BACKEND_NAME:-${COMPOSE_PROJECT_NAME}-coog-backend}
NETWORK_BACKEND_SUBNET=${CUSTOM_NETWORK_BACKEND_SUBNET:-10.0.1.0/24}
NETWORK_FRONTEND_NAME=${CUSTOM_NETWORK_FRONTEND_NAME:-${COMPOSE_PROJECT_NAME}-coog-frontend}
NETWORK_FRONTEND_SUBNET=${CUSTOM_NETWORK_FRONTEND_SUBNET:-10.0.2.0/24}
###############################################################################
# Exposition configuration #
###############################################################################
# Exposed traefik port: Where the stack will be available. Do not change unless
# you know what you are doing
PROJECT_HOSTNAME=${PROJECT_HOSTNAME:-${COMPOSE_PROJECT_NAME}.localhost}
TRAEFIK_HTTP_PORT=80
TRAEFIK_HTTPS_PORT=443
TRAEFIK_MANAGMENT_PORT=8080
TRAEFIK_CONFIGURATION_FOLDER=${TRAEFIK_CONFIGURATION_FOLDER:-./defaults/traefik/}
TRAEFIK_CERTS_PATH=${TRAEFIK_CONFIGURATION_FOLDER}/certs
TRAEFIK_TOML_PATH=${TRAEFIK_CONFIGURATION_FOLDER}/traefik.toml
TRAEFIK_CONFIG_TOML_PATH=${TRAEFIK_CONFIGURATION_FOLDER}/traefik.config.toml
TRAEFIK_ACME_PATH=${TRAEFIK_CONFIGURATION_FOLDER}/acme.json
# Base url, used for CORS management
MAIN_URL_SCHEME=${MAIN_URL_SCHEME:-http}
BASE_URL=${MAIN_URL_SCHEME}://${PROJECT_HOSTNAME}
###############################################################################
# SFTP configuration #
###############################################################################
ENABLE_SFTP=${ENABLE_SFTP:-"false"}
SFTP_PORT=${CUSTOM_SFTP_PORT:-2222}
SFTP_USER=${CUSTOM_SFTP_USER:-coog}
SFTP_PASSWORD=${CUSTOM_SFTP_PASSWORD:-coog}
SFTP_VOLUME=${CUSTOM_SFTP_VOLUME:-${FILESYSTEM_ROOT}/sftp}
###############################################################################
# Backoffice Database configuration #
###############################################################################
# Name of the main database. If you change it, you will need to manually create
# a new database in the postgresql instance and trigger its initialization
COOG_MAIN_DATABASE=${COOG_MAIN_DATABASE:-coog}
# Name of all backoffice databases.
COOG_DATABASES=${COOG_MAIN_DATABASE}${COOG_EXTRA_DATABASES+,}${COOG_EXTRA_DATABASES:-}
# Access to the main database
POSTGRES_HOST=${CUSTOM_POSTGRES_HOST:-postgres}
POSTGRES_PORT=${CUSTOM_POSTGRES_PORT:-5432}
POSTGRES_USER=${CUSTOM_POSTGRES_USER:-coog}
POSTGRES_PASSWORD=${CUSTOM_POSTGRES_PASSWORD:-coog}
# Connection string
POSTGRESQL_CONNECTION_STRING=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${COOG_MAIN_DATABASE}
###############################################################################
# API / Front Database configuration #
###############################################################################
GATEWAY_MAIN_DATABASE=${CUSTOM_GATEWAY_MAIN_DATABASE:-coog-gateway}
API_V1_MAIN_DATABASE=${CUSTOM_API_V1_MAIN_DATABASE:-coog-api-v1}
API_V2_MAIN_DATABASE=${CUSTOM_API_V2_MAIN_DATABASE:-coog-api-v2}
IDENTITY_MANAGER_MAIN_DATABASE=${CUSTOM_IDENTITY_MANAGER_MAIN_DATABASE:-coog-identity-manager}
# Access to the main database
MONGO_HOST=${CUSTOM_MONGO_HOST:-mongo}
MONGO_PORT=${CUSTOM_MONGO_PORT:-27017}
MONGO_USER=${CUSTOM_MONGO_USER:-coog}
MONGO_PASSWORD=${CUSTOM_MONGO_PASSWORD:-coog}
MONGODB_URI=${CUSTOM_MONGODB_URI:-mongodb://coog:coog@mongo:27017/coog-services?authSource=admin}
MONGO_MAX_CACHE_SIZE="${CUSTOM_MONGO_MAX_CACHE_SIZE:-2}"
###############################################################################
# Redis configuration #
###############################################################################
# Access to the main database
REDIS_HOST=${CUSTOM_REDIS_HOST:-redis}
REDIS_PORT=${CUSTOM_REDIS_PORT:-6379}
REDIS_USER=${CUSTOM_REDIS_USER:-coog}
REDIS_PASSWORD=${CUSTOM_REDIS_PASSWORD:-coog}
###############################################################################
# Message Broker configuration #
###############################################################################
RABBITMQ_HOST=${CUSTOM_RABBITMQ_HOST:-rabbitmq}
RABBITMQ_PORT=${CUSTOM_RABBITMQ_PORT:-5672}
RABBITMQ_USER=${CUSTOM_RABBITMQ_USER:-guest}
RABBITMQ_PASSWORD=${CUSTOM_RABBITMQ_PASSWORD:-guest}
RABBITMQ_URI=amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@${RABBITMQ_HOST}:${RABBITMQ_PORT}
RABBITMQ_CONFIG=${CUSTOM_RABBITMQ_FOLDER:-./defaults/rabbitmq}
###############################################################################
# Services deployment information #
###############################################################################
# Internal services addresses
# Defaults to a full docker-compose setup. Can be modified to plug-in local
# services if needed
API_GATEWAY_INTERNAL_URL=http://gateway:3000
API_B2B_CONFIG_INTERNAL_URL=http://api-b2b-config:3000
API_B2C_INTERNAL_URL=http://api-b2c:3000
API_IDENTITY_MANAGER_INTERNAL_URL=http://api-identity-manager:3000
API_REFERENTIAL_INTERNAL_URL=http://api-referential:3000
API_API_V1_INTERNAL_URL=http://web:3000
API_API_V2_INTERNAL_URL=http://api:3000
B2C_BACK_INTERNAL_URL=http://b2c-back:1337
COOG_INTERNAL_URL=${CUSTOM_COOG_INTERNAL_URL:-http://coog:8000}
# External services addresses
# Used by services that need to know how to access the service
GATEWAY_SUB_ROUTE=gateway
GATEWAY_EXTERNAL_URL=${CUSTOM_GATEWAY_EXTERNAL_URL:-${BASE_URL}/${GATEWAY_SUB_ROUTE}}
PORTAL_SUB_ROUTE=portal
PORTAL_EXTERNAL_URL=${CUSTOM_PORTAL_EXTERNAL_URL:-${BASE_URL}/${PORTAL_SUB_ROUTE}}
API_V1_SUB_ROUTE=web/api
APP_B2C_SUB_ROUTE=${CUSTOM_APP_B2C_SUB_ROUTE:-customers/myspace}
# CORS configuration, can be extended if needed
CORS_WHITELIST=${CORS_WHITELIST:-${BASE_URL}}
###############################################################################
# OpenTelemetry configuration #
###############################################################################
# Enable OpenTelemetry data collection
OPEN_TELEMETRY_TRACING_ENABLED=${OPEN_TELEMETRY_TRACING_ENABLED:-0}
# Tracing server location
OPEN_TELEMETRY_TRACING_URL=${OPEN_TELEMETRY_TRACING_URL:-}
# Tracing server authentication token
OPEN_TELEMETRY_TRACING_TOKEN=${OPEN_TELEMETRY_TRACING_TOKEN:-}
# Service names
OPEN_TELEMETRY_SERVICE_NAME_COOG=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_COOG:-coog-back}
OPEN_TELEMETRY_SERVICE_NAME_CELERY=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_CELERY:-coog-celery}
OPEN_TELEMETRY_SERVICE_NAME_ADMIN=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_ADMIN:-coog-admin}
OPEN_TELEMETRY_SERVICE_NAME_CRON=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_CRON:-coog-cron}
OPEN_TELEMETRY_SERVICE_NAME_GATEWAY=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_GATEWAY:-coog-gateway}
OPEN_TELEMETRY_SERVICE_NAME_IDENTITY_MANAGER=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_IDENTITY_MANAGER:-coog-identity-manager}
OPEN_TELEMETRY_SERVICE_NAME_WEB=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_WEB:-coog-api-v1}
OPEN_TELEMETRY_SERVICE_NAME_API=${CUSTOM_OPEN_TELEMETRY_SERVICE_NAME_API:-coog-api-v2}
###############################################################################
# Backoffice configuration #
###############################################################################
# Number of server processes per container
COOG_SERVER_WORKERS=${COOG_SERVER_WORKERS:-1}
# Number of celery processes per container
COOG_CELERY_WORKERS=${COOG_CELERY_WORKERS:-1}
# Queues for main celery process. If not set, all queues will be added
COOG_CELERY_CUSTOM_QUEUES=${COOG_CELERY_CUSTOM_QUEUES:-}
# Enable uwsgi statistics
COOG_UWSGI_STATS=${COOG_UWSGI_STATS:-0}
# Enable uwsgi tracebackers
COOG_UWSGI_TRACEBACKER=${COOG_UWSGI_TRACEBACKER:-0}
# Swap to redis if needed
CELERY_BROKER_URI=${RABBITMQ_URI}
# Passphrase for sensitive informations encryption in the database
COOG_PASSPHRASE=${COOG_PASSPHRASE:-}
###############################################################################
# Front-Office configuration #
###############################################################################
# Backoffice token that will be used by API Gateway to communicate with the
# backoffice. Should be associated to a user with access to all APIs (admin,
# coog_api_user)
COOG_GATEWAY_TOKEN=${COOG_GATEWAY_TOKEN:?}
# How the API users are allowed to authenticate
ENABLE_GOOGLE_AUTHENTICATION=${ENABLE_GOOGLE_AUTHENTICATION:-false}
ENABLE_COOG_AUTHENTICATION=${ENABLE_COOG_AUTHENTICATION:-true}
ENABLE_COOG_TOKEN_AUTHENTICATION=${ENABLE_COOG_TOKEN_AUTHENTICATION:-true}
# Inter services communication
JWT_ENCRYPTION=${JWT_ENCRYPTION:?}
JWT_INTERNAL_ENCRYPTION=${JWT_ENCRYPTION}
JWT_EXPIRATION=${CUSTOM_JWT_EXPIRATION:-3600}
DOCUMENT_TOKEN_SECRET=${CUSTOM_DOCUMENT_TOKEN_SECRET-${JWT_ENCRYPTION}}
TOKEN_SHARED_SECRET=${CUSTOM_TOKEN_SHARED_SECRET-${JWT_ENCRYPTION}}
###############################################################################
# B2C configuration #
###############################################################################
# B2C Backend
# URL to access backend API only. Admin panel URL is set during image build (static)
B2C_BACKEND_URL=${CUSTOM_B2C_BACKEND_URL:-${BASE_URL}/v1/customer}
# B2C Database configuration
# Access to the main database
POSTGRES_B2C_DB=${CUSTOM_POSTGRES_B2C_DB:-strapi}
POSTGRES_B2C_HOST=${CUSTOM_POSTGRES_B2C_HOST:-${POSTGRES_HOST}}
POSTGRES_B2C_PORT=${CUSTOM_POSTGRES_B2C_PORT:-${POSTGRES_PORT}}
POSTGRES_B2C_USER=${CUSTOM_POSTGRES_B2C_USER:-${POSTGRES_USER}}
POSTGRES_B2C_PASSWORD=${CUSTOM_POSTGRES_B2C_PASSWORD:-${POSTGRES_PASSWORD}}
# B2C Backend external URL
# Used by Frontend at runtime to request Backend API
B2C_BACKEND_SUB_ROUTE=${CUSTOM_B2C_BACKEND_SUB_ROUTE:-/v1/customer}
B2C_BACKEND_EXTERNAL_URL=${CUSTOM_B2C_BACKEND_EXTERNAL_URL:-${BASE_URL}${B2C_BACKEND_SUB_ROUTE}}
# B2C Backend internal URL
# Used by Frontend at build time to request Backend GraphQL API
B2C_FRONTEND_BUILD_INTERNAL_API_URL=${CUSTOM_B2C_FRONTEND_BUILD_INTERNAL_API_URL:-${B2C_BACK_INTERNAL_URL}}
# B2C Frontend prefix path
B2C_FRONT_PATH_PREFIX=${CUSTOM_B2C_FRONT_PATH_PREFIX:-/customer}