SSO icon is not resized since Netbox 4.1.2 #10306

Closed
opened 2025-12-29 21:29:41 +01:00 by adam · 2 comments
Owner

Originally created by @Fredouye on GitHub (Sep 30, 2024).

Originally assigned to: @arthanson on GitHub.

Deployment Type

Self-hosted

NetBox Version

v4.1.2

Python Version

3.12

Steps to Reproduce

Hi

Netbox Docker is installed using this command :

# git clone -b release https://github.com/netbox-community/netbox-docker.git .

docker-compose.override.yml :

services:
  netbox:
    image: netboxcommunity/netbox:v4.1.1
    volumes:
      - ./my-conf.py:/etc/netbox/config/extra.py:z,ro
    ports:
      - 18000:8080

  netbox-worker:
    image: netboxcommunity/netbox:v4.1.1

  netbox-housekeeping:
    image: netboxcommunity/netbox:v4.1.1

my-conf.py :

# Keycloak
REMOTE_AUTH_ENABLED=True
REMOTE_AUTH_BACKEND="social_core.backends.open_id_connect.OpenIdConnectAuth"
SOCIAL_AUTH_OIDC_ENDPOINT="https://auth.home.lab/realms/home.lab"
SOCIAL_AUTH_OIDC_KEY="Netbox"
SOCIAL_AUTH_OIDC_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"
SOCIAL_AUTH_OIDC_SCOPE = ["openid", "profile", "email", "roles"]
SOCIAL_AUTH_VERIFY_SSL=True
SOCIAL_AUTH_OIDC_USERNAME_KEY="preferred_username"

SOCIAL_AUTH_BACKEND_ATTRS = {
    'oidc': ("SSO", "https://raw.githubusercontent.com/keycloak/keycloak-misc/refs/heads/main/logo/icon.svg"),
}

The https://raw.githubusercontent.com/keycloak/keycloak-misc/refs/heads/main/logo/icon.svg icon is 167x151 pixels.

With Netbox 4.1.1, the SSO icon is properly rendered, whereas with Netbox 4.1.2, the SSO icon is not resized.

Expected Behavior

SSO icon should be resized (which is the case with Netbox 4.1.1) :

Netbox 4.1.1

Observed Behavior

SSO icon is not resized with Netbox 4.1.2 :

Netbox 4.1.2

All tests were made with Chrome 129 / macOS, in incognito mode.

Originally created by @Fredouye on GitHub (Sep 30, 2024). Originally assigned to: @arthanson on GitHub. ### Deployment Type Self-hosted ### NetBox Version v4.1.2 ### Python Version 3.12 ### Steps to Reproduce Hi Netbox Docker is installed using this command : ```bash # git clone -b release https://github.com/netbox-community/netbox-docker.git . ``` `docker-compose.override.yml` : ```yaml services: netbox: image: netboxcommunity/netbox:v4.1.1 volumes: - ./my-conf.py:/etc/netbox/config/extra.py:z,ro ports: - 18000:8080 netbox-worker: image: netboxcommunity/netbox:v4.1.1 netbox-housekeeping: image: netboxcommunity/netbox:v4.1.1 ``` `my-conf.py` : ```py # Keycloak REMOTE_AUTH_ENABLED=True REMOTE_AUTH_BACKEND="social_core.backends.open_id_connect.OpenIdConnectAuth" SOCIAL_AUTH_OIDC_ENDPOINT="https://auth.home.lab/realms/home.lab" SOCIAL_AUTH_OIDC_KEY="Netbox" SOCIAL_AUTH_OIDC_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx" SOCIAL_AUTH_OIDC_SCOPE = ["openid", "profile", "email", "roles"] SOCIAL_AUTH_VERIFY_SSL=True SOCIAL_AUTH_OIDC_USERNAME_KEY="preferred_username" SOCIAL_AUTH_BACKEND_ATTRS = { 'oidc': ("SSO", "https://raw.githubusercontent.com/keycloak/keycloak-misc/refs/heads/main/logo/icon.svg"), } ``` The https://raw.githubusercontent.com/keycloak/keycloak-misc/refs/heads/main/logo/icon.svg icon is `167x151` pixels. With Netbox 4.1.1, the SSO icon is properly rendered, whereas with Netbox 4.1.2, the SSO icon is not resized. ### Expected Behavior SSO icon should be resized (which is the case with Netbox 4.1.1) : <img width="1211" alt="Netbox 4.1.1" src="https://github.com/user-attachments/assets/11b87ab9-06fb-4b4c-8d89-bdfbc13a6e7f"> ### Observed Behavior SSO icon is not resized with Netbox 4.1.2 : <img width="1194" alt="Netbox 4.1.2" src="https://github.com/user-attachments/assets/6b95f123-972a-40dc-af81-668e8974333b"> All tests were made with Chrome 129 / macOS, in incognito mode.
adam added the type: bugstatus: acceptedseverity: low labels 2025-12-29 21:29:41 +01:00
adam closed this issue 2025-12-29 21:29:41 +01:00
Author
Owner

@marsteel commented on GitHub (Oct 8, 2024):

seems it is caused by that height: auto is introduced. Not sure the root cause.

img, svg {
    max-width: 100%;
    /* height: auto; */
}
@marsteel commented on GitHub (Oct 8, 2024): seems it is caused by that height: auto is introduced. Not sure the root cause. ``` img, svg { max-width: 100%; /* height: auto; */ } ```
Author
Owner

@marsteel commented on GitHub (Oct 9, 2024):

@Fredouye you can delete img,svg{max-width:100%;height:auto} from netbox/project-static/dist/netbox.css to fix the issue

This bug is caused by https://github.com/netbox-community/netbox/pull/17480 fa1e89d3d2

@marsteel commented on GitHub (Oct 9, 2024): @Fredouye you can delete `img,svg{max-width:100%;height:auto}` from netbox/project-static/dist/netbox.css to fix the issue This bug is caused by https://github.com/netbox-community/netbox/pull/17480 https://github.com/netbox-community/netbox/commit/fa1e89d3d2d2142d9908d28dcf39a934f516d785
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10306