-
Notifications
You must be signed in to change notification settings - Fork 117
/
config_env_subst.sh
67 lines (52 loc) · 1.57 KB
/
config_env_subst.sh
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
#!/bin/bash
# This source code is licensed under the terms of the
# GNU Affero General Public License found in the LICENSE file in
# the root directory of this source tree.
#
# Copyright (c) 2021-present Kaleidos INC
contribs=()
# Slack
if [[ -z "${ENABLE_SLACK}" ]]; then
export ENABLE_SLACK="false"
fi
if [ ${ENABLE_SLACK} == "true" ]; then
contribs+=('"plugins/slack/slack.json"')
fi
# Public registration and oauth
if [[ -z "${PUBLIC_REGISTER_ENABLED}" ]]; then
export PUBLIC_REGISTER_ENABLED="false"
fi
if [ ${PUBLIC_REGISTER_ENABLED} == "true" ]; then
if [ ${ENABLE_GITHUB_AUTH} == "true" ]; then
contribs+=('"plugins/github-auth/github-auth.json"')
fi
if [ ${ENABLE_GITLAB_AUTH} == "true" ]; then
contribs+=('"plugins/gitlab-auth/gitlab-auth.json"')
fi
fi
# Importers
if [[ -z "${ENABLE_GITHUB_IMPORTER}" ]]; then
export ENABLE_GITHUB_IMPORTER="false"
fi
if [[ -z "${ENABLE_JIRA_IMPORTER}" ]]; then
export ENABLE_JIRA_IMPORTER="false"
fi
if [[ -z "${ENABLE_TRELLO_IMPORTER}" ]]; then
export ENABLE_TRELLO_IMPORTER="false"
fi
# Default language
if [[ -z "${DEFAULT_LANGUAGE}" ]]; then
export DEFAULT_LANGUAGE="en"
fi
# Debug
if [[ -z "${DEBUG}" ]]; then
export DEBUG="false"
fi
contribs=$( IFS=,; echo "[${contribs[*]}]" )
export CONTRIB_PLUGINS=$contribs
FILE=/usr/share/nginx/html/conf.json
if [ ! -f "$FILE" ]; then
envsubst < /usr/share/nginx/html/conf.json.template \
> /usr/share/nginx/html/conf.json
fi
sed -i 's;<base href="/">;<base href="'"${TAIGA_SUBPATH}/"'">;g' /usr/share/nginx/html/index.html