Compare commits

...

11 Commits

Author SHA1 Message Date
15150aa565
feat: Cache-Control
All checks were successful
/ deploy (push) Successful in 4s
2025-05-03 04:15:38 +00:00
58ba882a9b
test: no server-snippet
All checks were successful
/ deploy (push) Successful in 4s
2025-05-03 04:14:48 +00:00
b11683a26c
fix: more_set_headers syntax
Some checks failed
/ deploy (push) Failing after 4s
2025-05-03 04:10:31 +00:00
e191fa71db
fix: deploy scripts
Some checks failed
/ deploy (push) Failing after 5s
2025-05-03 04:06:14 +00:00
7bdc38b151
fix: ingress cache conditions
Some checks failed
/ deploy (push) Failing after 5s
2025-05-03 03:53:36 +00:00
eb5d95f02c
fix: ingress annotation error
Some checks failed
/ deploy (push) Failing after 4s
2025-05-03 03:45:04 +00:00
7431dd4524
fix: yaml type error
All checks were successful
/ deploy (push) Successful in 4s
2025-05-03 03:23:07 +00:00
e041e4c490
feat: element headers
Some checks failed
/ deploy (push) Failing after 10s
2025-05-03 03:18:53 +00:00
bee2e150e1
fix: element port 2025-05-03 03:18:48 +00:00
450be7a336
bump: v1.11.99
All checks were successful
/ deploy (push) Successful in 5s
2025-05-03 02:55:29 +00:00
cc1c63854e
bump: 1.11.89
All checks were successful
/ deploy (push) Successful in 5s
2024-12-23 03:10:50 +00:00
6 changed files with 37 additions and 21 deletions

2
.env
View File

@ -1,2 +1,2 @@
PROD_URL=chat.gmoker.com PROD_URL=chat.gmoker.com
IMAGEAPP=docker.io/vectorim/element-web:v1.11.78 IMAGEAPP=docker.io/vectorim/element-web:v1.11.99

View File

@ -4,6 +4,8 @@ services:
image: "$IMAGEAPP" image: "$IMAGEAPP"
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8080:80" - "8080:8080"
environment:
- ELEMENT_WEB_PORT=8080
volumes: volumes:
- ./config.json:/app/config.json:ro - ./config/config.json:/app/config.json:ro

View File

@ -3,32 +3,34 @@ set -o pipefail
function kapply() { function kapply() {
for f in "$@"; do for f in "$@"; do
kubectl apply -f \ kubectl apply --server-side \
<(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f") -f<(envsubst "$(env | sed 's/^/$/')" < "manifests/$f")
done done
} }; export -f kapply
function kcreatesec() { function kcreatesec() {
kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f- kubectl apply --server-side \
} -f<(kubectl create secret generic --dry-run=client -oyaml "$@")
}; export -f kcreatesec
function kcreatecm() { function kcreatecm() {
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f- kubectl apply --server-side \
} -f<(kubectl create configmap --dry-run=client -oyaml "$@")
}; export -f kcreatecm
function kgseckey() { function kgseckey() {
local sec="$1"; shift local sec="$1"; shift
local key="$1"; shift local key="$1"; shift
kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d kubectl get secret "$sec" -ojson | jq -re ".data.\"$key\"" | base64 -d
} }; export -f kgseckey
function kgcmkey() { function kgcmkey() {
local cm="$1"; shift local cm="$1"; shift
local key="$1"; shift local key="$1"; shift
kubectl get configmap "$cm" -o jsonpath="{.data.$key}" kubectl get configmap "$cm" -ojson | jq -re ".data.\"$key\""
} }; export -f kgcmkey
kcreatecm element --from-file=config/config.json kcreatecm element --from-file=config/config.json

View File

@ -1,4 +1,5 @@
#!/bin/bash -e #!/bin/bash -e
set -o pipefail
export NB_REPLICAS=1 export NB_REPLICAS=1

View File

@ -1,4 +1,5 @@
#!/bin/bash -e #!/bin/bash -e
set -o pipefail
export NB_REPLICAS=3 export NB_REPLICAS=3

View File

@ -5,11 +5,18 @@ metadata:
name: app name: app
annotations: annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod cert-manager.io/cluster-issuer: letsencrypt-prod
gethomepage.dev/enabled: "true" nginx.ingress.kubernetes.io/configuration-snippet: |
gethomepage.dev/instance: "$GITHUB_REF_NAME" more_set_headers "X-Frame-Options: SAMEORIGIN";
gethomepage.dev/name: Element more_set_headers "X-Content-Type-Options: nosniff";
gethomepage.dev/icon: element more_set_headers "X-XSS-Protection: 1; mode=block";
gethomepage.dev/description: Secure collaboration and messaging more_set_headers "Content-Security-Policy: frame-ancestors 'self'";
if ($request_uri = /) {
more_set_headers "Cache-Control: no-cache";
}
if ($request_uri ~* ^/(config\..*\.json|i18n|home|sites|index\.html)$) {
more_set_headers "Cache-Control: no-cache, no-store, must-revalidate";
}
spec: spec:
ingressClassName: nginx ingressClassName: nginx
tls: tls:
@ -63,7 +70,10 @@ spec:
image: "$IMAGEAPP" image: "$IMAGEAPP"
ports: ports:
- name: http - name: http
containerPort: 80 containerPort: 8080
env:
- name: ELEMENT_WEB_PORT
value: "8080"
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /app/config.json mountPath: /app/config.json