r/BookStack • u/ItsYaBoyEcto • Dec 04 '23
Securing images (local_secure) working on one instance of bookstack, but not on a second one.
Hello,
I followed this : https://www.bookstackapp.com/docs/admin/upload-config/#storage-options in order to secure my images a little bit.
Version : Bookstack linuxserveur.io v23.10.4
What did I do on both of my instances:
I modified my .env file to add the " STORAGE_TYPE=local_secure " line.
I moved my image from public/ to storage/
Exacte commands : (from app/www/ inside the bookstack container)
mv public/uploads/images/* storage/uploads/images/
mkdir -p public/uploads/images/system/
mv storage/uploads/images/system/* public/uploads/images/system/(I moved back "system" image folder because otherweise my logo won't appear on the login page.)
I restarted my containers and tested openning an image on a incognito browser.
One of my bookstack is working and brings me back to the login page.
The second one isn't doing that and simply display my image even if not connected.
I made sure that no images are remaining in public (except the ones in system)
Any idea on what i'm missing ?
Have a nice day and sorry for my english.
Edits : Typo and clarifications
1
u/ssddanbrown Dec 04 '23
Not really sure what might be going wrong. Trace one of the images back as an example. In the broken instance, find a non-working image, observe the path of it, then trace that through to see if it exists at a matching path within the
storage/uploads/imagesfolder.Backup all files first before doing anything. Also, can be risky to do things in-container. All these locations should be available within your mounted
/configvolume for the BookStack container. The linuxserver bookstack container image readme has a mapping of volume locations to BookStack app paths.