mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-06 21:57:57 +02:00
feat: add config for trust proxy
This commit is contained in:
@@ -28,6 +28,7 @@ interface Config {
|
|||||||
S3_ENDPOINT?: string;
|
S3_ENDPOINT?: string;
|
||||||
S3_REGION?: string;
|
S3_REGION?: string;
|
||||||
STORAGE: "filesystem" | "s3";
|
STORAGE: "filesystem" | "s3";
|
||||||
|
TRUST_PROXY: number;
|
||||||
}
|
}
|
||||||
const config: Config = {
|
const config: Config = {
|
||||||
CLIENT_ID: "CLIENT_ID",
|
CLIENT_ID: "CLIENT_ID",
|
||||||
@@ -40,6 +41,7 @@ const config: Config = {
|
|||||||
AUTH_CALLBACK: "http://localhost:5000/github/auth",
|
AUTH_CALLBACK: "http://localhost:5000/github/auth",
|
||||||
ANONYMIZATION_MASK: "XXXX",
|
ANONYMIZATION_MASK: "XXXX",
|
||||||
PORT: 5000,
|
PORT: 5000,
|
||||||
|
TRUST_PROXY: 1,
|
||||||
HOSTNAME: "anonymous.4open.science",
|
HOSTNAME: "anonymous.4open.science",
|
||||||
DB_USERNAME: "admin",
|
DB_USERNAME: "admin",
|
||||||
DB_PASSWORD: "password",
|
DB_PASSWORD: "password",
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ export default async function start() {
|
|||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
app.set("trust proxy", 1);
|
app.set("trust proxy", config.TRUST_PROXY);
|
||||||
app.set("etag", "strong");
|
app.set("etag", "strong");
|
||||||
|
|
||||||
// handle session and connection
|
// handle session and connection
|
||||||
|
|||||||
Reference in New Issue
Block a user