fix
This commit is contained in:
parent
a61e4c3382
commit
b07d0097d3
7 changed files with 36 additions and 7 deletions
|
@ -26,7 +26,11 @@
|
||||||
**/values.dev.yaml
|
**/values.dev.yaml
|
||||||
**/build
|
**/build
|
||||||
**/dist
|
**/dist
|
||||||
public/css/*.css
|
|
||||||
public/courses/*.txt
|
|
||||||
LICENSE
|
LICENSE
|
||||||
README.md
|
README.md
|
||||||
|
|
||||||
|
data/main_db.json
|
||||||
|
data/test_db.json
|
||||||
|
stack.env
|
||||||
|
public/css/*.css
|
||||||
|
public/courses/*.txt
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,8 +1,9 @@
|
||||||
# Custom
|
# Custom
|
||||||
|
stack.env
|
||||||
public/css/*
|
public/css/*
|
||||||
public/courses/*
|
public/courses/*
|
||||||
data/*
|
data/*
|
||||||
!data/main_db.json
|
!data/main_db.example.json
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
|
|
|
@ -51,6 +51,8 @@ COPY . .
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# This project specific
|
# This project specific
|
||||||
|
RUN mv stack.env.example stack.env
|
||||||
|
RUN mv data/main_db.example.json data/main_db.json
|
||||||
RUN chmod -R 777 data/
|
RUN chmod -R 777 data/
|
||||||
RUN chmod -R 777 public/
|
RUN chmod -R 777 public/
|
||||||
# End
|
# End
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
require("dotenv").config();
|
require("dotenv").config({
|
||||||
|
path: "stack.env",
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/* Set true for production database */
|
/* Set true for production database */
|
||||||
|
@ -17,4 +19,4 @@ module.exports = {
|
||||||
cookieSecret: process.env.COOKIE || "",
|
cookieSecret: process.env.COOKIE || "",
|
||||||
/* Discord webhook url or leave empty */
|
/* Discord webhook url or leave empty */
|
||||||
webhook_url: process.env.WEBHOOK || "",
|
webhook_url: process.env.WEBHOOK || "",
|
||||||
};
|
};
|
||||||
|
|
12
data/main_db.example.json
Normal file
12
data/main_db.example.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"admins": {
|
||||||
|
"YOUR_STEAMID64": true
|
||||||
|
},
|
||||||
|
"keys": {},
|
||||||
|
"courses": {},
|
||||||
|
"locked": {},
|
||||||
|
"rating": {},
|
||||||
|
"records": {},
|
||||||
|
"usernames": {},
|
||||||
|
"ratelimits": {}
|
||||||
|
}
|
|
@ -21,10 +21,10 @@ router.get("/", async (req, res) => {
|
||||||
/* Pages Count */
|
/* Pages Count */
|
||||||
const coursesCount = Object.keys(courses).length;
|
const coursesCount = Object.keys(courses).length;
|
||||||
const pagesCount = Math.max(Math.ceil(coursesCount / 20), 0);
|
const pagesCount = Math.max(Math.ceil(coursesCount / 20), 0);
|
||||||
|
|
||||||
if (page === "Page") page = 1;
|
if (page === "Page") page = 1;
|
||||||
if (page * 20 - coursesCount >= 20) page = 1;
|
if (page * 20 - coursesCount >= 20) page = 1;
|
||||||
|
|
||||||
|
/* Pages Dropdown */
|
||||||
let pagesDropdown = "";
|
let pagesDropdown = "";
|
||||||
|
|
||||||
for (let i = 1; i <= pagesCount; i++) {
|
for (let i = 1; i <= pagesCount; i++) {
|
||||||
|
@ -118,7 +118,7 @@ router.get("/", async (req, res) => {
|
||||||
plays: "DESC",
|
plays: "DESC",
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sortType === "none" || sortType === "Sort")
|
if (sortType === "none" || sortType === "Sort by")
|
||||||
sortedCodesData = codesData.sort((a, b) => {
|
sortedCodesData = codesData.sort((a, b) => {
|
||||||
return b.time - a.time;
|
return b.time - a.time;
|
||||||
});
|
});
|
||||||
|
|
8
stack.env.example
Normal file
8
stack.env.example
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
PROD=true
|
||||||
|
DOMAIN=http://localhost:6547
|
||||||
|
PORT=6547
|
||||||
|
RATELIMIT=5000
|
||||||
|
IPCHANGETIME=10800000
|
||||||
|
STEAMKEY=NO_KEY
|
||||||
|
COOKIE=NO_COOKIE
|
||||||
|
WEBHOOK=""
|
Loading…
Reference in a new issue