Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After migrating to Netbox-docker version 2.9.0 and Netbox 4.0, dark mode not being kept when refreshing the page #1226

Closed
KPTheProf opened this issue May 7, 2024 · 5 comments

Comments

@KPTheProf
Copy link

KPTheProf commented May 7, 2024

Current Behavior

After migrating to Netbox-docker version 2.9.0 and Netbox 4.0, dark mode not being kept when refreshing the page.

From the netbox 4.0.0 release notes:
Bug Fixes (from Beta2)
#15630 - Ensure consistent toggling between light & dark UI modes

From previous working setup of Docker version 3.7.7 and netbox-docker 2.8.0 and upgraded using the following
docker compose down
git pull
docker compose build --no-cache
docker compose up --detach

It would appear that the docker version is using Beta2 and not the final production 4.0.0 version?

Expected Behavior

I expect that the dark mode setting is kept between screen refresh.

The public demo at https://demo.netbox.dev/ does not have this issue, so it appears to be only an issue with the docker version.

Docker Compose Version

Docker Compose version v2.26.1-desktop.1

Docker Version

Client:
 Cloud integration: v1.0.35+desktop.13
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:18:56 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.29.0 (145265)
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:18:01 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

The git Revision

6d25a54

The git Status

On branch release
Your branch is up to date with 'origin/release'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   configuration/plugins.py
        modified:   env/netbox.env

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        Dockerfile-Plugins
        plugin_requirements.txt
        ssl/

no changes added to commit (use "git add" and/or "git commit -a")

Startup Command

docker compose up --detach

NetBox Logs

netbox-1  | ÔÜÖ´©Å Applying database migrations
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  | Operations to perform:
netbox-1  |   Apply all migrations: account, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, netbox_dns, sessions, social_django, taggit, tenancy, users, virtualization, vpn, wireless
netbox-1  | Running migrations:
netbox-1  |   Applying dcim.0186_location_facility... OK
netbox-1  |   Applying dcim.0187_alter_device_vc_position... OK
netbox-1  |   Applying extras.0108_convert_reports_to_scripts... OK
netbox-1  |   Applying extras.0109_script_model... OK
netbox-1  |   Applying extras.0110_remove_eventrule_action_parameters... OK
netbox-1  |   Applying extras.0111_rename_content_types... OK
netbox-1  |   Applying extras.0112_tag_update_object_types... OK
netbox-1  |   Applying extras.0113_customfield_rename_object_type... OK
netbox-1  |   Applying extras.0114_customfield_add_comments... OK
netbox-1  |   Applying extras.0115_convert_dashboard_widgets... OK
netbox-1  |   Applying netbox_dns.0002_contact_description_registrar_description... OK
netbox-1  |   Applying netbox_dns.0003_default_view... OK
netbox-1  |   Applying netbox_dns.0004_create_and_assign_default_view... OK
netbox-1  |   Applying netbox_dns.0005_alter_zone_view_not_null... OK
netbox-1  |   Applying tenancy.0015_contactassignment_rename_content_type... OK
netbox-1  |   Applying users.0005_alter_user_table... OK
netbox-1  |   Applying users.0006_custom_group_model... OK
netbox-1  |   Applying users.0007_objectpermission_update_object_types... OK
netbox-1  |   Applying users.0008_flip_objectpermission_assignments... OK
netbox-1  |   Applying vpn.0005_rename_indexes... OK
netbox-1  | ÔÜÖ´©Å Running trace_paths
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  | Found no missing console port paths; skipping
netbox-1  | Found no missing console server port paths; skipping
netbox-1  | Found no missing interface paths; skipping
netbox-1  | Found no missing power feed paths; skipping
netbox-1  | Found no missing power outlet paths; skipping
netbox-1  | Found no missing power port paths; skipping
netbox-1  | Finished.
netbox-1  | ÔÜÖ´©Å Removing stale content types
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  | ÔÜÖ´©Å Removing expired user sessions
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  | ÔÜÖ´©Å Building search index (lazy)
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  | Reindexing 81 models.
netbox-1  | Indexing models
netbox-1  |   netbox_dns.record... Skipping (found 18176 existing).
netbox-1  |   netbox_dns.view... Skipping (found 2 existing).
netbox-1  |   netbox_dns.nameserver... Skipping (found 33 existing).
netbox-1  |   netbox_dns.zone... Skipping (found 65 existing).
netbox-1  |   netbox_dns.contact... No objects found.
netbox-1  |   netbox_dns.registrar... No objects found.
netbox-1  |   core.datasource... No objects found.
netbox-1  |   core.datafile... No objects found.
netbox-1  |   circuits.circuit... Skipping (found 1143 existing).
netbox-1  |   circuits.circuittermination... Skipping (found 1321 existing).
netbox-1  |   circuits.circuittype... Skipping (found 36 existing).
netbox-1  |   circuits.provider... Skipping (found 12 existing).
netbox-1  |   circuits.providernetwork... Skipping (found 12 existing).
netbox-1  |   dcim.cable... Skipping (found 105 existing).
netbox-1  |   dcim.consoleport... Skipping (found 1420 existing).
netbox-1  |   dcim.consoleserverport... No objects found.
netbox-1  |   dcim.device... Skipping (found 2733 existing).
netbox-1  |   dcim.devicebay... Skipping (found 28 existing).
netbox-1  |   dcim.devicerole... Skipping (found 54 existing).
netbox-1  |   dcim.devicetype... Skipping (found 7060 existing).
netbox-1  |   dcim.frontport... Skipping (found 2376 existing).
netbox-1  |   dcim.interface... Skipping (found 40585 existing).
netbox-1  |   dcim.inventoryitem... No objects found.
netbox-1  |   dcim.location... Skipping (found 306 existing).
netbox-1  |   dcim.manufacturer... Skipping (found 269 existing).
netbox-1  |   dcim.module... Skipping (found 8 existing).
netbox-1  |   dcim.modulebay... Skipping (found 125 existing).
netbox-1  |   dcim.moduletype... Skipping (found 2033 existing).
netbox-1  |   dcim.platform... Skipping (found 92 existing).
netbox-1  |   dcim.powerfeed... Skipping (found 59 existing).
netbox-1  |   dcim.poweroutlet... Skipping (found 580 existing).
netbox-1  |   dcim.powerpanel... Skipping (found 4 existing).
netbox-1  |   dcim.powerport... Skipping (found 2920 existing).
netbox-1  |   dcim.rack... Skipping (found 90 existing).
netbox-1  |   dcim.rackreservation... No objects found.
netbox-1  |   dcim.rackrole... Skipping (found 16 existing).
netbox-1  |   dcim.rearport... Skipping (found 2412 existing).
netbox-1  |   dcim.region... Skipping (found 97 existing).
netbox-1  |   dcim.site... Skipping (found 1734 existing).
netbox-1  |   dcim.sitegroup... Skipping (found 144 existing).
netbox-1  |   dcim.virtualchassis... Skipping (found 4 existing).
netbox-1  |   dcim.virtualdevicecontext... No objects found.
netbox-1  |   ipam.aggregate... Skipping (found 171 existing).
netbox-1  |   ipam.asn... Skipping (found 24 existing).
netbox-1  |   ipam.asnrange... Skipping (found 1 existing).
netbox-1  |   ipam.fhrpgroup... Skipping (found 4 existing).
netbox-1  |   ipam.ipaddress... Skipping (found 7549 existing).
netbox-1  |   ipam.iprange... No objects found.
netbox-1  |   ipam.prefix... Skipping (found 5976 existing).
netbox-1  |   ipam.rir... Skipping (found 18 existing).
netbox-1  |   ipam.role... Skipping (found 160 existing).
netbox-1  |   ipam.routetarget... No objects found.
netbox-1  |   ipam.service... Skipping (found 24 existing).
netbox-1  |   ipam.servicetemplate... Skipping (found 4 existing).
netbox-1  |   ipam.vlan... Skipping (found 384 existing).
netbox-1  |   ipam.vlangroup... Skipping (found 24 existing).
netbox-1  |   ipam.vrf... Skipping (found 48 existing).
netbox-1  |   extras.customfield... 30 entries cached.
netbox-1  |   extras.journalentry... No objects found.
netbox-1  |   extras.webhook... No objects found.
netbox-1  |   tenancy.contact... Skipping (found 1395 existing).
netbox-1  |   tenancy.contactgroup... Skipping (found 24 existing).
netbox-1  |   tenancy.contactrole... Skipping (found 12 existing).
netbox-1  |   tenancy.tenant... Skipping (found 44 existing).
netbox-1  |   tenancy.tenantgroup... Skipping (found 7 existing).
netbox-1  |   virtualization.cluster... Skipping (found 12 existing).
netbox-1  |   virtualization.clustergroup... Skipping (found 8 existing).
netbox-1  |   virtualization.clustertype... Skipping (found 14 existing).
netbox-1  |   virtualization.virtualmachine... Skipping (found 257 existing).
netbox-1  |   virtualization.vminterface... Skipping (found 800 existing).
netbox-1  |   virtualization.virtualdisk... Skipping (found 836 existing).
netbox-1  |   vpn.tunnel... No objects found.
netbox-1  |   vpn.ikeproposal... No objects found.
netbox-1  |   vpn.ikepolicy... No objects found.
netbox-1  |   vpn.ipsecproposal... No objects found.
netbox-1  |   vpn.ipsecpolicy... No objects found.
netbox-1  |   vpn.ipsecprofile... No objects found.
netbox-1  |   vpn.l2vpn... Skipping (found 84 existing).
netbox-1  |   wireless.wirelesslan... No objects found.
netbox-1  |   wireless.wirelesslangroup... No objects found.
netbox-1  |   wireless.wirelesslink... No objects found.
netbox-1  | Completed. Total entries: 103964
netbox-1  | Ôå®´©Å Skip creating the superuser
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/configuration.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/extra.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/jinjas_filters.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/logging.py'
netbox-1  | ­ƒº¼ loaded config '/etc/netbox/config/plugins.py'
netbox-1  |  Initialisation is done.
netbox-1  | 2024/05/07 11:08:31 [warn] 7#7 Unit is running unprivileged, then it cannot use arbitrary user and group.
netbox-1  | ÔÅ│ Waiting for control socket to be created... (1/10)
netbox-1  | 2024/05/07 11:08:31 [info] 7#7 unit 1.32.0 started
netbox-1  | 2024/05/07 11:08:31 [info] 290#290 discovery started
netbox-1  | 2024/05/07 11:08:31 [notice] 290#290 module: python 3.11.6 "/usr/lib/unit/modules/python3.11.unit.so"
netbox-1  | 2024/05/07 11:08:31 [info] 7#7 controller started
netbox-1  | 2024/05/07 11:08:31 [notice] 7#7 process 290 exited with code 0
netbox-1  | 2024/05/07 11:08:31 [info] 292#292 router started
netbox-1  | 2024/05/07 11:08:31 [info] 292#292 OpenSSL 3.0.10 1 Aug 2023, 300000a0
netbox-1  | ÔÜÖ´©Å Applying configuration from /etc/unit/nginx-unit.json
netbox-1  | 2024/05/07 11:08:32 [info] 295#295 "netbox" prototype started
netbox-1  | 2024/05/07 11:08:32 [info] 296#296 "netbox" application started
netbox-1  |  Unit configuration loaded successfully
netbox-1  | 2024/05/07 11:08:35 [notice] 7#7 process 288 exited with code 0
netbox-1  | 2024/05/07 11:08:35 [info] 334#334 "netbox" application started
netbox-1  | ::1 - - [07/May/2024:11:08:43 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:08:53 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:09:08 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:09:23 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:09:44 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:09:56 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:10:11 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:10:26 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:10:41 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:10:56 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:11:11 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:11:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:11:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:11:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:12:12 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:12:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:12:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:12:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:13:12 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:13:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:13:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:13:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:14:12 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:14:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:14:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:14:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:15:12 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:15:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:15:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:15:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:16:12 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:16:27 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:16:42 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"
netbox-1  | ::1 - - [07/May/2024:11:16:57 +0000] "GET /api/ HTTP/1.1" 200 549 "-" "curl/8.2.1"

Content of docker-compose.override.yml

services:
  netbox:
    image: netbox:latest-plugins
    ports:
      - "8000:8080"
    # If you want the Nginx unit status page visible from the
    # outside of the container add the following port mapping:
    # - "8001:8081"
    healthcheck:
      # Time for which the health check can fail after the container is started.
      # This depends mostly on the performance of your database. On the first start,
      # when all tables need to be created the start_period should be higher than on
      # subsequent starts. For the first start after major version upgrades of NetBox
      # the start_period might also need to be set higher.
      # Default value in our docker-compose.yml is 60s
      start_period: 120s
    environment:
      # SKIP_SUPERUSER: "false"
      # SUPERUSER_API_TOKEN: ""
      # SUPERUSER_EMAIL: ""
      # SUPERUSER_NAME: ""
      # SUPERUSER_PASSWORD: ""
      REMOTE_AUTH_ENABLED: "True"
      REMOTE_AUTH_BACKEND: "netbox.authentication.LDAPBackend"
      # AUTH_LDAP_SERVER_URI: "ldap://10.8.6.204"
      AUTH_LDAP_SERVER_URI: "ldap://uk.company.biz"
      AUTH_LDAP_BIND_DN: "CN=SVC_Netbox,OU=Service Accounts,OU=Central Services,DC=uk,DC=company,DC=biz"
      AUTH_LDAP_BIND_PASSWORD: "password"
      AUTH_LDAP_USER_SEARCH_BASEDN: "OU=365 Synced,OU=Users IT,OU=UK,OU=Companies,DC=uk,DC=company,dc=biz"
      AUTH_LDAP_GROUP_SEARCH_BASEDN: "OU=Security Groups,OU=Central Services,DC=uk,DC=company,dc=biz"
      AUTH_LDAP_REQUIRE_GROUP_DN: "CN=G - Netbox Logon,OU=Security Groups,OU=Central Services,DC=uk,DC=company,dc=biz"
      AUTH_LDAP_GROUP_TYPE: "NestedGroupOfNamesType"
      # AUTH_LDAP_IS_ADMIN_DN: "CN=G - Netbox Admins,OU=Security Groups,OU=Central Services,DC=uk,DC=company,dc=biz"
      # AUTH_LDAP_IS_SUPERUSER_DN: "CN=G - Netbox Superusers,OU=Security Groups,OU=Central Services,DC=uk,DC=company,dc=biz"
      # LDAP_IGNORE_CERT_ERRORS: "false"
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    restart: unless-stopped

  netbox-worker:
    image: netbox:latest-plugins
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    restart: unless-stopped

  netbox-housekeeping:
    image: netbox:latest-plugins
    build:
      context: .
      dockerfile: Dockerfile-Plugins
    restart: unless-stopped

  postgres:
    restart: unless-stopped

  redis:
    restart: unless-stopped

  redis-cache:
    restart: unless-stopped

  tls:
    image: caddy:2-alpine
    depends_on:
      - netbox
    volumes:
      - ./ssl/wildcard.pem:/etc/ssl/private/wildcard.crt:ro,z
      - ./ssl/wildcard-key.pem:/etc/ssl/private/wildcard.key:ro,z
      - ./ssl/Caddyfile:/etc/caddy/Caddyfile:ro
    ports:
      - 80:80 # Allows for http redirection
      - 443:443
    restart: unless-stopped
@KPTheProf KPTheProf changed the title After migrating to Docker version 2.9.0 and Netbox 4.0, dark mode not being kept when freshing the page After migrating to Netbox-docker version 2.9.0 and Netbox 4.0, dark mode not being kept when freshing the page May 7, 2024
@tobiasge
Copy link
Member

tobiasge commented May 7, 2024

I can't reproduce the problem with the image from Docker Hub. Are you using the correct FROM tag in your Dockerfile-Plugins?

@KPTheProf
Copy link
Author

KPTheProf commented May 7, 2024

Here's the content of Dockerfile-Plugins

FROM netboxcommunity/netbox:latest

COPY ./plugin_requirements.txt /opt/netbox/
RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location -r /opt/netbox/plugin_requirements.txt

# These lines are only required if your plugin has its own static files.
COPY configuration/configuration.py /etc/netbox/config/configuration.py
COPY configuration/plugins.py /etc/netbox/config/plugins.py
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input

@KPTheProf KPTheProf changed the title After migrating to Netbox-docker version 2.9.0 and Netbox 4.0, dark mode not being kept when freshing the page After migrating to Netbox-docker version 2.9.0 and Netbox 4.0, dark mode not being kept when refreshing the page May 7, 2024
@KPTheProf
Copy link
Author

Hi @tobiasge, FYI, I've cleaned down all my images and upgraded Docker Desktop to the latest version 4.30 (on Window 11 Pro) and pulled and rebuilt netbox.

If I use https://localhost I get the issue as described.
I have found that if I connect directly using http://localhost:8000 I don't get the issue and dark mode stays on.

I'm using the recommended setup for Caddy from the wiki TLS

Here's the section from the Caddy file for localhost.

0.0.0.0, ::0, localhost {
    reverse_proxy netbox:8080
    encode gzip zstd
    
    tls /etc/ssl/private/localhost.crt /etc/ssl/private/localhost.key

    log {
      level error
    }
}

There were no issues previoulsy with dark mode using TLS until I upgraded to Netbox 4.0.0 (and Netbox-docker 2.9.0) this morning.

@tobiasge
Copy link
Member

tobiasge commented May 7, 2024

Might also be related to netbox-community/netbox#16003

@KPTheProf
Copy link
Author

Hi @tobiasge, thanks for pointing that out, I'm not getting the issue this morning and I haven't made any changes. I can only assume that the setmode.js has expired from the cache overnight.

I think that this can be closed, as the fix will be in Fixes #16003: Enable cache busting on upgrade for setmode.js

Below is a screen shot from the debugger for reference. The above fix will add a version number like netbox.js

image

@tobiasge tobiasge closed this as completed May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants