Compare commits
4 Commits
0.2.11
...
d469a7cf2c
Author | SHA1 | Date | |
---|---|---|---|
d469a7cf2c
|
|||
d308fd662a
|
|||
a9a8a36cb9
|
|||
845e4ec673
|
@ -14,6 +14,22 @@ steps:
|
||||
when:
|
||||
- event: [push, tag]
|
||||
|
||||
deploytest:
|
||||
image: portainer/kubectl-shell:latest
|
||||
secrets:
|
||||
- source: kube_config
|
||||
target: KUBE_CONFIG_CONTENT
|
||||
- source: encryption_key
|
||||
target: ENCRYPTION_KEY
|
||||
- source: secrets_checksum
|
||||
target: MD5_CHECKSUM
|
||||
commands:
|
||||
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
|
||||
- export KUBECONFIG=/tmp/kubeconfig
|
||||
- ./deployment/deploy.sh test
|
||||
when:
|
||||
- event: [push, tag]
|
||||
|
||||
deploy:
|
||||
image: portainer/kubectl-shell:latest
|
||||
secrets:
|
||||
|
@ -42,14 +42,14 @@ kind: Ingress
|
||||
metadata:
|
||||
name: nutri
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production-http
|
||||
cert-manager.io/cluster-issuer: letsencrypt-staging-http
|
||||
spec:
|
||||
tls:
|
||||
- hosts:
|
||||
- nutri.hottis.de
|
||||
- %PREFIX%nutri.hottis.de
|
||||
secretName: nutri-cert
|
||||
rules:
|
||||
- host: nutri.hottis.de
|
||||
- host: %PREFIX%nutri.hottis.de
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
|
13
deployment/test-oidc-config.json
Normal file
13
deployment/test-oidc-config.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"web": {
|
||||
"issuer": "https://auth2.hottis.de/realms/hottis",
|
||||
"auth_uri": "https://auth2.hottis.de/ealms/hottis/protocol/openid-connect/auth",
|
||||
"client_id": "nutri",
|
||||
"client_secret": "%CLIENT_SECRET%",
|
||||
"redirect_uris": [
|
||||
"https://nutri.hottis.de/*"
|
||||
],
|
||||
"userinfo_uri": "https://auth2.hottis.de/realms/hottis/protocol/openid-connect/userinfo",
|
||||
"token_uri": "https://auth2.hottis.de/realms/hottis/protocol/openid-connect/token"
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ app.config.update({
|
||||
})
|
||||
|
||||
oidc = OpenIDConnect(app)
|
||||
|
||||
app.logger.handlers = logging.getLogger('gunicorn.error').handlers
|
||||
|
||||
def calculate_nutrition(food, weight):
|
||||
try:
|
||||
@ -107,6 +107,8 @@ def convert_decimal(value):
|
||||
@app.route('/add_nutrition', methods=['POST'])
|
||||
@oidc.accept_token(['openid'])
|
||||
def add_nutrition():
|
||||
app.logger.info("add_nutrition")
|
||||
|
||||
food = request.form.get('food')
|
||||
kcal = convert_decimal(request.form.get('kcal'))
|
||||
ew = convert_decimal(request.form.get('ew'))
|
||||
@ -173,7 +175,7 @@ def get_database_entries():
|
||||
if conn:
|
||||
conn.close()
|
||||
|
||||
app = ProxyFix(app, x_for=1, x_host=1)
|
||||
exposed_app = ProxyFix(app, x_for=1, x_host=1)
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user