Updates
This commit is contained in:
parent
ab3ca1839f
commit
f269e68bae
@ -10,6 +10,7 @@ type AdminPagesAuth = {
|
|||||||
|
|
||||||
const server = Bun.serve({
|
const server = Bun.serve({
|
||||||
port: AuthServerPort,
|
port: AuthServerPort,
|
||||||
|
hostname: "0.0.0.0",
|
||||||
fetch(req) {
|
fetch(req) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(req.url);
|
const url = new URL(req.url);
|
||||||
@ -20,6 +21,12 @@ const server = Bun.serve({
|
|||||||
decrypt({ encryptedString: key! }),
|
decrypt({ encryptedString: key! }),
|
||||||
) as AdminPagesAuth;
|
) as AdminPagesAuth;
|
||||||
|
|
||||||
|
const decrptedUrl = decryptedKey.url;
|
||||||
|
|
||||||
|
if (!srcOrigin || !decrptedUrl) {
|
||||||
|
throw new Error(`Origin Not Found!`);
|
||||||
|
}
|
||||||
|
|
||||||
return new Response("Auth Success!", {
|
return new Response("Auth Success!", {
|
||||||
status: 200,
|
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
7
run.sh
@ -7,11 +7,14 @@ bun install -g pm2
|
|||||||
|
|
||||||
# pm2 start apps/auth-server/index.ts --name cdr-auth-server --interpreter bun
|
# 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 \
|
--name cdr-auth-server \
|
||||||
--hostname cdr-auth-server \
|
--hostname cdr-auth-server \
|
||||||
--network cdr-network \
|
--network cdr-network \
|
||||||
-d -w /app \
|
-w /app \
|
||||||
-e DSQL_ENCRYPTION_PASSWORD=$DSQL_ENCRYPTION_PASSWORD \
|
-e DSQL_ENCRYPTION_PASSWORD=$DSQL_ENCRYPTION_PASSWORD \
|
||||||
-e DSQL_ENCRYPTION_SALT=$DSQL_ENCRYPTION_SALT \
|
-e DSQL_ENCRYPTION_SALT=$DSQL_ENCRYPTION_SALT \
|
||||||
--volume /root/.coderank/server:/app \
|
--volume /root/.coderank/server:/app \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user