Uploads naar externe opslag

Hallo allemaal,

Ik probeer de Discourse-uploads te verplaatsen naar een externe opslaglocatie op mijn zelf-gehoste instantie vanwege ruimtegebrek. Ik heb een CIFS-share gemount en alle bestaande uploads met dezelfde mapstructuur al naar de gemounte locatie gekopieerd.

Daarna heb ik de volgende regels toegevoegd aan app.yml:

- volumes:
  - volume:
      host: /<storage-location>/uploads
      guest: /shared/uploads

Nadat ik de container opnieuw heb opgebouwd met ./launcher rebuild app (ik ben de root-gebruiker), zijn de afbeeldingen niet meer zichtbaar op de website. Het lijkt erop dat ze allemaal een 404-code retourneren.

Ik heb geprobeerd de CIFS-share te mounten als root:root en _default_hostname:www-data, maar telkens verschijnen de afbeeldingen niet.

Wat is de beste (of correcte) manier om deze locatieverandering voor uploads uit te voeren?

Alvast bedankt!

Here is what is the default:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared

You probably want something like this:

volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /your/cifs/share/discourse-uploads
      guest: /shared/uploads
1 like

True! I tried it that way, and it worked, just keeping in mind that the mounted storage location must have the right permissions. root:root doesn’t work, but _default_hostname:www-data seems to work.

Another thing I noticed: uploads in topics, even with moving them to the new storage location, don’t work anymore and have to be re-uploaded. Other images/uploads (logos, headers etc) work fine.

Thanks!

That shouldn’t be. Maybe you copied the files to the wrong place.

I was thinking that too, but I double checked that I copied the whole uploads folder from shared/standalone/ to my external storage location, including the default and other sub folders.

It’s important to mention that I tried a few times to change the uploads location with different configurations for the external storage (mostly different file and folder permissions) and in between executed a rake posts:rebake in an attempt to let the attachments work again, and maybe somewhere in between the problem occurred…

Het is vreemd dat het opnieuw uploaden het oplost.

Je kunt Uploads.pluck(:url) in rails bekijken en zien of daar iets vreemds is.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.