Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07a1d9a31d | ||
|
|
62480a439f | ||
|
|
19af384c4f | ||
|
|
0948358703 | ||
|
|
89ad40bb88 | ||
|
|
856070907e | ||
|
|
e206e45427 | ||
|
|
8075bab534 |
7 changed files with 102 additions and 14 deletions
18
CHANGELOG.md
Normal file
18
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
## 2.0.0
|
||||||
|
|
||||||
|
_v2 release: Improved NGINX configuration for performance and compatibility_
|
||||||
|
|
||||||
|
2025-02-19
|
||||||
|
|
||||||
|
- Enhanced proxy buffering to optimize request handling.
|
||||||
|
- Improved gzip compression settings.
|
||||||
|
- Fixed rewrite rules to properly handle static content.
|
||||||
|
- Added resolver for better DNS resolution.
|
||||||
|
- Ensured proper trailing slash redirections.
|
||||||
|
- Updated proxy settings for better MinIO integration.
|
||||||
|
|
||||||
|
## 1.0.0
|
||||||
|
|
||||||
|
_v1 release: Initial release_
|
||||||
|
|
||||||
|
2025-02-09
|
||||||
|
|
@ -2,5 +2,5 @@ apiVersion: v2
|
||||||
name: k8s-pages
|
name: k8s-pages
|
||||||
description: A Helm chart for an NGINX reverse proxy with configurable sites hosted from minio object storage
|
description: A Helm chart for an NGINX reverse proxy with configurable sites hosted from minio object storage
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 2.0.0
|
||||||
appVersion: "1.0"
|
appVersion: "1.0"
|
||||||
|
|
|
||||||
|
|
@ -4,35 +4,47 @@ Generate the content for the NGINX configuration.
|
||||||
{{- define "nginx.configmap.content" -}}
|
{{- define "nginx.configmap.content" -}}
|
||||||
{{- range .Values.sites }}
|
{{- range .Values.sites }}
|
||||||
server {
|
server {
|
||||||
listen 80;
|
{{ if .apex }}
|
||||||
|
server_name {{ .host }};
|
||||||
|
{{ else if .subdomain }}
|
||||||
|
server_name {{ .subdomain }}.{{ .host }};
|
||||||
|
{{ else }}
|
||||||
server_name {{ .name }}.{{ .host }};
|
server_name {{ .name }}.{{ .host }};
|
||||||
|
{{ end }}
|
||||||
|
listen 80;
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_comp_level 6;
|
gzip_comp_level 6;
|
||||||
gzip_buffers 16 8k;
|
gzip_buffers 16 8k;
|
||||||
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
gzip_types text/plain text/html text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_intercept_errors on;
|
proxy_intercept_errors on;
|
||||||
|
proxy_buffer_size 16k;
|
||||||
|
proxy_buffers 4 32k;
|
||||||
|
proxy_busy_buffers_size 64k;
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
resolver 1.1.1.1 valid=300s ipv6=off;
|
||||||
proxy_hide_header x-amz-request-id;
|
proxy_hide_header x-amz-request-id;
|
||||||
proxy_hide_header x-minio-deployment-id;
|
proxy_hide_header x-minio-deployment-id;
|
||||||
|
|
||||||
location / {
|
location ~ ^([^.?]*[^/])$ {
|
||||||
# These rewrites are kept as in your original config.
|
return 301 $1/;
|
||||||
rewrite ^/$ /{{ $.Values.bucket }}/{{ .name }}/index.html break;
|
}
|
||||||
rewrite ^(.*)/$ /$1/index.html break;
|
|
||||||
|
|
||||||
# Use the parameterized backend URL.
|
location / {
|
||||||
proxy_pass {{ .minioURL }}/{{ $.Values.bucket }}/{{ .name }}/;
|
rewrite ^/$ /{{ $.Values.bucket }}/{{ .name }}/index.html break;
|
||||||
|
rewrite ^/(.+)/$ /{{ $.Values.bucket }}/{{ .name }}/$1/index.html break;
|
||||||
|
rewrite ^/(.+)$ /{{ $.Values.bucket }}/{{ .name }}/$1 break;
|
||||||
|
|
||||||
|
proxy_pass {{ .minioURL }}/{{ $.Values.bucket }}/{{ .name }};
|
||||||
proxy_set_header Host {{ .minioHost }};
|
proxy_set_header Host {{ .minioHost }};
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
@ -42,8 +54,10 @@ server {
|
||||||
proxy_ssl_verify off;
|
proxy_ssl_verify off;
|
||||||
error_page 404 {{ .errorPage }};
|
error_page 404 {{ .errorPage }};
|
||||||
|
|
||||||
add_header Cache-Control "public, max-age={{ $.Values.maxAge }}, stale-while-revalidate={{ $.Values.staleWhileRevalidate }}" always;
|
proxy_hide_header Cache-Control;
|
||||||
}
|
add_header Cache-Control "public, max-age={{ $.Values.maxAge }}, stale-while-revalidate={{ $.Values.staleWhileRevalidate }}, stale-if-error={{ $.Values.staleIfError }}" always;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,13 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.sites }}
|
{{- range .Values.sites }}
|
||||||
|
{{- if .apex }}
|
||||||
|
- host: {{ .host }}
|
||||||
|
{{- else if .subdomain }}
|
||||||
|
- host: {{ .subdomain }}.{{ .host }}
|
||||||
|
{{- else }}
|
||||||
- host: {{ .name }}.{{ .host }}
|
- host: {{ .name }}.{{ .host }}
|
||||||
|
{{ end }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
|
|
|
||||||
15
justfile
Normal file
15
justfile
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
version := `cat version`
|
||||||
|
|
||||||
|
version:
|
||||||
|
#!/bin/bash
|
||||||
|
echo {{ version }}
|
||||||
|
|
||||||
|
release:
|
||||||
|
#!/bin/bash
|
||||||
|
./scripts/get_release_notes.py "{{ version }}" > release_notes.tmp
|
||||||
|
helm package helm-chart
|
||||||
|
gh release create "v{{ version }}" \
|
||||||
|
--title "v{{version}}" \
|
||||||
|
--notes-file release_notes.tmp \
|
||||||
|
k8s-pages-{{ version }}.tgz
|
||||||
|
rm release_notes.tmp
|
||||||
35
scripts/get_release_notes.py
Executable file
35
scripts/get_release_notes.py
Executable file
|
|
@ -0,0 +1,35 @@
|
||||||
|
#!/usr/bin/env -S uv run --quiet --script
|
||||||
|
# /// script
|
||||||
|
# requires-python = ">=3.10"
|
||||||
|
# ///
|
||||||
|
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def get_release_notes(version):
|
||||||
|
with open("CHANGELOG.md", "r") as f:
|
||||||
|
content = f.read()
|
||||||
|
|
||||||
|
sections = content.split("\n## ")
|
||||||
|
# First section won't start with ## since it's split on that
|
||||||
|
sections = ["## " + s if i > 0 else s for i, s in enumerate(sections)]
|
||||||
|
|
||||||
|
for section in sections:
|
||||||
|
if section.startswith(f"## {version}"):
|
||||||
|
return section.strip()
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
print("Usage: get_release_notes.py VERSION", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
version = sys.argv[1]
|
||||||
|
notes = get_release_notes(version)
|
||||||
|
if notes:
|
||||||
|
print(notes)
|
||||||
|
else:
|
||||||
|
print(f"Error: No release notes found for version {version}", file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
2
version
2
version
|
|
@ -1 +1 @@
|
||||||
1
|
2.0.0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue