bon normalement ca marche, sauf que grafana et nginx ne se lancent pas auto

This commit is contained in:
piair 2023-08-22 16:32:37 +02:00
parent a426e787e3
commit a9674a5b0a
3 changed files with 1499 additions and 6 deletions

View File

@ -1,18 +1,42 @@
rm /etc/nginx/sites-available/default
echo "
map \$http_upgrade \$connection_upgrade {
default upgrade;
'' close;
}
upstream grafana {
server localhost:3000;
}
server {
listen 1234;
server_name localhost;
location /grafana {
proxy_pass http://localhost:3000;
rewrite ^/grafana/(.*) /\$1 break;
proxy_set_header Host \$host;
}
location /grafana/api/live/ {
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection \$connection_upgrade;
proxy_set_header Host \$http_host;
proxy_pass http://grafana;
rewrite ^/grafana/(.*) /\$1 break;
}
location / {
proxy_set_header X-Forwarded-For \$remote_addr;
proxy_set_header Host \$http_host;
proxy_pass "http://127.0.0.1:6666";
}
location /stats {
proxy_pass http://localhost:3000;
rewrite ^/stats/(.*) /\$1 break;
proxy_set_header Host \$host;
}
}
" >> /etc/nginx/sites-available/default
service nginx restart
sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE daily (id INTEGER PRIMARY KEY,compte TEXT,points int,date TEXT);"
sqlite3 /app/MsRewards-Reborn/MsRewards.db "CREATE TABLE comptes (id INTEGER PRIMARY KEY,compte TEXT,last_pts int, banned int);"
cp /app/MsRewards-Reborn/grafana-config/grafana.ini /etc/grafana/
grafana-cli plugins install frser-sqlite-datasource

View File

@ -40,7 +40,7 @@ def add_to_database(compte, points, save_if_fail=True):
if points is None:
pass
else:
mydb = sqlite3.connect("MsRewards.db")
mydb = sqlite3.connect("/app/MsRewards-Reborn/MsRewards.db")
mycursor = mydb.cursor()
if get_row(compte, points,mycursor, True): #check if the row exist with the same ammount of points and do nothind if it does
#printf("les points sont deja bon")

1469
modules/grafana-config/grafana.ini Executable file

File diff suppressed because it is too large Load Diff