Fixed file upload issue by modifying the reverse proxy to allow a higher body size

This commit is contained in:
Josh Krawczyk 2020-02-16 19:25:15 -05:00
parent fbb4017e3c
commit d0b7d34772
7 changed files with 44 additions and 7 deletions

View File

@ -26,4 +26,4 @@ EMAIL_HOST=smtp.gmail.com
EMAIL_USER=example@gmail.com
EMAIL_PASS=changeme
EMAIL_PORT=587
EMAIL_ALERT_RECIPIENTS="example@gmail.com",
EMAIL_RECIPIENTS="example@gmail.com",

View File

@ -1,5 +1,7 @@
FROM tiangolo/uwsgi-nginx:python3.7
WORKDIR /app
ARG DJANGO_SEKRET
ARG DJANGO_DEBUG
ARG POSTGRES_USER
@ -33,4 +35,4 @@ COPY ./docker/api/api.conf /app/api.conf.tmp
RUN envsubst '\$APP_HOST, \$API_HOST' < /app/api.conf.tmp > /app/nginx.conf && \
rm /app/api.conf.tmp
COPY ./docker/api/local_settings.py.keep ./tacticalrmm/local_settings.py.tmp
RUN envsubst < /app/tacticalrmm/local_settings.py.tmp > /app/tacticalrmm/local_settings.py && rm /app/tacticalrmm/local_settings.py.tmp
RUN envsubst < /app/tacticalrmm/local_settings.py.tmp > /app/tacticalrmm/local_settings.py && rm /app/tacticalrmm/local_settings.py.tmp

View File

@ -4,7 +4,7 @@ ALLOWED_HOSTS = ['${API_HOST}']
ADMIN_URL = "${ADMIN_URL}"
CORS_ORIGIN_WHITELIST = ["https://${APP_HOST}"]
CORS_ORIGIN_WHITELIST = ["https://${APP_HOST}",]
DEBUG = ${DJANGO_DEBUG}

View File

@ -1,2 +1,2 @@
VUE_APP_PROD_URL = "https://${APP_HOST}"
VUE_APP_DEV_URL = "http://localhost:8000"
VUE_APP_PROD_URL = "https://${API_HOST}"
VUE_APP_DEV_URL = "https://${API_HOST}"

View File

@ -103,6 +103,7 @@ services:
dockerfile: "./docker/api/dockerfile"
args:
- DJANGO_SEKRET=${DJANGO_SEKRET}
- DJANGO_DEBUG=${DJANGO_DEBUG}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASS}
- POSTGRES_HOST=${POSTGRES_HOST}
@ -116,6 +117,12 @@ services:
- API_HOST=${API_HOST}
- ADMIN_URL=${ADMIN_URL}
- TWO_FACTOR_OTP=${TWO_FACTOR_OTP}
- EMAIL_TLS=${EMAIL_TLS}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_USER=${EMAIL_USER}
- EMAIL_PASS=${EMAIL_PASS}
- EMAIL_PORT=${EMAIL_PORT}
- EMAIL_RECIPIENTS=${EMAIL_RECIPIENTS}
command: celery -A tacticalrmm worker -l info
networks:
- redis
@ -129,6 +136,7 @@ services:
dockerfile: "./docker/api/dockerfile"
args:
- DJANGO_SEKRET=${DJANGO_SEKRET}
- DJANGO_DEBUG=${DJANGO_DEBUG}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASS}
- POSTGRES_HOST=${POSTGRES_HOST}
@ -142,6 +150,12 @@ services:
- API_HOST=${API_HOST}
- ADMIN_URL=${ADMIN_URL}
- TWO_FACTOR_OTP=${TWO_FACTOR_OTP}
- EMAIL_TLS=${EMAIL_TLS}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_USER=${EMAIL_USER}
- EMAIL_PASS=${EMAIL_PASS}
- EMAIL_PORT=${EMAIL_PORT}
- EMAIL_RECIPIENTS=${EMAIL_RECIPIENTS}
command: celery -A tacticalrmm beat -l info
networks:
- redis
@ -155,6 +169,7 @@ services:
dockerfile: "./docker/api/dockerfile"
args:
- DJANGO_SEKRET=${DJANGO_SEKRET}
- DJANGO_DEBUG=${DJANGO_DEBUG}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASS=${POSTGRES_PASS}
- POSTGRES_HOST=${POSTGRES_HOST}
@ -168,6 +183,12 @@ services:
- API_HOST=${API_HOST}
- ADMIN_URL=${ADMIN_URL}
- TWO_FACTOR_OTP=${TWO_FACTOR_OTP}
- EMAIL_TLS=${EMAIL_TLS}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_USER=${EMAIL_USER}
- EMAIL_PASS=${EMAIL_PASS}
- EMAIL_PORT=${EMAIL_PORT}
- EMAIL_RECIPIENTS=${EMAIL_RECIPIENTS}
command: celery -A tacticalrmm worker -Q wupdate
networks:
- redis

View File

@ -19,6 +19,8 @@ server {
error_log /var/log/nginx/api-error.log;
access_log /var/log/nginx/api-access.log;
client_max_body_size 300M;
listen 443 ssl;
ssl_certificate /cert/fullchain.pem;
ssl_certificate_key /cert/privkey.pem;

View File

@ -20,8 +20,8 @@ Copy the fullchain.pem and privkey.pem to the cert directory.
## Run the environment with Docker
Copy the .env.example to .env
Change values in .env to match your environment
Copy the .env.example to .env then
change values in .env to match your environment
```
cd docker
@ -57,3 +57,15 @@ Use the generated code and the username to generate a bar code for your authenti
```
sudo docker exec -it docker_api_1 python manage.py generate_barcode [OTP_CODE] [username]
```
## Connect to a container instance shell
run `docker ps` to get the name of the running container instance
Then use the name in the below command. It will use the api container instance as an example
```
sudo docker exec -it docker_api_1 /bin/bash
```
If /bin/bash doesn't work then /bin/sh might need to be used.