-
- Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
Describe the Bug
When switching domains or from a local domain to a public domain via proxy, attachments and uploaded images for the logo etc. are referenced by the old local hostname they where uploaded from instead using the APP_URL environment variable as it would be expected.
Hence you'll. get mixed content in the browser and it's not possible to download attachements if the original url was not public available.
The links should be dynamic or relativ to make sure, the files can be served even, if the domain changes.
After reuploading the attachments / logo images, the resource can be loaded. But thats not an option for all attachments for an instance that is used for years with hundreds of attachments.
Steps to Reproduce
- use a local domain or hostname
- upload logo or icon in the settings
- attach files to a page
- address the host via an public URL (I additionally had to use a proxy, hence I run it on HomeAssistant inside my internal network)
- set the APP_URL to the public domain in the .env file
- Open the page in Browser and see http request in developer toolbar => mixed content error + old url for requesting the files
- try to download an attachment => fails due to old, not accessible domain is used
Expected Behaviour
I would expect the application to use the APP_URL as prefix for all generated URLs and not saving the domain that was used to upload the image / attachment at all. Or analog wordpress there should be a replacement command or interface, where the URLs in the DB can be replaced. Or the URLs should always be relative or generated in the form "BASE_URL/REL_PATH_FROM_DB".
Screenshots or Additional Context
No response
Browser Details
No response
Exact BookStack Version
3.2.1