Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
52040aff08 |
|
@ -1,7 +1,2 @@
|
|||
HOSTNAME=localhost
|
||||
PORT=2056
|
||||
|
||||
HYPERATE_TOKEN=your_hyperate_token_here
|
||||
|
||||
HYPERATE_ID=a1b2c3
|
||||
DISCORD_ID=0000000000000000000
|
3
.gitignore
vendored
|
@ -32,6 +32,3 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|||
|
||||
# Finder (MacOS) folder config
|
||||
.DS_Store
|
||||
|
||||
|
||||
bun.lock
|
4
.vscode/settings.json
vendored
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"html.customData": ["./node_modules/mdui/html-data.en.json"],
|
||||
"css.customData": ["./node_modules/mdui/css-data.en.json"]
|
||||
}
|
25
biome.json
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.0.0-beta.4/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
|
@ -7,19 +7,15 @@
|
|||
},
|
||||
"files": {
|
||||
"ignoreUnknown": true,
|
||||
"includes": ["**", "!**/dist/**"]
|
||||
"ignore": []
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab",
|
||||
"lineEnding": "lf"
|
||||
},
|
||||
"assist": {
|
||||
"actions": {
|
||||
"source": {
|
||||
"organizeImports": "on"
|
||||
}
|
||||
}
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"css": {
|
||||
"formatter": {
|
||||
|
@ -33,19 +29,6 @@
|
|||
"recommended": true,
|
||||
"correctness": {
|
||||
"noUnusedImports": "error"
|
||||
},
|
||||
"style": {
|
||||
"noParameterAssign": "error",
|
||||
"useAsConstAssertion": "error",
|
||||
"useDefaultParameterLast": "error",
|
||||
"useEnumInitializers": "error",
|
||||
"useSelfClosingElements": "error",
|
||||
"useConst": "error",
|
||||
"useSingleVarDeclarator": "error",
|
||||
"noUnusedTemplateLiteral": "error",
|
||||
"useNumberNamespace": "error",
|
||||
"noInferrableTypes": "error",
|
||||
"noUselessElse": "error"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
57
bun.lock
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"lockfileVersion": 1,
|
||||
"workspaces": {
|
||||
"": {
|
||||
"name": "ipv4.army",
|
||||
"dependencies": {
|
||||
"@speed-highlight/core": "latest",
|
||||
"reconnecting-websocket": "latest",
|
||||
"tsx-dom": "latest",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@types/bun": "latest",
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "^5.8.3",
|
||||
},
|
||||
},
|
||||
},
|
||||
"packages": {
|
||||
"@biomejs/biome": ["@biomejs/biome@1.9.4", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "1.9.4", "@biomejs/cli-darwin-x64": "1.9.4", "@biomejs/cli-linux-arm64": "1.9.4", "@biomejs/cli-linux-arm64-musl": "1.9.4", "@biomejs/cli-linux-x64": "1.9.4", "@biomejs/cli-linux-x64-musl": "1.9.4", "@biomejs/cli-win32-arm64": "1.9.4", "@biomejs/cli-win32-x64": "1.9.4" }, "bin": { "biome": "bin/biome" } }, "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog=="],
|
||||
|
||||
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@1.9.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw=="],
|
||||
|
||||
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@1.9.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg=="],
|
||||
|
||||
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@1.9.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g=="],
|
||||
|
||||
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@1.9.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA=="],
|
||||
|
||||
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@1.9.4", "", { "os": "linux", "cpu": "x64" }, "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg=="],
|
||||
|
||||
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@1.9.4", "", { "os": "linux", "cpu": "x64" }, "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg=="],
|
||||
|
||||
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@1.9.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg=="],
|
||||
|
||||
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@1.9.4", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="],
|
||||
|
||||
"@speed-highlight/core": ["@speed-highlight/core@1.2.7", "", {}, "sha512-0dxmVj4gxg3Jg879kvFS/msl4s9F3T9UXC1InxgOf7t5NvcPD97u/WTA5vL/IxWHMn7qSxBozqrnnE2wvl1m8g=="],
|
||||
|
||||
"@types/bun": ["@types/bun@1.2.12", "", { "dependencies": { "bun-types": "1.2.12" } }, "sha512-lY/GQTXDGsolT/TiH72p1tuyUORuRrdV7VwOTOjDOt8uTBJQOJc5zz3ufwwDl0VBaoxotSk4LdP0hhjLJ6ypIQ=="],
|
||||
|
||||
"@types/node": ["@types/node@22.14.1", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw=="],
|
||||
|
||||
"bun-types": ["bun-types@1.2.12", "", { "dependencies": { "@types/node": "*" } }, "sha512-tvWMx5vPqbRXgE8WUZI94iS1xAYs8bkqESR9cxBB1Wi+urvfTrF1uzuDgBHFAdO0+d2lmsbG3HmeKMvUyj6pWA=="],
|
||||
|
||||
"reconnecting-websocket": ["reconnecting-websocket@4.4.0", "", {}, "sha512-D2E33ceRPga0NvTDhJmphEgJ7FUYF0v4lr1ki0csq06OdlxKfugGzN0dSkxM/NfqCxYELK4KcaTOUOjTV6Dcng=="],
|
||||
|
||||
"tsx-dom": ["tsx-dom@3.1.0", "", { "dependencies": { "tsx-dom-types": "2.1.0" } }, "sha512-PGN7iL6zNC4Jj7bA1groSIz5mFB3Rr+SeoywZk2g4+c9uV8wwzCf+5tFQ8SyZxQIBHech3ueB0KxV3OFieqhOA=="],
|
||||
|
||||
"tsx-dom-types": ["tsx-dom-types@2.1.0", "", {}, "sha512-pZaMTrMRNom+D1b82K+1cWVMuogXrD/ANI42UYxilw27tF+tDCgj7GrD1XLmCxbHPDO2zxfmFuaz04KIEfWydQ=="],
|
||||
|
||||
"typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
||||
|
||||
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||
}
|
||||
}
|
2
bunfig.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
[loader]
|
||||
".woff2" = "file"
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -8,7 +8,7 @@
|
|||
"lint:fix": "bunx biome check --fix"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^2.0.0-beta.5",
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@types/bun": "latest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
@ -17,13 +17,7 @@
|
|||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@fontsource/roboto": "^5.2.5",
|
||||
"@fontsource/roboto-mono": "^5.2.5",
|
||||
"@material/material-color-utilities": "^0.3.0",
|
||||
"@mdui/icons": "^1.0.3",
|
||||
"@speed-highlight/core": "latest",
|
||||
"mdui": "^2.1.4",
|
||||
"purgecss": "^7.0.2",
|
||||
"reconnecting-websocket": "latest",
|
||||
"tsx-dom": "latest"
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.1 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 2 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 8.4 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5 KiB |
Before Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 5.7 KiB |
Before Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 8 KiB |
Before Width: | Height: | Size: 9.9 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 6.7 KiB |
1
public/favicon.svg
Normal file
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" fill="none"><g filter="url(#a)"><g clip-path="url(#b)"><rect width="256" height="256" fill="#1a1a1a" rx="128"/><path stroke="#787878" stroke-width="10" d="m150.035 192 142 1"/><ellipse cx="87" cy="120" fill="#e8e8e8" rx="13" ry="8"/><path fill="#e8e8e8" fill-rule="evenodd" d="M101.139 38.263c-1.6764-7.0088-9.9916-9.9969-15.7458-5.6584L52.0779 57.7231c-.9878.7448-2.2162 1.0925-3.4501 1.0038-2.8433-.2042-5.7211-.3084-8.6278-.3084-52.5128 0-97 34.4995-97 79.1815 0 22.093 11.0445 44.911 28.4288 62.117C-11.1382 216.973 13.0784 229 40 229c9.3865 0 18.4441-1.462 27-4.098V251c0 2.762 2.2386 5 5 5h20.0132c2.5448 0 4.6836-1.911 4.9686-4.44l2.9543-26.219c.2799-2.489 2.3799-4.324 4.8249-4.861.724-.159 1.436-.353 2.132-.583 2.205-.729 4.208-1.797 5.895-3.144 1.688-1.346 3.027-2.945 3.94-4.704.377-.727.679-1.647.903-2.61.51-2.192 1.987-4.165 4.164-4.733l2.084-.544c.412-.107.837-.162 1.262-.162h10.218c.425 0 .85.055 1.262.162l10.258 2.676c.412.108.837.162 1.262.162H154c2.761 0 5-2.238 5-5v-18c0-2.761-2.239-5-5-5h-29.191C132.533 165.993 137 151.65 137 137.6c0-19.979-9.03-38.0624-23.615-51.8194-.73-.6885-1.255-1.5689-1.489-2.5447L101.139 38.263Zm11.793 140.755c.045-.012.092-.018.138-.018h11.739c-4.421 7.446-9.909 14.453-16.238 20.717C97.2163 210.956 82.9836 219.978 67 224.902v-10.524c13.1215-4.569 24.9171-12.247 34.536-21.768 4.28-4.235 8.099-8.806 11.396-13.592Zm0 0-22.3113 5.82c-.4121.108-.8363.162-1.2621.162H72c-2.7614 0-5 2.239-5 5v24.378C58.4813 217.344 49.4038 219 40 219c-23.8886 0-45.67204-10.687-61.5365-26.39C-37.4496 176.859-47 156.477-47 137.6c0-37.256 37.89237-69.1815 87-69.1815 3.8926 0 7.7237.2036 11.4777.5979 1.2591.1323 2.5215-.218 3.5324-.9802l30.3067-22.8501c2.8771-2.1693 7.0347-.6752 7.8729 2.8292l9.7033 40.5664c.241 1.0061.788 1.9129 1.565 2.5952C118.617 103.6 127 119.919 127 137.6c0 13.801-5.105 28.406-14.068 41.418Zm-11.601 33.945c-.257 2.282 1.628 4.279 3.809 3.558 1.65-.545 3.148-1.344 4.411-2.351 1.262-1.007 2.263-2.203 2.946-3.519.546-1.051.88-2.163.993-3.294.024-.245-.206-.431-.445-.369-.03.008-.061.012-.092.012h-6.482c-2.545 0-4.684 1.912-4.969 4.44l-.171 1.523Z" clip-rule="evenodd"/><g filter="url(#c)" opacity=".25"><path fill="#e8e8e8" fill-rule="evenodd" d="M114.139 38.263c-1.676-7.0088-9.992-9.9969-15.7458-5.6584L63.5434 58.8801c-3.4643-.3052-6.9821-.4616-10.5434-.4616-52.51276 0-97 34.4995-97 79.1815 0 22.093 11.0445 44.911 28.4288 62.117C1.86185 216.973 26.0784 229 53 229c9.3865 0 18.4441-1.462 27-4.098V256h29.481l3.945-35.005c2.22-.047 4.412-.419 6.467-1.098 2.205-.729 4.208-1.797 5.895-3.144 1.688-1.346 3.027-2.945 3.94-4.704.887-1.708 1.356-4.479 1.382-6.382L137.5 204H149l11.5 3H172v-28h-34.191C145.533 165.993 150 151.65 150 137.6c0-20.49-9.497-38.9861-24.745-52.8664L114.139 38.263Zm11.793 140.755L126 179h11.809c-4.421 7.446-9.909 14.453-16.238 20.717-11.355 11.239-25.5874 20.261-41.571 25.185v-10.524c13.1215-4.569 24.917-12.247 34.536-21.768 4.28-4.235 8.099-8.806 11.396-13.592Zm0 0L103 185H80v29.378C71.4813 217.344 62.4038 219 53 219c-23.8886 0-45.67204-10.687-61.53647-26.39C-24.4496 176.859-34 156.477-34 137.6c0-37.256 37.89237-69.1815 87-69.1815 3.8926 0 7.7237.2036 11.4777.5979l1.9593.2058 1.5731-1.186 36.4029-27.4468 11.48 47.9923.37 1.5465 1.195 1.0487C131.617 103.6 140 119.919 140 137.6c0 13.801-5.105 28.406-14.068 41.418Zm-12.092 38.305c1.476-.078 2.929-.349 4.3-.802 1.65-.545 3.148-1.344 4.411-2.351 1.262-1.007 2.263-2.203 2.946-3.519.625-1.204.973-2.487 1.027-3.788L126 207h-10.997l-1.163 10.323Z" clip-rule="evenodd"/></g></g></g><defs><filter id="a" width="276" height="256" x="-20" y="0" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dx="-20"/><feGaussianBlur stdDeviation="10"/><feComposite in2="hardAlpha" k2="-1" k3="1" operator="arithmetic"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend in2="shape" result="effect1_innerShadow_1591_192"/></filter><filter id="c" width="256" height="265.418" x="-64" y="10.582" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_1591_192" stdDeviation="10"/></filter><clipPath id="b"><rect width="256" height="256" fill="#fff" rx="128"/></clipPath></defs></svg>
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -8,7 +8,7 @@ export default class {
|
|||
|
||||
constructor(callback: (data: number) => void) {
|
||||
this._socket = new ReconnectingWebSocket(
|
||||
`wss://app.hyperate.io/socket/websocket?token=${process.env.HYPERATE_TOKEN}`,
|
||||
"wss://app.hyperate.io/socket/websocket?token=wv39nM6iyrNJulvpmMQrimYPIXy2dVrYRjkuHpbRapKT2VSh65ngDGHdCdCtmEN9",
|
||||
);
|
||||
this._keepAlive = null;
|
||||
this._interval = null;
|
||||
|
@ -21,7 +21,7 @@ export default class {
|
|||
|
||||
this._socket.send(
|
||||
JSON.stringify({
|
||||
topic: `hr:${process.env.HYPERATE_ID}`,
|
||||
topic: "hr:84aa0f",
|
||||
event: "phx_join",
|
||||
payload: {},
|
||||
ref: 0,
|
||||
|
@ -37,7 +37,7 @@ export default class {
|
|||
ref: 0,
|
||||
}),
|
||||
);
|
||||
}, 10000 - 1000);
|
||||
}, 10000);
|
||||
};
|
||||
|
||||
this._socket.onmessage = ({ data }: MessageEvent) => {
|
|
@ -7,7 +7,7 @@ export default class {
|
|||
|
||||
constructor(callback: (data: LanyardData) => void) {
|
||||
this._socket = new ReconnectingWebSocket(
|
||||
"wss://lanyard.atums.world/socket",
|
||||
"wss://lanyard.creations.works/socket",
|
||||
);
|
||||
this._keepAlive = null;
|
||||
this._callback = callback;
|
||||
|
@ -31,7 +31,7 @@ export default class {
|
|||
JSON.stringify({
|
||||
op: 2,
|
||||
d: {
|
||||
subscribe_to_id: process.env.DISCORD_ID,
|
||||
subscribe_to_id: "1273447359417942128",
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
@ -41,7 +41,7 @@ export default class {
|
|||
op: 3,
|
||||
}),
|
||||
);
|
||||
}, data.d.heartbeat_interval - 1000);
|
||||
}, data.d.heartbeat_interval);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ export default class {
|
|||
}
|
||||
};
|
||||
|
||||
this._socket.onclose = (_e) => {
|
||||
this._socket.onclose = () => {
|
||||
console.log("Lanyard socket closed");
|
||||
if (this._keepAlive) {
|
||||
clearInterval(this._keepAlive);
|
|
@ -1,28 +1,17 @@
|
|||
import { PurgeCSS } from "purgecss";
|
||||
import Hyperate from "./utilities/sockets/Hyperate";
|
||||
import Lanyard from "./utilities/sockets/Lanyard";
|
||||
import Hyperate from "./Sockets/Hyperate";
|
||||
import Lanyard from "./Sockets/Lanyard";
|
||||
|
||||
const development = process.env.NODE_ENV === "development";
|
||||
|
||||
const build = async () => {
|
||||
await Bun.build({
|
||||
return await Bun.build({
|
||||
entrypoints: ["./src/front/index.html"],
|
||||
outdir: "./dist",
|
||||
minify: !development,
|
||||
sourcemap: development ? "inline" : "none",
|
||||
splitting: true,
|
||||
env: "inline",
|
||||
sourcemap: "linked",
|
||||
minify: true,
|
||||
publicPath: "/assets/",
|
||||
});
|
||||
|
||||
const result = await new PurgeCSS().purge({
|
||||
content: ["dist/*.html", "dist/*.js"],
|
||||
css: ["dist/*.css"],
|
||||
});
|
||||
|
||||
for (const file of result) {
|
||||
await Bun.write(file.file || "", file.css);
|
||||
}
|
||||
};
|
||||
|
||||
const respOptions = {
|
||||
|
@ -44,14 +33,10 @@ const Responses = {
|
|||
return new Response(Bun.gzipSync(JSON.stringify(data)), respOptions);
|
||||
},
|
||||
file: async (file: Bun.BunFile) => {
|
||||
const isHTML = file.type === "text/html";
|
||||
|
||||
return new Response(Bun.gzipSync(await file.arrayBuffer()), {
|
||||
headers: {
|
||||
"Content-Type": file.type,
|
||||
...(isHTML
|
||||
? { "Cache-Control": "no-cache" }
|
||||
: { "Cache-Control": "public, max-age=31536000" }),
|
||||
"Cache-Control": "public, max-age=31536000",
|
||||
"Content-Encoding": "gzip",
|
||||
},
|
||||
});
|
||||
|
@ -60,19 +45,21 @@ const Responses = {
|
|||
|
||||
const postAnalytics = async (
|
||||
req: Request | Bun.BunRequest,
|
||||
_server: Bun.Server,
|
||||
server: Bun.Server,
|
||||
) => {
|
||||
const cfIp = req.headers.get("CF-Connecting-IP");
|
||||
//const realIp = req.headers.get("X-Real-IP");
|
||||
const forwardedIp = req.headers.get("X-Forwarded-For");
|
||||
//const serverIp = server.requestIP(req)?.address;
|
||||
|
||||
return await fetch("https://plausible.creations.works/api/event", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"User-Agent": req.headers.get("user-agent") || "",
|
||||
"X-Forwarded-For": String(cfIp || forwardedIp?.split(",")[0]),
|
||||
"X-Forwarded-For": String(
|
||||
req.headers.get("CF-Connecting-IP") ||
|
||||
req.headers.get("X-Real-IP") ||
|
||||
req.headers.get("X-Forwarded-For")?.split(",")[0] ||
|
||||
(typeof server.requestIP(req) === "string"
|
||||
? server.requestIP(req)
|
||||
: server.requestIP(req)?.address || ""),
|
||||
),
|
||||
},
|
||||
body: JSON.stringify({
|
||||
domain: "ipv4.army",
|
||||
|
|