Skip to content

Commit 2748af8

Browse files
authored
Alis/env var updates (#89)
* feat: add optional configuration variables and update wizard script * fix: update script URLs to main branch and remove cleanup of ubuntu user
1 parent daa305c commit 2748af8

5 files changed

Lines changed: 28 additions & 10 deletions

File tree

dibbs-ecr-viewer/dibbs-ecr-viewer-wizard.sh.home

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ set_vars() {
9393
pg
9494
auth
9595
nextauth
96+
optional
9697
break
9798
;;
9899
"AWS_PG_DUAL")
@@ -103,6 +104,7 @@ set_vars() {
103104
nbs
104105
auth
105106
nextauth
107+
optional
106108
break
107109
;;
108110
"AWS_SQLSERVER_NON_INTEGRATED")
@@ -112,6 +114,7 @@ set_vars() {
112114
sqlserver
113115
auth
114116
nextauth
117+
optional
115118
break
116119
;;
117120
"AWS_SQLSERVER_DUAL")
@@ -122,6 +125,7 @@ set_vars() {
122125
nbs
123126
auth
124127
nextauth
128+
optional
125129
break
126130
;;
127131
"AWS_INTEGRATED")
@@ -130,6 +134,7 @@ set_vars() {
130134
aws
131135
nbs
132136
nextauth
137+
optional
133138
break
134139
;;
135140
"AZURE_PG_NON_INTEGRATED")
@@ -139,6 +144,7 @@ set_vars() {
139144
pg
140145
auth
141146
nextauth
147+
optional
142148
break
143149
;;
144150
"AZURE_PG_DUAL")
@@ -149,6 +155,7 @@ set_vars() {
149155
nbs
150156
auth
151157
nextauth
158+
optional
152159
break
153160
;;
154161
"AZURE_SQLSERVER_NON_INTEGRATED")
@@ -158,6 +165,7 @@ set_vars() {
158165
sqlserver
159166
auth
160167
nextauth
168+
optional
161169
break
162170
;;
163171
"AZURE_SQLSERVER_DUAL")
@@ -168,6 +176,7 @@ set_vars() {
168176
nbs
169177
auth
170178
nextauth
179+
optional
171180
break
172181
;;
173182
"AZURE_INTEGRATED")
@@ -176,6 +185,7 @@ set_vars() {
176185
azure
177186
nbs
178187
nextauth
188+
optional
179189
break
180190
;;
181191
"GCP_PG_NON_INTEGRATED")
@@ -185,6 +195,7 @@ set_vars() {
185195
pg
186196
auth
187197
nextauth
198+
optional
188199
break
189200
;;
190201
"GCP_PG_DUAL")
@@ -195,6 +206,7 @@ set_vars() {
195206
nbs
196207
auth
197208
nextauth
209+
optional
198210
break
199211
;;
200212
"GCP_SQLSERVER_NON_INTEGRATED")
@@ -204,6 +216,7 @@ set_vars() {
204216
sqlserver
205217
auth
206218
nextauth
219+
optional
207220
break
208221
;;
209222
"GCP_SQLSERVER_DUAL")
@@ -214,6 +227,7 @@ set_vars() {
214227
nbs
215228
auth
216229
nextauth
230+
optional
217231
break
218232
;;
219233
"GCP_INTEGRATED")
@@ -222,6 +236,7 @@ set_vars() {
222236
gcp
223237
nbs
224238
nextauth
239+
optional
225240
break
226241
;;
227242
"Quit")
@@ -315,13 +330,20 @@ auth() {
315330
check_var AUTH_CLIENT_ID
316331
check_var AUTH_CLIENT_SECRET
317332
check_var AUTH_ISSUER
333+
check_var AUTH_SESSION_DURATION_MIN "Optional: leave blank for use defaults"
318334
check_var NEXTAUTH_URL "URL for the eCR Viewer application authentication: http(s)://(DOMAIN||IP:PORT)/ecr-viewer/api/auth/"
319335
}
320336

321337
nextauth() {
322338
check_var NEXTAUTH_SECRET "Generate a random secret using: openssl rand -base64 32"
323339
}
324340

341+
optional() {
342+
check_var SAVE_XML "Optional: leave blank for use defaults"
343+
check_var DISPLAY_FEEDBACK_LINKS "Optional: leave blank for use defaults"
344+
check_var ECR_PROCESSING_TIMEOUT "Optional: leave blank for use defaults"
345+
}
346+
325347
aws() {
326348
check_var AWS_REGION
327349
check_var ECR_BUCKET_NAME

dibbs-ecr-viewer/packer/dibbs-ecr-viewer.pkr.hcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,5 @@ build {
175175

176176
execute_command = "echo '${var.ssh_password}' | {{.Vars}} sudo -S -E bash '{{.Path}}'"
177177
}
178+
178179
}

dibbs-ecr-viewer/packer/http/aws-user-data

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ sed -i 's/^#*PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/ssh
2222
systemctl restart ssh
2323

2424
# Run postinstall script
25-
wget -O /tmp/postinstall.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/alis/vm_work1/dibbs-ecr-viewer/packer/scripts/post-install.sh
25+
wget -O /tmp/postinstall.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/main/dibbs-ecr-viewer/packer/scripts/post-install.sh
2626
bash /tmp/postinstall.sh
2727
rm /tmp/postinstall.sh
2828

2929
# Run fail2ban installation script
30-
wget -O /tmp/fail2ban-install.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/alis/vm_work1/dibbs-ecr-viewer/packer/scripts/fail2ban.sh
30+
wget -O /tmp/fail2ban-install.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/main/dibbs-ecr-viewer/packer/scripts/fail2ban.sh
3131
bash /tmp/fail2ban-install.sh
3232
rm /tmp/fail2ban-install.sh
3333

3434
# Run provision script
35-
wget -O /tmp/provision.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/alis/vm_work1/dibbs-ecr-viewer/packer/scripts/provision.sh
35+
wget -O /tmp/provision.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/main/dibbs-ecr-viewer/packer/scripts/provision.sh
3636
bash /tmp/provision.sh
3737
rm /tmp/provision.sh
3838

dibbs-ecr-viewer/packer/http/user-data

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ autoinstall:
3838
# - network
3939

4040
locale: en_US
41-
keyboard:
41+
keyboard:
4242
layout: us
4343

4444
network:
@@ -68,7 +68,7 @@ autoinstall:
6868
late-commands:
6969
# A postinstall script may optionally be used for further install
7070
# customization. Deploy this postinstall.sh script on the webserver.
71-
- wget -O /target/postinstall.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/alis/vm_work1/dibbs-ecr-viewer/packer/scripts/post-install.sh
71+
- wget -O /target/postinstall.sh https://raw.githubusercontent.com/CDCgov/dibbs-vm/refs/heads/main/dibbs-ecr-viewer/packer/scripts/post-install.sh
7272
- curtin in-target -- bash /postinstall.sh
7373
- rm /target/postinstall.sh
7474

dibbs-ecr-viewer/packer/scripts/provision.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,3 @@ docker info
9393
docker compose build
9494
docker compose up -d
9595
echo "[$(date)] DIBBS provision script completed."
96-
97-
sudo userdel -rf ubuntu
98-
sleep 20
99-
100-
# check if user exists

0 commit comments

Comments
 (0)