Compare commits
No commits in common. "9af0f4aadbb7bdf05bb9fc1277f40c0a47e6182a" and "50c4036c735b618928777bee3115dcb8987cd204" have entirely different histories.
9af0f4aadb
...
50c4036c73
48
Dockerfile
48
Dockerfile
|
@ -1,38 +1,22 @@
|
||||||
FROM python:3.10
|
FROM python:3.10
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
|
|
||||||
# Initial apt install
|
|
||||||
RUN apt update
|
|
||||||
RUN apt install -y libgtk-4-1 libvulkan1 libxdamage1 \
|
|
||||||
novnc websockify xvfb nginx nano tzdata \
|
|
||||||
sqlite3 apt-transport-https software-properties-common \
|
|
||||||
wget wfrench tigervnc-standalone-server libasound2 \
|
|
||||||
libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 \
|
|
||||||
libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 \
|
|
||||||
libdbus-1-3 xdg-utils fonts-liberation libdrm2
|
|
||||||
|
|
||||||
# Additional repos and packages
|
|
||||||
RUN wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb \
|
|
||||||
&& dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
|
|
||||||
RUN curl -sSLO https://nc.piair.xyz/s/BKLsBWoZkTdYjfq/download/chrome.deb \
|
|
||||||
&& dpkg -i chrome.deb
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime
|
|
||||||
RUN wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \
|
|
||||||
&& echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | tee -a /etc/apt/sources.list.d/grafana.list
|
|
||||||
RUN curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
|
|
||||||
# Install from new repo
|
|
||||||
RUN apt update \
|
RUN apt update \
|
||||||
&& apt install -y redis grafana
|
&& wget http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb \
|
||||||
|
&& dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb \
|
||||||
# Setup app
|
&& apt install redis libgtk-4-1 libvulkan1 libxdamage1 -y \
|
||||||
RUN git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn
|
&& curl -sSLO https://nc.piair.xyz/s/BKLsBWoZkTdYjfq/download/chrome.deb \
|
||||||
# Use this instead when developping locally:
|
&& ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime \
|
||||||
# COPY . /app/MsRewards-Reborn
|
&& git clone https://gitea.augustin64.fr/piair/MsRewards-Reborn \
|
||||||
|
&& python3 -m pip install -r MsRewards-Reborn/requirements.txt \
|
||||||
RUN python3 -m pip install -r MsRewards-Reborn/requirements.txt
|
&& wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key \
|
||||||
RUN bash MsRewards-Reborn/config/config.sh
|
&& 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 \
|
||||||
ENV TZ="Europe/Paris"
|
&& apt update \
|
||||||
|
&& apt install novnc websockify grafana xvfb nginx nano tzdata sqlite3 apt-transport-https software-properties-common wget wfrench tigervnc-standalone-server libasound2 libatk-bridge2.0-0 libnss3 libnspr4 xvfb libgbm1 libatk1.0-0 libu2f-udev libatspi2.0-0 libcups2 libxkbcommon0 libxrandr2 libdbus-1-3 xdg-utils fonts-liberation libdrm2 -y \
|
||||||
|
&& bash MsRewards-Reborn/config/config.sh \
|
||||||
|
&& dpkg -i chrome.deb
|
||||||
|
|
||||||
|
ENV TZ="Europe/Paris"
|
||||||
WORKDIR /app/MsRewards-Reborn/Flask/
|
WORKDIR /app/MsRewards-Reborn/Flask/
|
||||||
CMD bash start.sh
|
CMD bash start.sh
|
||||||
|
|
14
Flask/app.py
14
Flask/app.py
|
@ -373,18 +373,8 @@ def config_post():
|
||||||
def logs():
|
def logs():
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||||
configs = json.load(inFile)
|
configs = json.load(inFile)
|
||||||
|
print(configs)
|
||||||
files = [(configs[i]["name"], i) for i in configs]
|
return(render_template("logs.html", data=configs))
|
||||||
config_files = [i[1] for i in files]
|
|
||||||
for f in os.listdir("/app/MsRewards-Reborn/Flask/static/logs"):
|
|
||||||
fid = ".".join(f.split(".")[:-1]) # filename without .txt
|
|
||||||
if f != ".gitignore" and fid not in config_files:
|
|
||||||
files.append((f, fid))
|
|
||||||
|
|
||||||
return render_template(
|
|
||||||
"logs.html",
|
|
||||||
files=files
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/stats/", methods=["GET", "POST"])
|
@app.route("/stats/", methods=["GET", "POST"])
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
|
|
||||||
<select name="select" onchange="change_logs(this.value)">
|
<select name="select" onchange="change_logs(this.value)">
|
||||||
<option id="null" value="0">Choisir une config</option>
|
<option id="null" value="0">Choisir une config</option>
|
||||||
{% for file in files %}
|
{% for i in data %}
|
||||||
<option id="{{ file[0] }}" value="{{ file[1] }}">{{ file[0] }}</option>
|
<option id="{{data[i]['name']}}" value="{{i}}">{{data[i]['name']}}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
13
build.sh
13
build.sh
|
@ -1,12 +1 @@
|
||||||
#!/bin/bash
|
sudo docker build --no-cache --network host -t msrewards . && sudo docker run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name MsRewards msrewards
|
||||||
|
|
||||||
docker-do () { # Check if sudo needs to be used
|
|
||||||
if id -nG "$(whoami)" | grep -qw "docker"; then
|
|
||||||
docker $@
|
|
||||||
else
|
|
||||||
sudo docker $@
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
docker-do build --network host -t msrewards .
|
|
||||||
docker-do run -d --restart unless-stopped -p 1234:1234 -p 2345:2345 -ti --shm-size=2gb --name MsRewards msrewards
|
|
||||||
|
|
Loading…
Reference in New Issue