mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 00:31:00 -05:00
Compare commits
4 Commits
4fb097fa70
...
8b541cbed3
Author | SHA1 | Date | |
---|---|---|---|
|
8b541cbed3 | ||
|
5cba023ff1 | ||
|
553e13c057 | ||
|
b79831811c |
@ -1,6 +1,6 @@
|
|||||||
# Pointless stuff
|
# Pointless stuff
|
||||||
Dockerfile
|
Dockerfile
|
||||||
docker-compose.yml
|
docker-compose.*.yml
|
||||||
.ncurc.json
|
.ncurc.json
|
||||||
.env
|
.env
|
||||||
.mailmap
|
.mailmap
|
||||||
@ -9,8 +9,6 @@ docker-compose.yml
|
|||||||
.github
|
.github
|
||||||
postgres-replica-stuff
|
postgres-replica-stuff
|
||||||
README.md
|
README.md
|
||||||
ufwReject.sh
|
|
||||||
|
|
||||||
# Startup files
|
# Startup files
|
||||||
startWithYarn.cjs
|
startDocker.sh
|
||||||
botStartup.bat
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,4 @@
|
|||||||
.env
|
.env
|
||||||
ips.txt
|
|
||||||
# Yarn stuff
|
# Yarn stuff
|
||||||
.yarn
|
.yarn
|
||||||
# TypeScript stuff
|
# TypeScript stuff
|
||||||
|
20
.pnp.cjs
generated
20
.pnp.cjs
generated
@ -29,7 +29,7 @@ const RAW_RUNTIME_STATE =
|
|||||||
["@napi-rs/canvas", "npm:0.1.45"],\
|
["@napi-rs/canvas", "npm:0.1.45"],\
|
||||||
["@octokit/rest", "npm:20.0.2"],\
|
["@octokit/rest", "npm:20.0.2"],\
|
||||||
["@sequelize/core", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:7.0.0-alpha.37"],\
|
["@sequelize/core", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:7.0.0-alpha.37"],\
|
||||||
["@toast/tokenservice-client", "npm:1.0.11::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.11%2Ftokenservice-client-1.0.11.tgz"],\
|
["@toast/tokenservice-client", "npm:1.0.12::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.12%2Ftokenservice-client-1.0.12.tgz"],\
|
||||||
["@types/ms", "npm:0.7.34"],\
|
["@types/ms", "npm:0.7.34"],\
|
||||||
["@types/node", "npm:20.11.17"],\
|
["@types/node", "npm:20.11.17"],\
|
||||||
["@types/node-cron", "npm:3.0.11"],\
|
["@types/node-cron", "npm:3.0.11"],\
|
||||||
@ -708,11 +708,11 @@ const RAW_RUNTIME_STATE =
|
|||||||
}]\
|
}]\
|
||||||
]],\
|
]],\
|
||||||
["@toast/tokenservice-client", [\
|
["@toast/tokenservice-client", [\
|
||||||
["npm:1.0.11::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.11%2Ftokenservice-client-1.0.11.tgz", {\
|
["npm:1.0.12::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.12%2Ftokenservice-client-1.0.12.tgz", {\
|
||||||
"packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.11-c95d3498fc-c910af2b01.zip/node_modules/@toast/tokenservice-client/",\
|
"packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.12-11df688697-64112744b4.zip/node_modules/@toast/tokenservice-client/",\
|
||||||
"packageDependencies": [\
|
"packageDependencies": [\
|
||||||
["@toast/tokenservice-client", "npm:1.0.11::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.11%2Ftokenservice-client-1.0.11.tgz"],\
|
["@toast/tokenservice-client", "npm:1.0.12::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.12%2Ftokenservice-client-1.0.12.tgz"],\
|
||||||
["undici", "npm:6.5.0"]\
|
["undici", "npm:6.6.2"]\
|
||||||
],\
|
],\
|
||||||
"linkType": "HARD"\
|
"linkType": "HARD"\
|
||||||
}]\
|
}]\
|
||||||
@ -858,7 +858,7 @@ const RAW_RUNTIME_STATE =
|
|||||||
["@napi-rs/canvas", "npm:0.1.45"],\
|
["@napi-rs/canvas", "npm:0.1.45"],\
|
||||||
["@octokit/rest", "npm:20.0.2"],\
|
["@octokit/rest", "npm:20.0.2"],\
|
||||||
["@sequelize/core", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:7.0.0-alpha.37"],\
|
["@sequelize/core", "virtual:20c353e2d6536e37339997f03975c6a660f4d296e664d291bd43620c6162cca8eb5ef90b0998dc9db75ff6862e5da587d0530bae26805f5fadc8f17aaa4ff794#npm:7.0.0-alpha.37"],\
|
||||||
["@toast/tokenservice-client", "npm:1.0.11::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.11%2Ftokenservice-client-1.0.11.tgz"],\
|
["@toast/tokenservice-client", "npm:1.0.12::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.12%2Ftokenservice-client-1.0.12.tgz"],\
|
||||||
["@types/ms", "npm:0.7.34"],\
|
["@types/ms", "npm:0.7.34"],\
|
||||||
["@types/node", "npm:20.11.17"],\
|
["@types/node", "npm:20.11.17"],\
|
||||||
["@types/node-cron", "npm:3.0.11"],\
|
["@types/node-cron", "npm:3.0.11"],\
|
||||||
@ -1604,14 +1604,6 @@ const RAW_RUNTIME_STATE =
|
|||||||
],\
|
],\
|
||||||
"linkType": "HARD"\
|
"linkType": "HARD"\
|
||||||
}],\
|
}],\
|
||||||
["npm:6.5.0", {\
|
|
||||||
"packageLocation": "./.yarn/cache/undici-npm-6.5.0-5598def435-0ad9289bd8.zip/node_modules/undici/",\
|
|
||||||
"packageDependencies": [\
|
|
||||||
["undici", "npm:6.5.0"],\
|
|
||||||
["@fastify/busboy", "npm:2.0.0"]\
|
|
||||||
],\
|
|
||||||
"linkType": "HARD"\
|
|
||||||
}],\
|
|
||||||
["npm:6.6.2", {\
|
["npm:6.6.2", {\
|
||||||
"packageLocation": "./.yarn/cache/undici-npm-6.6.2-a0bd6785a6-e08ac9c279.zip/node_modules/undici/",\
|
"packageLocation": "./.yarn/cache/undici-npm-6.6.2-a0bd6785a6-e08ac9c279.zip/node_modules/undici/",\
|
||||||
"packageDependencies": [\
|
"packageDependencies": [\
|
||||||
|
@ -1 +0,0 @@
|
|||||||
pm2 start startWithYarn.cjs --name Daggerbot
|
|
@ -35,7 +35,7 @@
|
|||||||
"@napi-rs/canvas": "0.1.45",
|
"@napi-rs/canvas": "0.1.45",
|
||||||
"@octokit/rest": "20.0.2",
|
"@octokit/rest": "20.0.2",
|
||||||
"@sequelize/core": "7.0.0-alpha.37",
|
"@sequelize/core": "7.0.0-alpha.37",
|
||||||
"@toast/tokenservice-client": "1.0.11",
|
"@toast/tokenservice-client": "1.0.12",
|
||||||
"ansi-colors": "4.1.3",
|
"ansi-colors": "4.1.3",
|
||||||
"dayjs": "1.11.10",
|
"dayjs": "1.11.10",
|
||||||
"discord.js": "14.14.1",
|
"discord.js": "14.14.1",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker compose -f docker-compose.bot.yml down && \
|
||||||
docker compose -f docker-compose.bot.yml build && \
|
docker compose -f docker-compose.bot.yml build && \
|
||||||
docker compose -f docker-compose.bot.yml up -d
|
docker compose -f docker-compose.bot.yml up -d --remove-orphans
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1 +0,0 @@
|
|||||||
require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})
|
|
35
ufwReject.sh
35
ufwReject.sh
@ -1,35 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
echo "Please run this script as root or sudo"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Store the IP addresses in a file
|
|
||||||
IP_ADDRESSES_STORE="ips.txt"
|
|
||||||
|
|
||||||
# Scan the kernel log for IP addresses and store them in a file
|
|
||||||
dmesg | grep 'SRC=' | awk -F'SRC=' '{ print $2 }' | awk '{ print $1 }' | sort | uniq | head -n 5000 > "$IP_ADDRESSES_STORE"
|
|
||||||
|
|
||||||
# Initialize a counter for new IPs
|
|
||||||
new_ips=0
|
|
||||||
|
|
||||||
# Store the output of ufw status in a variable
|
|
||||||
ufw_status=$(ufw status)
|
|
||||||
|
|
||||||
# Populate the UFW reject rule with the IP addresses collected from the kernel log
|
|
||||||
while IFS= read -r ip
|
|
||||||
do
|
|
||||||
ip_prefix="${ip%.*}"
|
|
||||||
# Check if the IP is already in the UFW rules
|
|
||||||
if ! echo "$ufw_status" | grep -q "$ip" && [ "$ip_prefix" != "${TOAST_IP%.*}" ]
|
|
||||||
then
|
|
||||||
ufw reject from $ip
|
|
||||||
# Increment the counter
|
|
||||||
((new_ips++))
|
|
||||||
fi
|
|
||||||
done < "$IP_ADDRESSES_STORE"
|
|
||||||
|
|
||||||
echo "Done populating UFW reject rule"
|
|
||||||
echo "$new_ips IP addresses were added"
|
|
||||||
exit 0
|
|
21
yarn.lock
21
yarn.lock
@ -500,12 +500,12 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@toast/tokenservice-client@npm:1.0.11":
|
"@toast/tokenservice-client@npm:1.0.12":
|
||||||
version: 1.0.11
|
version: 1.0.12
|
||||||
resolution: "@toast/tokenservice-client@npm:1.0.11::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.11%2Ftokenservice-client-1.0.11.tgz"
|
resolution: "@toast/tokenservice-client@npm:1.0.12::__archiveUrl=https%3A%2F%2Fgit.toast-server.net%2Fapi%2Fpackages%2Ftoast%2Fnpm%2F%2540toast%252Ftokenservice-client%2F-%2F1.0.12%2Ftokenservice-client-1.0.12.tgz"
|
||||||
dependencies:
|
dependencies:
|
||||||
undici: "npm:6.5.0"
|
undici: "npm:6.6.2"
|
||||||
checksum: 10/c910af2b01876ca53de3078cf6b20c3cd8619ed807c3ce573074bc886a8690e6edc43f961088acf4bc2a7e925e8a0cb0e35df930b5923b20ecbbad6fd9bf4c81
|
checksum: 10/64112744b4bfefb9018f8125e5e54653ff8af3bff493ae1767bd6db0c123a9052dbfa8ea0a3e2f4d8db3ebfb6c2b6823104f288721ba9304c04734f64aeb46c9
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@ -626,7 +626,7 @@ __metadata:
|
|||||||
"@napi-rs/canvas": "npm:0.1.45"
|
"@napi-rs/canvas": "npm:0.1.45"
|
||||||
"@octokit/rest": "npm:20.0.2"
|
"@octokit/rest": "npm:20.0.2"
|
||||||
"@sequelize/core": "npm:7.0.0-alpha.37"
|
"@sequelize/core": "npm:7.0.0-alpha.37"
|
||||||
"@toast/tokenservice-client": "npm:1.0.11"
|
"@toast/tokenservice-client": "npm:1.0.12"
|
||||||
"@types/ms": "npm:0.7.34"
|
"@types/ms": "npm:0.7.34"
|
||||||
"@types/node": "npm:20.11.17"
|
"@types/node": "npm:20.11.17"
|
||||||
"@types/node-cron": "npm:3.0.11"
|
"@types/node-cron": "npm:3.0.11"
|
||||||
@ -1270,15 +1270,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"undici@npm:6.5.0":
|
|
||||||
version: 6.5.0
|
|
||||||
resolution: "undici@npm:6.5.0"
|
|
||||||
dependencies:
|
|
||||||
"@fastify/busboy": "npm:^2.0.0"
|
|
||||||
checksum: 10/0ad9289bd8dc8a5ee8cf81a48a629a59c33814702ae706b1d8e7c7fac3cfa85bd6a73943db5d9379f4d420858d239ed3857ec1003e517ddb67eb44fdbc227f3e
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"undici@npm:6.6.2":
|
"undici@npm:6.6.2":
|
||||||
version: 6.6.2
|
version: 6.6.2
|
||||||
resolution: "undici@npm:6.6.2"
|
resolution: "undici@npm:6.6.2"
|
||||||
|
Loading…
Reference in New Issue
Block a user