mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #2841 from SchrodingersGat/x-forwarded-for
X-forwarded-for
This commit is contained in:
commit
ad541903c8
@ -282,6 +282,7 @@ INSTALLED_APPS = [
|
|||||||
|
|
||||||
MIDDLEWARE = CONFIG.get('middleware', [
|
MIDDLEWARE = CONFIG.get('middleware', [
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
|
'x_forwarded_for.middleware.XForwardedForMiddleware',
|
||||||
'user_sessions.middleware.SessionMiddleware', # db user sessions
|
'user_sessions.middleware.SessionMiddleware', # db user sessions
|
||||||
'django.middleware.locale.LocaleMiddleware',
|
'django.middleware.locale.LocaleMiddleware',
|
||||||
'django.middleware.common.CommonMiddleware',
|
'django.middleware.common.CommonMiddleware',
|
||||||
|
@ -7,9 +7,9 @@ version: "3.8"
|
|||||||
# - Serves media and static content directly from Django webserver
|
# - Serves media and static content directly from Django webserver
|
||||||
|
|
||||||
# IMPORANT NOTE:
|
# IMPORANT NOTE:
|
||||||
# The InvenTree docker image does not clone source code from git.
|
# The InvenTree development image does not clone source code from git.
|
||||||
# Instead, you must specify *where* the source code is located,
|
# Instead, you must specify *where* the source code is located, (on your local machine).
|
||||||
# (on your local machine).
|
# The default setup in this file should work straight out of the box, without modification
|
||||||
# The django server will auto-detect any code changes and reload the server.
|
# The django server will auto-detect any code changes and reload the server.
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -4,24 +4,29 @@ server {
|
|||||||
# Listen for connection on (internal) port 80
|
# Listen for connection on (internal) port 80
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location / {
|
real_ip_header proxy_protocol;
|
||||||
# Change 'inventree-server' to the name of the inventree server container,
|
|
||||||
# and '8000' to the INVENTREE_WEB_PORT (if not default)
|
|
||||||
proxy_pass http://inventree-server:8000;
|
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
location / {
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Forwarded-By $server_addr:$server_port;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header CLIENT_IP $remote_addr;
|
||||||
|
|
||||||
|
proxy_pass_request_headers on;
|
||||||
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
|
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
|
|
||||||
|
# Change 'inventree-server' to the name of the inventree server container,
|
||||||
|
# and '8000' to the INVENTREE_WEB_PORT (if not default)
|
||||||
|
proxy_pass http://inventree-server:8000;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirect any requests for static files
|
# Redirect any requests for static files
|
||||||
|
@ -4,24 +4,30 @@ server {
|
|||||||
# Listen for connection on (internal) port 80
|
# Listen for connection on (internal) port 80
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
location / {
|
real_ip_header proxy_protocol;
|
||||||
# Change 'inventree-dev-server' to the name of the inventree server container,
|
|
||||||
# and '8000' to the INVENTREE_WEB_PORT (if not default)
|
|
||||||
proxy_pass http://inventree-dev-server:8000;
|
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
location / {
|
||||||
proxy_set_header Host $http_host;
|
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Forwarded-By $server_addr:$server_port;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header CLIENT_IP $remote_addr;
|
||||||
|
|
||||||
|
proxy_pass_request_headers on;
|
||||||
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
|
|
||||||
client_max_body_size 100M;
|
client_max_body_size 100M;
|
||||||
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
|
||||||
|
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
|
|
||||||
|
# Change 'inventree-dev-server' to the name of the inventree server container,
|
||||||
|
# and '8000' to the INVENTREE_WEB_PORT (if not default)
|
||||||
|
proxy_pass http://inventree-dev-server:8000;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Redirect any requests for static files
|
# Redirect any requests for static files
|
||||||
|
@ -1,46 +1,47 @@
|
|||||||
# Please keep this list sorted
|
# Please keep this list sorted
|
||||||
Django==3.2.12 # Django package
|
Django==3.2.12 # Django package
|
||||||
bleach==4.1.0 # HTML santization
|
bleach==4.1.0 # HTML santization
|
||||||
certifi # Certifi is (most likely) installed through one of the requirements above
|
certifi # Certifi is (most likely) installed through one of the requirements above
|
||||||
coreapi==2.3.0 # API documentation
|
coreapi==2.3.0 # API documentation
|
||||||
coverage==5.3 # Unit test coverage
|
coverage==5.3 # Unit test coverage
|
||||||
coveralls==2.1.2 # Coveralls linking (for Travis)
|
coveralls==2.1.2 # Coveralls linking (for Travis)
|
||||||
cryptography==3.4.8 # Cryptography support
|
cryptography==3.4.8 # Cryptography support
|
||||||
django-admin-shell==0.1.2 # Python shell for the admin interface
|
django-admin-shell==0.1.2 # Python shell for the admin interface
|
||||||
django-allauth==0.45.0 # SSO for external providers via OpenID
|
django-allauth==0.45.0 # SSO for external providers via OpenID
|
||||||
django-allauth-2fa==0.8 # MFA / 2FA
|
django-allauth-2fa==0.8 # MFA / 2FA
|
||||||
django-cleanup==5.1.0 # Manage deletion of old / unused uploaded files
|
django-cleanup==5.1.0 # Manage deletion of old / unused uploaded files
|
||||||
django-cors-headers==3.2.0 # CORS headers extension for DRF
|
django-cors-headers==3.2.0 # CORS headers extension for DRF
|
||||||
django-crispy-forms==1.11.2 # Form helpers
|
django-crispy-forms==1.11.2 # Form helpers
|
||||||
django-debug-toolbar==2.2 # Debug / profiling toolbar
|
django-debug-toolbar==2.2 # Debug / profiling toolbar
|
||||||
django-error-report==0.2.0 # Error report viewer for the admin interface
|
django-error-report==0.2.0 # Error report viewer for the admin interface
|
||||||
django-filter==2.4.0 # Extended filtering options
|
django-filter==2.4.0 # Extended filtering options
|
||||||
django-formtools==2.3 # Form wizard tools
|
django-formtools==2.3 # Form wizard tools
|
||||||
django-import-export==2.5.0 # Data import / export for admin interface
|
django-import-export==2.5.0 # Data import / export for admin interface
|
||||||
django-maintenance-mode==0.16.1 # Shut down application while reloading etc.
|
django-maintenance-mode==0.16.1 # Shut down application while reloading etc.
|
||||||
django-markdownify==0.8.0 # Markdown rendering
|
django-markdownify==0.8.0 # Markdown rendering
|
||||||
django-markdownx==3.0.1 # Markdown form fields
|
django-markdownx==3.0.1 # Markdown form fields
|
||||||
django-money==1.1 # Django app for currency management
|
django-money==1.1 # Django app for currency management
|
||||||
django-mptt==0.11.0 # Modified Preorder Tree Traversal
|
django-mptt==0.11.0 # Modified Preorder Tree Traversal
|
||||||
django-redis>=5.0.0
|
django-redis>=5.0.0 # Redis integration
|
||||||
django-q==1.3.4 # Background task scheduling
|
django-q==1.3.4 # Background task scheduling
|
||||||
django-sql-utils==0.5.0 # Advanced query annotation / aggregation
|
django-sql-utils==0.5.0 # Advanced query annotation / aggregation
|
||||||
django-stdimage==5.1.1 # Advanced ImageField management
|
django-stdimage==5.1.1 # Advanced ImageField management
|
||||||
django-test-migrations==1.1.0 # Unit testing for database migrations
|
django-test-migrations==1.1.0 # Unit testing for database migrations
|
||||||
django-user-sessions==1.7.1 # user sessions in DB
|
django-user-sessions==1.7.1 # user sessions in DB
|
||||||
django-weasyprint==1.0.1 # django weasyprint integration
|
django-weasyprint==1.0.1 # django weasyprint integration
|
||||||
djangorestframework==3.12.4 # DRF framework
|
djangorestframework==3.12.4 # DRF framework
|
||||||
flake8==3.8.3 # PEP checking
|
django-xforwardedfor-middleware==2.0 # IP forwarding metadata
|
||||||
gunicorn>=20.1.0 # Gunicorn web server
|
flake8==3.8.3 # PEP checking
|
||||||
importlib_metadata # Backport for importlib.metadata
|
gunicorn>=20.1.0 # Gunicorn web server
|
||||||
inventree # Install the latest version of the InvenTree API python library
|
importlib_metadata # Backport for importlib.metadata
|
||||||
markdown==3.3.4 # Force particular version of markdown
|
inventree # Install the latest version of the InvenTree API python library
|
||||||
pep8-naming==0.11.1 # PEP naming convention extension
|
markdown==3.3.4 # Force particular version of markdown
|
||||||
pillow==9.0.1 # Image manipulation
|
pep8-naming==0.11.1 # PEP naming convention extension
|
||||||
py-moneyed==0.8.0 # Specific version requirement for py-moneyed
|
pillow==9.0.1 # Image manipulation
|
||||||
pygments==2.7.4 # Syntax highlighting
|
py-moneyed==0.8.0 # Specific version requirement for py-moneyed
|
||||||
python-barcode[images]==0.13.1 # Barcode generator
|
pygments==2.7.4 # Syntax highlighting
|
||||||
qrcode[pil]==6.1 # QR code generator
|
python-barcode[images]==0.13.1 # Barcode generator
|
||||||
rapidfuzz==0.7.6 # Fuzzy string matching
|
qrcode[pil]==6.1 # QR code generator
|
||||||
tablib[xls,xlsx,yaml] # Support for XLS and XLSX formats
|
rapidfuzz==0.7.6 # Fuzzy string matching
|
||||||
weasyprint==52.5 # PDF generation library (Note: in the future need to update to 53)
|
tablib[xls,xlsx,yaml] # Support for XLS and XLSX formats
|
||||||
|
weasyprint==52.5 # PDF generation library (Note: in the future need to update to 53)
|
||||||
|
Loading…
Reference in New Issue
Block a user