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 \
|
&& git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn \
|
||||||
&& python3 -m pip install -r MsRewards-Reborn/requirements.txt \
|
&& python3 -m pip install -r MsRewards-Reborn/requirements.txt \
|
||||||
&& wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \
|
&& 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/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 \
|
&& 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 \
|
&& apt update \
|
||||||
|
28
Flask/app.py
28
Flask/app.py
@ -12,18 +12,18 @@ import json
|
|||||||
import re
|
import re
|
||||||
from requests import get
|
from requests import get
|
||||||
import redis
|
import redis
|
||||||
|
from flask_sse import sse
|
||||||
|
|
||||||
|
## redis part for live update
|
||||||
# redis part for live update
|
#redis_client = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
|
||||||
redis_client = redis.StrictRedis(host='127.0.0.1', port=6379, db=0)
|
#pubsub = redis_client.pubsub()
|
||||||
pubsub = redis_client.pubsub()
|
#pubsub.subscribe('console')
|
||||||
pubsub.subscribe('console')
|
#
|
||||||
|
#def generate_output():
|
||||||
def generate_output():
|
# for message in pubsub.listen():
|
||||||
for message in pubsub.listen():
|
# if message['type'] == 'message':
|
||||||
if message['type'] == 'message':
|
# print(message)
|
||||||
print(message)
|
# yield f"data: {message['data'].decode()}\n\n"
|
||||||
yield f"data: {message['data'].decode()}\n\n"
|
|
||||||
|
|
||||||
|
|
||||||
# the end
|
# the end
|
||||||
@ -124,6 +124,7 @@ def inject_default_variables():
|
|||||||
#Login stuff
|
#Login stuff
|
||||||
"""
|
"""
|
||||||
# config
|
# config
|
||||||
|
app.config["REDIS_URL"] = "redis://localhost"
|
||||||
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
app.config["TEMPLATES_AUTO_RELOAD"] = True
|
||||||
app.config.update(
|
app.config.update(
|
||||||
SECRET_KEY = secret
|
SECRET_KEY = secret
|
||||||
@ -145,9 +146,8 @@ class User(UserMixin):
|
|||||||
|
|
||||||
users = [User(1)]
|
users = [User(1)]
|
||||||
|
|
||||||
@app.route('/stream')
|
|
||||||
def stream():
|
app.register_blueprint(sse, url_prefix='/stream')
|
||||||
return Response(generate_output(), content_type='text/event-stream')
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/login/", methods=["GET", "POST"])
|
@app.route("/login/", methods=["GET", "POST"])
|
||||||
|
@ -44,6 +44,8 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For \$remote_addr;
|
proxy_set_header X-Forwarded-For \$remote_addr;
|
||||||
proxy_set_header Host \$http_host;
|
proxy_set_header Host \$http_host;
|
||||||
proxy_pass "http://127.0.0.1:6666";
|
proxy_pass "http://127.0.0.1:6666";
|
||||||
|
chunked_transfer_encoding off;
|
||||||
|
proxy_buffering off;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ pyvirtualdisplay
|
|||||||
undetected_chromedriver
|
undetected_chromedriver
|
||||||
requests
|
requests
|
||||||
flask
|
flask
|
||||||
|
flask_sse
|
||||||
enquiries
|
enquiries
|
||||||
EasyProcess
|
EasyProcess
|
||||||
pyotp
|
pyotp
|
||||||
|
Loading…
Reference in New Issue
Block a user