Compare commits
4 Commits
d207281a53
...
master
Author | SHA1 | Date | |
---|---|---|---|
a995ba76bc
|
|||
fdacb09bde
|
|||
614c9b7821
|
|||
885f508996
|
@@ -1,4 +1,4 @@
|
||||
FROM node:10-alpine
|
||||
FROM node:24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
4
Makefile
4
Makefile
@@ -1,6 +1,6 @@
|
||||
.DEFAULT_GOAL := default
|
||||
|
||||
IMAGE ?= docker.cluster.fun/averagemarcus/cors-proxy:latest
|
||||
IMAGE ?= rg.fr-par.scw.cloud/averagemarcus/cors-proxy:latest
|
||||
|
||||
.PHONY: test # Run all tests, linting and format checks
|
||||
test: lint check-format run-tests
|
||||
@@ -47,7 +47,7 @@ ci:
|
||||
|
||||
.PHONY: release # Release the latest version of the application
|
||||
release:
|
||||
@kubectl --namespace cors-proxy set image deployment cors-proxy web=docker.cluster.fun/averagemarcus/cors-proxy:$(SHA)
|
||||
@kubectl --namespace cors-proxy set image deployment cors-proxy web=rg.fr-par.scw.cloud/averagemarcus/cors-proxy:$(SHA)
|
||||
|
||||
.PHONY: help # Show this list of commands
|
||||
help:
|
||||
|
4
index.js
4
index.js
@@ -25,12 +25,12 @@ http.createServer((req, response) => {
|
||||
if(!remoteURL.hostname || remoteURL.hostname === 'localhost') return response.end();
|
||||
|
||||
if(blockList.some(b => remoteURL.hostname == b || remoteURL.hostname.endsWith("." + b))) {
|
||||
console.log("Domain is in blocklist")
|
||||
console.log(`Domain '${remoteURL.hostname}' is in blocklist`)
|
||||
response.writeHead(403);
|
||||
return response.end();
|
||||
}
|
||||
if(allowList.length > 0 && !allowList.some(b => remoteURL.hostname == b || remoteURL.hostname.endsWith("." + b))) {
|
||||
console.log("Domain is not in allowlist")
|
||||
console.log(`Domain '${remoteURL.hostname}' is not in allowlist`)
|
||||
response.writeHead(403);
|
||||
return response.end();
|
||||
}
|
||||
|
Reference in New Issue
Block a user