Utilizing MinIO server for S3 compatible object storage
MinIO is an S3-compatible object storage server solution that is cloud-native by default but easy to deploy on on-prem servers or VPSes or cloud servers for your use as an alternative to Amazon AWS S3 or other systems, and is compatible with Discourse when configured right.
This section presupposes that the following are true in your environment:
You have a fully configured MinIO server instance
You have Domain Support enabled in the MinIO configuration
You have DNS configuration properly set up for MinIO so that bucket subdomains properly resolve to the MinIO server
The bucket discourse-data exists on the MinIO server and has a “public” policy set on it
The bucket discourse-backups exists on the MinIO server and is a private bucket for uploads to be put into (and not publicly reachable - the default policy for new buckets)
Your S3 CDN URL is a properly configured CDN pointing to the bucket and cache requests, as stated earlier in this document.
If you have all of the above requirements available, then you should be good to go.
It’s worked with both subdomain AND path style buckets for a while. However, the DNS configuration component is the most painful component - it needs special wildcard DNS rules to work, or a customized DNS server that is actively aware of all actual buckets or not. I’ve done that in bind9 with wildcard zones, but doing it in Cloudflare or others and the subdomain style bits barf hard.
IF you think the above is suitable to be in that section, I’ll be happy to. But it’ll include that ‘caveats’ section - and I’d appreciate any exits/reviews you’d like me to make first for wording, etc. (And note I didn’t include a CDN URL 'cause I don’t have a CDN in my deployment (because $$$ is not something I can experiment with).
Users who run MinIO just for Discourse can also create the DNS entries for the 2 Discourse buckets manually too right?
The caveat in this topic should be enough. Configuring MinIO is completely out of scope for this forum, but given a working MinIO getting Discourse to use is a valid use case.
Correct, but as you said config is out of scope, so I simply will state that the bucket subdomain paths have to resolve (and will leave DNS config to ${ADMINS} of the instance)
Yep, and I"ve edited the wiki accordingly. However, MinIO doesn’t (to my knowledge) run a cloud service so I left the ‘Service Name’ in the wiki TOC at the beginning blank, adjust accordingly if you wish.
I also tweaked it, Provider is Self-hosted but the MinIO section is still linked to. That should solve the fact they don’t have a cloud provided solution that I could find at the moment. (You can close this thread now if you wish since it’s integrated into the wiki post)
Also discovered (thank you open source code and decent documentation for MinIO!) that CORS is already by default on all MinIO HTTP action verbs - so no need to install the CORS rules, they’re already present. Also updated the self-hosted minio section as well, plus some grammar tweaks.
Thanks to @Falco for some help tracing the issue I had noticed during app build / rebuild time for this, and for the base guidance on CDN config with StackPath (because I wanted a fully functional test, and have StackPath CDN for something else anyways so using the CDN stack verified everything worked!)
No entiendo cómo configurar el estilo de ruta de fuerza. Cuando configuro la versión 2.6.8 con minio a través de la configuración de S3, siempre antepone el nombre del bucket al punto final de s3, donde debería añadirlo como ruta después del punto final de s3.
También parece, por la muestra de configuración en github, que la opción s3_force_path_style ha sido eliminada. ¿Me estoy perdiendo algo? Gracias.
Discourse usa el modo DNS, no el modo de ruta, para S3. Ha sido así DURANTE MUCHO TIEMPO, por eso no especifico nada sobre el modo de ruta en el manual o en la página del manual de almacenamiento S3. También deberías aprender a crear nuevos hilos en lugar de revivir un hilo antiguo para algo no relacionado.
@teward Gracias por tus comentarios. Disculpa por revivir el hilo, estoy acostumbrado a la forma de escribir de los issues de GitHub Comenzaré un nuevo hilo sobre cómo podemos usar discourse S3 en modo de ruta.
Tienes habilitado el soporte de dominio en la configuración de MinIO, para URL de bucket dirigidas por dominio. Esto es obligatorio y no es una opción, no hay soporte basado en rutas en Discourse para rutas de bucket.
Hace mucho tiempo, cuando trabajé por primera vez con Discourse, tenían esa opción, luego la eliminaron y tuve que dejar de usar MinIO como backend. AHORA, dado que hay documentación en MinIO sobre cómo hacer que el modo DNS funcione (es decir, rutas bucket[.]server[.]com ahora como lo hace S3), funciona cuando se configura MinIO correctamente. (Gracias al personal/moderadores/sistema por aumentar mi nivel de confianza para editar el wiki ahora).