You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
6abc
changed the title
can we add this automatically I have run a script to make changes
can we add this automatically I have to run a script to make changes, else I get 127.0.0.1
Feb 10, 2024
Find the path to auth_signals.py
AUTH_SIGNALS_PATH=$(find . -type f -name auth_signals.py)
Check if the file was found
if [ -z "$AUTH_SIGNALS_PATH" ]; then
echo "Error: auth_signals.py not found."
exit 1
fi
Use sed to replace the lines in auth_signals.py
sed -i "s/'remote_ip': request.META[REMOTE_ADDR_HEADER]/'remote_ip': request.META.get('HTTP_X_FORWARDED_FOR', request.META['REMOTE_ADDR']).split(',')[0],/" "$AUTH_SIGNALS_PATH"
Find the path to request_signals.py
REQUEST_SIGNALS_PATH=$(find . -type f -name request_signals.py)
Check if the file was found
if [ -z "$REQUEST_SIGNALS_PATH" ]; then
echo "Error: request_signals.py not found."
exit 1
fi
Use sed to replace the lines in request_signals.py
sed -i "s/remote_ip = environ.get(REMOTE_ADDR_HEADER, None)/remote_ip = environ.get('HTTP_X_FORWARDED_FOR', environ.get(REMOTE_ADDR_HEADER, '0.0.0.0')).split(',')[0]/" "$REQUEST_SIGNALS_PATH"
sed -i "s/remote_ip = list(scope.get('client', ('0.0.0.0', 0)))[0]/remote_ip = headers.get(b'x-forwarded-for', b'0.0.0.0').decode("utf-8").split(',')[0]/" "$REQUEST_SIGNALS_PATH"
The text was updated successfully, but these errors were encountered: