Skip to content

Commit

Permalink
Merge branch 'main' into chore/migrations-test
Browse files Browse the repository at this point in the history
# Conflicts:
#	server/main.go
  • Loading branch information
CommanderStorm committed Oct 16, 2023
2 parents 7fe2da2 + 57774cd commit e5793e1
Show file tree
Hide file tree
Showing 38 changed files with 2,064 additions and 1,534 deletions.
4 changes: 2 additions & 2 deletions client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ require (
require (
github.com/golang/protobuf v1.5.3 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
Expand Down
8 changes: 4 additions & 4 deletions client/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
11 changes: 4 additions & 7 deletions client/local/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,14 @@ func storeImage(path string, i []byte) (string, error) {
}
}

out, errFile := os.Create(imgPath)
if errFile != nil {
log.WithError(errFile).Error("Unable to create the new testfile")
out, err := os.Create(imgPath)
if err != nil {
log.WithError(err).Error("Unable to create the new testfile")
}
defer func(out *os.File) {
if err := out.Close(); err != nil {
log.WithError(err).Error("File was not closed successfully")
}
}(out)
var opts jpeg.Options
opts.Quality = 100
errFile = jpeg.Encode(out, img, &opts)
return imgPath, errFile
return imgPath, jpeg.Encode(out, img, &jpeg.Options{Quality: 100})
}
6 changes: 3 additions & 3 deletions deployment/charts/backend/files/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ static_resources:
cors:
allow_origin_string_match:
- prefix: "*"
allow_methods: GET, PUT, DELETE, POST, OPTIONS
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
max_age: "1728000"
allow_methods: GET, DELETE, POST
allow_headers: "*"
max_age: "86400"
expose_headers: custom-header-1,grpc-status,grpc-message
http_filters:
- name: envoy.grpc_web
Expand Down
24 changes: 12 additions & 12 deletions deployment/charts/backend/templates/deployments/backend-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ spec:
- name: logs
emptyDir: { }
containers:
- name: access-legacybackend
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/apache2/access.log']
volumeMounts:
- name: logs
mountPath: /var/log
- name: error-legacybackend
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/apache2/error.log']
volumeMounts:
- name: logs
mountPath: /var/log
- name: tca-legacybackend
image: ghcr.io/kordianbruck/tca-backend/tca-server:{{ $.Values.tag }}
imagePullPolicy: Always
Expand All @@ -75,6 +63,18 @@ spec:
name: https
securityContext:
readOnlyRootFilesystem: true
- name: access-legacybackend
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/apache2/access.log']
volumeMounts:
- name: logs
mountPath: /var/log
- name: error-legacybackend
image: busybox:1.36
args: [/bin/sh, -c, 'tail -n+1 -F /var/log/apache2/error.log']
volumeMounts:
- name: logs
mountPath: /var/log
imagePullSecrets:
- name: regcred
---
Expand Down
68 changes: 34 additions & 34 deletions deployment/charts/backend/templates/deployments/backend-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,6 @@ spec:
configMap:
name: backend-grpc-web-config
containers:
- name: grpc-web-proxy
image: envoyproxy/envoy:v1.27-latest
imagePullPolicy: IfNotPresent
args:
- --config-path
- /etc/envoy/envoy.yaml
- --service-cluster
- backend-v2
- --service-node
- backend-v2
- --log-level
- info
ports:
- containerPort: 8081
name: http
- containerPort: 9901
name: admin
volumeMounts:
- mountPath: /etc/envoy/envoy.yaml
subPath: envoy.yaml
name: backend-grpc-web-config
readOnly: true
livenessProbe:
httpGet:
path: /ready
port: admin
failureThreshold: 5
periodSeconds: 1
startupProbe:
httpGet:
path: /ready
port: admin
failureThreshold: 60
periodSeconds: 1
- name: tca-backend
image: ghcr.io/tum-dev/campus-backend/backend-server:{{ $.Values.tag }}
imagePullPolicy: Always
Expand Down Expand Up @@ -136,6 +102,40 @@ spec:
port: http
failureThreshold: 60
periodSeconds: 1
- name: grpc-web-proxy
image: envoyproxy/envoy:v1.27-latest
imagePullPolicy: IfNotPresent
args:
- --config-path
- /etc/envoy/envoy.yaml
- --service-cluster
- backend-v2
- --service-node
- backend-v2
- --log-level
- info
ports:
- containerPort: 8081
name: http
- containerPort: 9901
name: admin
volumeMounts:
- mountPath: /etc/envoy/envoy.yaml
subPath: envoy.yaml
name: backend-grpc-web-config
readOnly: true
livenessProbe:
httpGet:
path: /ready
port: admin
failureThreshold: 5
periodSeconds: 1
startupProbe:
httpGet:
path: /ready
port: admin
failureThreshold: 60
periodSeconds: 1
---
apiVersion: v1
kind: Secret
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: cors
labels:
app.kubernetes.io/part-of: tum-campus-app
namespace: {{ $.Values.namespace }}
spec:
headers:
accessControlAllowMethods:
- GET
- DELETE
- POST
accessControlAllowHeaders:
- "*"
accessControlAllowOriginList:
- "*"
accessControlMaxAge: 86400
addVaryHeader: true
6 changes: 6 additions & 0 deletions deployment/charts/backend/templates/networking/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ spec:
port: 80
- kind: Rule
match: Host(`{{ join "`) || Host(`" $.Values.urls.v2 }}`)
middlewares:
- name: cors
services:
- name: backend-v2-svc
port: 50051
- kind: Rule
match: Host(`{{ join "`) || Host(`" $.Values.urls.v2WebGrpc }}`)
middlewares:
- name: cors
services:
- name: backend-v2-svc
port: 8081
- kind: Rule
match: (Host(`{{ join "`) || Host(`" $.Values.urls.v2 }}`)) && Headers(`Content-Type`, `application/grpc`)
middlewares:
- name: cors
services:
- name: backend-v2-svc
port: 50051
Expand Down
Loading

0 comments on commit e5793e1

Please sign in to comment.