-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.jps
199 lines (190 loc) · 6.28 KB
/
manifest.jps
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
jpsVersion: 1.3
jpsType: install
application:
id: shopozor-auth
name: Shopozor Auth
version: 0.0
baseUrl: https://raw.githubusercontent.com/shopozor/fusionauth/master
settings:
fields:
- name: authDatabaseRootUser
caption: Auth Root DB User
type: string
default: webadmin
- name: authDatabaseRootUserPassword
caption: Auth Root DB User Password
type: string
inputType: password
required: true
- name: authDatabaseUser
caption: Auth DB User
type: string
default: fusionauth
- name: authDatabaseUserPassword
caption: Auth DB User Password
type: string
inputType: password
required: true
- name: authDatabaseName
caption: Auth DB Name
type: string
default: fusionauth
- name: authDatabaseHostname
caption: Auth DB Hostname (without https)
type: string
required: true
- name: authDatabasePort
caption: Auth DB Port
type: string
default: 5432
- name: fusionauthVersion
caption: Fusionauth version
type: string
default: 1.16.1
- name: openSslNumbits
caption: Numbits (OpenSSL)
type: numberpicker
required: true
default: 4096
editable: true
min: 0
max: 16384
- name: resetDB
type: toggle
caption: Reset DB
value: false
hidden: false
showIf:
true:
- name: authAdminUserEmail
caption: Auth Admin User Email
type: string
default: [email protected]
- name: tenantIssuerName
caption: Fusionauth Tenant Issuer
type: string
default: shopozor.com
- name: corsAllowedOrigins
caption: CORS Allowed Origins
type: string
default: https://shopozor.com, https://www.shopozor.com, https://admin.shopozor.com, https://staging.shopozor.com, https://admin-staging.shopozor.com, https://preprod.shopozor.com, https://admin-preprod.shopozor.com
- name: hasuraClaimsNamespace
caption: Hasura Claims Namespace
type: string
default: https://hasura.io/jwt/claims
globals:
AUTH_USER: fusionauth
AUTH_USER_HOME: /home/${globals.AUTH_USER}
AUTH_ADMIN_USER_PASSWORD: ${fn.password(20)}
DEFAULT_TENANT_ID: ${fn.uuid}
DHPARAM_FILENAME: /var/lib/nginx/dhparam.pem
env:
topology:
nodes:
- nodeGroup: bl
nodeType: nginx-dockerized
tag: 1.16.1
displayName: Node balancing
count: 1
fixedCloudlets: 1
cloudlets: 32
- nodeGroup: cp
nodeType: docker
displayName: Fusion Auth
count: 1
fixedCloudlets: 1
cloudlets: 16
startServiceOnCreation: false
image: fusionauth/fusionauth-app:${settings.fusionauthVersion}
env:
DATABASE_URL: jdbc:postgresql://${settings.authDatabaseHostname}:${settings.authDatabasePort}/${settings.authDatabaseName}
DATABASE_ROOT_USER: ${settings.authDatabaseRootUser}
DATABASE_ROOT_PASSWORD: ${settings.authDatabaseRootUserPassword}
DATABASE_USER: ${settings.authDatabaseUser}
DATABASE_PASSWORD: ${settings.authDatabaseUserPassword}
FUSIONAUTH_MEMORY: 256M
volumeMounts:
/kickstart:
readOnly: true
sourcePath: /data
sourceNodeGroup: bl
volumes:
- /kickstart
onInstall:
- if ('${settings.resetDB}' == 'true'):
- resetDB
- setupKickstart
- startAuth
- secure
- cleanupKickstart
- log: "admin : ${settings.authAdminUserEmail} / ${globals.AUTH_ADMIN_USER_PASSWORD}"
actions:
resetDB:
- cmd [bl]:
- yum install -y postgresql
user: root
- cmd [bl]:
- curl -fsSL ${baseUrl}/scripts/reset_auth_db.sh | /bin/sh -s ${settings.authDatabaseRootUser} ${settings.authDatabaseRootUserPassword} ${settings.authDatabaseName} ${settings.authDatabaseUser} ${settings.authDatabaseUserPassword} ${settings.fusionauthVersion} ${settings.authDatabaseHostname}
setupKickstart:
- jelastic.environment.control.AddContainerEnvVars [cp]:
vars:
FUSIONAUTH_KICKSTART: /kickstart/kickstart.json
- cmd [bl]: |-
wget ${baseUrl}/conf/kickstart.json -O kickstart.json
wget ${baseUrl}/scripts/setup_kickstart.py -O setup_kickstart.py
mkdir /data
python setup_kickstart.py --admin-email=${settings.authAdminUserEmail} \
--admin-password=${globals.AUTH_ADMIN_USER_PASSWORD} \
--cors-allowed-origins="${settings.corsAllowedOrigins}" \
--hasura-claims-namespace=${settings.hasuraClaimsNamespace} \
--input-kickstart=kickstart.json \
--issuer=${settings.tenantIssuerName} \
--output-kickstart=/data/kickstart.json
user: root
startAuth:
- jelastic.env.control.ExecDockerRunCmd [${nodes.cp.join(id,)}]
secure:
- redirectHttpToHttps
- configureSSL
- restartNodes [bl]
redirectHttpToHttps:
- cmd [bl]:
- wget ${baseUrl}/conf/nginx/1.16.1/nginx-jelastic.conf -O /etc/nginx/nginx-jelastic.conf
user: root
configureSSL:
- installAddon:
id: letsencrypt
- cmd [bl]:
- wget ${baseUrl}/conf/nginx/1.16.1/conf.d/ssl.conf -O /etc/nginx/conf.d/ssl.conf
- cmd [bl]:
- openssl dhparam -out ${globals.DHPARAM_FILENAME} ${settings.openSslNumbits}
- replaceConfigPlaceholders:
filename: /etc/nginx/conf.d/ssl.conf
replaceConfigPlaceholders:
- replaceInFile:
path: ${this.filename}
replacements:
- pattern: IP_ADDRESS
replacement: ${nodes.cp.intIP}
- pattern: PORT
replacement: 9011
- pattern: PATH_TO_PEM_FILE
replacement: ${globals.DHPARAM_FILENAME}
nodeType: bl
cleanupKickstart:
- cmd [bl]:
- rm -f /data/kickstart.json
- restartNodes [cp]
addons:
- id: letsencrypt
name: letsencrypt
onInstall:
- install:
envName: ${env.envName}
jps: https://github.com/jelastic-jps/lets-encrypt/blob/master/manifest.jps
settings:
nodeGroup: bl
customDomains: ${env.envName}.hidora.com
success: |
Auth credentials:
* admin : ${settings.authAdminUserEmail} / ${globals.AUTH_ADMIN_USER_PASSWORD}