From 2e8002d6c26e56509501009e50cbac09364c6a47 Mon Sep 17 00:00:00 2001 From: Nathan Schneider Date: Sun, 18 Oct 2026 21:25:00 -0600 Subject: [PATCH] =?UTF-8?q?Branding=20fix:=20inject=20custom.css=20via=20s?= =?UTF-8?q?ource=20patch=20and=20add=20auto=E2=80=91load=20JS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 12 +++++++----- assets/custom.js | 8 ++++++++ client/index.html.patch | 6 ++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 assets/custom.js create mode 100644 client/index.html.patch diff --git a/Dockerfile b/Dockerfile index b1a164e..f821714 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,8 +31,10 @@ COPY assets/maskable-icon.png /app/code/librechat/client/dist/assets/maskable-ic # Copy custom branding CSS COPY assets/custom.css /app/code/librechat/client/dist/assets/custom.css -# Insert the CSS link after the title tag -RUN sed -i '/Inference Co-op<\/title>/a <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html - -# Insert custom CSS link before closing </head> -RUN sed -i '/<\/head>/i <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html +# Copy optional helper JS (auto‑load API key) +COPY assets/custom.js /app/code/librechat/client/dist/assets/custom.js +# Apply branding patch to the *source* index.html before the container copies it +COPY client/index.html.patch /tmp/index.html.patch +RUN cd /app/code/librechat/client && \ + patch -p0 < /tmp/index.html.patch && \ + rm /tmp/index.html.patch diff --git a/assets/custom.js b/assets/custom.js new file mode 100644 index 0000000..6d8d07d --- /dev/null +++ b/assets/custom.js @@ -0,0 +1,8 @@ +// Auto‑load saved image generation API key into the MCP input field +window.addEventListener('load', () => { + const savedKey = localStorage.getItem('image_api_key'); + if (savedKey) { + const icInput = document.querySelector('input[name="IC_API_KEY"]'); + if (icInput) icInput.value = savedKey; + } +}); diff --git a/client/index.html.patch b/client/index.html.patch new file mode 100644 index 0000000..3a24d75 --- /dev/null +++ b/client/index.html.patch @@ -0,0 +1,6 @@ +--- a/client/index.html ++++ b/client/index.html +@@ +- <title>LibreChat ++ Inference Co‑op ++