mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
Merge pull request #311 from GaboritJunior/fix/tusd-behind-proxy
fix: Enable --behind-proxy for tusd
This commit is contained in:
@@ -78,3 +78,6 @@ TRUSTED_DOMAINS="http://localhost:8887, http://localhost:3055, http://localhost:
|
|||||||
#OPENAPI_ENABLED=true
|
#OPENAPI_ENABLED=true
|
||||||
#API_ENABLED=true
|
#API_ENABLED=true
|
||||||
#MCP_ENABLED=true
|
#MCP_ENABLED=true
|
||||||
|
|
||||||
|
# Default to false
|
||||||
|
#TUSD_BEHIND_PROXY=true
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ ENV PORT=80
|
|||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
ENV PGDATA=/data/postgres
|
ENV PGDATA=/data/postgres
|
||||||
ENV PRIVATE_PATH=/data/private
|
ENV PRIVATE_PATH=/data/private
|
||||||
|
ENV TUSD_BEHIND_PROXY=false
|
||||||
|
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs
|
||||||
|
|||||||
@@ -72,7 +72,18 @@ fi
|
|||||||
|
|
||||||
mkdir -p /data/private/uploads/tmp
|
mkdir -p /data/private/uploads/tmp
|
||||||
echo "▶ Starting tusd server..."
|
echo "▶ Starting tusd server..."
|
||||||
tusd --base-path /tus/files/ --upload-dir /data/private/uploads/tmp --hooks-http http://127.0.0.1:3000/api/tus/hooks --port 1080 --max-size 21474836480 &
|
TUSD_BEHIND_PROXY_FLAG=""
|
||||||
|
if [ "${TUSD_BEHIND_PROXY:-false}" = "true" ]; then
|
||||||
|
TUSD_BEHIND_PROXY_FLAG="--behind-proxy"
|
||||||
|
echo "[INFO] TUSD_BEHIND_PROXY=true, enabling tusd proxy mode"
|
||||||
|
fi
|
||||||
|
tusd \
|
||||||
|
--base-path /tus/files/ \
|
||||||
|
--upload-dir /data/private/uploads/tmp \
|
||||||
|
--hooks-http http://127.0.0.1:3000/api/tus/hooks \
|
||||||
|
--port 1080 \
|
||||||
|
--max-size 21474836480 \
|
||||||
|
$TUSD_BEHIND_PROXY_FLAG &
|
||||||
|
|
||||||
echo "▶ Starting Next.js server..."
|
echo "▶ Starting Next.js server..."
|
||||||
PORT=3000 node server.js &
|
PORT=3000 node server.js &
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
events {}
|
events {}
|
||||||
|
|
||||||
http {
|
http {
|
||||||
|
map $http_x_forwarded_proto $forwarded_proto {
|
||||||
|
default $scheme;
|
||||||
|
"~*^\s*(https?)\s*(?:,|$)" $1;
|
||||||
|
}
|
||||||
|
|
||||||
client_max_body_size 20G;
|
client_max_body_size 20G;
|
||||||
ignore_invalid_headers off;
|
ignore_invalid_headers off;
|
||||||
|
|
||||||
@@ -18,7 +23,7 @@ http {
|
|||||||
|
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Host $http_host;
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $forwarded_proto;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
@@ -34,7 +39,7 @@ http {
|
|||||||
|
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Host $http_host;
|
proxy_set_header X-Forwarded-Host $http_host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $forwarded_proto;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ spec:
|
|||||||
value: {{ .Values.project.url }}
|
value: {{ .Values.project.url }}
|
||||||
- name: PROJECT_SECRET
|
- name: PROJECT_SECRET
|
||||||
value: {{ .Values.project.secret }}
|
value: {{ .Values.project.secret }}
|
||||||
|
- name: TUSD_BEHIND_PROXY
|
||||||
|
value: {{ .Values.project.behindProxy | quote }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: data
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ timezone: Europe/Paris
|
|||||||
project:
|
project:
|
||||||
url: http://localhost:8887
|
url: http://localhost:8887
|
||||||
secret: "change_me_generate_secure_secret"
|
secret: "change_me_generate_secure_secret"
|
||||||
|
behindProxy: false
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|||||||
Reference in New Issue
Block a user