-
Notifications
You must be signed in to change notification settings - Fork 0
HOW‐TO
To prevent confusion on how to get this installed, the readme is a good start, but I figured I would break it down a little more.
After the initial install, mirgate, etc. the app will function without having to do any of the extra folder creations by using image URLs.
The upside it, it will work, the downside is, for any user that is located in a country that is blocking certain websites, like Imgur, the images will not appear. (A UK user in our Corp pointed this out to me.)
So, the work around is either:
-
A: Use a service that can provide global hosting for images. For this, I used Cloudflare's R2 Object storage, linked to the custom domain (your Auth URL), which then created a DNS record for the storage. This in turn will expose anything put into the bucket, so it's recommended to only store what is needed, I.E.: pictures.
-
B: Do the setup to allow the images to be hosted directly in Auth.
Modify the docker-compose.yml file to include the following
volumes:
# ... your existing volume mounts ...
- media-data:/var/www/myauth/media
***
services:
nginx:
volumes:
# ... your existing volume mounts ...
- media-data:/var/www/myauth/media
***
volumes:
media-data:
Edit the nginx.conf file:
# Allow uploads up to 20 MB (nginx default is 1 MB — raise this if you
# get "413 Request Entity Too Large" when uploading background images).
client_max_body_size 20m;
# add after location /static
location /media {
alias /var/www/myauth/media;
autoindex off;
}
And then add this to the local.py file under custom settings:
TEMPLATES[0]["OPTIONS"]["context_processors"].append(
"aa_customizer.context_processors.aa_customizer"
)
MEDIA_ROOT = "/path/to/your/media/"
MEDIA_URL = "/media/"