Mageia Bugzilla – Attachment 9444 Details for
Bug 20100
docker new security issue CVE-2016-9962
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
app.py and requirements.txt
files (text/plain), 725 bytes, created by
Len Lawrence
on 2017-06-23 01:53:50 CEST
(
hide
)
Description:
app.py and requirements.txt
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2017-06-23 01:53:50 CEST
Size:
725 bytes
patch
obsolete
>requirements.txt >---------------- > >Flask >Redis > >app.py >------ > >from flask import Flask >from redis import Redis, RedisError >import os >import socket > ># Connect to Redis >redis = Redis(host="redis", db=0, socket_connect_timeout=2, socket_timeout=2) > >app = Flask(__name__) > >@app.route("/") >def hello(): > try: > visits = redis.incr("counter") > except RedisError: > visits = "<i>cannot connect to Redis, counter disabled</i>" > > html = "<h3>Hello {name}!</h3>" \ > "<b>Hostname:</b> {hostname}<br/>" \ > "<b>Visits:</b> {visits}" > return html.format(name=os.getenv("NAME", "world"), hostname=socket.gethostname(), visits=visits) > >if __name__ == "__main__": > app.run(host='0.0.0.0', port=80)
requirements.txt ---------------- Flask Redis app.py ------ from flask import Flask from redis import Redis, RedisError import os import socket # Connect to Redis redis = Redis(host="redis", db=0, socket_connect_timeout=2, socket_timeout=2) app = Flask(__name__) @app.route("/") def hello(): try: visits = redis.incr("counter") except RedisError: visits = "<i>cannot connect to Redis, counter disabled</i>" html = "<h3>Hello {name}!</h3>" \ "<b>Hostname:</b> {hostname}<br/>" \ "<b>Visits:</b> {visits}" return html.format(name=os.getenv("NAME", "world"), hostname=socket.gethostname(), visits=visits) if __name__ == "__main__": app.run(host='0.0.0.0', port=80)
View Attachment As Raw
Actions:
View
Attachments on
bug 20100
:
9442
|
9443
| 9444