diff --git a/.dockerignore b/.dockerignore index 1d4e483..8936d2c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -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 diff --git a/.gitignore b/.gitignore index c55b01c..9a2e64d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .env -ips.txt # Yarn stuff .yarn # TypeScript stuff diff --git a/.pnp.cjs b/.pnp.cjs index 940425d..550f9a3 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -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": [\ diff --git a/botStartup.bat b/botStartup.bat deleted file mode 100644 index 7d5b42a..0000000 --- a/botStartup.bat +++ /dev/null @@ -1 +0,0 @@ -pm2 start startWithYarn.cjs --name Daggerbot diff --git a/package.json b/package.json index b61ad0c..46dac1f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/startDocker.sh b/startDocker.sh index 5f07505..d09ebfd 100755 --- a/startDocker.sh +++ b/startDocker.sh @@ -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 diff --git a/startWithYarn.cjs b/startWithYarn.cjs deleted file mode 100644 index f26c1e2..0000000 --- a/startWithYarn.cjs +++ /dev/null @@ -1 +0,0 @@ -require('node:child_process').spawn('yarn node dist/index.js', {stdio: [null,process.stdout,process.stderr,null], windowsHide: true, shell: true}) \ No newline at end of file diff --git a/ufwReject.sh b/ufwReject.sh deleted file mode 100755 index d148a0a..0000000 --- a/ufwReject.sh +++ /dev/null @@ -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 diff --git a/yarn.lock b/yarn.lock index e44de01..5eb7286 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"