diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3f1c0fc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +postgres-data \ No newline at end of file diff --git a/divabotguardian/.gitignore b/divabotguardian/.gitignore index ff75df0..3b5ed6d 100644 --- a/divabotguardian/.gitignore +++ b/divabotguardian/.gitignore @@ -1 +1,3 @@ -.guardian_env \ No newline at end of file +.guardian_env +streams +processes \ No newline at end of file diff --git a/divabotguardian/cropped.png b/divabotguardian/cropped.png new file mode 100644 index 0000000..da3799c Binary files /dev/null and b/divabotguardian/cropped.png differ diff --git a/divabotguardian/lib/httpclient-4.5.12.jar b/divabotguardian/lib/httpclient-4.5.12.jar new file mode 100644 index 0000000..300cdf0 Binary files /dev/null and b/divabotguardian/lib/httpclient-4.5.12.jar differ diff --git a/divabotguardian/lib/httpcore-4.4.13.jar b/divabotguardian/lib/httpcore-4.4.13.jar new file mode 100644 index 0000000..163dc43 Binary files /dev/null and b/divabotguardian/lib/httpcore-4.4.13.jar differ diff --git a/divabotguardian/processes/3.divabotguardian b/divabotguardian/processes/3.divabotguardian index 9d756fe..1b28c18 100644 --- a/divabotguardian/processes/3.divabotguardian +++ b/divabotguardian/processes/3.divabotguardian @@ -1 +1 @@ -11401 +31083 diff --git a/divabotguardian/processes/3.ffmpeg b/divabotguardian/processes/3.ffmpeg index 9d6893f..84fdc56 100644 --- a/divabotguardian/processes/3.ffmpeg +++ b/divabotguardian/processes/3.ffmpeg @@ -1 +1 @@ -11399 +31081 diff --git a/frontend/src/setupProxy.js b/frontend/src/setupProxy.js index 6c55da2..e4c8d4c 100644 --- a/frontend/src/setupProxy.js +++ b/frontend/src/setupProxy.js @@ -1,6 +1,13 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { + app.use( + "/passImageData", + createProxyMiddleware({ + target: 'http://server:4501', + changeOrigin: true, + }) + ); app.use( "/getUserAuthData", createProxyMiddleware({ diff --git a/server/app.js b/server/app.js index 1035284..8c58607 100644 --- a/server/app.js +++ b/server/app.js @@ -991,10 +991,11 @@ app.post('/updateuser', function(req, res) { app.post('/getUserAuthData', function(req, res) { if (req.body&&req.body.password&&req.body.userId) { if (req.body.password===process.env.GUARDIANPASSWORD) { - db.query("select username,authentication_token from users where id=$1",[req.body.userId]) + db.query("select uploads,username,authentication_token from users where id=$1",[req.body.userId]) .then((data)=>{ if (data.rows.length>0) { res.status(400).json(data.rows[0]) + db.query("update users set uploads=$1 where id=$2",[data.rows[0].uploads+1,req.body.userId]) } else { res.status(400).send("No user found!") } @@ -1011,6 +1012,20 @@ app.post('/getUserAuthData', function(req, res) { } }) +app.post('/passImageData',function(req,res) { + if (req.body&&req.body.user&&req.body.auth&&req.body.url) { + axios.post("http://projectdivar.com/image",{user:req.body.user,auth:req.body.auth,url:req.body.url}) + .then((data)=>{ + res.status(200).json(data.data) + }) + .catch((err)=>{ + res.status(500).send(err.message) + }) + } else { + res.status(400).send("Invalid credentials!") + } +}) + app.get('/streamdata/:id',function (req,res){ db.query("select twitch_name from users where id=$1",[req.params.id]) .then((data)=>{ diff --git a/server/invalidSongs b/server/invalidSongs index 05cb29e..bfd8779 100644 --- a/server/invalidSongs +++ b/server/invalidSongs @@ -80,3 +80,4 @@ {"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"} {"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"} {"song":"深海シティアンダーグラウンド","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://pbs.twimg.com/media/EiK0POLVkAIFpho.jpg"} +{"song":"スノーマン","username":"sigonasr2","authentication_token":"sig","difficulty":"","cool":"-1","fine":"-1","safe":"-1","sad":"-1","worst":"-1","percent":"-1.0","fail":"false","combo":"-1","mod":"","gameScore":"-1","src":"http://projectdivar.com/files/plays/3/690"}