Replace the inline gaufre.js/nginx.conf ConfigMap approach with a purpose-built custom image (sunbeam/integration-service) that builds the lagaufre.js v2 widget from the suitenumerique/integration source and serves it via nginx. Changes: - Rewrite integration-deployment.yaml: custom image, v2 services.json format, only actually-deployed services (docs, meet, people) - Add people-frontend nginx sub_filter overlay to rewrite the hardcoded production integration URL baked into the Next.js bundle at build time - Register integration image in local overlay kustomization
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# nginx config for people-frontend that rewrites the hardcoded production
|
|
# integration URL baked into the desk static Next.js build.
|
|
#
|
|
# The people-frontend image has integration.lasuite.numerique.gouv.fr compiled
|
|
# in. sub_filter rewrites it to our local instance so the gaufre.js and
|
|
# services.json come from integration.DOMAIN_SUFFIX instead of the official
|
|
# government service.
|
|
#
|
|
# gzip must be off for sub_filter to operate on JS responses.
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: people-frontend-nginx-conf
|
|
namespace: lasuite
|
|
data:
|
|
default.conf: |
|
|
server {
|
|
listen 3000;
|
|
listen 8080;
|
|
server_name localhost;
|
|
server_tokens off;
|
|
|
|
root /usr/share/nginx/html;
|
|
|
|
gzip off;
|
|
sub_filter 'integration.lasuite.numerique.gouv.fr' 'integration.DOMAIN_SUFFIX';
|
|
sub_filter_once off;
|
|
sub_filter_types text/html application/javascript;
|
|
|
|
location / {
|
|
try_files $uri index.html $uri/ =404;
|
|
}
|
|
|
|
location /teams/ {
|
|
error_page 404 /teams/[id]/;
|
|
}
|
|
|
|
location /mail-domains/ {
|
|
error_page 404 /mail-domains/[slug]/;
|
|
}
|
|
|
|
error_page 404 /404.html;
|
|
location = /404.html {
|
|
internal;
|
|
}
|
|
}
|