Skip to content

Commit c0ffe70

Browse files
authored
added test env as a copy of staging but with flexible on (#3052)
* small changes to make demo/staging more alike, added test env as a copy of staging but with flexible on * turn proxy on for demo * turn redirects feature on for test and staging * add test to deployable list
1 parent ad31b59 commit c0ffe70

4 files changed

Lines changed: 560 additions & 13 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
# - demo - pausing for accessibility testing
1313
- iiif
1414
- staging
15+
- test
1516
debug_enabled:
1617
type: boolean
1718
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"

ops/demo-deploy.tmpl.yaml

Lines changed: 125 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
replicaCount: 2
2+
23
resources:
34
limits:
45
memory: "4Gi"
56
cpu: "1000m"
67
requests:
78
memory: "2Gi"
89
cpu: "100m"
10+
911
livenessProbe:
1012
enabled: false
1113
readinessProbe:
@@ -193,6 +195,8 @@ extraEnvVars: &envVars
193195
value: $SOLR_ADMIN_PASSWORD
194196
- name: SOLR_COLLECTION_NAME
195197
value: hyku-demo
198+
- name: SOLR_COLLECTION_REPLICAS
199+
value: "2"
196200
- name: SOLR_CONFIGSET_NAME
197201
value: hyku-demo-2
198202
- name: SOLR_HOST
@@ -209,6 +213,7 @@ extraEnvVars: &envVars
209213
value: $SENTRY_ENVIRONMENT
210214
- name: VALKYRIE_TRANSITION
211215
value: "true"
216+
212217
worker:
213218
resources:
214219
limits:
@@ -282,6 +287,123 @@ global:
282287
hyraxName: hyku-demo-hyrax
283288

284289
nginx:
285-
enabled: false
286-
service:
287-
port: 80
290+
enabled: true
291+
resources:
292+
limits:
293+
memory: "256Mi"
294+
cpu: "100m"
295+
requests:
296+
memory: "128Mi"
297+
cpu: "20m"
298+
image:
299+
registry: ghcr.io
300+
repository: notch8/scripts/bitnamilegacy-nginx
301+
tag: 1.21.6-debian-11-r21
302+
serverBlock: |-
303+
upstream rails_app {
304+
server {{ .Values.global.hyraxName }};
305+
}
306+
307+
map ${DOLLAR}status ${DOLLAR}loggable {
308+
~^444 0;
309+
default 1;
310+
}
311+
312+
log_format loki 'host=${DOLLAR}host ip=${DOLLAR}http_x_forwarded_for remote_user=${DOLLAR}remote_user [${DOLLAR}time_local] '
313+
'request="${DOLLAR}request" status=${DOLLAR}status bytes=${DOLLAR}body_bytes_sent '
314+
'referer="${DOLLAR}http_referer" agent="${DOLLAR}http_user_agent" request_time=${DOLLAR}request_time upstream_response_time=${DOLLAR}upstream_response_time upstream_response_length=${DOLLAR}upstream_response_length';
315+
316+
error_log /opt/bitnami/nginx/logs/error.log warn;
317+
#tcp_nopush on;
318+
319+
# Cloudflare ips see for refresh
320+
# https://support.cloudflare.com/hc/en-us/articles/200170786-Restoring-original-visitor-IPs-logging-visitor-IP-addresses
321+
# update list https://www.cloudflare.com/ips/
322+
set_real_ip_from 103.21.244.0/22;
323+
set_real_ip_from 103.22.200.0/22;
324+
set_real_ip_from 103.31.4.0/22;
325+
set_real_ip_from 104.16.0.0/13;
326+
set_real_ip_from 104.24.0.0/14;
327+
set_real_ip_from 108.162.192.0/18;
328+
set_real_ip_from 131.0.72.0/22;
329+
set_real_ip_from 141.101.64.0/18;
330+
set_real_ip_from 162.158.0.0/15;
331+
set_real_ip_from 172.64.0.0/13;
332+
set_real_ip_from 173.245.48.0/20;
333+
set_real_ip_from 188.114.96.0/20;
334+
set_real_ip_from 190.93.240.0/20;
335+
set_real_ip_from 197.234.240.0/22;
336+
set_real_ip_from 198.41.128.0/17;
337+
set_real_ip_from 2400:cb00::/32;
338+
set_real_ip_from 2606:4700::/32;
339+
set_real_ip_from 2803:f800::/32;
340+
set_real_ip_from 2405:b500::/32;
341+
set_real_ip_from 2405:8100::/32;
342+
set_real_ip_from 2a06:98c0::/29;
343+
set_real_ip_from 2c0f:f248::/32;
344+
345+
real_ip_header X-Forwarded-For;
346+
real_ip_recursive on;
347+
include /opt/bitnami/nginx/conf/conf.d/*.conf;
348+
server {
349+
listen 8080;
350+
server_name _;
351+
root /app/samvera/hyrax-webapp/public;
352+
index index.html;
353+
354+
client_body_in_file_only clean;
355+
client_body_buffer_size 32K;
356+
client_max_body_size 0;
357+
access_log /opt/bitnami/nginx/logs/access.log loki;
358+
# if=${DOLLAR}loggable;
359+
360+
sendfile on;
361+
send_timeout 300s;
362+
363+
include /opt/bitnami/nginx/conf/bots.d/ddos.conf;
364+
include /opt/bitnami/nginx/conf/bots.d/blockbots.conf;
365+
366+
location ~ (\.php|\.aspx|\.asp) {
367+
return 404;
368+
}
369+
370+
# deny requests for files that should never be accessed
371+
location ~ /\. {
372+
deny all;
373+
}
374+
375+
location ~* ^.+\.(rb|log)${DOLLAR} {
376+
deny all;
377+
}
378+
379+
# serve static (compiled) assets directly if they exist (for rails production)
380+
location ~ ^/(assets|packs|fonts|images|javascripts|stylesheets|swfs|system)/ {
381+
try_files ${DOLLAR}uri @rails;
382+
383+
# access_log off;
384+
gzip_static on; # to serve pre-gzipped version
385+
386+
expires max;
387+
add_header Cache-Control public;
388+
389+
# Some browsers still send conditional-GET requests if there's a
390+
# Last-Modified header or an ETag header even if they haven't
391+
# reached the expiry date sent in the Expires header.
392+
add_header Last-Modified "";
393+
add_header ETag "";
394+
break;
395+
}
396+
397+
# send non-static file requests to the app server
398+
location / {
399+
try_files ${DOLLAR}uri @rails;
400+
}
401+
402+
location @rails {
403+
proxy_set_header X-Real-IP ${DOLLAR}remote_addr;
404+
proxy_set_header X-Forwarded-For ${DOLLAR}proxy_add_x_forwarded_for;
405+
proxy_set_header Host ${DOLLAR}http_host;
406+
proxy_redirect off;
407+
proxy_pass http://rails_app;
408+
}
409+
}

ops/staging-deploy.tmpl.yaml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ extraEnvVars: &envVars
8989
value: "8080"
9090
- name: FCREPO_REST_PATH
9191
value: rest
92+
- name: GOOGLE_ACCOUNT_JSON
93+
value: $GOOGLE_ACCOUNT_JSON
9294
- name: GOOGLE_ANALYTICS_ID
9395
value: $GOOGLE_ANALYTICS_ID
96+
- name: GOOGLE_ANALYTICS_PROPERTY_ID
97+
value: $GOOGLE_ANALYTICS_PROPERTY_ID
9498
- name: GOOGLE_OAUTH_APP_NAME
9599
value: hyku-staging
96100
- name: GOOGLE_OAUTH_APP_VERSION
@@ -135,10 +139,18 @@ extraEnvVars: &envVars
135139
value: support@notch8.com
136140
- name: HYKU_FILE_ACL
137141
value: "false"
142+
- name: HYRAX_ANALYTICS
143+
value: "true"
144+
- name: HYRAX_ANALYTICS_PROVIDER
145+
value: "ga4"
146+
- name: HYRAX_ANALYTICS_REPORTING
147+
value: "true"
138148
- name: HYRAX_FITS_PATH
139149
value: /app/fits/fits.sh
140150
- name: HYRAX_FLEXIBLE
141151
value: "false"
152+
- name: HYRAX_REDIRECTS_ENABLED
153+
value: "true"
142154
- name: HYRAX_VALKYRIE
143155
value: "true"
144156
- name: HYKU_ADMIN_HOST
@@ -208,7 +220,7 @@ worker:
208220
resources:
209221
limits:
210222
memory: "4Gi"
211-
cpu: "1000m"
223+
cpu: "1250m"
212224
requests:
213225
memory: "2Gi"
214226
cpu: "100m"
@@ -233,6 +245,15 @@ leaseRelease:
233245

234246
fcrepo:
235247
enabled: false
248+
fits:
249+
enabled: true
250+
resources:
251+
limits:
252+
memory: "2Gi"
253+
cpu: "1000m"
254+
requests:
255+
memory: "1Gi"
256+
cpu: "250m"
236257
postgresql:
237258
enabled: false
238259
redis:
@@ -248,6 +269,7 @@ redis:
248269
architecture: standalone
249270
auth:
250271
password: $REDIS_PASSWORD
272+
251273
solr:
252274
enabled: false
253275

@@ -263,15 +285,6 @@ externalSolrUser: admin
263285
externalSolrCollection: "hyku-staging"
264286
externalSolrPassword: $SOLR_ADMIN_PASSWORD
265287

266-
fits:
267-
enabled: true
268-
resources:
269-
limits:
270-
memory: "2Gi"
271-
cpu: "1000m"
272-
requests:
273-
memory: "1Gi"
274-
cpu: "250m"
275288
global:
276289
hyraxName: hyku-staging-hyrax
277290

0 commit comments

Comments
 (0)