-
Notifications
You must be signed in to change notification settings - Fork 17
/
config
282 lines (211 loc) · 12.1 KB
/
config
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
# vim: set ft=sh:
#-------------------------------------------------------------------------------#
# GENERAL PURPOSE
#-------------------------------------------------------------------------------#
if [ -z "$COOG_CODE_DIR" ] || [ ! -d "$COOG_CODE_DIR" ] || [ -z "$COOG_DATA_DIR" ]
then
{
echo "Please make sure that these two env vars are set:"
echo " COOG_CODE_DIR: your coog-admin install folder"
echo " COOG_DATA_DIR: the folder where to keep your custom config"
} >&2 && exit 1
fi
[ -z "$EDITOR" ] && EDITOR=nano
NETWORK_NAME=$USER
[ -z "$DOCKER_DAEMON_OPTS" ] && DOCKER_DAEMON_OPTS="-d --restart always"
[ -z "$DOCKER_PIPED_OPTS" ] && DOCKER_PIPED_OPTS="--rm"
[ -z "$DOCKER_INTERACTIVE_OPTS" ] && DOCKER_INTERACTIVE_OPTS="-it --rm"
[ -z "$DOCKER_BURST_OPTS" ] && DOCKER_BURST_OPTS="-d --rm"
[ -z "$COOG_TIMEOUT" ] && COOG_TIMEOUT=600
#-------------------------------------------------------------------------------#
# POSTGRES CONFIG
#-------------------------------------------------------------------------------#
POSTGRES_IMAGE=postgres:9.6-alpine # docker image
POSTGRES_VOLUME=$COOG_DATA_DIR/postgres # docker data volume
POSTGRES_USER=postgres # postgres user
POSTGRES_PASSWORD=postgres # postgres password
COOG_DB_USER=$POSTGRES_USER # coog pg user
COOG_DB_PASSWORD=$POSTGRES_PASSWORD # coog pg password
COOG_DB_NAME=coog # coog pg db name
SENTRY_DB_USER=$POSTGRES_USER # sentry db user
SENTRY_DB_PASSWORD=$POSTGRES_PASSWORD # sentry db password
SENTRY_DB_NAME=sentry # sentry db db name
#-------------------------------------------------------------------------------#
# REDIS CONFIG
#-------------------------------------------------------------------------------#
REDIS_IMAGE=redis:3.2-alpine # docker image
REDIS_VOLUME=$COOG_DATA_DIR/redis # docker data volume
REDIS_EXTRA_ARGS= # to disable persistence: '--save "" --appendonly no' [do not forget the single quotes]
COOG_CACHE_DB=0 # coog cache db name
COOG_CELERY_DB=1 # coog celery db name
COOG_RQ_DB=2 # coog rq db name
SENTRY_REDIS_DB=5 # sentry db name
WEB_REDIS_DB=7 # web db name
#-------------------------------------------------------------------------------#
# UNOCONV CONFIG
#-------------------------------------------------------------------------------#
UNOCONV_IMAGE=coopengohub/unoconv # docker image
#-------------------------------------------------------------------------------#
# SENTRY CONFIG
#-------------------------------------------------------------------------------#
SENTRY_IMAGE=sentry:9 # docker image
SENTRY_VOLUME=$COOG_DATA_DIR/sentry # docker data volume
SENTRY_KEY=$COOG_DATA_DIR/sentry.key # containers shared key
SENTRY_POSTGRES_HOST= # defaults to postgres container
SENTRY_POSTGRES_PORT= # defaults to postgres container
SENTRY_REDIS_HOST= # defaults to redis container
SENTRY_REDIS_PORT= # defaults to redis container
#-------------------------------------------------------------------------------#
# COOG CONFIG
#-------------------------------------------------------------------------------#
COOG_IMAGE=coopengohub/coog:master # docker image
COOG_VOLUME=$COOG_DATA_DIR/coog # docker data volume
COOG_POSTGRES_HOST= # defaults to postgres container
COOG_POSTGRES_PORT= # defaults to postgres container
COOG_REDIS_HOST= # defaults to redis container
COOG_REDIS_PORT= # defaults to redis container
COOG_SERVER_WORKERS="$(nproc)" # server workers
COOG_CELERY_WORKERS="$(nproc)" # celery workers
COOG_SENTRY_PROTOCOL= # defaults to http
COOG_SENTRY_HOST= # defaults to sentry container
COOG_SENTRY_PORT= # defaults to sentry container
COOG_SENTRY_PUB=
COOG_SENTRY_SEC=
COOG_SENTRY_PROJECT=
COOG_SESSION_SUPERPWD=super # coog super password (not a user)
COOG_DB_LANG=fr # database locale - eg. fr_FR
COOG_CACHE_MODEL= # models cache size
COOG_CACHE_RECORD= # records cache size
COOG_CACHE_FIELD= # fields cache size
COOG_CACHE_COOG= # coog cache size
COOG_REPORT_API= # report server - default: unoconv ctn
COOG_LOG_LEVEL= # python levels
COOG_ADMIN_EMAIL=example@coopengo.com # application admin email address
COOG_TEST= # switch conf when not empty
COOG_TEST_WORKERS="$(nproc)" # test workers number
COOG_FONT_DIR=/usr/local/fonts # folder to look in for fonts
#-------------------------------------------------------------------------------#
# WEB CONFIG
#-------------------------------------------------------------------------------#
WEB_IMAGE=coopengohub/web:master # docker image
COOG_API_API_URL= # server url
COOG_API_API_PROTOCOL= # API protocol
COOG_API_APP_URL= # front-end application url if distant
COOG_API_CORS= # cross-origin resource sharing
COOG_API_GOOGLE_SECRET= # Google API Secret
COOG_API_GOOGLE_KEY= # Google API Key
#-------------------------------------------------------------------------------#
# PORTAL CONFIG
#-------------------------------------------------------------------------------#
PORTAL_VERSION=master # Portal image tag
API_VERSION=master # Api image tag
GATEWAY_VERSION=master # Gateway image tag
REACT_APP_PORTAL_URL=/portal # The basename of coog-portal url
# Basename is at the start of the path section
# https://en.wikipedia.org/wiki/URL#Syntax
REACT_APP_PROD_API_URL=/gateway
#-------------------------------------------------------------------------------#
# API CONFIG
#-------------------------------------------------------------------------------#
API_WEB_TOKEN= # Token use to communicate with coog
COOG_SERVER_PORT=80 # Coog server port
COOG_SERVER_PROTOCOL=http # Coog server protocol if distant
API_MONGO_DB_NAME= # Custom mongo database
#-------------------------------------------------------------------------------#
# GATEWAY CONFIG
#-------------------------------------------------------------------------------#
GATEWAY_WHITELIST= # All front-end or api that will communicate with gateway
COOG_PORTAL_URL= # Full url <protocol>://<host>:<port> of portal url
JWT_SECRET= # Custom secret encryption ofr JWT
JWT_EXPIRATION= # Custom duration of JWT
GATEWAY_WEB_TOKEN= # Token used to communicate with API V1
GATEWAY_MONGO_DB_NAME= # Custom mongo database
COOG_API_URL= # Container web url if not present on the same machine
COOG_API_URL_V2= # Container api url if not present on the same machine
COOG_MODULE= # Set to true if you want to enable authentification with coog
GOOGLE_MODULE= # Set to true if you want to enable authentification with google
GOOGLE_CLIENT_ID= # Application id of google
GOOGLE_CLIENT_SECRET= # Application secret of google
FACEBOOK_MODULE= # Set to true if you want to enable authentification with facebook
FACEBOOK_CLIENT_ID= # Application id of facebook
FACEBOOK_CLIENT_SECRET= # Application secret of facebook
FORCEDOTCOM_MODULE= # Set to true if you want to enable authentification with forcedotcom
FORCEDOTCOM_CLIENT_ID= # Application id of forcedotcom
FORCEDOTCOM_CLIENT_SECRET= # Application secret of forcedotcom
#-------------------------------------------------------------------------------#
# MONGO CONFIG
#-------------------------------------------------------------------------------#
MONGO_IMAGE=mongo # Custom mongo docker image
MONGO_PORT=27017 # Port of mongo server
MONGO_USER= # User for mongo server
MONGO_PASSWORD= # Password for mongo server
#-------------------------------------------------------------------------------#
# NGINX CONFIG
#-------------------------------------------------------------------------------#
NGINX_IMAGE=nginx:1-alpine # docker image
NGINX_VOLUME=$COOG_DATA_DIR/nginx # nginx conf folder
NGINX_PUB_PORT=80 # host mapped port
NGINX_SSL_PUB_PORT=443 # SSL host mapped port
NGINX_SSL_METHOD= # SSL method (LETSENCRYPT or CUSTOM_KEYS)
NGINX_SSL_SERVER_NAME= # SSL server name
#-------------------------------------------------------------------------------#
# PAYBOX CONFIG
#-------------------------------------------------------------------------------#
PAYBOX_IMAGE=coopengohub/paybox:master
PAYBOX_PUB_PORT=3000
PAYBOX_COOG_USER=admin
PAYBOX_COOG_PASS=admin
#-------------------------------------------------------------------------------#
# SYNC CONFIG
#-------------------------------------------------------------------------------#
SYNC_IMAGE=coopengohub/sync:master # docker image
SYNC_SRC=$COOG_VOLUME # source volume
SYNC_DEST=/home/$USER/.sync # destination volume
#-------------------------------------------------------------------------------#
# BACKUP CONFIG
#-------------------------------------------------------------------------------#
BACKUP_DIRECTORY=/mnt/coog_backup
#-------------------------------------------------------------------------------#
# DWH CONFIG
#-------------------------------------------------------------------------------#
DWH_IMAGE="$POSTGRES_IMAGE" # docker postgres image
DWH_VOLUME="$COOG_DATA_DIR/dwh" # shared volume
DWH_USER=postgres # datawarehouse pg user
DWH_PASSWORD=postgres # datawarehouse pg passwor
DWH_DB_NAME=coog_dwh # datawarehouse database
#-------------------------------------------------------------------------------#
# ETL CONFIG
#-------------------------------------------------------------------------------#
ETL_IMAGE=coopengohub/etl:master
ETL_ORIGIN_DB_HOST="$COOG_POSTGRES_HOST"
ETL_ORIGIN_DB_PORT="$COOG_POSTGRES_PORT"
ETL_ORIGIN_DB_USER="$COOG_DB_USER"
ETL_ORIGIN_DB_PASSWORD="$COOG_DB_PASSWORD"
ETL_ORIGIN_DB_NAME="$COOG_DB_NAME"
ETL_TARGET_DB_HOST=
ETL_TARGET_DB_PORT=
ETL_TARGET_DB_USER="$DWH_USER"
ETL_TARGET_DB_PASSWORD="$DWH_PASSWORD"
ETL_TARGET_DB_NAME="$DWH_DB_NAME"
#-------------------------------------------------------------------------------#
# BI SERVER CONFIG
#-------------------------------------------------------------------------------#
BI_IMAGE=coopengohub/bi:master
BI_DB_HOST="$ETL_TARGET_DB_HOST"
BI_DB_PORT="$ETL_TARGET_DB_PORT"
BI_DB_USER="$ETL_TARGET_DB_USER"
BI_DB_PASSWORD="$ETL_TARGET_DB_PASSWORD"
BI_DB_NAME="$ETL_TARGET_DB_NAME"
BI_PORT=4242
#-------------------------------------------------------------------------------#
# CUSTOMS
#-------------------------------------------------------------------------------#
source "$COOG_DATA_DIR/config"
#-------------------------------------------------------------------------------#
# INIT
#-------------------------------------------------------------------------------#
source "$COOG_CODE_DIR/config.fn"
#-------------------------------------------------------------------------------#
# VALIDATE CONFIG
#-------------------------------------------------------------------------------#
config_check || exit 1