je tente des truc mais on a jamais été si proche
This commit is contained in:
parent
26faab4133
commit
29fce1215d
|
@ -6,6 +6,7 @@ RUN curl -sSLO https://piair.xyz/download/chrome.deb \
|
|||
&& git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn \
|
||||
&& python3 -m pip install -r MsRewards-Reborn/requirements.txt \
|
||||
&& wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \
|
||||
&& curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb bullseye main" | tee /etc/apt/sources.list.d/redis.list \
|
||||
&& apt update \
|
||||
|
|
28
Flask/app.py
28
Flask/app.py
|
@ -12,18 +12,18 @@ import json
|
|||
import re
|
||||
from requests import get
|
||||
import redis
|
||||
from flask_sse import sse
|
||||
|
||||
|
||||
# redis part for live update
|
||||
redis_client = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
|
||||
pubsub = redis_client.pubsub()
|
||||
pubsub.subscribe('console')
|
||||
|
||||
def generate_output():
|
||||
for message in pubsub.listen():
|
||||
if message['type'] == 'message':
|
||||
print(message)
|
||||
yield f"data: {message['data'].decode()}\n\n"
|
||||
## redis part for live update
|
||||
#redis_client = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
|
||||
#pubsub = redis_client.pubsub()
|
||||
#pubsub.subscribe('console')
|
||||
#
|
||||
#def generate_output():
|
||||
# for message in pubsub.listen():
|
||||
# if message['type'] == 'message':
|
||||
# print(message)
|
||||
# yield f"data: {message['data'].decode()}\n\n"
|
||||
|
||||
|
||||
# the end
|
||||
|
@ -124,6 +124,7 @@ def inject_default_variables():
|
|||
#Login stuff
|
||||
"""
|
||||
# config
|
||||
app.config["REDIS_URL"] = "redis://localhost"
|
||||
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
||||
app.config.update(
|
||||
SECRET_KEY = secret
|
||||
|
@ -145,9 +146,8 @@ class User(UserMixin):
|
|||
|
||||
users = [User(1)]
|
||||
|
||||
@app.route('/stream')
|
||||
def stream():
|
||||
return Response(generate_output(), content_type='text/event-stream')
|
||||
|
||||
app.register_blueprint(sse, url_prefix='/stream')
|
||||
|
||||
|
||||
@app.route("/login/", methods=["GET", "POST"])
|
||||
|
|
|
@ -44,6 +44,8 @@ server {
|
|||
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||
proxy_set_header Host \$http_host;
|
||||
proxy_pass "http://127.0.0.1:6666";
|
||||
chunked_transfer_encoding off;
|
||||
proxy_buffering off;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ pyvirtualdisplay
|
|||
undetected_chromedriver
|
||||
requests
|
||||
flask
|
||||
flask_sse
|
||||
enquiries
|
||||
EasyProcess
|
||||
pyotp
|
||||
|
|
Loading…
Reference in New Issue