This commit is contained in:
Benjamin Toby 2026-02-02 12:12:51 +01:00
parent ab3ca1839f
commit f269e68bae
2 changed files with 13 additions and 3 deletions

View File

@ -10,6 +10,7 @@ type AdminPagesAuth = {
const server = Bun.serve({
port: AuthServerPort,
hostname: "0.0.0.0",
fetch(req) {
try {
const url = new URL(req.url);
@ -20,6 +21,12 @@ const server = Bun.serve({
decrypt({ encryptedString: key! }),
) as AdminPagesAuth;
const decrptedUrl = decryptedKey.url;
if (!srcOrigin || !decrptedUrl) {
throw new Error(`Origin Not Found!`);
}
return new Response("Auth Success!", {
status: 200,
});
@ -31,4 +38,4 @@ const server = Bun.serve({
},
});
console.log(`Auth Server running at http://localhost:${server.port}/`);
console.log(`Auth Server running at http://localhost:${server.port}/ ...`);

7
run.sh
View File

@ -7,11 +7,14 @@ bun install -g pm2
# pm2 start apps/auth-server/index.ts --name cdr-auth-server --interpreter bun
docker run \
docker kill cdr-auth-server || echo "Auth Server Not Running"
docker rm cdr-auth-server || echo "No Auth Server Found"
docker run -d\
--name cdr-auth-server \
--hostname cdr-auth-server \
--network cdr-network \
-d -w /app \
-w /app \
-e DSQL_ENCRYPTION_PASSWORD=$DSQL_ENCRYPTION_PASSWORD \
-e DSQL_ENCRYPTION_SALT=$DSQL_ENCRYPTION_SALT \
--volume /root/.coderank/server:/app \