1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-18 00:31:00 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
toast-ts
8b541cbed3 Merge branch 'master' into sequelize-v7 2024-02-13 08:29:25 +11:00
toast-ts
5cba023ff1 Remove unused stuff 2024-02-13 08:22:19 +11:00
toast-ts
553e13c057 Update bash script to efficiently update container 2024-02-13 01:13:26 +11:00
toast-ts
b79831811c Update TS client to 1.0.12 2024-02-13 01:07:47 +11:00
9 changed files with 17 additions and 73 deletions

View File

@ -1,6 +1,6 @@
# Pointless stuff
Dockerfile
docker-compose.yml
docker-compose.*.yml
.ncurc.json
.env
.mailmap
@ -9,8 +9,6 @@ docker-compose.yml
.github
postgres-replica-stuff
README.md
ufwReject.sh
# Startup files
startWithYarn.cjs
botStartup.bat
startDocker.sh

1
.gitignore vendored
View File

@ -1,5 +1,4 @@
.env
ips.txt
# Yarn stuff
.yarn
# TypeScript stuff

20
.pnp.cjs generated
View File

@ -29,7 +29,7 @@ const RAW_RUNTIME_STATE =
["@napi-rs/canvas", "npm:0.1.45"],\
["@octokit/rest", "npm:20.0.2"],\
["@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/node", "npm:20.11.17"],\
["@types/node-cron", "npm:3.0.11"],\
@ -708,11 +708,11 @@ const RAW_RUNTIME_STATE =
}]\
]],\
["@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", {\
"packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.11-c95d3498fc-c910af2b01.zip/node_modules/@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", {\
"packageLocation": "./.yarn/cache/@toast-tokenservice-client-npm-1.0.12-11df688697-64112744b4.zip/node_modules/@toast/tokenservice-client/",\
"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"],\
["undici", "npm:6.5.0"]\
["@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.6.2"]\
],\
"linkType": "HARD"\
}]\
@ -858,7 +858,7 @@ const RAW_RUNTIME_STATE =
["@napi-rs/canvas", "npm:0.1.45"],\
["@octokit/rest", "npm:20.0.2"],\
["@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/node", "npm:20.11.17"],\
["@types/node-cron", "npm:3.0.11"],\
@ -1604,14 +1604,6 @@ const RAW_RUNTIME_STATE =
],\
"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", {\
"packageLocation": "./.yarn/cache/undici-npm-6.6.2-a0bd6785a6-e08ac9c279.zip/node_modules/undici/",\
"packageDependencies": [\

View File

@ -1 +0,0 @@
pm2 start startWithYarn.cjs --name Daggerbot

View File

@ -35,7 +35,7 @@
"@napi-rs/canvas": "0.1.45",
"@octokit/rest": "20.0.2",
"@sequelize/core": "7.0.0-alpha.37",
"@toast/tokenservice-client": "1.0.11",
"@toast/tokenservice-client": "1.0.12",
"ansi-colors": "4.1.3",
"dayjs": "1.11.10",
"discord.js": "14.14.1",

View File

@ -1,6 +1,7 @@
#!/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 up -d
docker compose -f docker-compose.bot.yml up -d --remove-orphans
exit 0

View File

@ -1 +0,0 @@
require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true})

View File

@ -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

View File

@ -500,12 +500,12 @@ __metadata:
languageName: node
linkType: hard
"@toast/tokenservice-client@npm:1.0.11":
version: 1.0.11
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"
"@toast/tokenservice-client@npm:1.0.12":
version: 1.0.12
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:
undici: "npm:6.5.0"
checksum: 10/c910af2b01876ca53de3078cf6b20c3cd8619ed807c3ce573074bc886a8690e6edc43f961088acf4bc2a7e925e8a0cb0e35df930b5923b20ecbbad6fd9bf4c81
undici: "npm:6.6.2"
checksum: 10/64112744b4bfefb9018f8125e5e54653ff8af3bff493ae1767bd6db0c123a9052dbfa8ea0a3e2f4d8db3ebfb6c2b6823104f288721ba9304c04734f64aeb46c9
languageName: node
linkType: hard
@ -626,7 +626,7 @@ __metadata:
"@napi-rs/canvas": "npm:0.1.45"
"@octokit/rest": "npm:20.0.2"
"@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/node": "npm:20.11.17"
"@types/node-cron": "npm:3.0.11"
@ -1270,15 +1270,6 @@ __metadata:
languageName: node
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":
version: 6.6.2
resolution: "undici@npm:6.6.2"