Skip to content

[BUG] Modscript no longer support custom docker registry without auth #1056

@iq250vip

Description

@iq250vip

Is there an existing issue for this?

  • I have searched the existing issues

Name of mod

I think due to this patch where it now requires an auth token or it refuses to even attempt to fetch from the given repository and would only look at the mod cache.

I'm running a private docker repository using the official registry container to store some private docker mods (for things like installing customer root CA), and this used to work a year ago. But now when I try to tell the container to use install some custom docker mods, I get logs like:

[mod-init] Running Docker Modification Logic
[mod-init] Could not fetch auth URL from registry for lsio-docker-mods/essentials:latest, attempting unauthenticated fetch
[mod-init] Adding lsio-docker-mods/essentials:latest to container
[mod-init] (ERROR) Couldn't fetch auth token from <URL of internal docker registry>, switching to offline mode for lsio-docker-mods/essentials:latest
[mod-init] (ERROR) OFFLINE: lsio-docker-mods/essentials:latest not found in modcache, skipping

Looking at this further, I see that when it is fetching the www-authentication header, the curl command didn't include the -H "Accept: application/vnd.oci.image.index.v1+json" request header, so the registry returned with 404 {"errors":[{"code":"MANIFEST_UNKNOWN","message":"OCI index found, but accept header does not support OCI indexes"}]}, though even if it sent that header, since my private repository doesn't need the auth token, it would respond back with 200 instead of 401, and without the www-authenticate header the script expects so it would still fail the same way.

Can we bring back the behavior, at least for custom repositories, that auth token isn't a requirement when fetching the docker mod remotely instead of only relying on the mod cache?

Name of base container

code-server (though shouldn't really matter here?)

Current Behavior

Docker mods are skipped

Expected Behavior

Specified docker mods loads

Steps To Reproduce

  1. Setup a docker registry to store docker mods. For simplicity this can just be a pull through cache.
  2. Point the docker mods URL to this docker register instead of unspecified default or one of the hardcoded supported repo and start the container
  3. The mod script on container start would refuse to pull the docker mods with logs similliar to the one shown above.

Environment

- OS: Debian 12
- How docker service was installed: https://get.docker.com

CPU architecture

arm64

Docker creation

Docker compose file snippet:
---
services:
  app:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    environment:
      - PUID=1001
      - PGID=1001
      - TZ=Etc/UTC
      - DOCKER_MODS=<internal docker registry URL>/lsio-docker-mods/essentials
... ...

Container logs

[mod-init] Running Docker Modification Logic
[mod-init] Could not fetch auth URL from registry for lsio-docker-mods/essentials:latest, attempting unauthenticated fetch
[mod-init] Adding lsio-docker-mods/essentials:latest to container
[mod-init] (ERROR) Couldn't fetch auth token from <internal docker registry URL>, switching to offline mode for lsio-docker-mods/essentials:latest
[mod-init] (ERROR) OFFLINE: lsio-docker-mods/essentials:latest not found in modcache, skipping
... ...
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1001
User GID:    1001
───────────────────────────────────────
Linuxserver.io version: 4.103.1-ls293
Build-date: 2025-08-16T02:28:04+00:00
───────────────────────────────────────
    
... ...
[custom-init] No custom files found, skipping...
[2025-08-24T18:09:48.084Z] info  code-server 4.103.1 fbaadbcfbc16401327e28bd5df3040261977a540
[2025-08-24T18:09:48.085Z] info  Using user-data-dir /config/data
[2025-08-24T18:09:48.101Z] info  Using config file /config/.config/code-server/config.yaml
[2025-08-24T18:09:48.101Z] info  HTTP server listening on http://0.0.0.0:8443/
[2025-08-24T18:09:48.101Z] info    - Authentication is enabled
[2025-08-24T18:09:48.101Z] info      - Using password from $HASHED_PASSWORD
[2025-08-24T18:09:48.101Z] info    - Not serving HTTPS
[2025-08-24T18:09:48.101Z] info  Session server listening on /config/data/code-server-ipc.sock
Connection to 127.0.0.1 8443 port [tcp/*] succeeded!
[ls.io-init] done.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions