forked from DogeNetwork/v3
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
43,028 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,104 @@ | ||
(async() => { | ||
await import('./index.mjs'); | ||
})(); | ||
import cluster from "cluster"; | ||
import os from "os"; | ||
import express from "express"; | ||
import http from "node:http"; | ||
import createBareServer from "@tomphttp/bare-server-node"; | ||
import path from "node:path"; | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
|
||
const __dirname = process.cwd(); | ||
|
||
// Increase max sockets to 1000 | ||
http.globalAgent.maxSockets = 1000; | ||
|
||
if (cluster.isMaster) { | ||
const numCPUs = os.cpus().length; | ||
console.log(`Master process running with PID ${process.pid}`); | ||
|
||
// Fork worker processes | ||
for (let i = 0; i < numCPUs; i++) { | ||
cluster.fork(); | ||
} | ||
|
||
// Handle worker exit events | ||
cluster.on("exit", (worker, code, signal) => { | ||
console.log( | ||
`Worker ${worker.process.pid} died with code ${code} and signal ${signal}` | ||
); | ||
console.log("Forking a new worker..."); | ||
cluster.fork(); | ||
}); | ||
} else { | ||
const server = http.createServer(); | ||
const app = express(server); | ||
const bareServer = createBareServer("/bare/"); | ||
|
||
// Serve static files with caching | ||
const staticOptions = { | ||
maxAge: "1d", | ||
setHeaders: (res, path) => { | ||
if (path.endsWith(".html")) { | ||
res.setHeader("Cache-Control", "no-cache"); | ||
} else { | ||
res.setHeader("Cache-Control", "public, max-age=86400"); | ||
} | ||
}, | ||
}; | ||
app.use(express.static(path.join(__dirname, "static"), staticOptions)); | ||
|
||
app.use(express.json()); | ||
app.use( | ||
express.urlencoded({ | ||
extended: true, | ||
}) | ||
); | ||
|
||
// Define routes | ||
const routes = [ | ||
{ path: "/", file: "index.html" }, | ||
{ path: "/photos", file: "photos.html" }, | ||
{ path: "/play", file: "play.html" }, | ||
{ path: "/apps", file: "apps.html" }, | ||
{ path: "/chat", file: "chat.html" }, | ||
{ path: "/go", file: "go.html" }, | ||
{ path: "/settings", file: "settings.html" }, | ||
{ path: "/donate", file: "donate.html" }, | ||
{ path: "/404", file: "404.html" }, | ||
]; | ||
|
||
// Define routes using the routes array | ||
routes.forEach((route) => { | ||
app.get(route.path, (req, res) => { | ||
res.sendFile(path.join(__dirname, "static", route.file)); | ||
}); | ||
}); | ||
|
||
// Catch-all route | ||
app.get("/*", (req, res) => { | ||
res.redirect("/404"); | ||
}); | ||
|
||
// Bare Server | ||
server.on("request", (req, res) => { | ||
if (bareServer.shouldRoute(req)) { | ||
bareServer.routeRequest(req, res); | ||
} else { | ||
app(req, res); | ||
} | ||
}); | ||
|
||
server.on("upgrade", (req, socket, head) => { | ||
if (bareServer.shouldRoute(req)) { | ||
bareServer.routeUpgrade(req, socket, head); | ||
} else { | ||
socket.end(); | ||
} | ||
}); | ||
|
||
server.listen({ | ||
port: process.env.PORT, | ||
}); | ||
|
||
console.log(`Worker process running with PID ${process.pid}`); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
services: | ||
- type: web | ||
name: doge | ||
env: node | ||
plan: free | ||
startCommand: node index.js | ||
services: | ||
- type: web | ||
name: doge | ||
env: node | ||
plan: free | ||
startCommand: node index.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
<html><head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
<style> | ||
body { | ||
margin: 0; | ||
font-family: Arial, Helvetica, sans-serif; | ||
background-color: #262626; | ||
} | ||
|
||
|
||
nav .icon { | ||
display: none; | ||
} | ||
|
||
|
||
@media screen and (max-width: 555px) { | ||
nav a:not(:first-child) {display: none;} | ||
nav a.icon { | ||
float: right; | ||
display: block; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 555px) { | ||
nav.responsive {position: relative;} | ||
nav.responsive .icon { | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
} | ||
nav.responsive a { | ||
float: none; | ||
display: block; | ||
text-align: left; | ||
} | ||
} | ||
|
||
h1 { | ||
font-size: 45.5px; | ||
} | ||
input { | ||
|
||
width: 52.5%; | ||
padding: 20px 20px; | ||
margin: 10px 0; | ||
box-sizing: border-box; | ||
border: 1px black; | ||
border-radius: 10px; | ||
background-color: #141414; | ||
transition: 0.5s; | ||
} | ||
input[type=text] { | ||
transition: 0.5s; | ||
color: white; | ||
|
||
|
||
} | ||
input:hover { | ||
-webkit-box-shadow: 0px 10px 35px 0px rgba(0,0,0,0.46); | ||
box-shadow: 0px 10px 35px 0px rgba(0,0,0,0.46); | ||
transition: 0.5s; | ||
} | ||
#card1, #card2, #card3, #card4 { | ||
outline: 3.5px solid #004be0; | ||
text-align: center; | ||
floating: center; | ||
width: 5.5%; | ||
height: 150px; | ||
color: white; | ||
padding: 4.5rem; | ||
border-radius: 5.5px; | ||
transition: 0.5s; | ||
} | ||
|
||
#card1:hover, #card2:hover, #card3:hover, #card4:hover{ | ||
background-color: #004be0; | ||
cursor: pointer; | ||
transition: 0.5s; | ||
} | ||
#featured { | ||
max-width: 1000px; | ||
margin: 0 auto; | ||
margin-top: 45.5px; | ||
display: grid; | ||
grid-gap: 1rem; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
} | ||
.clock { | ||
position: absolute; | ||
width: 350px; | ||
top: 98%; | ||
text-align: right; | ||
left: 25px; | ||
transform: translateX(-50%) translateY(-50%); | ||
color: #3d7eff; | ||
font-size: 25px; | ||
letter-spacing: 3px; | ||
</style> | ||
<link rel="icon" href="doge.jpg"> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
<style> | ||
@font-face{ | ||
font-family: mosk; | ||
src: url(mosk.ttf); | ||
} | ||
.button-6 { | ||
align-items: center; | ||
background-color: #3A3A3A; | ||
border: 1px solid rgba(0, 0, 0, 0.1); | ||
border-color: #343434; | ||
border-radius: .25rem; | ||
box-shadow: rgba(0, 0, 0, 0.02) 0 1px 3px 0; | ||
box-sizing: border-box; | ||
color: white; | ||
cursor: pointer; | ||
display: inline-flex; | ||
font-family: system-ui,-apple-system,system-ui,"Helvetica Neue",Helvetica,Arial,sans-serif; | ||
font-size: 16px; | ||
font-weight: 600; | ||
justify-content: center; | ||
line-height: 1.25; | ||
margin: 0; | ||
min-height: 3rem; | ||
padding: calc(.875rem - 1px) calc(1.5rem - 1px); | ||
position: relative; | ||
text-decoration: none; | ||
transition: all 250ms; | ||
user-select: none; | ||
-webkit-user-select: none; | ||
touch-action: manipulation; | ||
vertical-align: baseline; | ||
width: auto; | ||
} | ||
|
||
.button-6:hover, | ||
.button-6:focus { | ||
border-color: none; | ||
box-shadow: red; | ||
color: white; | ||
} | ||
|
||
.button-6:hover { | ||
transform: translateY(-1px); | ||
} | ||
|
||
.button-6:active { | ||
background-color: #3A3A3A; | ||
border-color: none; | ||
box-shadow: #3A3A3A 0 2px 4px; | ||
color: black; | ||
transform: translateY(0); | ||
} | ||
</style> | ||
<link href="https://unpkg.com/movement.css/movement.css" rel="stylesheet"> | ||
<style>@font-face{ | ||
font-family: mosk; | ||
src: url(mosk.ttf); | ||
}</style> | ||
<style> | ||
body { | ||
background-image: url('background.png'); | ||
background-size: 99% 100% ; | ||
} | ||
</style> | ||
<style> | ||
.loader { | ||
margin: auto; | ||
border: 20px solid #3A3A3A; | ||
border-radius: 50%; | ||
border-top: 20px solid white; | ||
width: 110px; | ||
height: 110px; | ||
|
||
animation: spinner 1.5s linear infinite; | ||
} | ||
|
||
@keyframes spinner { | ||
0% { transform: rotate(0deg); } | ||
100% { transform: rotate(360deg); } | ||
} | ||
</style> | ||
<script src="https://code.jquery.com/jquery-1.10.2.js"></script> | ||
<title>Doge Unblocker</title> | ||
</head> | ||
<body data-new-gr-c-s-check-loaded="14.1028.0" data-gr-ext-installed=""> | ||
<br> | ||
<center> | ||
<nav> | ||
<div class="loader"></div> | ||
<h1 style="font-family:mosk;color:white;">Loading site...</h1> | ||
<a href="app.html"> | ||
<button class="button-6">Cancel</button> | ||
</a> | ||
</center> | ||
</div><grammarly-desktop-integration data-grammarly-shadow-root="true"></grammarly-desktop-integration> | ||
</body></html> |
Oops, something went wrong.