EOX GitLab Instance

Skip to content
Snippets Groups Projects
Commit 91ec38c9 authored by Nikola Jankovic's avatar Nikola Jankovic :computer:
Browse files

Merge branch 'configure-http-access' into 'main'

Configure http access

See merge request !7
parents 0584e9d2 31941d8f
No related branches found
No related tags found
1 merge request!7Configure http access
Pipeline #20786 passed
......@@ -84,7 +84,8 @@ ENV INSTANCE_ID="prism-view-server_core" \
REGISTRAR_REPLACE= \
GDAL_PAM_ENABLED="NO" \
EOXS_LAYER_SUFFIX_SEPARATOR="__" \
DEV="false"
DEV="false" \
ENABLE_HTTP_ACCESS="false"
COPY . .
......
......@@ -69,6 +69,12 @@ spec:
value: /opt/core/wait-initialized.sh {{- range $script := .Values.global.env.startup_scripts }} {{ $script }}{{ end }}
- name: WAIT_SERVICES
value: {{ .Release.Name }}-database:{{ .Values.global.env.DB_PORT }}
- name: ENABLE_HTTP_ACCESS
{{- if .Values.config.enableHttpAccess }}
value: "true"
{{- else }}
value: "false"
{{- end }}
envFrom:
- secretRef:
name: django-secret-key
......
......@@ -53,7 +53,16 @@ spec:
name: {{ $fullName }}
port:
number: 80
{{- else }}
{{- if $.Values.config.enableHttpAccess }}
- path: /(http.*)
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: 80
{{- end -}}
{{- else -}}
- host: {{ .host | quote }}
http:
paths:
......@@ -69,6 +78,12 @@ spec:
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- if $.Values.config.enableHttpAccess -}}
- path: /(http.*)
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end -}}
{{- end -}}
{{- end }}
{{- end -}}
{{- end -}}
......@@ -39,6 +39,9 @@ volumes: []
ingress:
enabled: true
config:
enableHttpAccess: false
global:
env:
REDIS_PORT: "6379"
......
......@@ -3,6 +3,7 @@
echo "Running configure.sh"
DEBUG=${DEBUG:="false"}
ENABLE_HTTP_ACCESS=${ENABLE_HTTP_ACCESS:="false"}
# Configure instance
sed -e "s/'disable_existing_loggers': True,/'disable_existing_loggers': False,/" -i pvs_instance/settings.py
HANDLERS="'handlers': {\n
......@@ -62,6 +63,12 @@
sed -e "s/SECRET_KEY = '.*'/SECRET_KEY = '${DJANGO_SECRET_KEY}'/" -i pvs_instance/settings.py
chmod g+w -R .
chgrp users -R .
if [[ "$ENABLE_HTTP_ACCESS" = true ]] ; then
echo "Installing and enabling http_access"
echo "INSTALLED_APPS += ('http_access', )" >> pvs_instance/settings.py
echo "urlpatterns.append(re_path(r'^http/', include('http_access.urls')))" >> pvs_instance/urls.py
fi
if [[ "$DEBUG" = true ]] ; then
echo "DEBUG ON Setting functions"
......
......@@ -7,3 +7,4 @@ jsonschema<5.0
boto3<2.0
django-cors-headers<4.0
pystac<2.0
http-access==0.0.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment