General commit

pull/10/head
sigonasr2 3 years ago
parent ef9d324cc8
commit b38a54a3c3
  1. 17
      docker-compose.yml
  2. 2
      frontend/Dockerfile
  3. 8
      frontend/src/setupProxy.js
  4. 4
      server/Dockerfile
  5. 27
      server/app.js
  6. 1
      server2

@ -19,6 +19,23 @@ services:
max-size: "1m"
max-file: "3"
server2:
build: server2
depends_on:
- postgres
ports:
- "4504:4504"
working_dir: /server2
volumes:
- ./server2:/server2
env_file:
- ./server/.env.twitter
logging:
options:
max-size: "1m"
max-file: "3"
imgparser:
build: imgparser
restart: always

@ -9,7 +9,7 @@ ENV PATH /app/node_modules/.bin:$PATH
COPY . /app
RUN npm install --silent
RUN npm install -y --silent
RUN npm rebuild node-sass
CMD ["npm", "start"]

@ -8,6 +8,14 @@ module.exports = function(app) {
changeOrigin: true,
})
);*/
app.use(
"/ngsplanner",
createProxyMiddleware({
target: 'https://server2:4504',
changeOrigin: true,
})
);
app.use(
"/ev",
createProxyMiddleware({

@ -55,8 +55,6 @@ RUN apt-get update && \
apt-get install -y ffmpeg && \
apt-get clean;
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
@ -71,7 +69,7 @@ RUN yarn global add nodemon
# update
RUN apt-get update
# install curl
RUN apt-get install curl
RUN apt-get install -y curl
# get install script and pass it to execute:
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash
# and install node

@ -1,4 +1,4 @@
const express = require('express')
const express = require('express')
const axios = require('axios')
const twitchStreams = require('twitch-get-stream')
const app = express()
@ -1189,10 +1189,10 @@ app.post('/streaminfo/:id',function (req,res){
}
})
var lastscores={}
const EVENTID=23;
var EVENTSTART=moment('2021-06-28 03:00:00+00');
var EVENTEND=moment('2021-07-06 11:59:59+00');
var lastscores_JP={}
const EVENTID=26;
var EVENTSTART=moment('2021-07-25 03:00:00+00');
var EVENTEND=moment('2021-07-29 11:59:59+00');
var lastscores_EN={}
const EVENTID_EN=23;
@ -1206,9 +1206,13 @@ app.get("/helpmetestwithoutbreakingshit", (req,res) => {
app.post('/eventsubmit',function(req,res) {
lastscores={}
const lastscores = req.query.en ? lastscores_EN: lastscores_JP;
function submit() {
lastscores[req.body.rank]=Number(req.body.points)
if (req.query.en) {
lastscores_EN[req.body.rank]=Number(req.body.points)
} else {
lastscores_JP[req.body.rank]=Number(req.body.points)
}
db.query("insert into "+(req.query.en?"en_":"")+"eventdata(eventid,rank,date,name,description,points) values($1,$2,$3,$4,$5,$6) returning *;",
[req.body.eventid,req.body.rank,req.body.date?req.body.date:req.body.fin?moment(EVENTEND).add(5,'minutes').format("YYYY-MM-DD HH:mm:ssZ"):new Date(),req.body.name,req.body.description,req.body.points])
.then((data)=>{
@ -1280,10 +1284,6 @@ app.post('/eventsubmit',function(req,res) {
db.query('select distinct on (rank) rank,eventid,date,name,description,points,difference from (select lead(points) over (partition by rank order by rank,date desc)-points difference,* from '+(req.query.en?"en_":"")+'eventdata where eventid='+EVENTID+' order by rank,date desc)t order by rank,date desc')
.then((data) =>
{
if (data.rows.length>0) {
data.rows.map((row)=>{lastscores[row.rank]=row.points})
}
if (!lastscores[req.body.rank]
|| (/*FurtherTierIsOkay(req.body.rank,lastscores,req.body.points)&&*/lastscores[req.body.rank]<req.body.points
@ -1294,6 +1294,10 @@ app.post('/eventsubmit',function(req,res) {
} else {
res.status(200).send("No update required.")
}
if (data.rows.length>0) {
data.rows.map((row)=>{lastscores[row.rank]=row.points})
}
}
)
})
@ -1891,6 +1895,7 @@ app.get('/eventdata/t50',function(req,res){
app.get('/eventdata/t20',function(req,res){
var eventinfo = []
var eventinfo_en = []
if (req.query.date&&req.query.rank) {
db.query('select * from '+(req.query.en?"en_":"")+'eventdata where date<=$1 and rank=$2 and eventid=$3 order by date desc limit 1;',[req.query.date,req.query.rank,req.query.eventid])
.then((data)=>{

@ -0,0 +1 @@
Subproject commit 2dcbc472eca5d33831722d176d39a2758b652c35
Loading…
Cancel
Save