Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Backmerge hotfix : v0.117.11 (#1345)

Athul7c9cd57efe29
diff --git a/docker/dockerfiles/frontend.Dockerfile b/docker/dockerfiles/frontend.Dockerfile
index 33468d897..6a5c8d5b9 100644
--- a/docker/dockerfiles/frontend.Dockerfile
+++ b/docker/dockerfiles/frontend.Dockerfile
@@ -34,6 +34,15 @@ COPY --from=builder /app/build /usr/share/nginx/html
# Copy custom NGINX configuration
COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf
+# Create config directory and set permissions
+RUN mkdir -p /usr/share/nginx/html/config && \
+ chown nginx:nginx /usr/share/nginx/html/config && \
+ chmod 755 /usr/share/nginx/html/config
+
+# Copy the environment script
+COPY ../frontend/generate-runtime-config.sh /docker-entrypoint.d/40-env.sh
+RUN chmod +x /docker-entrypoint.d/40-env.sh
+
EXPOSE 80
USER nginx
diff --git a/frontend/generate-runtime-config.sh b/frontend/generate-runtime-config.sh
index b004dbc52..38f1ffbb6 100755
--- a/frontend/generate-runtime-config.sh
+++ b/frontend/generate-runtime-config.sh
@@ -3,9 +3,6 @@
# This script generates a runtime config file with environment variables
# It will be executed when the container starts
-# Create config directory if it doesn't exist
-mkdir -p /usr/share/nginx/html/config
-
# Generate the runtime-config.js file with the current environment variables
cat > /usr/share/nginx/html/config/runtime-config.js << EOF
// This file is auto-generated at runtime. Do not modify manually.
diff --git a/frontend/public/index.html b/frontend/public/index.html
index 881bd7301..5102fc582 100644
--- a/frontend/public/index.html
+++ b/frontend/public/index.html
@@ -13,23 +13,5 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
- <script type="module">
- // Set favicon dynamically based on configuration
- import config from '../src/config.js';
-
- // Create a new link element for the favicon
- const faviconLink = document.createElement('link');
- faviconLink.rel = 'icon';
- faviconLink.type = 'image/svg+xml';
- faviconLink.href = config.favicon;
-
- // Replace any existing favicon or add if none exists
- const existingFavicon = document.querySelector('link[rel="icon"]');
- if (existingFavicon) {
- document.head.removeChild(existingFavicon);
- }
- document.head.appendChild(faviconLink);
-
- </script>
</body>
</html>
diff --git a/frontend/src/index.js b/frontend/src/index.js
index 0d0585f73..86b0876d2 100644
--- a/frontend/src/index.js
+++ b/frontend/src/index.js
@@ -7,6 +7,7 @@ import { GenericLoader } from "./components/generic-loader/GenericLoader";
import { LazyLoader } from "./components/widgets/lazy-loader/LazyLoader.jsx";
import { SocketProvider } from "./helpers/SocketContext.js";
import "./index.css";
+import config from "./config.js";
const enablePosthog = process.env.REACT_APP_ENABLE_POSTHOG;
if (enablePosthog !== "false") {
@@ -22,6 +23,20 @@ if (enablePosthog !== "false") {
});
}
+// Utility to set favicon
+function setFavicon(url) {
+ let link = document.querySelector("link[rel~='icon']");
+ if (!link) {
+ link = document.createElement("link");
+ link.rel = "icon";
+ document.head.appendChild(link);
+ }
+ link.href = url;
+}
+
+// Call this after config is loaded
+setFavicon(config.favicon);
+
const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
<React.StrictMode>