netbox-community / netbox-reorder-rack

NetBox plugin to allow users to reorder devices within a rack using a drag and drop UI.
Apache License 2.0
57 stars 6 forks source link

S3 images not working #29

Open llamafilm opened 2 weeks ago

llamafilm commented 2 weeks ago

netbox-reorder-rack version

v1.1.3

Python version

3.12

Steps to Reproduce

  1. Configure Netbox to use S3 storage.
  2. View the reorder-rack page
  3. Set the view to "images only"
STORAGE_BACKEND = 'storages.backends.s3boto3.S3Boto3Storage'
STORAGE_CONFIG = {
    'AWS_STORAGE_BUCKET_NAME': 'xxx,
    'AWS_S3_REGION_NAME': 'us-east-1',
    'AWS_LOCATION': 'storage'
}

Expected Behavior

The rack elevation should show images.

Observed Behavior

No images are shown. Chrome dev tools shows that it's using an invalid URL like this:

background-image: url('https://netbox.mydomain.comhttps://mys3bucket.s3.amazonaws.com/storage/devicetype-images/iBoot-PDU8SA-N15_front.png?AWSAccessKeyId=xxx&Signature=xxx&x-amz-security-token=xxx&Expires=1730145488')

image

image

llamafilm commented 2 weeks ago

I checked in nbshell, and device_type.front_image.url returns the correct URL: https://mys3bucket.s3.amazonaws.com/storage/devicetype-images/iBoot-PDU8SA-N15_front.png?AWSAccessKeyId=xxx&Signature=xxx&x-amz-security-token=xxx&Expires=1730145919