diff --git a/Dockerfile b/Dockerfile index e3c0810..07afea5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,5 +35,6 @@ COPY assets/custom.js /app/code/librechat/client/dist/assets/custom.js # Inject branding into built HTML (dist) before image is packaged # rebuild marker 20261019-$(date +%s) -RUN sed -i 's|LibreChat|Inference Co-op|' /app/code/librechat/client/dist/index.html && \ - sed -i '/Inference Co-op<\/title>/a <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html +RUN sed -i 's|<title>LibreChat|Inference Co‑op|' /app/code/librechat/client/dist/index.html && \ + sed -i '/Inference Co‑op<\/title>/a <link rel="stylesheet" href="assets/custom.css">' /app/code/librechat/client/dist/index.html && \ + sed -i '/<link rel="stylesheet" href="assets\/custom.css">/a <script src="assets/custom.js"></script>' /app/code/librechat/client/dist/index.html diff --git a/assets/custom.js b/assets/custom.js index 6d8d07d..2a0f1df 100644 --- a/assets/custom.js +++ b/assets/custom.js @@ -1,6 +1,15 @@ -// Auto‑load saved image generation API key into the MCP input field +// Auto‑load saved image‑generation API key into the MCP input field. +// If no key is stored, prompt the user once and persist it in localStorage. window.addEventListener('load', () => { - const savedKey = localStorage.getItem('image_api_key'); + const storageKey = 'image_api_key'; + let savedKey = localStorage.getItem(storageKey); + if (!savedKey) { + // Prompt user only once per browser session + savedKey = prompt('Enter your Inference Co‑op image‑generation API key (will be saved locally):'); + if (savedKey) { + localStorage.setItem(storageKey, savedKey); + } + } if (savedKey) { const icInput = document.querySelector('input[name="IC_API_KEY"]'); if (icInput) icInput.value = savedKey;