From 43e7ad6ad8efa4e5e0071dc9c9012bd71c5c318f Mon Sep 17 00:00:00 2001 From: Phil Huang Date: Fri, 13 Oct 2023 02:30:17 +0800 Subject: [PATCH] 20231013 --- Dockerfile | 2 +- httpbin/VERSION | 2 +- httpbin/core.py | 3 ++- httpbin/templates/flasgger/index.html | 2 +- k8s/httpbin-re.yaml | 37 +++++++++++++++++++++++++++ requirements.txt | 2 +- 6 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 k8s/httpbin-re.yaml diff --git a/Dockerfile b/Dockerfile index 48ad0b37..7ff33b86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="httpbin-re" \ org.opencontainers.image.source="https://github.com/pichuang/httpbin-re" \ org.opencontainers.image.licenses="ISC License" \ org.opencontainers.image.url="https://httpbin.org" \ - org.opencontainers.image.version="20230721" \ + org.opencontainers.image.version="20231013" \ org.opencontainers.image.base.name="library/ubuntu:22.04" RUN apt update -y && \ diff --git a/httpbin/VERSION b/httpbin/VERSION index af9337a9..1c9b8360 100644 --- a/httpbin/VERSION +++ b/httpbin/VERSION @@ -1 +1 @@ -20230721 \ No newline at end of file +20231013 \ No newline at end of file diff --git a/httpbin/core.py b/httpbin/core.py index 4c377fcc..77567de6 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -96,7 +96,7 @@ def jsonify(*args, **kwargs): "title": "httpbin.org", "description": ( "A simple HTTP Request & Response Service." - "

Run locally: $ docker run -p 8080:80 ghcr.io/pichuang/httpbin:master" + "

Run locally: $ docker run -p 8080:80 ghcr.io/pichuang/httpbin-re:master" ), "contact": { "responsibleOrganization": "Kenneth Reitz", @@ -143,6 +143,7 @@ def jsonify(*args, **kwargs): } if "SWAGGER_TITLE" in os.environ: + app.config["SWAGGER"]["title"] = os.environ["SWAGGER_TITLE"] template["info"]["title"] = os.environ["SWAGGER_TITLE"] if "SWAGGER_DESCRIPTION" in os.environ: diff --git a/httpbin/templates/flasgger/index.html b/httpbin/templates/flasgger/index.html index 071dd801..b01fd15d 100644 --- a/httpbin/templates/flasgger/index.html +++ b/httpbin/templates/flasgger/index.html @@ -87,7 +87,7 @@

httpbin.org -
20230721
+
20231013

[ Base URL: httpbin.org/ ]
diff --git a/k8s/httpbin-re.yaml b/k8s/httpbin-re.yaml new file mode 100644 index 00000000..648b6dad --- /dev/null +++ b/k8s/httpbin-re.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: httpbin-re + namespace: default + labels: + app: httpbin-re +spec: + ports: + - name: http + port: 8080 + targetPort: 80 + selector: + app: httpbin-re +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: httpbin-re + namespace: default +spec: + replicas: 2 + selector: + matchLabels: + app: httpbin-re + template: + metadata: + labels: + app: httpbin-re + spec: + containers: + - image: ghcr.io/pichuang/httpbin-re:master + imagePullPolicy: IfNotPresent + name: httpbin-re + ports: + - containerPort: 80 diff --git a/requirements.txt b/requirements.txt index aa59693d..1cc4e85e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ gunicorn>=21.2.0 -Werkzeug>=2.3.6 +Werkzeug==2.2.3 gevent>=23.7.0 flasgger>=0.9.7.1 \ No newline at end of file