Merge branch 'testing' of https://gitea.tryton.geeraert.eu/pi-ux-ce/Django_kube into testing
This commit is contained in:
@@ -33,6 +33,8 @@ jobs:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
clean: false
|
||||
fetch-depth: 1
|
||||
ref: 'main'
|
||||
|
||||
# - name: Manually check out repository code
|
||||
# run: cd ${{ gitea.workspace }} ; git pull origin main
|
||||
@@ -81,6 +83,9 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
build-args: |
|
||||
ALLOWED_HOSTS='django.tryton.geeraert.eu'
|
||||
DEBUG='True'
|
||||
tags: |
|
||||
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
||||
gitea.tryton.geeraert.eu/pi-ux-ce/django-python:${{ env.next_version }}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: django-python
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: django-webserver
|
||||
namespace: django-python
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: django-python
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: django-python
|
||||
spec:
|
||||
containers:
|
||||
- name: django-python
|
||||
image: gitea.tryton.geeraert.eu/pi-ux-ce/django-python:latest
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
name: webserver-port
|
||||
volumeMounts:
|
||||
## - name: django-python-code
|
||||
# mountPath: /code
|
||||
- name: servarr-data
|
||||
mountPath: /data
|
||||
readOnly: true
|
||||
- name: secret-kubeconfig
|
||||
mountPath: /kubeconfig
|
||||
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 200Mi
|
||||
volumes:
|
||||
- name: django-python-code
|
||||
persistentVolumeClaim:
|
||||
claimName: django-python-code
|
||||
- name: servarr-data
|
||||
hostPath:
|
||||
path: /data
|
||||
- name: secret-kubeconfig
|
||||
secret:
|
||||
defaultMode: 420
|
||||
secretName: kubeconfig
|
||||
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: webserver
|
||||
namespace: django-python
|
||||
spec:
|
||||
ports:
|
||||
- name: http
|
||||
port: 8000
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: django-python
|
||||
@@ -23,7 +23,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
SECRET_KEY = 'django-insecure-71%)_#e#o9-dl2o^6mfud-*rw+4+8vy-nd*bzeier&(34ap-p9'
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = os.getenv("DEBUG")
|
||||
#DEBUG = os.getenv("DEBUG")
|
||||
DEBUG = os.getenv("DEBUG", "False").lower() in ("true", "1", "t")
|
||||
|
||||
|
||||
ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS").split(",")
|
||||
|
||||
|
||||
@@ -41,8 +41,11 @@ def display_key(request,key):
|
||||
def redirect_to_key(request,key):
|
||||
value = r.get(key)
|
||||
if value == None:
|
||||
icon_url = r.get('icon')
|
||||
if icon_url == None:
|
||||
icon_url = "https://cdn-icons-png.flaticon.com/512/6402/6402576.png"
|
||||
print(key+" is not setup, displaying default page")
|
||||
return render(request, 'blank_page.html',{})
|
||||
return render(request, 'blank_page.html', {'title': key,'icon_url':icon_url})
|
||||
else:
|
||||
value_extracted = str(value.decode('utf-8'))
|
||||
print(key+" is setup to : "+value_extracted)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<link rel="icon" type="image/x-icon" href="https://cdn-icons-png.flaticon.com/512/6402/6402576.png">
|
||||
<title>Streaming</title>
|
||||
<title>{{ title }}</title>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
@@ -275,8 +275,17 @@
|
||||
</fieldset>
|
||||
|
||||
<button id="submit" type="submit" class="btn">Submit the form</button>
|
||||
<button id="clearkey" type="submit" formaction="/redirect/clearkey/" class="btn">Clear the key</button>
|
||||
|
||||
<button id="clearkey" type="submit" formaction="/clearkey/" class="btn">Clear the key</button>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<button type="button" onclick="location.href='/go/streaming'" class="btn">Streaming</button>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" onclick="location.href='/go/streaming-sam'" class="btn">Streaming Sam</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ urlpatterns = [
|
||||
# path('admin/', admin.site.urls),
|
||||
|
||||
################### Redirect ###################
|
||||
path('', website_redirectionapp.hello),
|
||||
path('', website_redirectionapp.redirect),
|
||||
path('hello/', website_redirectionapp.hello),
|
||||
path('set/', website_redirectionapp.redirect),
|
||||
path('get/<str:key>', website_redirectionapp.display_key),
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
FROM gitea.tryton.geeraert.eu/pi-ux-ce/python:3
|
||||
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
#ENV ALLOWED_HOSTS 'django.tryton.geeraert.eu'
|
||||
#ENV DEBUG 'True'
|
||||
|
||||
ARG ALLOWED_HOSTS
|
||||
ARG DEBUG
|
||||
ENV ALLOWED_HOSTS=$ALLOWED_HOSTS
|
||||
ENV DEBUG=$DEBUG
|
||||
|
||||
WORKDIR /code/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user